Queries a list of resource scenarios.
Operation description
This topic provides an example of how to query the list of resource scenarios in the China (Hangzhou) region. The response shows that there are two resource scenarios in the China (Hangzhou) region: resource management and resource replication.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:ListTemplateScratches |
get |
*TemplateScratch
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the resource scenario. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| TemplateScratchId |
string |
No |
The ID of the resource scenario. |
ts-7f7a704cf71c49a6**** |
| TemplateScratchType |
string |
No |
The type of the resource scenario. Valid values:
|
ArchitectureReplication |
| Status |
string |
No |
The status of the resource scenario. Valid values:
|
["GENERATE_COMPLETE"] |
| Tags |
array<object> |
No |
The tags of the resource scenario. |
|
|
object |
No |
|||
| Key |
string |
Yes |
The tag key of the resource scenario. Note
Tags is optional. If you specify Tags, you must specify Tags.N.Key. |
usage |
| Value |
string |
No |
The tag value of the resource scenario. |
test |
| PageSize |
integer |
No |
The number of entries per page in a paged query. Settings for paging. Maximum value: 50. Default value: 10. |
10 |
| PageNumber |
integer |
No |
The page number of the resource scenario list. Start value: 1. Default value: 1. |
1 |
| ResourceGroupId |
string |
No |
The resource group ID. |
rg-acfmxazb4ph6aiy**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
D1C09606-C58B-558F-9B4E-5BF263D17D09 |
| TotalCount |
integer |
The total number of resource scenarios. |
2 |
| PageNumber |
integer |
The page number of the resource scenario list. |
1 |
| PageSize |
integer |
The number of entries per page in a paged query. Settings for paging. |
10 |
| TemplateScratches |
array<object> |
The resource scenarios. |
|
|
array<object> |
|||
| TemplateScratchId |
string |
The ID of the resource scenario. |
ts-48ad85d66cca4620**** |
| TemplateScratchType |
string |
The type of the resource scenario. Valid values:
|
ResourceImport |
| Status |
string |
The status of the resource scenario. |
GENERATE_COMPLETE |
| StatusReason |
string |
The reason why the resource scenario failed to be generated. Note
This parameter is returned only if Status is GENERATE_FAILED. |
Resource ALIYUN::ECS::VPC vpc-m5eauuq80anx59v28**** could not be found for template scratch. |
| FailedCode |
string |
The status code that indicates why the resource scenario failed to be generated. Valid values:
Note
This parameter is returned only if Status is GENERATE_FAILED. This information is generated based on call logs and may be incomplete. Verify the information. |
InvalidZoneId |
| PreferenceParameters |
array<object> |
The configuration parameters of the resource scenario. |
|
|
object |
|||
| ParameterKey |
string |
The parameter name. |
DeletionPolicy |
| ParameterValue |
string |
The parameter value. |
Retain |
| Description |
string |
The description of the resource scenario. |
The description of the scenario. |
| SourceResources |
array<object> |
The source resources. |
|
|
object |
|||
| ResourceId |
string |
The resource ID. |
vpc-m5eauuq80anx59v28**** |
| ResourceType |
string |
The resource type. |
ALIYUN::ECS::VPC |
| SourceTag |
object |
The source tag. |
|
| ResourceTags |
object |
The source tags. |
{"a": "b"} |
| ResourceTypeFilter |
array |
The resource types for filtering resources. |
|
|
string |
The resource type for filtering resources. |
ALIYUN::ECS::VPC |
|
| SourceResourceGroup |
object |
The source resource group. |
|
| ResourceGroupId |
string |
The ID of the source resource group. |
rg-acfmzawhxxc**** |
| ResourceTypeFilter |
array |
The resource types for filtering resources. |
|
|
string |
The resource type for filtering resources. |
ALIYUN::ECS::VPC |
|
| LogicalIdStrategy |
string |
The logical ID generation strategy. Valid values:
|
LongTypePrefixAndIndexSuffix |
| Tags |
array<object> |
The tags of the resource scenario. |
|
|
object |
|||
| Key |
string |
The tag key of the resource scenario. |
usage1 |
| Value |
string |
The tag value of the resource scenario. |
test1 |
| CreateTime |
string |
The time when the resource scenario was created. The time is displayed in UTC+0 and follows the ISO 8601 standard without the Z suffix. Format: YYYY-MM-DDThh:mm:ss. |
2021-12-07T08:06:44 |
| UpdateTime |
string |
The time when the resource scenario was last updated. The time is displayed in UTC+0 and follows the ISO 8601 standard without the Z suffix. Format: YYYY-MM-DDThh:mm:ss. |
2021-12-07T08:06:44 |
| ResourceGroupId |
string |
The resource group ID. |
rg-acfm4nxcvht4pmi |
Examples
Success response
JSON format
{
"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"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.