功能介紹
查詢當前租戶所有的保護組列表。
接口約束
無
調(diào)試
您可以在API Explorer中調(diào)試該接口。
URI
GET /v1/{project_id}/server-groups
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
項目ID。 |
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
---|---|---|---|
availability_zone |
否 |
String |
保護組的當前生產(chǎn)站點可用區(qū)。 |
limit |
否 |
Integer |
每次請求返回結(jié)果個數(shù)限制,取值范圍為[0,1000]的正整數(shù),默認值為1000。 最小值:0 最大值:1000 缺省值:1000 |
name |
否 |
String |
保護組的名稱。支持模糊查詢。 |
offset |
否 |
Integer |
每次請求開始的下標,即偏移量,默認值為0。offset必須為數(shù)字,不能為負數(shù)。 最小值:0 缺省值:0 |
query_type |
否 |
String |
查詢場景類型。 status_abnormal:表示查詢異常狀態(tài)的保護組列表。 stop_protected:表示查詢停止保護的保護組列表。 period_no_dr_drill:表示查詢一段時間未做容災演練的保護組,默認為三個月。 general或空時:該參數(shù)不生效。 枚舉值:
|
status |
否 |
String |
保護組狀態(tài)。 |
請求參數(shù)
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用戶Token。通過調(diào)用 IAM 服務(wù)獲取用戶Token接口獲取(響應(yīng)消息頭中X-Subject-Token的值) |
響應(yīng)參數(shù)
狀態(tài)碼: 200
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
server_groups |
保護組的信息列表。 |
|
count |
Integer |
此參數(shù)為滿足過濾條件的列表中包含的保護組個數(shù)。 |
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
id |
String |
保護組的ID。 |
name |
String |
保護組的名稱。 |
description |
String |
保護組的描述。 |
status |
String |
保護組的狀態(tài)。 |
progress |
Integer |
保護組的同步進度。單位:百分比(%)。 最小值:0 最大值:100 |
source_availability_zone |
String |
保護組創(chuàng)建時的生產(chǎn)站點可用區(qū)名稱。注意:保護組切換、故障切換后,該值不變。 |
target_availability_zone |
String |
保護組創(chuàng)建時的容災站點可用區(qū)名稱。注意:保護組切換、故障切換后,該值不變。 |
domain_id |
String |
雙活域ID。 |
domain_name |
String |
雙活域名稱。 |
priority_station |
String |
用于標識保護組的當前生產(chǎn)站點。 source:表示當前生產(chǎn)站點可用區(qū)為source_availability_zone的值。 target:表示當前生產(chǎn)站點可用區(qū)為target_availability_zone的值。 |
protected_instance_num |
Integer |
該保護組中保護實例的個數(shù)。 |
replication_num |
Integer |
該保護組中復制對的個數(shù)。 |
disaster_recovery_drill_num |
Integer |
該保護組中容災演練的個數(shù)。 |
protected_status |
String |
保護狀態(tài)。started:表示該保護組開始保護。stopped:表示該保護組停止保護。 說明:系統(tǒng)近期進行了升級,對于升級后創(chuàng)建的保護組,該字段值為null,無實際意義。 枚舉值:
|
replication_status |
String |
數(shù)據(jù)同步狀態(tài)。 active:表示數(shù)據(jù)已同步完成。 inactive:表示數(shù)據(jù)未同步。 copying:表示數(shù)據(jù)正在同步。 active-stopped:表示數(shù)據(jù)已停止同步。 說明:系統(tǒng)近期進行了升級,對于升級后創(chuàng)建的保護組,該字段值為null,無實際意義。 枚舉值:
|
health_status |
String |
健康狀態(tài)。 normal:表示該保護組處于正常狀態(tài)。 abnormal:表示該保護組處于非正常狀態(tài)。 說明:系統(tǒng)近期進行了升級,對于升級后創(chuàng)建的保護組,該字段值為null,無實際意義。 枚舉值:
|
source_vpc_id |
String |
生產(chǎn)站點 虛擬私有云 ID。 |
target_vpc_id |
String |
容災站點虛擬 私有云 ID。 |
test_vpc_id |
String |
容災演練虛擬私有云ID。(該參數(shù)暫未使用) |
dr_type |
String |
部署模式。默認值為“migration”,migration表示VPC內(nèi) 遷移 。 |
created_at |
String |
創(chuàng)建時間。默認格式為:"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:表示以復制對為單位進行數(shù)據(jù)同步。 null:表示將保護組中的所有復制對作為一個整體進行數(shù)據(jù)同步。 說明:當保護組中的所有復制對作為一個整體進行數(shù)據(jù)同步時,如果數(shù)據(jù)同步失敗,保護組中的所有復制對都會受到影響。因此,SDRS服務(wù)對系統(tǒng)做了優(yōu)化升級: 對于升級后創(chuàng)建的資源,默認以復制對為單位進行數(shù)據(jù)同步,返回值為replication-pair; 對于已有資源,仍以一個整體進行數(shù)據(jù)同步,返回值為null。 枚舉值:
|
replication_model |
String |
復制類型。 說明:預留參數(shù),暫未啟用。 |
server_type |
String |
管理的服務(wù)器類型 ECS:表示管理的服務(wù)器類型為 云服務(wù)器 。 |
狀態(tài)碼: 400
狀態(tài)碼: 401
狀態(tài)碼: 403
狀態(tài)碼: 404
狀態(tài)碼: 405
狀態(tài)碼: 406
狀態(tài)碼: 407
狀態(tài)碼: 408
狀態(tài)碼: 409
狀態(tài)碼: 500
狀態(tài)碼: 501
狀態(tài)碼: 502
狀態(tài)碼: 503
狀態(tài)碼: 504
請求示例
GET https://{Endpoint}/v1/{project_id}/server-groups
響應(yīng)示例
狀態(tài)碼: 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 } ] }
狀態(tài)碼
狀態(tài)碼 |
描述 |
---|---|
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 |
錯誤碼
請參見錯誤碼。