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 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 the key is obtained, it must be filled in as a parameter when BccClient is configured. SDK integrates an authentication mechanism. You do not need to understand the complex operation method behind the authentication, but only fill in the AK/SK in the designated field according to requirements, after which SDK will automatically implement 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 import gpu_card_type
9from baidubce.services.bcc import fpga_card_type
10from baidubce.services.bcc.bcc_model import EphemeralDisk
