host-component.md 2.7 KB

View Host Component Information

Back to Resources

Summary

Returns information for a specific role on the given host.

GET /clusters/:name/hosts/:hostName/host_components/:componentName

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

Returns information for a the DATANODE role on the the host named "host1" on the cluster named "c1".

GET /clusters/c1/hosts/host1/host_components/DATANODE

200 OK
{
    "href" : "http://your.ambari.server/api/v1/clusters/c1/hosts/host1/host_components/DATANODE",
    "HostRoles" : {
        "cluster_name" : "c1",
        "component_name" : "DATANODE",
        "host_name" : "host1",
        "state" : "STARTED"
    },
    "host" : {
        "href" : "http://localhost:8080/api/v1/clusters/c1/hosts/dev.hortonworks.com"
    },
    "metrics" : {
        "process" : {
            ...    
        },
        "ugi" : {
            ...
        },
        "dfs" : {
            "datanode" : {
            ...
            }
        },
        "disk" : {
            ...
        },
        "cpu" : {
            ...
        },
        "jvm" : {
            ...
        },
        "load" : {
            ...
        },
        "memory" : {
            ...
        },
        "network" : {
            ...
        },
    },
    "component" : [
        {
            "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS/components/DATANODE",
            "ServiceComponentInfo" : {
                "cluster_name" : "c1",
                "component_name" : "DATANODE",
                "service_name" : "HDFS"
            }
        }
    ]
}