<?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: Guys can anyone tell me if we can get components status (running,stopped) from ambari REST API's . in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224196#M60765</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/102/nmaheshwari.html" nodeid="102"&gt;@Namit Maheshwari&lt;/A&gt;  when I try the above .. its actually creating the service . Please find below the status I got from curl function .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  curl -u admin:'XXXX' -H "X-Requested-By:ambari" -i -X POST &lt;A href="http://XXXX:8080/api/v1/clusters/HDF_DEV/services/NIFI"&gt;http://XXXX:8080/api/v1/clusters/HDF_DEV/services/NIFI&lt;/A&gt;
HTTP/1.1 409 Conflict
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Set-Cookie: AMBARISESSIONID=1rb3hvd20fc9g1rcuezfvw84fg;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain
Content-Length: 128
Server: Jetty(8.1.19.v20160209)&lt;/P&gt;&lt;P&gt;{
  "status" : 409,
  "message" : "Attempted to create a service which already exists: , clusterName=HDF_DEV serviceName=NIFI"&lt;/P&gt;&lt;P&gt;I was thinking to use nifi and check all the services for HDP components .&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2017 08:54:20 GMT</pubDate>
    <dc:creator>bhara</dc:creator>
    <dc:date>2017-05-09T08:54:20Z</dc:date>
    <item>
      <title>Guys can anyone tell me if we can get components status (running,stopped) from ambari REST API's .</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224194#M60763</link>
      <description>&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;I want to read Ambari alerts through NIFI  using REST API's . Please let me know if its feasible to do it .&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 03:35:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224194#M60763</guid>
      <dc:creator>bhara</dc:creator>
      <dc:date>2017-05-09T03:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Guys can anyone tell me if we can get components status (running,stopped) from ambari REST API's .</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224195#M60764</link>
      <description>&lt;P&gt;Yes, you can get component status using ambari Rest API's. &lt;/P&gt;&lt;PRE&gt;curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST &lt;A href="http://sandbox.hortonworks.com:8080/api/v1/clusters/Sandbox/services/NIFI" target="_blank"&gt;http://sandbox.hortonworks.com:8080/api/v1/clusters/Sandbox/services/NIFI&lt;/A&gt;
&lt;/PRE&gt;&lt;P&gt;Below is a good article:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/30289/working-with-ambari-rest-api-automate-nifi-install.html" target="_blank"&gt;https://community.hortonworks.com/articles/30289/working-with-ambari-rest-api-automate-nifi-install.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 05:38:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224195#M60764</guid>
      <dc:creator>namaheshwari</dc:creator>
      <dc:date>2017-05-09T05:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Guys can anyone tell me if we can get components status (running,stopped) from ambari REST API's .</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224196#M60765</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/102/nmaheshwari.html" nodeid="102"&gt;@Namit Maheshwari&lt;/A&gt;  when I try the above .. its actually creating the service . Please find below the status I got from curl function .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  curl -u admin:'XXXX' -H "X-Requested-By:ambari" -i -X POST &lt;A href="http://XXXX:8080/api/v1/clusters/HDF_DEV/services/NIFI"&gt;http://XXXX:8080/api/v1/clusters/HDF_DEV/services/NIFI&lt;/A&gt;
HTTP/1.1 409 Conflict
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Set-Cookie: AMBARISESSIONID=1rb3hvd20fc9g1rcuezfvw84fg;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain
Content-Length: 128
Server: Jetty(8.1.19.v20160209)&lt;/P&gt;&lt;P&gt;{
  "status" : 409,
  "message" : "Attempted to create a service which already exists: , clusterName=HDF_DEV serviceName=NIFI"&lt;/P&gt;&lt;P&gt;I was thinking to use nifi and check all the services for HDP components .&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 08:54:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224196#M60765</guid>
      <dc:creator>bhara</dc:creator>
      <dc:date>2017-05-09T08:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Guys can anyone tell me if we can get components status (running,stopped) from ambari REST API's .</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224197#M60766</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18027/bharadwajbhimavarapu.html" nodeid="18027" target="_blank"&gt;@Bharadwaj Bhimavarapu&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Based on the thread title you want to know how to get components status (running,stopped) from ambari REST API's?&lt;/P&gt;&lt;P&gt;However later you mentioned that "you want to read Ambari alerts through NIFI using REST API's", Can you please clarify which alert are you getting and Are you sure that you want to read the component status from Alerts?  &lt;/P&gt;&lt;P&gt;- If you simply want to read the component status (like NIFI) then you can make the following kind of REST Curl call:
&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin -H "X-Requested-By:ambari" -i -X GET &lt;A href="http://localhost:8080/api/v1/clusters/Sandbox/hosts/sandbox.hortonworks.com/host_components/NIFI_MASTER" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/api/v1/clusters/Sandbox/hosts/sandbox.hortonworks.com/host_components/NIFI_MASTER&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR more precisely&lt;/STRONG&gt;
&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin -H "X-Requested-By:ambari" -i -X GET &lt;A href="http://localhost:8080/api/v1/clusters/Sandbox/hosts/sandbox.hortonworks.com/host_components/NIFI_MASTER?fields=HostRoles/component_name,HostRoles/host_name,HostRoles/state,HostRoles/service_name" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/api/v1/clusters/Sandbox/hosts/sandbox.hortonworks.com/host_components/NIFI_MASTER?fields=HostRoles/component_name,HostRoles/host_name,HostRoles/state,HostRoles/service_name&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;Example output will be something like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="15220-nifi-state.png" style="width: 2076px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15529iC4387AAC9E4BA0C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="15220-nifi-state.png" alt="15220-nifi-state.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 01:47:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224197#M60766</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-08-18T01:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Guys can anyone tell me if we can get components status (running,stopped) from ambari REST API's .</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224198#M60767</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay SenSharma&lt;/A&gt; Hi Jay.. Thanks for the details .. this is what I  am looking for.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 22:16:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224198#M60767</guid>
      <dc:creator>bhara</dc:creator>
      <dc:date>2017-05-09T22:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Guys can anyone tell me if we can get components status (running,stopped) from ambari REST API's .</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224199#M60768</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/18027/bharadwajbhimavarapu.html" nodeid="18027"&gt;@Bharadwaj Bhimavarapu&lt;/A&gt;&lt;P&gt;Good to know that the detail was useful.&lt;/P&gt;&lt;P&gt;It will be great if you can click on the "Accept" link on this thread and mark this thread as "Answered", that will be useful for other users as well.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 22:37:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Guys-can-anyone-tell-me-if-we-can-get-components-status/m-p/224199#M60768</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-05-09T22:37:02Z</dc:date>
    </item>
  </channel>
</rss>

