更新时间:2024-03-20 GMT+08:00
分享

查询内网Zone列表

功能介绍

查询内网Zone列表

调用方法

请参见如何调用API

URI

GET /v2/zones

表1 Query参数

参数

是否必选

参数类型

描述

type

String

待查询的zone的类型。

取值范围:private。

缺省值:private

limit

Integer

每页返回的资源个数。

取值范围:0~500

取值一般为10,20,50。默认值为500。

marker

String

分页查询起始的资源ID,为空时为查询第一页。

默认值为空。

offset

Integer

分页查询起始偏移量,表示从偏移量的下一个资源开始查询。

取值范围:0~2147483647

默认值为0。

当前设置marker不为空时,以marker为分页起始标识。

tags

String

资源标签。

name

String

zone名称。

status

String

资源状态。

search_mode

String

查询条件搜索模式。

取值范围:

like:模糊搜索 equal:精确搜索

enterprise_project_id

String

域名关联的企业项目ID,长度不超过36个字符。

默认值为0。

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。

通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

links

pageLink object

指向当前资源或者其他资源的链接。当查询需要分页时,需要包含一个next链接指向下一页。

metadata

metadata object

返回满足过滤条件的资源总数。

zones

Array of PrivateZoneResp objects

zone列表信息。

表4 metadata

参数

参数类型

描述

total_count

Integer

满足查询条件的资源总数,不受分页(即limit、offset参数)影响。

表5 PrivateZoneResp

参数

参数类型

描述

id

String

zone的ID,uuid形式的一个资源标识。

name

String

zone名称。

description

String

对zone的描述信息。

email

String

管理该zone的管理员邮箱。

zone_type

String

zone类型,内网(private)。

ttl

Integer

该zone下SOA记录中的ttl值。

serial

Integer

该zone下SOA记录中用于标识zone文件变更的序列值,用于主从节点同步。

status

String

资源状态。

record_num

Integer

该zone下的recordset个数。

proxy_pattern

String

内网Zone的子域名递归解析代理模式。

取值范围:

AUTHORITY:当前Zone不进行递归解析 RECURSIVE:开启递归解析代理

pool_id

String

托管该zone的pool,由系统分配。

project_id

String

zone所属的项目ID。

created_at

String

创建时间。

updated_at

String

更新时间。

links

pageLink object

指向当前资源或者其他资源的链接。当查询需要分页时,需要包含一个next链接指向下一页。

tags

Array of tag objects

资源标签。

masters

Array of strings

主从模式中,从DNS服务器用以获取DNS信息。

routers

Array of RouterWithStatus objects

与该zone关联的Router(VPC)列表。

enterprise_project_id

String

域名关联的企业项目ID,长度不超过36个字符。

表7 tag

参数

参数类型

描述

key

String

键。最大长度36个unicode字符。 key不能为空。不能包含“=”,“*”,“<”,“>”,“\”,“,”,“|”,“/”,且首尾字符不能为空格。

value

String

值。每个值最大长度43个unicode字符,可以为空字符串。 不能包含“=”,“*”,“<”,“>”,“\”,“,”,“|”,“/”,且首尾字符不能为空格。

表8 RouterWithStatus

参数

参数类型

描述

status

String

资源状态。

router_id

String

Router(VPC)所属VPC的ID。

router_region

String

Router(VPC)所在的region。

状态码: 400

表9 响应Body参数

参数

参数类型

描述

code

String

错误码

最小长度:8

最大长度:36

message

String

错误描述

最小长度:2

最大长度:512

状态码: 404

表10 响应Body参数

参数

参数类型

描述

code

String

错误码

最小长度:8

最大长度:36

message

String

错误描述

最小长度:2

最大长度:512

状态码: 500

表11 响应Body参数

参数

参数类型

描述

code

String

错误码

最小长度:8

最大长度:36

message

String

错误描述

最小长度:2

最大长度:512

请求示例

响应示例

状态码: 200

查询内网Zone列表响应。

{
  "links" : {
    "self" : "https://Endpoint/v2/zones?type=private&limit=10",
    "next" : "https://Endpoint/v2/zones?type=private&limit=10&marker=ff8080825b8fc86c015b94bc6f8712c3"
  },
  "zones" : [ {
    "id" : "ff8080825b8fc86c015b94bc6f8712c3",
    "name" : "example.com.",
    "description" : "This is an example zone.",
    "email" : "xx@example.com",
    "ttl" : 300,
    "serial" : 0,
    "masters" : [ ],
    "tags" : [ ],
    "status" : "ACTIVE",
    "links" : {
      "self" : "https://Endpoint/v2/zones/ff8080825b8fc86c015b94bc6f8712c3"
    },
    "pool_id" : "ff8080825ab738f4015ab7513298010e",
    "project_id" : "e55c6f3dc4e34c9f86353b664ae0e70c",
    "zone_type" : "private",
    "created_at" : "2017-04-22T08:17:08.997",
    "updated_at" : "2017-04-22T08:17:09.997",
    "record_num" : 2,
    "proxy_pattern" : "AUTHORITY",
    "routers" : [ {
      "status" : "ACTIVE",
      "router_id" : "19664294-0bf6-4271-ad3a-94b8c79c6558",
      "router_region" : "xx"
    }, {
      "status" : "ACTIVE",
      "router_id" : "f0791650-db8c-4a20-8a44-a06c6e24b15b",
      "router_region" : "xx"
    } ],
    "enterprise_project_id" : 0
  }, {
    "id" : "ff8080825b95142f015b951f87280029",
    "name" : "example.org.",
    "description" : "This is an example zone.",
    "email" : "xx@example.org",
    "ttl" : 300,
    "serial" : 0,
    "masters" : [ ],
    "tags" : [ ],
    "status" : "ACTIVE",
    "links" : {
      "self" : "https://Endpoint/v2/zones/ff8080825b95142f015b951f87280029"
    },
    "pool_id" : "ff8080825ab738f4015ab7513298010e",
    "project_id" : "e55c6f3dc4e34c9f86353b664ae0e70c",
    "zone_type" : "private",
    "created_at" : "2017-04-22T08:17:08.997",
    "updated_at" : "2017-04-22T08:17:09.997",
    "record_num" : 2,
    "proxy_pattern" : "AUTHORITY",
    "routers" : [ {
      "status" : "ACTIVE",
      "router_id" : "19664294-0bf6-4271-ad3a-94b8c79c6558",
      "router_region" : "xx"
    }, {
      "status" : "ACTIVE",
      "router_id" : "f0791650-db8c-4a20-8a44-a06c6e24b15b",
      "router_region" : "xx"
    } ],
    "enterprise_project_id" : 0
  } ],
  "metadata" : {
    "total_count" : 2
  }
}

状态码

状态码

描述

200

查询内网Zone列表响应。

400

接口错误响应。

404

接口错误响应。

500

接口错误响应。

错误码

请参见错误码

分享:

    相关文档

    相关产品