Skip to Content
GPU 接口文档GPU实例获取支持的可用区信息列表
GPU API 接口

获取支持的可用区列表

接口说明

获取优云智算平台当前支持的所有可用区信息,包括地域和可用区的 ID 及名称。

POSThttps://api.compshare.cnActionDescribeCompShareSupportZone

当前支持的可用区

当前支持以下 5 个可用区。其他接口的 Region 和 Zone 参数均从这份列表中选择。

地域地域 ID可用区可用区 ID名称资源类型
cn-wlcb1000039cn-wlcb-0110027华北二A云主机
cn-sh21000009cn-sh2-028200上海二B云主机
cn-bj21000001cn-bj2-035001华北一C容器
cn-sh21000009cn-sh2-018100上海二A容器
cn-sh21000009cn-sh2-038300上海二C容器

请求参数

名称类型必填描述示例值
ActionString是接口名称DescribeCompShareSupportZone
RegionString否地域筛选条件。不传时返回全部支持的可用区cn-wlcb

响应参数

名称类型描述示例值
ActionString响应名称DescribeCompShareSupportZoneResponse
RetCodeInteger返回码,0 为成功0
request_uuidString请求唯一标识e897f547-bd2d-44dd-9de0-415017aa65ad
ZoneInfoArray of Object可用区信息列表—

ZoneInfo 元素结构

名称类型描述
RegionString地域名称
RegionIdInteger地域 ID
ZoneString可用区名称
ZoneIdInteger可用区 ID
DescribeString可用区显示名称
IsPodBoolean是否为容器可用区(华北二A / 上海二B 以外的其他可用区)

请求示例

Python(使用 UCloud SDK)

from ucloud.core import exc from ucloud.client import Client def main(): client = Client({ "region": "cn-wlcb", "public_key": "my_public_key", # 替换为你的公钥(控制台 账户中心 → API 密钥:https://console.compshare.cn/uaccount/api_manage) "private_key": "my_private_key", # 替换为你的私钥 "base_url": "https://api.compshare.cn", }) try: resp = client.ucompshare().describe_comp_share_support_zone({}) for zone in resp.get("ZoneInfo", []): print(f" {zone['Zone']} - {zone['Describe']}") except exc.UCloudException as e: print(e) if __name__ == "__main__": main()

Go(使用 UCloud SDK)

package main import ( "fmt" "github.com/ucloud/ucloud-sdk-go/services/ucompshare" "github.com/ucloud/ucloud-sdk-go/ucloud" "github.com/ucloud/ucloud-sdk-go/ucloud/auth" ) func main() { cfg := ucloud.NewConfig() cfg.Region = "cn-wlcb" cfg.BaseUrl = "https://api.compshare.cn" credential := auth.NewCredential() credential.PublicKey = "my_public_key" // 替换为你的公钥(控制台 账户中心 → API 密钥:https://console.compshare.cn/uaccount/api_manage) credential.PrivateKey = "my_private_key" // 替换为你的私钥 client := ucompshare.NewClient(&cfg, &credential) req := client.NewDescribeCompShareSupportZoneRequest() resp, err := client.DescribeCompShareSupportZone(req) if err != nil { fmt.Printf("查询失败: %s\n", err) return } for _, zone := range resp.ZoneInfo { fmt.Printf(" %s - %s\n", zone.Zone, zone.Describe) } }

响应示例

{ "Action": "DescribeCompShareSupportZoneResponse", "RetCode": 0, "request_uuid": "e897f547-bd2d-44dd-9de0-415017aa65ad", "ZoneInfo": [ { "Region": "cn-wlcb", "RegionId": 1000039, "Zone": "cn-wlcb-01", "ZoneId": 10027, "Describe": "华北二A", "IsPod": false }, { "Region": "cn-sh2", "RegionId": 1000009, "Zone": "cn-sh2-02", "ZoneId": 8200, "Describe": "上海二B", "IsPod": false }, { "Region": "cn-bj2", "RegionId": 1000001, "Zone": "cn-bj2-03", "ZoneId": 5001, "Describe": "华北一C", "IsPod": true }, { "Region": "cn-sh2", "RegionId": 1000009, "Zone": "cn-sh2-01", "ZoneId": 8100, "Describe": "上海二A", "IsPod": true }, { "Region": "cn-sh2", "RegionId": 1000009, "Zone": "cn-sh2-03", "ZoneId": 8300, "Describe": "上海二C", "IsPod": true } ] }
Last updated on