<?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: API + how to know by API command all machines in ambari cluster in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/API-how-to-know-by-API-command-all-machines-in-ambari/m-p/226660#M67102</link>
    <description>&lt;P&gt;
	You can get the JSON response. &lt;/P&gt;&lt;P&gt;
	&lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/hosts.md" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/hosts.md&lt;/A&gt; &lt;/P&gt;
&lt;PRE&gt;&lt;A href="http://ambari-server:8080/clusters/:clusterName/hosts" target="_blank"&gt;http://ambari-server:8080/clusters/:clusterName/hosts&lt;/A&gt;
&lt;/PRE&gt;&lt;P&gt;
	To extract the hostnames easier, you could try JSONPath&lt;/P&gt;
&lt;PRE&gt;$.items[*].Hosts.host_name
&lt;/PRE&gt;&lt;P&gt;Or Python with Requests library&lt;/P&gt;&lt;PRE&gt;r = requests.get('...')
hosts = ','.join(x['Hosts']['host_name'] for x in r.json()['items'])&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Aug 2017 01:53:23 GMT</pubDate>
    <dc:creator>JordanMoore</dc:creator>
    <dc:date>2017-08-23T01:53:23Z</dc:date>
    <item>
      <title>API + how to know by API command all machines in ambari cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/API-how-to-know-by-API-command-all-machines-in-ambari/m-p/226658#M67100</link>
      <description>&lt;P&gt;how to know by API command all machines in ambari cluster , &lt;/P&gt;&lt;P&gt;example - master01,master02,master03,worker01,worker02,worker03,kafka01,kafka02 etc&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 01:10:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/API-how-to-know-by-API-command-all-machines-in-ambari/m-p/226658#M67100</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-08-23T01:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: API + how to know by API command all machines in ambari cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/API-how-to-know-by-API-command-all-machines-in-ambari/m-p/226659#M67101</link>
      <description>&lt;P&gt;This Rest call will get you all host names of nodes in the cluster&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://your.ambari.server/api/v1/clusters/yourClusterName/hosts" target="_blank"&gt;http://your.ambari.server/api/v1/clusters/yourClusterName/hosts&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;See these links on the Ambari API&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/hosts.md" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/hosts.md&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 23 Aug 2017 01:52:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/API-how-to-know-by-API-command-all-machines-in-ambari/m-p/226659#M67101</guid>
      <dc:creator>gkeys</dc:creator>
      <dc:date>2017-08-23T01:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: API + how to know by API command all machines in ambari cluster</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/API-how-to-know-by-API-command-all-machines-in-ambari/m-p/226660#M67102</link>
      <description>&lt;P&gt;
	You can get the JSON response. &lt;/P&gt;&lt;P&gt;
	&lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/hosts.md" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/hosts.md&lt;/A&gt; &lt;/P&gt;
&lt;PRE&gt;&lt;A href="http://ambari-server:8080/clusters/:clusterName/hosts" target="_blank"&gt;http://ambari-server:8080/clusters/:clusterName/hosts&lt;/A&gt;
&lt;/PRE&gt;&lt;P&gt;
	To extract the hostnames easier, you could try JSONPath&lt;/P&gt;
&lt;PRE&gt;$.items[*].Hosts.host_name
&lt;/PRE&gt;&lt;P&gt;Or Python with Requests library&lt;/P&gt;&lt;PRE&gt;r = requests.get('...')
hosts = ','.join(x['Hosts']['host_name'] for x in r.json()['items'])&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Aug 2017 01:53:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/API-how-to-know-by-API-command-all-machines-in-ambari/m-p/226660#M67102</guid>
      <dc:creator>JordanMoore</dc:creator>
      <dc:date>2017-08-23T01:53:23Z</dc:date>
    </item>
  </channel>
</rss>

