Support Questions

Find answers, ask questions, and share your expertise

Collecting roles from command line

avatar
New Contributor

Hello,

 

I would like to get the similar output as you can see it in the Cloudera Manager UI Hosts->Roles.

 

How can I collect all the roles and on which server this role is added from command line?

 

I can reach

https://hostname:7183/api/v32/clusters/clustername/

 

Also I can reach

https://hostname:7183/api/v32/clusters/clustername/services/servicename

 

I have full administrator right on the cluster,but

what is the correct permission level to get these information?

 

CDH version is 6.3.4 and 6.2.1.

 

Thanks,

András

1 REPLY 1

avatar
Expert Contributor

Hello @AndrasV ,

 

You may get the details using the host API as below:

https://archive.cloudera.com/cm6/6.2.0/generic/jar/cm_api/apidocs/resource_HostsResource.html#resour...

 

This would list down the roles that are installed/available on this particular host. To get the host Id, please use the below API:

https://archive.cloudera.com/cm6/6.2.0/generic/jar/cm_api/apidocs/resource_HostsResource.html#resour...

 

Let us know if this helps.

 

Cheers!

Was your question answered? Make sure to mark the answer as the accepted solution.

If you find a reply useful, say thanks by clicking on the thumbs up button.