All Products
Search
Document Center

Resource Orchestration Service:ListTemplateScratches

Last Updated:Jul 17, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the scenario.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
TemplateScratchIdstringNo

The ID of the scenario.

ts-7f7a704cf71c49a6****
TemplateScratchTypestringNo

The type of the resource scenario. Valid values:

  • ArchitectureReplication: resource replication
  • ArchitectureDetection: resource detection
  • ResourceImport: resource management
  • ResourceMigration: resource migration
ArchitectureReplication
StatusstringNo

The status of the scenario. Valid values:

  • GENERATE_IN_PROGRESS: The scenario is being created.
  • GENERATE_COMPLETE: The scenario is created.
  • GENERATE_FAILED: The scenario fails to be created.
["GENERATE_COMPLETE"]
Tagsarray<object>No

The tags of the scenario.

objectNo
KeystringYes

The tag key of the scenario.

Note Tags is optional. If you want to specify Tags, you must specify Key.
usage
ValuestringNo

The tag value of the scenario.

test
PageSizeintegerNo

The number of entries to return on each page.

Maximum value: 50.

Default value: 10.

10
PageNumberintegerNo

The number of the page to return.

Pages start from page 1.

Default value: 1

1
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmxazb4ph6aiy****

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

D1C09606-C58B-558F-9B4E-5BF263D17D09
TotalCountinteger

The total number of scenarios.

2
PageNumberinteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

10
TemplateScratchesarray<object>

The resource scenarios.

object
TemplateScratchIdstring

The ID of the resource scenario.

ts-48ad85d66cca4620****
TemplateScratchTypestring

The type of the resource scenario. Valid values:

  • ResourceImport: resource management
  • ArchitectureReplication: resource replication
ResourceImport
Statusstring

The state of the resource scenario.

GENERATE_COMPLETE
StatusReasonstring

The reason why the resource scenario failed to be generated.

Note This parameter is returned only if the value of Status is GENERATE_FAILED.
Resource ALIYUN::ECS::VPC vpc-m5eauuq80anx59v28**** could not be found for template scratch.
FailedCodestring

The status code of the resource scenario that failed to be generated.

Note This parameter is returned only if the value of Status is GENERATE_FAILED.
InvalidZoneId
PreferenceParametersarray<object>

The preference parameters of the resource scenario.

object
ParameterKeystring

The parameter name.

DeletionPolicy
ParameterValuestring

The parameter value.

Retain
Descriptionstring

The description of the resource scenario.

The description of the scenario.
SourceResourcesarray<object>

The source resources.

object
ResourceIdstring

The resource ID.

vpc-m5eauuq80anx59v28****
ResourceTypestring

The resource type.

ALIYUN::ECS::VPC
SourceTagobject

The source tag.

ResourceTagsobject

The source tags.

{"a": "b"}
ResourceTypeFilterarray

The resource types for filtering resources.

string

The resource type for filtering resources.

ALIYUN::ECS::VPC
SourceResourceGroupobject

The source resource group.

ResourceGroupIdstring

The ID of the source resource group.

rg-acfmzawhxxc****
ResourceTypeFilterarray

The resource types for filtering resources.

string

The resource type for filtering resources.

ALIYUN::ECS::VPC
LogicalIdStrategystring

The policy based on which the logical ID is generated. Valid values:

  • LongTypePrefixAndIndexSuffix (default): long-type prefix + index-type suffix
  • LongTypePrefixAndHashSuffix: long-type prefix + hash-type suffix
  • ShortTypePrefixAndHashSuffix: short-type prefix + hash-type suffix
LongTypePrefixAndIndexSuffix
Tagsarray<object>

The tags of the resource scenario.

object
Keystring

The tag key of the resource scenario.

usage1
Valuestring

The tag value of the resource scenario.

test1
CreateTimestring

The time when the resource scenario was created.

The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.

2021-12-07T08:06:44
UpdateTimestring

The time when the resource scenario was updated.

The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.

2021-12-07T08:06:44
ResourceGroupIdstring

The ID of the resource group.

rg-acfm4nxcvht4pmi

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2023-10-10The request parameters of the API has changed. The response structure of the API has changedView Change Details