GetTemplateScratch

Updated at:

Retrieves the details of a resource scenario.

Operation description

This topic provides an example that queries the details of the resource scenario ts-7f7a704cf71c49a6**** in the China (Hangzhou) region and displays the source node data.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:GetTemplateScratch

get

*TemplateScratch

acs:ros:{#regionId}:{#accountId}:templatescratch/{#templatescratchId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region to which the resource scenario belongs.

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

cn-hangzhou

TemplateScratchId

string

No

The ID of the resource scenario.

ts-7f7a704cf71c49a6****

ShowDataOption

string

No

The data display option. Valid values:

  • Sources: Displays only source node data and applies when TemplateScratchType is set to ArchitectureDetection.

  • Source: Displays only source node data and applies when TemplateScratchType is not set to ArchitectureDetection.

  • Provisions: Displays only new node data and applies when TemplateScratchType is not set to ArchitectureDetection.

  • All: Displays all data.

For more information about source nodes and new nodes, see Overview.

Note

If you do not specify this parameter, node data is not displayed by default.

Source

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

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

A8E0EF98-6FBD-5656-8298-FC8194F0F7B7

TemplateScratch

object

The resource scenario.

TemplateScratchId

string

The ID of the resource scenario.

ts-7f7a704cf71c49a6****

TemplateScratchType

string

The type of the resource scenario. Valid values:

  • ResourceImport: resource management.

  • ArchitectureReplication: resource replication.

ArchitectureReplication

Status

string

The status of the resource scenario. Valid values:

  • GENERATE_IN_PROGRESS: generating.

  • GENERATE_COMPLETE: generated.

  • GENERATE_FAILED: generation failed.

GENERATE_COMPLETE

StatusReason

string

The reason why the resource scenario failed to be generated.

Note

This parameter is returned only when Status is set to GENERATE_FAILED.

Resource ALIYUN::ECS::VPC vpc-m5eauuq80anx59v28**** could not be found for template scratch.

FailedCode

string

The status code returned when the resource scenario fails to be generated.

Note

This parameter is returned only when Status is set to GENERATE_FAILED.

InvalidZoneId

TemplateScratchData

object

The data of the resource scenario.

See the sample response

PreferenceParameters

array<object>

The configuration parameters of the resource scenario.

object

ParameterKey

string

The name of the parameter.

DeletionPolicy

ParameterValue

string

The value of the parameter.

Retain

Description

string

The description of the resource scenario.

Replicate VPC resources

SourceResources

array<object>

The source resources.

object

The source resources.

ResourceId

string

The ID of the resource.

vpc-m5e7cv7e9mz69sszb****

ResourceType

string

The resource type.

ALIYUN::ECS::VPC

RelatedResourceTypeFilter

array

The filter for associated resource types.

string

The filter for associated resource types.

ALIYUN::ECS::VPC

SourceTag

object

The source tag.

ResourceTags

object

The source tag.

{"a": "b"}

ResourceTypeFilter

array

The filter for resource types.

string

The filter for resource types.

ALIYUN::ECS::VPC

SourceResourceGroup

object

The source resource group.

ResourceGroupId

string

The ID of the source resource group.

rg-acfmzawhxxc****

ResourceTypeFilter

array

The filter for resource types.

string

The filter for resource types.

ALIYUN::ECS::VPC

LogicalIdStrategy

string

The strategy for generating logical IDs. Valid values:

  • LongTypePrefixAndIndexSuffix (default): long type prefix and index suffix.

  • LongTypePrefixAndHashSuffix: long type prefix and hash suffix.

  • ShortTypePrefixAndHashSuffix: short type prefix and hash suffix.

LongTypePrefixAndIndexSuffix

CreateTime

string

The time when the resource scenario was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format without the trailing Z.

2021-12-22T01:49:22

UpdateTime

string

The time when the resource scenario was updated. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format without the trailing Z.

2021-12-22T01:49:23

Stacks

array<object>

The list of stacks associated with the resource scenario.

object

StackId

string

The ID of the stack.

3708bf6a-3a67-44d4-9eb1-c56704b9****

RegionId

string

The ID of the region to which the stack belongs.

cn-hangzhou

UsageType

string

The usage type of the stack. Valid values:

  • ResourceImport: resource management.

  • ArchitectureReplication: resource replication.

ArchitectureReplication

StackProvision

object

The stack provision information.

Creatable

boolean

Specifies whether you can call the CreateStack operation to create a stack for resource replication. Valid values:

  • true: Supported.

  • false: Not supported.

true

Importable

boolean

Specifies whether you can call the CreateChangeSet operation to create a change set for resource management. Valid values:

  • true: Supported.

  • false: Not supported.

false

ResourceGroupId

string

The ID of the resource group.

rg-acfmzmhzoaad5oq

Examples

Success response

JSON format

{
  "RequestId": "A8E0EF98-6FBD-5656-8298-FC8194F0F7B7",
  "TemplateScratch": {
    "TemplateScratchId": "ts-7f7a704cf71c49a6****",
    "TemplateScratchType": "ArchitectureReplication",
    "Status": "GENERATE_COMPLETE",
    "StatusReason": "Resource ALIYUN::ECS::VPC vpc-m5eauuq80anx59v28**** could not be found for template scratch.",
    "FailedCode": "InvalidZoneId",
    "TemplateScratchData": {
      "test": "test",
      "test2": 1
    },
    "PreferenceParameters": [
      {
        "ParameterKey": "DeletionPolicy",
        "ParameterValue": "Retain"
      }
    ],
    "Description": "复制VPC资源。",
    "SourceResources": [
      {
        "ResourceId": "vpc-m5e7cv7e9mz69sszb****",
        "ResourceType": "ALIYUN::ECS::VPC",
        "RelatedResourceTypeFilter": [
          "ALIYUN::ECS::VPC"
        ]
      }
    ],
    "SourceTag": {
      "ResourceTags": {
        "a": "b"
      },
      "ResourceTypeFilter": [
        "ALIYUN::ECS::VPC"
      ]
    },
    "SourceResourceGroup": {
      "ResourceGroupId": "rg-acfmzawhxxc****",
      "ResourceTypeFilter": [
        "ALIYUN::ECS::VPC"
      ]
    },
    "LogicalIdStrategy": "LongTypePrefixAndIndexSuffix",
    "CreateTime": "2021-12-22T01:49:22",
    "UpdateTime": "2021-12-22T01:49:23",
    "Stacks": [
      {
        "StackId": "3708bf6a-3a67-44d4-9eb1-c56704b9****",
        "RegionId": "cn-hangzhou",
        "UsageType": "ArchitectureReplication"
      }
    ],
    "StackProvision": {
      "Creatable": true,
      "Importable": false
    },
    "ResourceGroupId": "rg-acfmzmhzoaad5oq"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.