Update Service

Back to Resources

Summary

Update the service identified by “:serviceName” of the cluster identified by “:clusterName”.

PUT /clusters/:clusterName/services/:serviceName

Response

Example 1

Start the HDFS service (update the state of the HDFS service to be ‘STARTED’).

PUT /clusters/c1/services/HDFS
{
  "ServiceInfo": {
    "state" : "STARTED"
  }
}

202 Accepted
{
  "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/3",
  "Requests" : {
    "id" : 3,
    "status" : "InProgress"
  } 
}

Example 2

Stop the HDFS service (update the state of the HDFS service to be ‘INSTALLED’).

PUT /clusters/c1/services/HDFS/
{
  "ServiceInfo": {
    "state" : "INSTALLED"
  }
}

202 Accepted
{
  "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/4",
  "Requests" : {
    "id" : 4,
    "status" : "InProgress"
  } 
}