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:
Go
1package main
2import (
3 "fmt"
4 "github.com/baidubce/bce-sdk-go/services/bcc"
5 "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9 ak := "ak"
10 sk := "sk"
11 endpoint := "bcc.baidubce.com"
12 // Create a BCC client
13 bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 args := &api.DescribeRegionsArgs{
15 // Region; if empty, query the domain name list for BCC (CDS, reserved instances) across all regions
16 Region: "",
17 }
18 result, err := bccClient.DescriceRegions(args)
19 fmt.Println(err)
20 fmt.Println(result)
21}
