Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Turn on Maintenance Mode for Rack using Ambari API

Turn on Maintenance Mode for Rack using Ambari API

Expert Contributor

Hi Team,

I am trying to find out Ambari API to Trun on Maintenance Mode for specific rack (rack awareness is configured). I could use Ambari API for same operation for specific host and set of hosts but it would be very useful to have this for specific rack. 


curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode for host","query":"Hosts/,host2)"},"Body":{"Hosts":{"maintenance_state":"ON"}}}' http://ambari:8080/api/v1/clusters/c1/hosts


I tried to capture the response from Developer Tools -> Network in Chrome and could see that it consider all the hosts in that specific rack. 

Any help on this.

Don't have an account?
Coming from Hortonworks? Activate your account here