services-service.md 2.9 KB

View Service Information

Back to Resources

Summary

Gets the service information for the service identified by ":serviceName" for cluster identified by ":clusterName".

GET /clusters/:clusterName/services/:serviceName

Response

<th>HTTP CODE</th>
<th>Description</th>

<td>200</td>
<td>OK</td>  

<td>400</td>
<td>Bad Request</td>  

<td>401</td>
<td>Unauthorized</td>  

<td>403</td>
<td>Forbidden</td>  

<td>404</td>
<td>Not Found</td>  

<td>500</td>
<td>Internal Server Error</td>  

Example

Get the information for the "HDFS" service of the cluster named "c1".

GET /clusters/c1/services/HDFS

200 OK
{
    "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS",
    "ServiceInfo" : {
        "cluster_name" : "c1",
        "service_name" : "HDFS",
        "state" : "STARTED"             
    },
    "components" : [
        {
            "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS/components/NAMENODE",
            "ServiceComponentInfo" : {
                "cluster_name" : "c1",
                "component_name" : "NAMENODE",
                "service_name" : "HDFS"
            }
        },
        {
            "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS/components/DATANODE",
            "ServiceComponentInfo" : {
                "cluster_name" : "c1",
                "component_name" : "DATANODE",
                "service_name" : "HDFS"
            }
        },
        {
            "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS/components/HDFS_CLIENT",
            "ServiceComponentInfo" : {
                "cluster_name" : "c1",
                "component_name" : "HDFS_CLIENT",
                "service_name" : "HDFS"
            }
        },
        {
            "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS/components/SECONDARY_NAMENODE",
            "ServiceComponentInfo" : {
                "cluster_name" : "c1",
                "component_name" : "SECONDARY_NAMENODE",
                "service_name" : "HDFS"
            }
        }
    ]
}