Queries scenarios.
Operation description
In this example, the scenarios that are created in the China (Hangzhou) region are queried. In the response, a scenario of the Resource Management and a scenario of the Resource Replication type are returned.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ros:ListTemplateScratches | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the scenario. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
TemplateScratchId | string | No | The ID of the scenario. | ts-7f7a704cf71c49a6**** |
TemplateScratchType | string | No | The type of the resource scenario. Valid values:
| ArchitectureReplication |
Status | string | No | The status of the scenario. Valid values:
| ["GENERATE_COMPLETE"] |
Tags | array<object> | No | The tags of the scenario. | |
object | No | |||
Key | string | Yes | The tag key of the scenario. Note
Tags is optional. If you want to specify Tags, you must specify Key.
| usage |
Value | string | No | The tag value of the scenario. | test |
PageSize | integer | No | The number of entries to return on each page. Maximum value: 50. Default value: 10. | 10 |
PageNumber | integer | No | The number of the page to return. Pages start from page 1. Default value: 1 | 1 |
ResourceGroupId | string | No | The ID of the resource group. | rg-acfmxazb4ph6aiy**** |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
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": "The description of the scenario.",
"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
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-10-10 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |