@devdb Take a look of this may be it can help :
https://archive.cloudera.com/cm7/7.2.4/generic/jar/cm_api/apidocs/
Also you can get the hosts details from this :
http://CM-SERVER:7180/api/v19/clusters/cluster1/services
For each ‘hosts’ in
http://cm:7180/api/v19/hosts iterate through the hostId …
{
"items" : [ {
"maintenanceOwners" : [ ],
"hostId" : "15b5c47f-9156-4347-abd4-efbc79d27ba2", <=== hostid
"ipAddress" : "IP",
"hostname" : "host",
...
{
"clusterName" : "Cluster 1",
"serviceName" : "HDFS-1",
"roleName" : "HDFS-1-DATANODE-d1ee4c53b9fbc4786263f0420c5157e8"
}, {
...
using the roleName
http://cm:7180/api/v19/clusters/Cluster%201/services/HDFS-1/roles/HDFS-1-DATANODE-d1ee4c53b9fbc47862...
Also full deployment details http://cm:7180/api/v19/cm/deployment
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.