功能介紹
查詢當(dāng)前租戶下的所有保護(hù)實(shí)例列表。
接口約束
無(wú)
調(diào)試
您可以在API Explorer中調(diào)試該接口。
URI
GET /v1/{project_id}/protected-instances
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
項(xiàng)目ID。 |
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
---|---|---|---|
availability_zone |
否 |
String |
保護(hù)實(shí)例所在的保護(hù)組的當(dāng)前生產(chǎn)站點(diǎn)可用區(qū)。 |
limit |
否 |
Integer |
每次請(qǐng)求返回結(jié)果個(gè)數(shù)限制,取值范圍為[0,1000]的正整數(shù),默認(rèn)值為1000。 最小值:0 最大值:1000 缺省值:1000 |
name |
否 |
String |
保護(hù)實(shí)例的名稱。支持模糊查詢。 |
offset |
否 |
Integer |
每次請(qǐng)求開(kāi)始的下標(biāo),即偏移量,默認(rèn)值為0。offset必須為數(shù)字,不能為負(fù)數(shù)。 最小值:0 缺省值:0 |
protected_instance_ids |
否 |
String |
保護(hù)實(shí)例的ID列表,格式為protected_instance_ids=['protected_instance_id1','protected_instance_id2',...,'protected_instance_idx'],請(qǐng)使用URL編碼進(jìn)行轉(zhuǎn)換。返回“protected_instance_ids”中有效protected_instance_id的所有保護(hù)實(shí)例列表,無(wú)效的protected_instance_id會(huì)被忽略。支持查詢最多30個(gè)protected_instance_id對(duì)應(yīng)的所有保護(hù)實(shí)例列表。如果“server_group_id”或者“server_group_ids”查詢參數(shù)存在時(shí),“protected_instance_ids”會(huì)被忽略。 |
query_type |
否 |
String |
查詢場(chǎng)景類型。status_abnormal:表示查詢異常狀態(tài)的保護(hù)實(shí)例列表。general或空時(shí):該參數(shù)不生效。 枚舉值:
|
server_group_id |
否 |
String |
保護(hù)組的ID,表示查詢?cè)摫Wo(hù)組下的所有保護(hù)實(shí)例列表。 |
server_group_ids |
否 |
String |
保護(hù)組的ID列表,格式為server_group_ids=['server_group_id1','server_group_id2',...,'server_group_idx'],請(qǐng)使用URL編碼進(jìn)行轉(zhuǎn)換。返回“server_group_ids”中有效server_group_id的所有保護(hù)實(shí)例列表,無(wú)效的server_group_id會(huì)被忽略。支持查詢最多30個(gè)server_group_id對(duì)應(yīng)的所有保護(hù)實(shí)例列表。如果“server_group_id”和“server_group_ids”查詢參數(shù)同時(shí)存在,“server_group_id”會(huì)被忽略。 |
status |
否 |
String |
保護(hù)實(shí)例狀態(tài)。 |
請(qǐng)求參數(shù)
參數(shù) |
是否必選 |
參數(shù)類型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用戶Token。通過(guò)調(diào)用 IAM 服務(wù)獲取用戶Token接口獲?。憫?yīng)消息頭中X-Subject-Token的值) |
響應(yīng)參數(shù)
狀態(tài)碼: 200
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
protected_instances |
保護(hù)實(shí)例的信息列表。 |
|
count |
Integer |
列表中包含的保護(hù)實(shí)例個(gè)數(shù)。 |
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
id |
String |
保護(hù)實(shí)例的ID。 |
name |
String |
保護(hù)實(shí)例的名稱。 |
description |
String |
保護(hù)實(shí)例的描述。 |
status |
String |
保護(hù)實(shí)例的狀態(tài)。 |
source_server |
String |
生產(chǎn)站點(diǎn) 云服務(wù)器 ID。 |
target_server |
String |
容災(zāi)站點(diǎn)云服務(wù)器ID。 |
server_group_id |
String |
保護(hù)組的ID。 |
created_at |
String |
創(chuàng)建時(shí)間。默認(rèn)格式為:"yyyy-MM-dd HH:mm:ss.SSS",例:"2019-04-01 12:00:00.000"。 |
updated_at |
String |
更新時(shí)間。默認(rèn)格式為:"yyyy-MM-dd HH:mm:ss.SSS",例:"2019-04-01 12:00:00.000"。 |
metadata |
保護(hù)實(shí)例元數(shù)據(jù)信息。 |
|
attachment |
掛載的復(fù)制對(duì)列表。 |
|
tags |
標(biāo)簽列表。 |
|
progress |
Integer |
保護(hù)實(shí)例的同步進(jìn)度。單位:百分比(%)。 |
priority_station |
String |
標(biāo)識(shí)保護(hù)實(shí)例所在保護(hù)組的當(dāng)前生產(chǎn)站點(diǎn)可用區(qū)。source:表示當(dāng)前生產(chǎn)站點(diǎn)可用區(qū)為保護(hù)組source_availability_zone的值。target:表示當(dāng)前生產(chǎn)站點(diǎn)可用區(qū)為保護(hù)組的target_availability_zone的值。 |
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
__system__frozen |
String |
保護(hù)實(shí)例元數(shù)據(jù)中資源凍結(jié)的字段。 true:表示資源被凍結(jié)。 空:表示資源沒(méi)有被凍結(jié)。 |
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
replication |
String |
復(fù)制對(duì)ID。 |
device |
String |
掛載點(diǎn)。 |
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
key |
String |
鍵。同一資源的key值不能重復(fù)。最大長(zhǎng)度為36個(gè)UNICODE字符。key不能為空,不允許為空字符串。不能包含以下字符:非打印字符ASCII(0-31)特殊字符“*”,“<”,“>”,“\”,“=”,“,”,“|”,“/”鍵。不能為空。對(duì)于同一資源鍵值唯一。 |
value |
String |
值。最大長(zhǎng)度為43個(gè)UNICODE字符。value不能為空,可以為空字符串。不能包含以下字符:非打印字符ASCII(0-31)特殊字符“*”,“<”,“>”,“\”,“=”,“,”,“|”,“/”。長(zhǎng)度不超過(guò)43個(gè)字符。 |
狀態(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
請(qǐng)求示例
說(shuō)明:使用server_group_ids或protected_instance_ids時(shí),請(qǐng)采用URL編碼。
GET https://{Endpoint}/v1/{project_id}/protected-instances?server_group_ids=
%5b%2221d65fa4-430e-4761-b9ad-4e27364f874c%22%2c%22943c7d15-0371-4b89-b1a6-db1ef35c9263%22%5d
響應(yīng)示例
狀態(tài)碼: 200
OK
{
"protected_instances" : [ {
"id" : "67a2cc7e-fb87-41a8-ba28-9c032abcaee1",
"name" : "protected_instance_xff",
"description" : "protected_instance_xff",
"server_group_id" : "21d65fa4-430e-4761-b9ad-4e27364f874c",
"status" : "available",
"progress" : 0,
"source_server" : "d1e8e8a7-ae6f-4f40-bead-20093976961e",
"target_server" : "9bad52b9-ca5a-4274-ba9e-3c8ca9843fa1",
"created_at" : "2018-11-06 11:09:25.861",
"updated_at" : "2018-11-06 11:12:11.716",
"priority_station" : "source",
"attachment" : [ {
"replication" : "08d6b5a0-9a12-4263-a468-30d71d10498c",
"device" : "/dev/vdb"
}, {
"replication" : "4c332757-dc77-458d-9883-03d701cde2f2",
"device" : "/dev/vda"
} ],
"tags" : [ {
"key" : "aaaaaaa",
"value" : "01234567889"
}, {
"key" : "ffffff",
"value" : "dddd"
} ],
"metadata" : { }
}, {
"id" : "50f5091e-9e9e-473c-a932-2a2cbcbeb1ff",
"name" : "ecs_sdrs_test",
"description" : "1111",
"server_group_id" : "943c7d15-0371-4b89-b1a6-db1ef35c9263",
"status" : "protected",
"progress" : 100,
"source_server" : "5fb92d6c-b0cb-46c9-824b-b90ec5500ae6",
"target_server" : "c6c0ff54-fa1f-43ef-9ccc-1774e40c8745",
"created_at" : "2018-11-06 09:27:52.258",
"updated_at" : "2018-11-06 09:44:59.853",
"priority_station" : "target",
"attachment" : [ {
"replication" : "6568f7c4-0510-4f39-929d-8ffccbd4fd47",
"device" : "/dev/vda"
} ],
"tags" : [ {
"key" : "aaaaaaa",
"value" : "01234567889"
}, {
"key" : "ffffff",
"value" : "dddd"
} ],
"metadata" : { }
} ],
"count" : 2
}
狀態(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ò)誤碼
請(qǐng)參見(jiàn)錯(cuò)誤碼。