全部产品
阿里云办公

获取App列表

更新时间:2018-11-19 21:02:55

接口

listApps

参数

参数名称 类型 是否必需 描述
scope string 可以为Public或Private。如果为Public,那么代表查询公共App;如果为Private或者不指定,那么代表查询私有App
marker string 用于分页查询的Marker。默认值:空
maxItemCount number 此次查询的条目数量。必须为整数,不能大于100,不能小于1。默认值:50

返回值

调用成功后返回一个 ListAppsResponse 实例, 通过 getItems 得到 List。调用失败后,抛出异常:ClientException 。App 属性描述,请参看获取App信息

例子

Java 源码:

  1. import com.aliyuncs.batchcompute.main.v20151111.*;
  2. import com.aliyuncs.batchcompute.model.v20151111.*;
  3. import com.aliyuncs.batchcompute.pojo.v20151111.*;
  4. import com.aliyuncs.exceptions.ClientException;
  5. import java.util.List;
  6. public class ListApps {
  7. static String ACCESS_KEY_ID = "xxx"; //这里填写您的 AccessKeyId
  8. static String ACCESS_KEY_SECRET = "xxx"; //这里填写您的 AccessKeySecret
  9. static String REGION_ID = "cn-xxx"; //这里填写 region
  10. public static void main(String[] args) {
  11. BatchCompute client = new BatchComputeClient(REGION_ID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
  12. try {
  13. //获取公共APP列表
  14. ListAppsResponse listAppsResponse = client.listApps("Public");
  15. List<App> list = listAppsResponse.getItems();
  16. for (int i = 0; i < list.size(); i++){
  17. App app = list.get(i);
  18. System.out.println("AppName: " + app.getName());
  19. System.out.println("AppDesc: " + app.getDescription());
  20. }
  21. System.out.println("RequestId: " + listAppsResponse.getRequestId());
  22. System.out.println("StatusCode: " + listAppsResponse.getStatusCode());
  23. } catch (ClientException e) {
  24. e.printStackTrace();
  25. //创建失败
  26. }
  27. }
  28. }

执行结果

  1. {
  2. AppName: cromwell
  3. AppDesc: Cromwell is a Workflow Management System geared towards scientific workflows. See https://github.com/broadinstitute/cromwell.
  4. AppName: fastq_to_ubam
  5. AppDesc: Convert fastq files to unaligned bam files.
  6. RequestId: null
  7. StatusCode: 200
  8. }