Initialization
Confirm Endpoint
The user can specify custom domain name by passing Endpoint parameter. For the concept of region, please refer to [Region Selection Guide](Reference/Region Selection Instructions/Region.md).
Before using the SDK, you must determine the target region for operation, thus configuring the BccClient by filling in the Endpoint parameter corresponding to the region. If unspecified, it defaults to the Beijing region, and Endpoint ishttp://bcc.bj.baidubce.com
For the domain names currently supported by BCC, please refer to [Service Domain](BCC/API Reference/Service domain.md).
Retrieve access key
To use BCC, you need an active AK (Access Key ID) and SK (Secret Access Key) for signature validation. AK/SK are unique identifiers assigned by the system to recognize users and execute the signature authentication for BCC.
Your AK/SK information can be obtained and understood through the following steps:
Register a Baidu AI Cloud account
After obtaining the keys, they must be provided as parameters when configuring the BccClient. The SDK comes with an integrated authentication mechanism, so you don't need to worry about the intricate underlying operations. Simply enter the AK/SK in the designated fields as per the requirements, and the SDK will automatically complete the authentication process for you.
Configuration file
1#Import BCC configuration management module and security authentication module from Python SDK
2import baidubce
3from baidubce.auth.bce_credentials import BceCredentials
4from baidubce.bce_client_configuration import BceClientConfiguration
5 #Import related BCC modules
6from baidubce.services.bcc import bcc_client
7from baidubce.services.bcc import bcc_model
8from baidubce.services.bcc.bcc_model import EphemeralDisk
