更新时间:2021-11-30 GMT+08:00
分享

查询保护组列表

功能介绍

查询当前租户所有的保护组列表。

接口约束

调试

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

URI

GET /v1/{project_id}/server-groups

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID。

表2 Query参数

参数

是否必选

参数类型

描述

availability_zone

String

保护组的当前生产站点可用区。

limit

Integer

每次请求返回结果个数限制,取值范围为[0,1000]的正整数,默认值为1000。

最小值:0

最大值:1000

缺省值:1000

name

String

保护组的名称。支持模糊查询。

offset

Integer

每次请求开始的下标,即偏移量,默认值为0。offset必须为数字,不能为负数。

最小值:0

缺省值:0

query_type

String

查询场景类型。 status_abnormal:表示查询异常状态的保护组列表。 stop_protected:表示查询停止保护的保护组列表。 period_no_dr_drill:表示查询一段时间未做容灾演练的保护组,默认为三个月。 general或空时:该参数不生效。

枚举值:

  • status_abnormal

  • stop_protected

  • period_no_dr_drill

  • general

status

String

保护组状态。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

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

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

server_groups

Array of ShowProtectionGroupParams objects

保护组的信息列表。

count

Integer

此参数为满足过滤条件的列表中包含的保护组个数。

表5 ShowProtectionGroupParams

参数

参数类型

描述

id

String

保护组的ID。

name

String

保护组的名称。

description

String

保护组的描述。

status

String

保护组的状态。

progress

Integer

保护组的同步进度。单位:百分比(%)。

最小值:0

最大值:100

source_availability_zone

String

保护组创建时的生产站点可用区名称。注意:保护组切换、故障切换后,该值不变。

target_availability_zone

String

保护组创建时的容灾站点可用区名称。注意:保护组切换、故障切换后,该值不变。

domain_id

String

双活域ID。

domain_name

String

双活域名称。

priority_station

String

用于标识保护组的当前生产站点。 source:表示当前生产站点可用区为source_availability_zone的值。 target:表示当前生产站点可用区为target_availability_zone的值。

protected_instance_num

Integer

该保护组中保护实例的个数。

replication_num

Integer

该保护组中复制对的个数。

disaster_recovery_drill_num

Integer

该保护组中容灾演练的个数。

protected_status

String

保护状态。started:表示该保护组开始保护。stopped:表示该保护组停止保护。 说明:系统近期进行了升级,对于升级后创建的保护组,该字段值为null,无实际意义。

枚举值:

  • started

  • stopped

replication_status

String

数据同步状态。 active:表示数据已同步完成。 inactive:表示数据未同步。 copying:表示数据正在同步。 active-stopped:表示数据已停止同步。 说明:系统近期进行了升级,对于升级后创建的保护组,该字段值为null,无实际意义。

枚举值:

  • active

  • inactive

  • copying

  • active-stopped

health_status

String

健康状态。 normal:表示该保护组处于正常状态。 abnormal:表示该保护组处于非正常状态。 说明:系统近期进行了升级,对于升级后创建的保护组,该字段值为null,无实际意义。

枚举值:

  • normal

  • abnormal

  • null

source_vpc_id

String

生产站点虚拟私有云ID。

target_vpc_id

String

容灾站点虚拟私有云ID。

test_vpc_id

String

容灾演练虚拟私有云ID。(该参数暂未使用)

dr_type

String

部署模式。默认值为“migration”,migration表示VPC内迁移。

created_at

String

创建时间。默认格式为:"yyyy-MM-dd'T'HH:mm:ss.SSSZ",例:"2019-04-01T12:00:00.000Z"。

updated_at

String

更新时间。默认格式为:"yyyy-MM-dd'T'HH:mm:ss.SSSZ",例:"2019-04-01T12:00:00.000Z"。

protection_type

String

