查詢資源情境列表。
介面說明
本文為您提供一個樣本,查詢杭州地區的資源情境列表。返回結果顯示,杭州地區有 2 個資源情境,分別為資源納管和資源複製。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ros:ListTemplateScratches |
get |
*TemplateScratch
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
資源情境所屬的地區 ID。 您可以調用 DescribeRegions 查看最新的阿里雲地區列表。 |
cn-hangzhou |
| TemplateScratchId |
string |
否 |
資源情境 ID。 |
ts-7f7a704cf71c49a6**** |
| TemplateScratchType |
string |
否 |
資源情境類型,取值:
|
ArchitectureReplication |
| Status |
string |
否 |
資源情境狀態,取值:
|
["GENERATE_COMPLETE"] |
| Tags |
array<object> |
否 |
資源情境的標籤。 |
|
|
object |
否 |
|||
| Key |
string |
是 |
資源情境的標籤鍵。 說明
Tags 為選擇性參數。如果需要指定 Tags,則 Tags.N.Key 必須指定。 |
usage |
| Value |
string |
否 |
資源情境的標籤值。 |
test |
| PageSize |
integer |
否 |
分頁查詢時設定的每頁行數。 最大值:50。 預設值:10。 |
10 |
| PageNumber |
integer |
否 |
資源情境的頁碼。 起始值:1。 預設值:1。 |
1 |
| ResourceGroupId |
string |
否 |
資源群組 ID。 |
rg-acfmxazb4ph6aiy**** |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
D1C09606-C58B-558F-9B4E-5BF263D17D09 |
| TotalCount |
integer |
資源情境總個數。 |
2 |
| PageNumber |
integer |
資源情境的頁碼。 |
1 |
| PageSize |
integer |
分頁查詢時設定的每頁行數。 |
10 |
| TemplateScratches |
array<object> |
資源情境列表。 |
|
|
array<object> |
|||
| TemplateScratchId |
string |
資源情境 ID。 |
ts-48ad85d66cca4620**** |
| TemplateScratchType |
string |
資源情境類型,取值:
|
ResourceImport |
| Status |
string |
資源情境狀態。 |
GENERATE_COMPLETE |
| StatusReason |
string |
資源情境產生失敗的原因。 說明
僅當 Status 為 GENERATE_FAILED 時返回該參數。 |
Resource ALIYUN::ECS::VPC vpc-m5eauuq80anx59v28**** could not be found for template scratch. |
| FailedCode |
string |
資源情境產生失敗的狀態代碼。 說明
僅當 Status 為 GENERATE_FAILED 時返回該參數。 |
InvalidZoneId |
| PreferenceParameters |
array<object> |
資源情境配置參數。 |
|
|
object |
|||
| ParameterKey |
string |
參數名稱。 |
DeletionPolicy |
| ParameterValue |
string |
參數值。 |
Retain |
| Description |
string |
資源情境說明。 |
納管VPC資源。 |
| SourceResources |
array<object> |
源資源。 |
|
|
object |
|||
| ResourceId |
string |
資源 ID。 |
vpc-m5eauuq80anx59v28**** |
| ResourceType |
string |
資源類型。 |
ALIYUN::ECS::VPC |
| SourceTag |
object |
源標籤。 |
|
| ResourceTags |
object |
源標籤。 |
{"a": "b"} |
| ResourceTypeFilter |
array |
資源類型篩選器。 |
|
|
string |
資源類型篩選器。 |
ALIYUN::ECS::VPC |
|
| SourceResourceGroup |
object |
源資源群組。 |
|
| ResourceGroupId |
string |
源資源群組 ID。 |
rg-acfmzawhxxc**** |
| ResourceTypeFilter |
array |
資源類型篩選器。 |
|
|
string |
資源類型篩選器。 |
ALIYUN::ECS::VPC |
|
| LogicalIdStrategy |
string |
邏輯 ID 建置原則,取值:
|
LongTypePrefixAndIndexSuffix |
| Tags |
array<object> |
資源情境的標籤。 |
|
|
object |
|||
| Key |
string |
資源情境的標籤鍵。 |
usage1 |
| Value |
string |
資源情境的標籤值。 |
test1 |
| CreateTime |
string |
資源情境建立時間。 按照 ISO8601 標準表示,需使用 UTC 時間,格式:YYYY-MM-DDThh:mm:ss。 |
2021-12-07T08:06:44 |
| UpdateTime |
string |
資源情境更新時間。 按照 ISO8601 標準表示,需使用 UTC 時間,格式:YYYY-MM-DDThh:mm:ss。 |
2021-12-07T08:06:44 |
| ResourceGroupId |
string |
資源群組 ID。 |
rg-acfm4nxcvht4pmi |
樣本
正常返回樣本
JSON格式
{
"RequestId": "D1C09606-C58B-558F-9B4E-5BF263D17D09",
"TotalCount": 2,
"PageNumber": 1,
"PageSize": 10,
"TemplateScratches": [
{
"TemplateScratchId": "ts-48ad85d66cca4620****",
"TemplateScratchType": "ResourceImport",
"Status": "GENERATE_COMPLETE",
"StatusReason": "Resource ALIYUN::ECS::VPC vpc-m5eauuq80anx59v28**** could not be found for template scratch.",
"FailedCode": "InvalidZoneId",
"PreferenceParameters": [
{
"ParameterKey": "DeletionPolicy",
"ParameterValue": "Retain"
}
],
"Description": "納管VPC資源。",
"SourceResources": [
{
"ResourceId": "vpc-m5eauuq80anx59v28****",
"ResourceType": "ALIYUN::ECS::VPC"
}
],
"SourceTag": {
"ResourceTags": {
"a": "b"
},
"ResourceTypeFilter": [
"ALIYUN::ECS::VPC"
]
},
"SourceResourceGroup": {
"ResourceGroupId": "rg-acfmzawhxxc****",
"ResourceTypeFilter": [
"ALIYUN::ECS::VPC"
]
},
"LogicalIdStrategy": "LongTypePrefixAndIndexSuffix",
"Tags": [
{
"Key": "usage1",
"Value": "test1"
}
],
"CreateTime": "2021-12-07T08:06:44",
"UpdateTime": "2021-12-07T08:06:44",
"ResourceGroupId": "rg-acfm4nxcvht4pmi"
}
]
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。