接口
getAppRevisions
参数
参数 | 类型 | 是否必需 | 说明 |
---|---|---|---|
appName | String | 是 | App名称。 |
返回值
调用成功后返回一个 GetAppRevisionsResponse
实例, 通过 getAppRevisions
得到 AppRevisions
列表;调用失败后,抛出异常: ClientException
。
AppRevision 的属性
参数名称 | 类型 | 描述 |
---|---|---|
revision | number | App资源的版本号 |
updateTime | string | 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 GetAppRevisions {
static String ACCESS_KEY_ID = ""; //这里填写您的 AccessKeyId
static String ACCESS_KEY_SECRET = ""; //这里填写您的 AccessKeySecret
static String REGION_ID = "cn-xxx"; //这里填写 region
static String appName = "JavaSdkApp";
public static void main(String[] args) {
BatchCompute client = new BatchComputeClient(REGION_ID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
try {
GetAppRevisionsResponse getAppRevisionsResponse = client.getAppRevisions(appName);
List<AppRevision> appRevisions = getAppRevisionsResponse.getAppRevisions();
for (int i = 0; i < appRevisions.size(); i++){
AppRevision appRevision = appRevisions.get(i);
System.out.println("appVersion: " + appRevision.getRevision());
System.out.println("appUpdateTime: " + appRevision.getUpdateTime());
}
System.out.println("RequestId: " + getAppRevisionsResponse.getRequestId());
System.out.println("StatusCode: " + getAppRevisionsResponse.getStatusCode());
} catch (ClientException e) {
e.printStackTrace();
//创建失败
}
}
}
执行结果
{
appVersion: 0
appUpdateTime: Tue Nov 13 11:27:47 CST 2018
appVersion: 1
appUpdateTime: Tue Nov 13 14:42:18 CST 2018
appVersion: 2
appUpdateTime: Tue Nov 13 14:43:12 CST 2018
RequestId: null
StatusCode: 200
}
文档内容是否对您有帮助?