Reputation: 97
I am trying to use Cloud era manager python API for starting and stopping the cluster.
IS it possible to stop the management roles also using this API?
IF can you let me know the commands or the documentation page?
Thanks
Upvotes: 0
Views: 2747
Reputation: 1538
Here's an example on how to stop Management Services using the python CM API
from cm_api.api_client import ApiResource
api = ApiResource("cm-host.cloudera.com")
mgmt = api.get_cloudera_manager().get_service()
mgmt.stop()
mgmt.start()
Upvotes: 3
Reputation: 4832
Cloudera Manager provides a number of REST APIs, which also include starting/stopping clusters/services. You can find more from the API documents [your cloudera manager host]:7180/static/apidocs/
/clusters/{clusterName}/commands/start
/clusters/{clusterName}/commands/stop
/clusters/{clusterName}/services/{serviceName}/commands/start
/clusters/{clusterName}/services/{serviceName}/commands/stop
Then there are a number of python modules you could use to visit REST APIs, Requests is one I'd like to recommend.
Upvotes: 0