更新时间:2022-08-16 GMT+08:00
查询区域列表
功能介绍
该接口用于查询区域列表。
URI
GET /v3/regions
请求
- Request Header参数说明
参数
是否必选
类型
说明
Content-Type
是
String
该字段内容填为“application/json;charset=utf8”。
X-Auth-Token
是
String
已认证的token。如果token中没有私有region信息,则查询结果不返回私有region。
- 请求样例
curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X GET https://sample.domain.com/v3/regions
响应
- Response Body参数说明
参数
是否必选
类型
说明
links
是
Dict
区域的资源链接。
regions
是
List
区域列表。
- regions格式说明
参数
是否必选
类型
说明
description
是
String
区域描述。
parent_region_id
是
String
区域的父区域ID。
id
是
String
区域id。
locales
是
Dict
区域名。
type
否
String
区域类型。
links
是
Dict
区域的资源链接。
- 响应样例(响应成功)
{ "regions": [ { "parent_region_id": null, "description": "", "links": { "self": "None/v3/regions/1500365963661574434" }, "type": "private", "id": "1500365963661574434", "locales": { "en-us": "region_name2" } }, { "parent_region_id": null, "description": "", "links": { "self": "https://sample.domain.com/v3/regions/500017826026667755" }, "type": "private", "id": "500017826026667755", "locales": { "en-us": "region_name2" } }, { "parent_region_id": null, "description": "", "links": { "self": "https://sample.domain.com/v3/regions/region_name" }, "type": "public", "id": "test2", "locales": { "en-us": "region_name2" } }, { "parent_region_id": null, "links": { "self": "https://sample.domain.com/v3/regions/test1112244" }, "id": "test1112244", "locales": { "en-us": "testregion1" }, "description": "" } ], "links": { "self": "https://sample.domain.com/v3/regions", "previous": null, "next": null } }
状态码
状态码 |
说明 |
---|---|
200 |
请求成功。 |
400 |
请求错误。 |
401 |
认证失败。 |
403 |
鉴权失败。 |
404 |
找不到资源。 |
405 |
不允许的方法。 |
413 |
请求体过大。 |
500 |
内部服务错误。 |
503 |
服务不可用。 |
父主题: 区域管理