查询流控记录__JAVA SDK_SDK 手册_CDN-阿里云
package com.aliyuncs.cdn.test;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.cdn.model.v20141111.DescribeLiveStreamsControlHistoryRequest;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.HttpResponse;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import org.junit.Test;
public class DescribeLiveStreamsControlHistoryTest {
private IAcsClient client = null;
public DescribeLiveStreamsControlHistoryTest() {
if (null == client) {
try {
init();
} catch (ClientException e) {
e.printStackTrace();
}
}
}
public void init() throws ClientException {
// 初始化IAcsClient
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", "<your accessKey>", "<your accessSecret>");
//DefaultProfile.addEndpoint("cn-hangzhou-2", "cn-hangzhou-2", "Cdn", "cdn.aliyuncs.com"); //添加自定义endpoint。
client = new DefaultAcsClient(profile);
//System.setProperty("http.proxyHost", "127.0.0.1"); //此设置用于设置代理,可用fiddler拦截查看http请求,便于调试。
//System.setProperty("http.proxyPort", "8888");
}
@Test
public void invoke() {
// 初始化请求
DescribeLiveStreamsControlHistoryRequest describeLiveStreamsControlHistoryRequest = new DescribeLiveStreamsControlHistoryRequest();
describeLiveStreamsControlHistoryRequest.setDomainName("test.cdnpe.com");
describeLiveStreamsControlHistoryRequest.setAppName("testapp");
describeLiveStreamsControlHistoryRequest.setStartTime("2015-10-01T00:00:00Z");
describeLiveStreamsControlHistoryRequest.setEndTime("2015-10-01T20:00:00Z");
try {
HttpResponse httpResponse = client.doAction(describeLiveStreamsControlHistoryRequest);
System.out.println(httpResponse.getUrl());
System.out.println(new String(httpResponse.getContent()));
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
e.printStackTrace();
}
}
}
最后更新:2016-11-24 11:23:47
上一篇:
获取域名日志__JAVA SDK_SDK 手册_CDN-阿里云
下一篇:
断流操作__JAVA SDK_SDK 手册_CDN-阿里云
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云