接口
接口名称:delete_cluster
参数
参数 | 类型 | 是否必需 | 说明 |
---|---|---|---|
clusterId | String | 是 | 集群ID |
返回值
成功返回 DeleteClusterResponse 对象,对象内容
失败抛出异常和错误,参考 SDK的使用说明 中的异常类型。
例子
下面例子您需要制定集群标识码。
Java 源码:
package demo;
import com.aliyuncs.batchcompute.main.v20151111.*;
import com.aliyuncs.batchcompute.model.v20151111.*;
import com.aliyuncs.exceptions.ClientException;
public class DeleteCluster {
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" //这里填写需要删除的集群的ID
public static void main(String[] args) {
BatchCompute client = new BatchComputeClient(REGION_ID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
try{
DeleteClusterResponse response = client.deleteCluster(ClusterId);
//调用成功
System.out.println("RequestId: " + response.getRequestId());
System.out.println("StatusCode: " + response.getStatusCode());
}catch(ClientException e) {
e.printStackTrace();
//调用失败
}
}
}
执行结果:
{
RequestId: null
StatusCode: 204
}
文档内容是否对您有帮助?