删除App

接口

deleteApp

参数

参数 类型 是否必需 说明
appName String App名称
qualifier String App资源的版本号,如参数,那么系统会删除整个App。

返回值

调用成功后返回一个 DeleteAppResponse 实例;调用失败后,抛出异常: ClientException

例子

Java 源码:

  1. import com.aliyuncs.batchcompute.main.v20151111.*;
  2. import com.aliyuncs.batchcompute.model.v20151111.*;
  3. import com.aliyuncs.exceptions.ClientException;
  4. public class DeleteApp {
  5. static String ACCESS_KEY_ID = ""; //这里填写您的 AccessKeyId
  6. static String ACCESS_KEY_SECRET = ""; //这里填写您的 AccessKeySecret
  7. static String REGION_ID = "cn-shenzhen"; //这里填写 region
  8. static String appName = "JavaSdkApp";
  9. public static void main(String[] args) {
  10. BatchCompute client = new BatchComputeClient(REGION_ID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
  11. try {
  12. DeleteAppResponse response = client.deleteApp(appName);
  13. //删除指定版本的app
  14. //DeleteAppResponse response = client.deleteApp(appName, "0.1");
  15. System.out.println("RequestId: " + response.getRequestId());
  16. System.out.println("StatusCode: " + response.getStatusCode());
  17. } catch (ClientException e) {
  18. e.printStackTrace();
  19. //创建失败
  20. }
  21. }
  22. }

执行结果:

  1. {
  2. RequestId: null
  3. StatusCode: 204
  4. }