接口
listApps
参数
参数名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
scope | string | 否 | 可以为Public或Private。如果为Public,那么代表查询公共App;如果为Private或者不指定,那么代表查询私有App |
marker | string | 否 | 用于分页查询的Marker。默认值:空 |
maxItemCount | number | 否 | 此次查询的条目数量。必须为整数,不能大于100,不能小于1。默认值:50 |
返回值
调用成功后返回一个 ListAppsResponse
实例, 通过 getItems
得到 ListClientException
。App 属性描述,请参看获取App信息。
例子
Java 源码:
import com.aliyuncs.batchcompute.main.v20151111.*;
import com.aliyuncs.batchcompute.model.v20151111.*;
import com.aliyuncs.batchcompute.pojo.v20151111.*;
import com.aliyuncs.exceptions.ClientException;
import java.util.List;
public class ListApps {
static String ACCESS_KEY_ID = "xxx"; //这里填写您的 AccessKeyId
static String ACCESS_KEY_SECRET = "xxx"; //这里填写您的 AccessKeySecret
static String REGION_ID = "cn-xxx"; //这里填写 region
public static void main(String[] args) {
BatchCompute client = new BatchComputeClient(REGION_ID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
try {
//获取公共APP列表
ListAppsResponse listAppsResponse = client.listApps("Public");
List<App> list = listAppsResponse.getItems();
for (int i = 0; i < list.size(); i++){
App app = list.get(i);
System.out.println("AppName: " + app.getName());
System.out.println("AppDesc: " + app.getDescription());
}
System.out.println("RequestId: " + listAppsResponse.getRequestId());
System.out.println("StatusCode: " + listAppsResponse.getStatusCode());
} catch (ClientException e) {
e.printStackTrace();
//创建失败
}
}
}
执行结果
{
AppName: cromwell
AppDesc: Cromwell is a Workflow Management System geared towards scientific workflows. See https://github.com/broadinstitute/cromwell.
AppName: fastq_to_ubam
AppDesc: Convert fastq files to unaligned bam files.
RequestId: null
StatusCode: 200
}
文档内容是否对您有帮助?