The python-ambariclient library has an api for retrieving the host_components:
ambari.services(service_name).components(component_name).host_components
How can I extract the name_node for an IBM Analytics Engine cluster?
I think I need to make the call:
GET https://xxxx.bi.services.us-south.bluemix.net:9443/api/v1/clusters/AnalyticsEngine/services/HDFS/components/NAMENODE?fields=host_components
Which retrieves the following information:
{
"href" : "https://xxxx.bi.services.us-south.bluemix.net:9443/api/v1/clusters/AnalyticsEngine/services/HDFS/components/NAMENODE?fields=host_components",
"ServiceComponentInfo" : {
"cluster_name" : "AnalyticsEngine",
"component_name" : "NAMENODE",
"service_name" : "HDFS"
},
"host_components" : [
{
"href" : "https://xxxx.bi.services.us-south.bluemix.net:9443/api/v1/clusters/AnalyticsEngine/hosts/xxxx.bi.services.us-south.bluemix.net/host_components/NAMENODE",
"HostRoles" : {
"cluster_name" : "AnalyticsEngine",
"component_name" : "NAMENODE",
"host_name" : "xxxx.bi.services.us-south.bluemix.net"
}
}
]
}
I have created a library to extract this information. Install with:
Then run: