Skip to main content
devdb
Bronze ⭐️⭐️⭐️
August 2, 2021
Question

Is it possible to get Impala hostname or datanodes information using Cloudera Manager API?

Is it possible to get Impala hostname or datanodes information using Cloudera Manager API?
I'm trying to automate some tests where I require to get the Impala hostname to run some connection checks. 

I dont want to hardcode the Impala hostnames in the tests. The tests would run on different environments so would like to find the hostname information or IP address of the configured Impala data nodes from Cloudera Manager API?
I'm able to get all the hosts IP addresses from the API but cannot filter or query a specific IP belonging to Impala from the response.

 

Our organisation is using 

v33 APICloudera Manager 6.3.0


Thanks,

DevDB

1 reply

GangWar
Platinum ⭐️⭐️
Platinum ⭐️⭐️
August 3, 2021

@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-d1ee4c53b9fbc4786263f0420c5157e8

 Also full deployment details http://cm:7180/api/v19/cm/deployment

Translate
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.