文档

删除集群

更新时间:

接口

接口名称:delete_cluster

# 参数

参数 类型 是否必须 描述
cluster string 集群标识符

返回值

成功返回 ActionResponse 对象,对象内容

失败抛出异常和错误,参考 SDK的使用说明 中的异常类型。

例子

下面例子您需要制定集群标识码。

Python 源码:

  1. import time
  2. import batchcompute
  3. from batchcompute import CN_SHENZHEN as REGION
  4. from batchcompute import Client, ClientError
  5. ACCESS_KEY_ID = 'Your Access Key Id'
  6. ACCESS_KEY_SECRET = 'Your Access Key Secret'
  7. client = Client(REGION, ACCESS_KEY_ID, ACCESS_KEY_SECRET)
  8. def delete_cluster():
  9. try:
  10. # Cluster ID.
  11. cluster_id = "cls-xxxx"
  12. rsp = client.delete_cluster(cluster_id)
  13. print rsp
  14. except ClientError, e:
  15. print (e.get_status_code(), e.get_code(), e.get_requestid(), e.get_msg())
  16. if __name__ == '__main__':
  17. delete_cluster()

执行结果:

  1. {
  2. "Date": "Thu, 08 Nov 2018 11:24:57 GMT",
  3. "RequestId": "8D509013-7568-4175-AB3D-1FC05E3BD472",
  4. "StatusCode": 200
  5. }
  • 本页导读 (0)
文档反馈