service-resources.md 3.7 KB

Service Resources

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.

<th>State</th>
<th>Description</th>

<td>INIT</td>
<td>The initial clean state after the service is first created.</td>  

<td>INSTALLING</td>
<td>In the process of installing the service.</td>  

<td>INSTALL_FAILED</td>
<td>The service install failed.</td>  

<td>INSTALLED</td>
<td>The service has been installed successfully but is not currently running.</td>  

<td>STARTING</td>
<td>In the process of starting the service.</td>  

<td>STARTED</td>
<td>The service has been installed and started.</td>  

<td>STOPPING</td>
<td>In the process of stopping the service.</td>  

<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).