Created 05-08-2017 04:13 PM
I would like to list all components with stale configs and I would like to have the service_name in the response. I tried several methods, like the one below, and all I get is the component but not the service it belongs to. Any idea how to get this please?
I am using Ambari 2.1
curl -u admin:admin http://host_name:8080/api/v1/clusters/test_cluster/host_components?HostRoles/stale_configs=true
Created 05-10-2017 02:03 PM
Can you try putting the URL inside Quotation Mark?
As the URL consist of (&)
Example:
curl -u admin:admin -H "X-Requested-By:ambari" -X GET "http://172.26.102.21:8080/api/v1/clusters/hdp234/host_components?HostRoles/stale_configs=false&fields=HostRoles/service_name
Created 05-08-2017 05:13 PM
Have you tried the following approach?
http://erie1.example.com:8080/api/v1/clusters/ClusterDemo/host_components?HostRoles/stale_configs=tr...
.
And also a bit more extended format as following:
http://erie1.example.com:8080/api/v1/clusters/ClusterDemo/host_components?HostRoles/stale_configs=tr...
.
Created 05-09-2017 05:45 PM
Tried both methods and same results, no service_name 😞
Created on 05-09-2017 06:10 PM - edited 08-17-2019 06:46 PM
Which ambari version are you using? Also can you please share the exact command and response output here?
I just now tried the same on Ambaei 2.4.0.0 and can se this thing working fine.
Created 05-09-2017 06:12 PM
Currently i do not have Ambari 2.1 setup ready to test the same .... but i guess it should be working as expected or else it might be enhanced to show the service name in later version of ambari 2.1
Created 05-09-2017 06:37 PM
So, I am getting mixed results. When I use the browser, like what you did above, I get the service_name. But when I use curl on command line, I do NOT get the the service_name. Which makes me more confused.
I am using Ambari 2.1
Created 05-10-2017 01:56 PM
I upgraded to Ambari 2.4.2 and the same issue. In order to replicate the issue, you need to call that url using curl and not the browser. Something like:
curl -u admin:admin -H "X-Requested-By:ambari" -X GET http://localhost:8080/api/v1/clusters/Sandbox/host_components?HostRoles/stale_configs=true&fields=Ho...
Created 05-10-2017 02:02 PM
Can you try putting the URL inside Quotation Mark?
As the URL consist of (&)
Example:
curl -u admin:admin -H "X-Requested-By:ambari" -X GET "http://172.26.102.21:8080/api/v1/clusters/hdp234/host_components?HostRoles/stale_configs=false&fields=HostRoles/service_name
Created 05-09-2017 04:32 AM
Created 05-09-2017 05:45 PM
I tried your suggestion and here is what I get:
"HostRoles" : {
"cluster_name" : "test_cluster",
"component_name" : "WEBHCAT_SERVER",
"host_name" : "hostname",
"stale_configs" : true
}
So, no service_name 😞