Getting Started
Confirm Endpoint
Currently, when you use CDN service, the Endpoint of CDN is https: //cdn.baidubce.com
, which is also a default value.
Get the Key
To use Baidu AI Cloud CDN, you need to have a valid AK (Access Key ID) and SK (Secret Access Key) for signature authentication. AK/SK is assigned to users by the system and is a string to identify users and verify signatures for accessing CDN.
You can obtain and understand your AK/SK information through the following steps:
Register a Baidu AI Cloud Account
Create a CDN Client with AK/SK
Access CDN via AK/SK, and users can create a CDN Client by reference to the following codes:
ak := "your_access_key_id"
sk := "your_secret_key_id"
endpoint := "https://cdn.baidubce.com"
client, err := cdn.NewClient(ak, sk, endpoint)
In the above code, the variable ak
corresponds to the “Access Key ID” in the console, and the variable ‘sk’ corresponds to the “Access Key Secret” in the console. To get them, please see “How to Get AKSK”. The variable endpoint
must be https://cdn.baidubce.com
, which is the default value, empty means to use the default value, and the SDK cannot work if it is set to be other content.