<?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: How can I setting the rack ID in Ambari API？ in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97739#M11225</link>
    <description>&lt;P&gt;It worked!
Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Dec 2015 09:13:25 GMT</pubDate>
    <dc:creator>kfukazaw</dc:creator>
    <dc:date>2015-12-16T09:13:25Z</dc:date>
    <item>
      <title>How can I setting the rack ID in Ambari API？</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97736#M11222</link>
      <description>&lt;P&gt;I have to build a large cluster, for which I’ll need to set rack ID many times.
I know two methods in Ambari Web for setting the Rack ID. 
&lt;A href="http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.0/bk_Ambari_Users_Guide/content/ch03s11.html"&gt;http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.0/bk_Ambari_Users_Guide/content/ch03s11.html&lt;/A&gt; &lt;/P&gt;&lt;P&gt;So I want to know if I can write a script which sets the rack ID in Ambari API&lt;/P&gt;&lt;P&gt;Ambari: 2.1.2.1
Hadoop: HDP2.3.0&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 10:17:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97736#M11222</guid>
      <dc:creator>kfukazaw</dc:creator>
      <dc:date>2015-12-02T10:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I setting the rack ID in Ambari API？</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97737#M11223</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/711/kfukazaw.html" nodeid="711"&gt;@Kai Fukazawa&lt;/A&gt;&lt;P&gt;Please see this&lt;/P&gt;&lt;P&gt;With the latest Ambari UI code you should see an option to set the rack info for each host. You can also set the rack info property through the API ...&lt;/P&gt;&lt;PRE&gt;PUT api/v1/clusters/c1/hosts/[host_name]

{
  "Hosts" : {
    "rack_info" : "/rack-01"
  } &lt;/PRE&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Take from &lt;A target="_blank" href="https://issues.apache.org/jira/browse/AMBARI-6646"&gt;https://issues.apache.org/jira/browse/AMBARI-6646&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 10:29:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97737#M11223</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-12-02T10:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I setting the rack ID in Ambari API？</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97738#M11224</link>
      <description>&lt;P&gt;The hosts table in the database has a field called rack_info that supports up to 255 chars.
It can be edited from the UI in the Host page for a single host.&lt;/P&gt;&lt;P&gt;In order to edit it using the API, you can make a single request to edit it for x number of hosts. E.g.,&lt;/P&gt;&lt;PRE&gt;curl -u $username:$password -X PUT -H 'X-Requested-By:admin' &lt;A href="http://$server:8080/api/v1/clusters/$clustername/hosts" target="_blank"&gt;http://$server:8080/api/v1/clusters/$clustername/hosts&lt;/A&gt; -d '{"RequestInfo":{"context":"Set Rack","query":"Hosts/host_name.in($FQDN_1,$FQDN_2,$FQDN_3)"},"Body":{"Hosts":{"rack_info":"/my_new_rack_value"}}}'&lt;/PRE&gt;&lt;P&gt;Actual call,&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin -X PUT -H 'X-Requested-By:admin' &lt;A href="http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts" target="_blank"&gt;http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts&lt;/A&gt; -d '{"RequestInfo":{"context":"Set Rack","query":"Hosts/host_name.in(c6401.ambari.apache.org,c6402.ambari.apache.org,c6403.ambari.apache.org)"},"Body":{"Hosts":{"rack_info":"/my_new_rack_value"}}}'
&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Dec 2015 11:00:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97738#M11224</guid>
      <dc:creator>afernandez</dc:creator>
      <dc:date>2015-12-02T11:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I setting the rack ID in Ambari API？</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97739#M11225</link>
      <description>&lt;P&gt;It worked!
Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 09:13:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-setting-the-rack-ID-in-Ambari-API/m-p/97739#M11225</guid>
      <dc:creator>kfukazaw</dc:creator>
      <dc:date>2015-12-16T09:13:25Z</dc:date>
    </item>
  </channel>
</rss>

