All Products
Search
Document Center

Resource Orchestration Service:GetTemplateScratch

Last Updated:Sep 12, 2024

Queries the details of a resource scenario.

Operation description

In this example, the details of the resource scenario whose ID is ts-7f7a704cf71c49a6**** is queried. In the response, the source node data is displayed.

Debugging

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

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.
OperationAccess levelResource typeCondition keyAssociated operation
ros:GetTemplateScratchget
  • TemplateScratch
    acs:ros:{#regionId}:{#accountId}:templatescratch/{#templatescratchId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the resource scenario.

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

cn-hangzhou
TemplateScratchIdstringYes

The ID of the resource scenario.

ts-7f7a704cf71c49a6****
ShowDataOptionstringNo

The data display option. Valid values:

  • Sources: displays only the data of source nodes. This setting takes effect only when TemplateScratchType is set to ArchitectureDetection.
  • Source: displays only the data of the source node. This setting takes effect only when TemplateScratchType is not set to ArchitectureDetection.
  • Provisions: displays only the data of new nodes. This setting takes effect only 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, the node data is not displayed.
Source

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

A8E0EF98-6FBD-5656-8298-FC8194F0F7B7
TemplateScratchobject

The resource scenario.

TemplateScratchIdstring

The ID of the resource scenario.

ts-7f7a704cf71c49a6****
TemplateScratchTypestring

The type of the resource scenario. Valid values:

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

The state of the resource scenario. Valid values:

  • GENERATE_IN_PROGRESS: The resource scenario is being created.
  • GENERATE_COMPLETE: The resource scenario is created.
  • GENERATE_FAILED: The resource scenario fails to be created.
GENERATE_COMPLETE
StatusReasonstring

The reason why the resource scenario fails to be created.

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

The status code of the resource scenario that fails to be created.

Note This parameter is returned only if you set Status to GENERATE_FAILED.
InvalidZoneId
TemplateScratchDataobject

The resource scenario data.

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 resource scenario.
SourceResourcesarray<object>

The source resources.

object

The source resource.

ResourceIdstring

The resource ID.

vpc-m5e7cv7e9mz69sszb****
ResourceTypestring

The resource type.

ALIYUN::ECS::VPC
RelatedResourceTypeFilterarray

The related resource type filters.

string

The related resource type filter.

ALIYUN::ECS::VPC
SourceTagobject

The source tag.

ResourceTagsobject

The source tags.

{"a": "b"}
ResourceTypeFilterarray

The resource type filters.

string

The resource type filter.

ALIYUN::ECS::VPC
SourceResourceGroupobject

The source resource group.

ResourceGroupIdstring

The ID of the source resource group.

rg-acfmzawhxxc****
ResourceTypeFilterarray

The resource type filters.

string

The resource type filter.

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
CreateTimestring

The time at which 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-22T01:49:22
UpdateTimestring

The time at which 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-22T01:49:23
Stacksarray<object>

The stacks that are associated with the resource scenario.

object
StackIdstring

The stack ID.

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

The region ID of the stack.

cn-hangzhou
UsageTypestring

The purpose of the stack. Valid values:

  • ResourceImport: resource management
  • ArchitectureReplication: resource replication
ArchitectureReplication
StackProvisionobject

The preset information of the stack.

Creatableboolean

Indicates whether the resource is replicated by calling the CreateStack operation. Valid values:

  • true
  • false
true
Importableboolean

Indicates whether the resource is managed by calling the CreateChangeSet operation. Valid values:

  • true
  • false
false
ResourceGroupIdstring

The ID of the resource group.

rg-acfmzmhzoaad5oq

Examples

Sample success responses

JSONformat

{
  "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": "The description of the resource scenario. ",
    "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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-24The response structure of the API has changedView Change Details
2023-10-10The response structure of the API has changedView Change Details