Service resources are services of a Hadoop cluster (e.g. HDFS, MapReduce and Ganglia). Service resources are sub-resources of clusters.
###API Summary
###Properties
Property | Description |
---|---|
ServiceInfo/service_name | The service name |
ServiceInfo/cluster_name | The parent cluster name |
ServiceInfo/state | The current state of the service |
ServiceInfo/desired_configs | The desired configurations |
###States
The current state of a service resource can be determined by looking at the ServiceInfo/state property.
GET api/v1/clusters/c1/services/HDFS?fields=ServiceInfo/state
200 OK
{
"href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS?fields=ServiceInfo/state",
"ServiceInfo" : {
"cluster_name" : "c1",
"state" : "INSTALLED",
"service_name" : "HDFS"
}
}
The following table lists the possible values of the service resource ServiceInfo/state property.
<td>UNINSTALLING</td>
<td>In the process of uninstalling the service.</td>
<td>UNINSTALLED</td>
<td>The service has been successfully uninstalled.</td>
<td>WIPING_OUT</td>
<td>In the process of wiping out the installed service.</td>
<td>UPGRADING</td>
<td>In the process of upgrading the service.</td>
<td>MAINTENANCE</td>
<td>The service has been marked for maintenance.</td>
<td>UNKNOWN</td>
<td>The service state can not be determined.</td>
###Starting a Service A service can be started through the API by setting its state to be STARTED (see update service).
###Stopping a Service A service can be stopped through the API by setting its state to be INSTALLED (see update service).