<?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 Manage CM using Rest API in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Manage-CM-using-Rest-API/m-p/337476#M232588</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I recently discovered the CM Rest API and how I can restart services and obtain some information just using the Linux console and not using the CM UI.&lt;/P&gt;
&lt;P&gt;I'm looking for some examples to delete and create the Impala Catalog Server and State Store (in a diferent node) by only using this feature.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did not find any information about it in the internet, just some poor youtube videos to do simple actions.&lt;/P&gt;
&lt;P&gt;I'm using&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CDP 7.1.6&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CM 7.3.1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;API v43&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is the Cloudera documentation I could get from my installation&lt;/P&gt;
&lt;P&gt;&lt;A href="http://my-CMhost.com:7180/static/apidocs/resource_RolesResource.html" target="_blank" rel="noopener"&gt;http://my-CMhost.com:7180/static/apidocs/resource_RolesResource.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33745i27247DC3C88341ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would really appreciate if anyone used this and could share some examples &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 21:11:58 GMT</pubDate>
    <dc:creator>Juanes</dc:creator>
    <dc:date>2022-03-02T21:11:58Z</dc:date>
    <item>
      <title>Manage CM using Rest API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Manage-CM-using-Rest-API/m-p/337476#M232588</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I recently discovered the CM Rest API and how I can restart services and obtain some information just using the Linux console and not using the CM UI.&lt;/P&gt;
&lt;P&gt;I'm looking for some examples to delete and create the Impala Catalog Server and State Store (in a diferent node) by only using this feature.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did not find any information about it in the internet, just some poor youtube videos to do simple actions.&lt;/P&gt;
&lt;P&gt;I'm using&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CDP 7.1.6&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CM 7.3.1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;API v43&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is the Cloudera documentation I could get from my installation&lt;/P&gt;
&lt;P&gt;&lt;A href="http://my-CMhost.com:7180/static/apidocs/resource_RolesResource.html" target="_blank" rel="noopener"&gt;http://my-CMhost.com:7180/static/apidocs/resource_RolesResource.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33745i27247DC3C88341ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would really appreciate if anyone used this and could share some examples &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 21:11:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Manage-CM-using-Rest-API/m-p/337476#M232588</guid>
      <dc:creator>Juanes</dc:creator>
      <dc:date>2022-03-02T21:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Manage CM using Rest API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Manage-CM-using-Rest-API/m-p/337485#M232592</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/83916"&gt;@Juanes&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are a couple of examples:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To delete a role:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl \
  -u admin:admin \
  -X DELETE \
  "http://cm-host:7180/api/v45/clusters/cluster1/services/impala1/roles/impala-CATALOGSERVER-3b111e1a47149ce566f7225d1120cf85"&lt;/LI-CODE&gt;&lt;P&gt;To create a role for a service in a particular host:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;❯ cat role.json
{
  "items": [
    {
      "name" : "impala-CATALOGSERVER-myrole",
      "type" : "CATALOGSERVER",
      "serviceRef" : {
        "clusterName" : "cluster1",
        "serviceName" : "impala1",
        "serviceDisplayName" : "Impala",
        "serviceType" : "IMPALA"
      },
      "hostRef" : {
        "hostId" : "21fd5c51-0fd2-4eb6-97d2-0e498639eb07",
        "hostname" : "host-2"
      }
    }
  ]
}

❯ curl \
   -u admin:admin \
   -X POST \
   "http://cm-host:7180/api/v45/clusters/cluster1/services/impala1/roles" \
   -H 'Content-Type: application/json' \
   -d @role.json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;André&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 12:43:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Manage-CM-using-Rest-API/m-p/337485#M232592</guid>
      <dc:creator>araujo</dc:creator>
      <dc:date>2022-03-02T12:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Manage CM using Rest API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Manage-CM-using-Rest-API/m-p/337508#M232602</link>
      <description>&lt;P&gt;Whow, this worked perfect!&lt;/P&gt;&lt;P&gt;You make my day, my best wishes to you my friend!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 17:01:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Manage-CM-using-Rest-API/m-p/337508#M232602</guid>
      <dc:creator>Juanes</dc:creator>
      <dc:date>2022-03-02T17:01:50Z</dc:date>
    </item>
  </channel>
</rss>

