地域
更新时间:2024-07-02
获取域名列表接口
使用以下代码可以获取全部地域或者指定地域的BCC(或CDS、预留实例劵)域名列表:
from baidubce.auth.bce_credentials import BceCredentials
from baidubce.bce_client_configuration import BceClientConfiguration
from baidubce.services.bcc import bcc_client, bcc_model
if __name__ == '__main__':
# 设置您的ak、sk和要访问的地域
HOST = b'http://bcc.baidubce.com'
AK = b'ak'
SK = b'sk'
config = BceClientConfiguration(credentials=BceCredentials(AK, SK),
endpoint=HOST)
client = bcc_client.BccClient(config)
response = client.describe_regions(
region='', # 待查询的地域,为空时代表查询全部地域
)
print response