465
阿里云
JAVA-SDK__点播SDK_SDK手册_视频点播-阿里云
SDK-JAVA
环境要求
Java 6+
Maven
安装
添加maven仓库
<repositories>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Nexus Staging</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
添加Jar包依赖
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-mts</artifactId>
<version>2.1.7</version>
</dependency>
多区域支持
添加北京区域(其他区域类似):
import com.aliyuncs.profile.DefaultProfile;
DefaultProfile.addEndpoint("cn-beijing",
"cn-beijing",
"Mts",
"mts.cn-beijing.aliyuncs.com");
API调用示例
下面以
SearchMediaWorkflow
API调用为例。import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.mts.model.v20140618.SearchMediaWorkflowRequest;
import com.aliyuncs.mts.model.v20140618.SearchMediaWorkflowResponse;
SearchMediaWorkflowResponse searchMediaWorkflow(DefaultAcsClient client) {
SearchMediaWorkflowRequest request = new SearchMediaWorkflowRequest();
SearchMediaWorkflowResponse response = null;
try {
response = client.getAcsResponse(request);
} catch (ServerException e) {
throw new RuntimeException("SearchMediaWorkflowRequest Server failed");
} catch (ClientException e) {
throw new RuntimeException("SearchMediaWorkflowRequest Client failed");
}
return response;
}
杭州区域
只要初始化profile和client时,正确设置RegionId参数”cn-hangzhou”,API调用时无需特殊设置。
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.DefaultAcsClient;
DefaultProfile profile = DefaultProfile.getProfile(
"cn-hangzhou",
accessKeyId,
accessKeySecret);
DefaultAcsClient client = new DefaultAcsClient(profile);
searchMediaWorkflow(client);
北京区域
只要初始化profile和client时,正确设置RegionId参数”cn-beijing”,API调用时无需特殊设置。
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.DefaultAcsClient;
DefaultProfile profile = DefaultProfile.getProfile(
"cn-beijing",
accessKeyId,
accessKeySecret);
DefaultAcsClient client = new DefaultAcsClient(profile);
searchMediaWorkflow(client);
最后更新:2016-11-23 18:24:22
上一篇:
多区域支持__点播SDK_SDK手册_视频点播-阿里云
下一篇:
PHP-SDK__点播SDK_SDK手册_视频点播-阿里云
ping 丢包或不通时链路测试说明__ECS常见问题_产品使用问题_云服务器 ECS-阿里云
可授权CDN Action__RAM资源授权-CDN_API 手册_CDN-阿里云
阿里云总裁胡晓明:阿里将打造1+100个云栖小镇
大文件上传如何续传__数据操作常见问题_产品使用问题_归档存储-阿里云
AvailableResourcesType__数据类型_API 参考_云服务器 ECS-阿里云
后端ECS为何访问不了负载均衡实例__后端 ECS 服务器常见问题_常见问题_负载均衡-阿里云
功能说明-DNAT__NAT网关产品简介_用户指南_专有网络 VPC-阿里云
7.4 查询SQL优化__第七章 性能优化和诊断_使用手册_分析型数据库-阿里云
SetLoadBalancerUDPListenerAttribute__Listener相关API_API 参考_负载均衡-阿里云
DeleteVirtualMFADevice__用户管理接口_RAM API文档_访问控制-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云