Region
Updated at:2025-10-20
Retrieve the Domain Name List API
You can retrieve the domain name list for BCC (or CDS, reserved instances) across all regions or for a specified region with the following code:
Python
1from baidubce.auth.bce_credentials import BceCredentials
2from baidubce.bce_client_configuration import BceClientConfiguration
3from baidubce.services.bcc import bcc_client, bcc_model
4if __name__ == '__main__':
5# Set your AK, SK, and the region to be accessed
6 HOST = b'http://bcc.baidubce.com'
7 AK = b'ak'
8 SK = b'sk'
9 config = BceClientConfiguration(credentials=BceCredentials(AK, SK),
10 endpoint=HOST)
11 client = bcc_client.BccClient(config)
12 response = client.describe_regions(
13 region='', # Region to be queried; if left blank, query all regions
14 )
15 print(response)
