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-阿裏雲