重新创建集群实例

接口

recreateClusterInstance

参数

参数

类型

是否必需

说明

clusterId

String

集群ID

groupName

String

实例组名称

id

String

集群实例ID

返回值

成功后返回一个 RecreateClusterInstanceResponse 实例。如果失败,抛出异常: ClientException

例子

Java 源码:

import com.aliyuncs.batchcompute.main.v20151111.*;
import com.aliyuncs.batchcompute.model.v20151111.*;
import com.aliyuncs.exceptions.ClientException;

public class RecreateClusterInstance {
    static String ACCESS_KEY_ID = "xxx";  //这里填写您的 AccessKeyId
    static String ACCESS_KEY_SECRET = "xxx"; //这里填写您的 AccessKeySecret
    static String REGION_ID = "cn-xxx";   //这里填写 region
    static String ClusterId = "cls-xxx";

    public static void main(String[] args) {
        BatchCompute client = new BatchComputeClient(REGION_ID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
        try{
            String groupName = "group1";
            String id = "ins-xxx"; //需要重建的实例Id

            RecreateClusterInstanceResponse response = client.recreateClusterInstance(ClusterId,groupName,id);
            //成功接受
            System.out.println("RequestId: " + response.getRequestId());
            System.out.println("StatusCode: " + response.getStatusCode());

        }catch(ClientException e){
            e.printStackTrace();
            //失败
        }
    }
}

执行结果:

{
  RequestId: null
  StatusCode: 204
}
  • 注意:这个是个异步接口,不会立即生效。