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

Python SDK

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

SDK安裝

  1. 安裝Alibaba Cloud VS SDK for Python

pip install alibabacloud_vs20181212==2.0.0
		

SDK使用

以下這個代碼示例展示了調用阿里云Python SDK的3個主要步驟:

  1. 創建Config實例。在創建Config實例時,您需要獲取Endpoint、AccessKey ID和AccessKey Secret。

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

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

# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys

from typing import List

from alibabacloud_vs20181212.client import Client as vs20181212Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_vs20181212 import models as vs_20181212_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient


class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client() -> vs20181212Client:
        """
        使用AK&SK初始化賬號Client
        @return: Client
        @throws Exception
        """
        # 工程代碼泄露可能會導致 AccessKey 泄露,并威脅賬號下所有資源的安全性。以下代碼示例僅供參考。
        # 建議使用更安全的 STS 方式,更多鑒權訪問方式請參見:http://m.bestwisewords.com/document_detail/378659.html。
        config = open_api_models.Config(
            # 必填,請確保代碼運行環境設置了環境變量 ALIBABA_CLOUD_ACCESS_KEY_ID。,
            access_key_id=os.environ['ALIBABA_CLOUD_ACCESS_KEY_ID'],
            # 必填,請確保代碼運行環境設置了環境變量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。,
            access_key_secret=os.environ['ALIBABA_CLOUD_ACCESS_KEY_SECRET']
        )
        # Endpoint 請參考 https://api.aliyun.com/product/vs
        config.endpoint = f'vs.cn-beijing.aliyuncs.com'
        return vs20181212Client(config)

    @staticmethod
    def main(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        add_vs_pull_stream_info_config_request = vs_20181212_models.AddVsPullStreamInfoConfigRequest(
            domain_name='your_value',
            app_name='your_value'
        )
        try:
            # 復制代碼運行請自行打印 API 的返回值
            client.add_vs_pull_stream_info_config_with_options(add_vs_pull_stream_info_config_request, util_models.RuntimeOptions())
        except Exception as error:
            # 此處僅做打印展示,請謹慎對待異常處理,在工程項目中切勿直接忽略異常。
            # 錯誤 message
            print(error.message)
            # 診斷地址
            print(error.data.get("Recommend"))
            UtilClient.assert_as_string(error.message)

    @staticmethod
    async def main_async(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        add_vs_pull_stream_info_config_request = vs_20181212_models.AddVsPullStreamInfoConfigRequest(
            domain_name='your_value',
            app_name='your_value'
        )
        try:
            # 復制代碼運行請自行打印 API 的返回值
            await client.add_vs_pull_stream_info_config_with_options_async(add_vs_pull_stream_info_config_request, util_models.RuntimeOptions())
        except Exception as error:
            # 此處僅做打印展示,請謹慎對待異常處理,在工程項目中切勿直接忽略異常。
            # 錯誤 message
            print(error.message)
            # 診斷地址
            print(error.data.get("Recommend"))
            UtilClient.assert_as_string(error.message)


if __name__ == '__main__':
    Sample.main(sys.argv[1:])