重建集群实例
接口
recreate_cluster_instance
参数
属性 | 类型 | 是否必须 | 描述 |
---|---|---|---|
cluster_id | string | 是 | 集群标识符 |
group_name | string | 是 | 实例组名称 |
instance_id | string | 是 | 实例名称 |
返回值
recreate_cluster_instance方法将返回一个 ActionResponse
对象。
例子
Python源码:
import time
import batchcompute
from batchcompute import CN_SHENZHEN as REGION
from batchcompute import Client, ClientError
ACCESS_KEY_ID = 'Your Access Key Id'
ACCESS_KEY_SECRET = 'Your Access Key Secret'
client = Client(REGION, ACCESS_KEY_ID, ACCESS_KEY_SECRET)
def recreate_cluster_instance():
try:
cluster_id = 'cls-xxx'
group_name = 'group1'
instance_id = 'ins-xxx'
rsp = client.recreate_cluster_instance(cluster_id, group_name, instance_id)
print rsp
except ClientError, e:
print (e.get_status_code(), e.get_code(), e.get_requestid(), e.get_msg())
if __name__ == '__main__':
recreate_cluster_instance()
执行结果:
{
"Date": "Thu, 08 Nov 2018 15:11:43 GMT",
"RequestId": "1E4495DD-35BF-412F-9001-A16E53407D18",
"StatusCode": 201
}