Support Questions
Find answers, ask questions, and share your expertise

components status without to set the host-name

this API give the component status ( need to set the COMPONENT_NAME )
curl -u {ambari-username}:{ambari-password}-H "X-Requested-By: ambari"-X GET http://{ambari-host}:{ambari-port}/api/v1/clusters/{clustername}/hosts/{host-name}/host_components/$...

what in case we want to show all components status (stop/start/installed) of all the cluster ( in case we not want to set the host-name )

is it possible to get all components status with API without to know the - host-name ?

Goal - print status of all components in the cluster without to set the host-name in the API

Michael-Bronson
2 REPLIES 2

Re: components status without to set the host-name

@Michael Bronson,

You can use this API to get status of all components

curl -u {ambari-username}:{ambari-password}-H "X-Requested-By: ambari"-X GET http://{ambari-host}:{ambari-port}/api/v1/clusters/{clustername}/components?fields=ServiceComponentI...

Thanks,

Aditya

Re: components status without to set the host-name

something very starnge

60382-capture.png

for example when I run the API I get that APP_TIMELINE_SERVER is started in spite this component is stop

curl -u admin:admin -H "X-Requested-By: ambari"-X GET http://master02.sysdns.com:8080/api/v1/clusters/HDP/components?fields=ServiceComponentInfo/state

{
  "href" : "http://master02.sysdns.com:8080/api/v1/clusters/HDP/components?fields=ServiceComponentInfo/state",
  "items" : [
    {
      "href" : "http://master02.sysdns.com:8080/api/v1/clusters/HDP/components/APP_TIMELINE_SERVER",
      "ServiceComponentInfo" : {
        "cluster_name" : "HDP",
        "component_name" : "APP_TIMELINE_SERVER",
        "service_name" : "YARN",
        "state" : "STARTED"
      }
    },
    {
Michael-Bronson