クラスターの開始と停止に Cloud era manager python API を使用しようとしています。
この API を使用して管理ロールを停止することはできますか?
コマンドまたはドキュメント ページを教えてもらえますか?
ありがとう
クラスターの開始と停止に Cloud era manager python API を使用しようとしています。
この API を使用して管理ロールを停止することはできますか?
コマンドまたはドキュメント ページを教えてもらえますか?
ありがとう
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()
Cloudera Manager は、クラスター/サービスの開始/停止も含む多数の REST API を提供します。APIドキュメントからさらに見つけることができます[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
次に、REST API にアクセスするために使用できる Python モジュールがいくつかあります。私が推奨したいのはRequestsです。