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

異步

更新時間:

本文為您介紹V2.0 Python SDK中異步請求的調用方式。

V2.0 SDK異步

V2.0 SDK 支持異步請求 async def 定義異步方法,通過await client.{方法名}_async()調用SDK異步方法。

import asyncio
import os

from alibabacloud_ecs20140526.models import DescribeImagesRequest
from alibabacloud_ecs20140526.client import Client
from alibabacloud_tea_openapi.models import Config

'''云服務器示例'''


async def main():
    config = Config(
        access_key_id=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID'),
        access_key_secret=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET'),
        endpoint='ecs-cn-hangzhou.aliyuncs.com'
    )
    client = Client(config)
    request = DescribeImagesRequest(
        region_id='cn-hangzhou'
    )

    response = await client.describe_images_async(request)
    print(response)
    return response


loop = asyncio.get_event_loop()
loop.run_until_complete(main())