保护模式。 replication-pair:表示以复制对为单位进行数据同步。 null:表示将保护组中的所有复制对作为一个整体进行数据同步。 说明:当保护组中的所有复制对作为一个整体进行数据同步时,如果数据同步失败,保护组中的所有复制对都会受到影响。因此,SDRS服务对系统做了优化升级: 对于升级后创建的资源,默认以复制对为单位进行数据同步,返回值为replication-pair; 对于已有资源,仍以一个整体进行数据同步,返回值为null。

枚举值:

  • replication-pair

  • null

replication_model

String

复制类型。 说明:预留参数,暂未启用。

server_type

String

管理的服务器类型 ECS:表示管理的服务器类型为云服务器。

状态码: 400

表6 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表7 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 401

表8 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表9 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 403

表10 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表11 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 404

表12 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表13 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 405

表14 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表15 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 406

表16 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表17 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 407

表18 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表19 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 408

表20 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表21 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 409

表22 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表23 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 500

表24 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表25 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 501

表26 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表27 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 502

表28 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表29 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 503

表30 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表31 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

状态码: 504

表32 响应Body参数

参数

参数类型

描述

error

ErrorInfo object

失败返回结构

表33 ErrorInfo

参数

参数类型

描述

message

String

错误信息

code

String

错误码

请求示例

GET https://{Endpoint}/v1/{project_id}/server-groups

响应示例

状态码: 200

OK

{
  "count" : 2,
  "server_groups" : [ {
    "id" : "40df180b-9fe2-471a-8c64-1b758dc84189",
    "name" : "testname",
    "description" : "description",
    "source_availability_zone" : "cn-north-1a",
    "target_availability_zone" : "cn-north-1b",
    "domain_id" : "fb4bb8e3-a574-4437-a156-78c916aeea4d",
    "domain_name" : "ActiveactiveDomain",
    "status" : "available",
    "protected_status" : null,
    "replication_status" : null,
    "health_status" : null,
    "progress" : 0,
    "priority_station" : "source",
    "protected_instance_num" : 0,
    "replication_num" : 0,
    "disaster_recovery_drill_num" : 0,
    "source_vpc_id" : "046852ef-c49d-409b-8389-546aaaa5701f",
    "target_vpc_id" : "046852ef-c49d-409b-8389-546aaaa5701f",
    "test_vpc_id" : null,
    "dr_type" : "migration",
    "created_at" : "2019-05-23 03:51:58.256",
    "updated_at" : "2019-05-23 07:48:12.484",
    "protection_type" : "replication-pair",
    "replication_model" : null
  }, {
    "id" : "decf224d-87fe-403a-8721-037a1a45c287",
    "name" : "Protection-Group-lwx",
    "description" : null,
    "source_availability_zone" : "cn-north-1a",
    "target_availability_zone" : "cn-north-1b",
    "domain_id" : "fb4bb8e3-a574-4437-a156-78c916aeea4d",
    "domain_name" : "ActiveactiveDomain",
    "status" : "available",
    "protected_status" : null,
    "replication_status" : null,
    "health_status" : null,
    "progress" : 0,
    "priority_station" : "source",
    "protected_instance_num" : 0,
    "replication_num" : 0,
    "disaster_recovery_drill_num" : 0,
    "source_vpc_id" : "046852ef-c49d-409b-8389-546aaaa5701f",
    "target_vpc_id" : "046852ef-c49d-409b-8389-546aaaa5701f",
    "test_vpc_id" : null,
    "dr_type" : "migration",
    "created_at" : "2019-05-22 08:16:54.413",
    "updated_at" : "2019-05-23 07:48:12.493",
    "protection_type" : "replication-pair",
    "replication_model" : null
  } ]
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

405

Method Not Allowed

406

Not Acceptable

407

Proxy Authentication Required

408

Request Timeout

409

Conflict

500

Internal Server Error

501

Not Implemented

502

Bad Gateway

503

Service Unavailable

504

Gateway Timeout

错误码

请参见错误码

分享:

    相关文档

    相关产品