<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: AMBARI + how to set value in json REST API in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290406#M214863</link>
    <description>&lt;P&gt;Dear Jay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what to say - you are the best ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;well done&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 06:11:52 GMT</pubDate>
    <dc:creator>mike_bronson7</dc:creator>
    <dc:date>2020-02-25T06:11:52Z</dc:date>
    <item>
      <title>AMBARI + how to set value in json REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290385#M214852</link>
      <description>&lt;DIV class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="post-text"&gt;
&lt;P&gt;the following API example , will stop the kafka service in ambari&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="pln"&gt;export service&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;kafka

curl &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;u admin&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;admin &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;i &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;H &lt;/SPAN&gt;&lt;SPAN class="str"&gt;'X-Requested-By: ambari'&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;X PUT &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;-&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;d &lt;/SPAN&gt;&lt;SPAN class="str"&gt;'{"RequestInfo":{"context":"_PARSE_.STOP.$service","operation_level":{"level":"SERVICE","cluster_name":"$CLUSTER_NAME","service_name":"$service"}},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}'&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; http&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;://&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;$HOST&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;8080&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;api&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;v1&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;clusters&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;$CLUSTER_NAME&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;services&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;$service &lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;the problem is about the syntax - _PARSE_.STOP.$service&lt;/P&gt;
&lt;P&gt;and we see that actually service value - kafka not set in - &lt;EM&gt;PARSE&lt;/EM&gt;.STOP.$service&lt;/P&gt;
&lt;P&gt;so ambri saw the name as - &lt;EM&gt;PARSE&lt;/EM&gt;.STOP.$service and not &lt;EM&gt;PARSE&lt;/EM&gt;.STOP.kafka&lt;/P&gt;
&lt;P&gt;any idea how we can set the value kafka inside the json syntax?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Feb 2020 22:55:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290385#M214852</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2020-02-24T22:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: AMBARI + how to set value in json REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290386#M214853</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/59349"&gt;@mike_bronson7&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I think the only change you will need to make is the &lt;STRONG&gt;"KAFKA"&lt;/STRONG&gt; service in &lt;EM&gt;&lt;STRONG&gt;Uppercase&lt;/STRONG&gt;&lt;/EM&gt; because "kafka" in lowercase will not exist as a service.&lt;/P&gt;&lt;P&gt;Following is the example which i tested in my cluster and it works pretty fine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# export service=kafka    (INCORRECT)

# export service=KAFKA

# curl -iLv -u "admin:admin" -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo":{"context":"_PARSE_.STOP.$service","operation_level":{"level":"SERVICE","cluster_name":"$CLUSTER_NAME","service_name":"$service"}},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://$HOST:8080/api/v1/clusters/$CLUSTER_NAME/services/$service&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to start KAFKA service.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# curl -iLv -u "admin:admin" -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.$service","operation_level":{"level":"SERVICE","cluster_name":"$CLUSTER_NAME","service_name":"$service"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://$HOST:8080/api/v1/clusters/$CLUSTER_NAME/services/$service&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 23:06:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290386#M214853</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2020-02-24T23:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: AMBARI + how to set value in json REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290401#M214859</link>
      <description>&lt;P&gt;Dear Jay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes I put KAFKA and not kafka , ( just I wrote by mistake in the post kafka instead KAFKA&lt;/P&gt;&lt;P&gt;but with the same problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 05:40:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290401#M214859</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2020-02-25T05:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: AMBARI + how to set value in json REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290403#M214860</link>
      <description>&lt;P&gt;also this is what we get from "ops" in ambari&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can see that ambari identify this as "$service" and not as KAFKA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/26479i83D1A07EE2A5A19B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 05:46:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290403#M214860</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2020-02-25T05:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: AMBARI + how to set value in json REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290404#M214861</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/59349"&gt;@mike_bronson7&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for sharing the screenshot .. it is very clean now.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please replace the following:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;"$CLUSTER_NAME" with "'"$CLUSTER_NAME"'"&lt;BR /&gt;"$service" with "'"$service"'"&lt;BR /&gt;"_PARSE_.STOP.$service" with "'"_PARSE_.STOP.$service"'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In general, Replace any value which has&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;$ABCD&lt;/STRONG&gt; with a single quote and then quote mark as&amp;nbsp; &lt;STRONG&gt;'"$ABCD"'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the over all change will be &lt;STRONG&gt;"$ABCD" -&lt;/STRONG&gt;---&amp;gt;&lt;STRONG&gt; "'"$ABCD"'"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Stop Kafka Service:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# curl -iLv -u "admin:admin" -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo":{"context":"'"_PARSE_.STOP.$service"'","operation_level":{"level":"SERVICE","cluster_name":"'"$CLUSTER_NAME"'","service_name":"'"$service"'"}},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://$HOST:8080/api/v1/clusters/$CLUSTER_NAME/services/$service&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Start Kafka Service&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# curl -iLv -u "admin:admin" -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo":{"context":"'"_PARSE_.START.$service"'","operation_level":{"level":"SERVICE","cluster_name":"'"$CLUSTER_NAME"'","service_name":"'"$service"'"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://$HOST:8080/api/v1/clusters/$CLUSTER_NAME/services/$service&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 06:04:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290404#M214861</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2020-02-25T06:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: AMBARI + how to set value in json REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290406#M214863</link>
      <description>&lt;P&gt;Dear Jay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what to say - you are the best ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;well done&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 06:11:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/AMBARI-how-to-set-value-in-json-REST-API/m-p/290406#M214863</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2020-02-25T06:11:52Z</dc:date>
    </item>
  </channel>
</rss>

