删除集群
更新时间:
接口
接口名称: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"; //这里填写您的 AccessKeyIdstatic String ACCESS_KEY_SECRET = "xxx"; //这里填写您的 AccessKeySecretstatic String REGION_ID = "cn-xxx"; //这里填写集群所在 regionstatic String ClusterId = "cls-xxx" //这里填写需要删除的集群的IDpublic 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: nullStatusCode: 204}
该文章对您有帮助吗?