更新时间:2024-02-27 GMT+08:00
分享

查询区域列表

功能介绍

该接口可以用于查询账号可以访问的区域列表。

该接口可以使用全局区域的Endpoint和其他区域的Endpoint调用。IAM的Endpoint请参见:地区和终端节点

调试

您可以在API Explorer中调试该接口。

URI

GET /v3/regions

请求参数

表1 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

String

该字段内容填为“application/json;charset=utf8”。

X-Auth-Token

String

IAM用户的token(无需特殊权限)。如果token中没有私有region信息,则查询结果不返回私有region。

响应参数

表2 响应Body参数

参数

参数类型

描述

links

Object

资源链接信息。

regions

Array of objects

区域信息列表。

表4 regions

参数

参数类型

描述

description

String

区域描述信息。

parent_region_id

String

null.

links

Object

区域的资源链接信息。

locales

Object

区域名。

id

String

区域ID。

type

String

区域类型。

表6 regions.locales

参数

参数类型

描述

zh-cn

String

区域的中文名称。

en-us

String

区域的英文名称。

pt-br

String

区域的葡萄牙语名称。

es-us

String

区域的美国西班牙语名称。

es-es

String

区域的西班牙语名称。

请求示例

查询区域列表。

GET https://iam.myhuaweicloud.com/v3/regions

响应示例

状态码为 200 时:

请求成功。

{
    "regions": [
        {
            "parent_region_id": null,
            "description": "",
            "links": {
                "self": "https://iam.myhuaweicloud.com/v3/regions/cn-north-1"
            },
            "type": "public",
            "id": "cn-north-1",
            "locales": {
                "zh-cn": "“华北-北京一”",
                "en-us": "cn-north-1"
            }
        },
        {
            "parent_region_id": null,
            "description": "",
            "links": {
                "self": "https://iam.myhuaweicloud.com/v3/regions/la-south-2"
            },
            "type": "public",
            "id": "la-south-2",
            "locales": {
                "pt-br": "AL-Santiago",
                "zh-cn": "拉美-圣地亚哥",
                "en-us": "LA-Santiago",
                "es-us": "AL-Santiago de Chile1",
                "es-es": "LA-Santiago"
            }
        }
    ],
    "links": {
        "self": "https://iam.myhuaweicloud.com/v3/regions",
        "previous": null,
        "next": null
    }
}

返回值

返回值

描述

200

请求成功。

400

参数无效。

401

认证失败。

403

没有操作权限。

404

未找到相应的资源。

405

不允许的方法。

413

请求体过大。

500

内部服务错误。

503

服务不可用。

错误码

分享:

    相关文档

    相关产品