Availability zone
Updated at:2025-10-20
Query list of availability zones
You can query the list of all availability zones with the following code:
Go
1result, err := client.ListZone()
2if err != nil {
3 fmt.Println("list zone failed: ", err)
4} else {
5 fmt.Println("list zone success: ", result)
6}
Query the availability zone of the model
You can query the list of availability zones supported by a specified model:
Go
1args := &api.ListTypeZonesArgs{
2 // Select the instance type, such as N1, N2 and N3
3 InstanceType: "",
4 // Product type, such as Prepaid and Postpaid
5 ProductType: "",
6 // Instance package specification, such as bcc.g3.c2m12
7 Spec: "",
8 // Instance family, such as g3 and ic4
9 SpecId: "",
10}
11if res, err := BCC_CLIENT.ListTypeZones(args); err != nil {
12 fmt.Println("Get the specific zone flavor failed: ", err)
13} else {
14 fmt.Println("Get the specific zone flavor success, result: ", res)
15}
