Host Component Resources

API Summary

Properties

States

The current state of a host component resource can be determined by looking at the ServiceComponentInfo/state property.

GET api/v1/clusters/c1/services/HDFS/components/NAMENODE?fields=ServiceComponentInfo/state

200 OK
{
  "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS/components/NAMENODE?fields=ServiceComponentInfo/state",
  "ServiceComponentInfo" : {
    "cluster_name" : "c1",
    "component_name" : "NAMENODE",
    "state" : "INSTALLED",
    "service_name" : "HDFS"
  }
}

The following table lists the possible values of the service resource ServiceComponentInfo/state property.

Starting a Host Component

A component can be started through the API by setting its state to be STARTED (see update host component).

Stopping a Host Component

A component can be stopped through the API by setting its state to be INSTALLED (see update host component).

Maintenance

The user can update the desired state of a host component through the API to be MAINTENANCE (see update host component). When a host component is into maintenance state it is basically taken off line. This state can be used, for example, to move a component like NameNode. The NameNode component can be put in MAINTENANCE mode and then a new NameNode can be created for the service.