获取App所有版本号
更新时间:
接口
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 = ""; //这里填写您的 AccessKeyIdstatic String ACCESS_KEY_SECRET = ""; //这里填写您的 AccessKeySecretstatic String REGION_ID = "cn-xxx"; //这里填写 regionstatic 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: 0appUpdateTime: Tue Nov 13 11:27:47 CST 2018appVersion: 1appUpdateTime: Tue Nov 13 14:42:18 CST 2018appVersion: 2appUpdateTime: Tue Nov 13 14:43:12 CST 2018RequestId: nullStatusCode: 200}
该文章对您有帮助吗?