日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

Java SDK

本文介紹Java SDK的安裝及使用說明。

Java SDK安裝

  1. 安裝Alibaba Cloud VS SDK for Java

比如,通過添加Maven依賴的方式安裝時,只需在pom.xml文件中添加以下依賴即可:

<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>vs20181212</artifactId>
  <version>2.0.0</version>
</dependency>
		
說明

建議使用視圖計算最新的版本,具體版本號請參考SDK中心

Java SDK使用

以下代碼示例展示了調用Java SDK的三個主要步驟:

  1. 創建Config實例并初始化。

  2. 創建API請求并設置參數。

  3. 發起請求并處理應答或異常。

// 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>使用AK&amp;SK初始化賬號Client</p>
     * @return Client
     * 
     * @throws Exception
     */
    public static com.aliyun.vs20181212.Client createClient() throws Exception {
        // 工程代碼泄露可能會導致 AccessKey 泄露,并威脅賬號下所有資源的安全性。以下代碼示例僅供參考。
        // 建議使用更安全的 STS 方式,更多鑒權訪問方式請參見:http://m.bestwisewords.com/document_detail/378657.html。
        com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
                // 必填,請確保代碼運行環境設置了環境變量 ALIBABA_CLOUD_ACCESS_KEY_ID。
                .setAccessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                // 必填,請確保代碼運行環境設置了環境變量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
                .setAccessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
        // Endpoint 請參考 https://api.aliyun.com/product/vs
        config.endpoint = "vs.cn-beijing.aliyuncs.com";
        return new com.aliyun.vs20181212.Client(config);
    }

    public static void main(String[] args_) throws Exception {
        java.util.List<String> args = java.util.Arrays.asList(args_);
        com.aliyun.vs20181212.Client client = Sample.createClient();
        com.aliyun.vs20181212.models.AddVsPullStreamInfoConfigRequest addVsPullStreamInfoConfigRequest = new com.aliyun.vs20181212.models.AddVsPullStreamInfoConfigRequest()
                .setDomainName("your_value")
                .setAppName("your_value");
        try {
            // 復制代碼運行請自行打印 API 的返回值
            client.addVsPullStreamInfoConfigWithOptions(addVsPullStreamInfoConfigRequest, new com.aliyun.teautil.models.RuntimeOptions());
        } 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);
        }        
    }
}