<?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: Getting impala daemon serves via cloudera rest API in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/56014#M62674</link>
    <description>&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;I am trying&amp;nbsp; to write a shell script using HTTP REST API.&lt;/P&gt;&lt;P&gt;something like "&lt;SPAN class="crayon-v"&gt;curl&lt;/SPAN&gt; &lt;SPAN class="crayon-o"&gt;-&lt;/SPAN&gt;&lt;SPAN class="crayon-i"&gt;u&lt;/SPAN&gt; &lt;SPAN class="crayon-s"&gt;'admin:admin'&lt;/SPAN&gt; &lt;SPAN class="crayon-v"&gt;http&lt;/SPAN&gt;&lt;SPAN class="crayon-o"&gt;:&lt;/SPAN&gt;&lt;SPAN class="crayon-c"&gt;//cm_host:7180/api/v1/clusters/dev01/services/hdfs2&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;could you please assist with a command I need to run (Is there a way doing it without python just a shell script)&lt;/P&gt;&lt;P&gt;King Regards,&lt;/P&gt;&lt;P&gt;Rotem&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2017 15:31:02 GMT</pubDate>
    <dc:creator>Rotem</dc:creator>
    <dc:date>2017-06-16T15:31:02Z</dc:date>
    <item>
      <title>Getting impala daemon serves via cloudera rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/55665#M62672</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I have been struggling to get the a list of the host on which cloudera daemon is installed,&lt;/P&gt;&lt;P&gt;I tried using the rest API, but I did not found any path to getting the list of nodes with impala daemon on.&lt;/P&gt;&lt;P&gt;Does someone know how to get it ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;King Regards,&lt;/P&gt;&lt;P&gt;Rotem&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:44:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/55665#M62672</guid>
      <dc:creator>Rotem</dc:creator>
      <dc:date>2022-09-16T11:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting impala daemon serves via cloudera rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/55675#M62673</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you did not specify which approach, I had a python console open and below seems to return what may be&amp;nbsp;looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;from cm_api.api_client import ApiResource
api = ApiResource(server_host="cloudera-manager.host.com",version=12)

cluster = api.get_cluster("___REPLACE_ME_WITH_CLUSTER_NAME__")
for host in api.get_all_hosts(view='full'):&lt;BR /&gt;  # List (rolename,servicename,hostname) from all host where service name = impala&lt;BR /&gt;  print [(x.roleName,x.serviceName,host.hostname) for x in host.roleRefs if "impala" in str(x.serviceName).lower()]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 00:14:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/55675#M62673</guid>
      <dc:creator>michalis</dc:creator>
      <dc:date>2017-06-12T00:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting impala daemon serves via cloudera rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/56014#M62674</link>
      <description>&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;I am trying&amp;nbsp; to write a shell script using HTTP REST API.&lt;/P&gt;&lt;P&gt;something like "&lt;SPAN class="crayon-v"&gt;curl&lt;/SPAN&gt; &lt;SPAN class="crayon-o"&gt;-&lt;/SPAN&gt;&lt;SPAN class="crayon-i"&gt;u&lt;/SPAN&gt; &lt;SPAN class="crayon-s"&gt;'admin:admin'&lt;/SPAN&gt; &lt;SPAN class="crayon-v"&gt;http&lt;/SPAN&gt;&lt;SPAN class="crayon-o"&gt;:&lt;/SPAN&gt;&lt;SPAN class="crayon-c"&gt;//cm_host:7180/api/v1/clusters/dev01/services/hdfs2&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;could you please assist with a command I need to run (Is there a way doing it without python just a shell script)&lt;/P&gt;&lt;P&gt;King Regards,&lt;/P&gt;&lt;P&gt;Rotem&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 15:31:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/56014#M62674</guid>
      <dc:creator>Rotem</dc:creator>
      <dc:date>2017-06-16T15:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting impala daemon serves via cloudera rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/56016#M62675</link>
      <description>&lt;P&gt;Then you will need to parse the REST result&amp;nbsp;of the /hosts?view=full [0] endpoint which gives you map of host-to-roleRef "The list of roles assigned to this host."&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$ curl -u admin:admin -X GET "http://cm-server:7180/api/v12/hosts?view=full"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[0]&amp;nbsp;&lt;A href="https://cloudera.github.io/cm_api/apidocs/v16/ns0_apiHost.html" target="_blank"&gt;https://cloudera.github.io/cm_api/apidocs/v16/ns0_apiHost.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 15:42:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-impala-daemon-serves-via-cloudera-rest-API/m-p/56016#M62675</guid>
      <dc:creator>michalis</dc:creator>
      <dc:date>2017-06-16T15:42:45Z</dc:date>
    </item>
  </channel>
</rss>

