// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sample;
import com.aliyun.tea.*;
public class Sample {
/**
* <b>description</b> :
* <p>使用凭据初始化账号Client</p>
* @return Client
*
* @throws Exception
*/
public static com.aliyun.dcdn20180115.Client createClient() throws Exception {
// 工程代码建议使用更安全的无AK方式,凭据配置方式请参见:https://help.aliyun.com/document_detail/378657.html。
com.aliyun.credentials.Client credential = new com.aliyun.credentials.Client();
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
.setCredential(credential);
// Endpoint 请参考 https://api.aliyun.com/product/dcdn
config.endpoint = "dcdn.aliyuncs.com";
return new com.aliyun.dcdn20180115.Client(config);
}
public static void main(String[] args_) throws Exception {
com.aliyun.dcdn20180115.Client client = Sample.createClient();
com.aliyun.dcdn20180115.models.DescribeDcdnRefreshTasksRequest describeDcdnRefreshTasksRequest = new com.aliyun.dcdn20180115.models.DescribeDcdnRefreshTasksRequest();
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
try {
// 复制代码运行请自行打印 API 的返回值
client.describeDcdnRefreshTasksWithOptions(describeDcdnRefreshTasksRequest, runtime);
} catch (TeaException error) {
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
System.out.println(error.getMessage());
// 诊断地址
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
} catch (Exception _error) {
TeaException error = new TeaException(_error.getMessage(), _error);
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
System.out.println(error.getMessage());
// 诊断地址
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
}
}
}
代码块222222222222222222222
前端技术实践分享
于 2025-05-22 09:20:37 首次发布
316

被折叠的 条评论
为什么被折叠?



