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