All Products
Search
Document Center

Resource Orchestration Service:UpdateTemplateScratch

Last Updated:Apr 10, 2024

Updates a scenario.

Operation description

In this example, a scenario whose ID is ts-7f7a704cf71c49a6**** is used. The scenario is created in the China (Hangzhou) region. In the scenario, the ID of a virtual private cloud (VPC) is updated to vpc-bp1m6fww66xbntjyc****.

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:UpdateTemplateScratchWrite
  • TemplateScratch
    acs:ros:{#regionId}:{#accountId}:templatescratch/{#templatescratchId}
    none
none

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
TemplateScratchIdstringYes

The ID of the scenario.

ts-7f7a704cf71c49a6****
DescriptionstringNo

The description of the scenario.

The description of the scenario.
SourceResourcesobject []No

The source resources.

If you specify SourceResources when TemplateScratchType is set to ArchitectureDetection, the system detects the architecture of all resources that are associated with the specified source resources. For example, if you set the value of SourceResources to an ID of a Classic Load Balancer (CLB) instance, the system detects the architecture of resources, such as Elastic Compute Service (ECS) instances, vSwitches, and virtual private clouds (VPCs), that are associated with the CLB instance.

If you set TemplateScratchType to ArchitectureDetection, you can specify up to 20 source resources for SourceResources. In other cases, you can specify up to 200 source resources.

ResourceIdstringYes

The resource ID.

vpc-bp1m6fww66xbntjyc****
ResourceTypestringYes

The resource type.

ALIYUN::ECS::VPC
SourceTagobjectNo

The source tag.

ResourceTagsobjectYes

The source tags that consist of key-value pairs.

If you want to specify only the tag key, you must set the tag value to an empty string. Example: {"TagKey": ""}.

If you set TemplateScratchType to ArchitectureDetection, you can add up to five source tags. In other cases, you can add up to 10 source tags.

{"a": "b"}
ResourceTypeFilterarrayNo

The resource types for filtering resources.

stringNo

The resource type for filtering resources. If you specify this parameter, only the resources that are of the specified type and have the specified tags are scanned. If you do not specify this parameter, all resources that have the specified tags are scanned.

You can specify up to 20 resource types.

ALIYUN::ECS::VPC
SourceResourceGroupobjectNo

The source resource group.

ResourceGroupIdstringYes

The ID of the source resource group.

rg-acfmzawhxxc****
ResourceTypeFilterarrayNo

The resource types.

stringNo

The resource type. If you specify this parameter, only the resources of the specified type and in the specified resource group are scanned. If you do not specify this parameter, all the resources in the specified resource group are scanned.

You can specify up to 20 resource types.

ALIYUN::ECS::VPC
PreferenceParametersobject []No

The preference parameters of the resource scenario.

ParameterKeystringYes

The parameter name.

For more information about the valid values of ParameterKey, see the "Additional information about request parameters" section of this topic.

Note
  • PreferenceParameters is optional. If you specify PreferenceParameters, you must specify both ParameterKey and ParameterValue.
  • If you set TemplateScratchType to ResourceImport, you must set ParameterKey to DeletionPolicy.
  • DeletionPolicy
    ParameterValuestringYes

    The parameter value. The value of ParameterValue varies based on the value of ParameterKey.

    For more information about the valid values of ParameterKey, see the "Additional information about request parameters" section of this topic.

    Note PreferenceParameters is optional. If you specify PreferenceParameters, you must specify both ParameterKey and ParameterValue.
    Retain
    LogicalIdStrategystringNo

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

    • LongTypePrefixAndIndexSuffix: long-type prefix + index-type suffix
    • LongTypePrefixAndHashSuffix: long-type prefix + hash-type suffix
    • ShortTypePrefixAndHashSuffix: short-type prefix + hash-type suffix
    Note If you set TemplateScratchType to ArchitectureDetection, the default value of LogicalIdStrategy is LongTypePrefixAndHashSuffix. In other cases, the default value of LogicalIdStrategy is LongTypePrefixAndIndexSuffix.
    LongTypePrefixAndIndexSuffix
    ClientTokenstringNo

    The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

    For more information, see How to ensure idempotence.

    123e4567-e89b-12d3-a456-42665544****
    ExecutionModestringNo

    The execution mode. Valid values:

    • Async (default)
    • Sync
    Note If you have a wide scope of resources, Sync takes longer. If you set ExecutionMode to Sync, we recommend that you specify ClientToken to prevent the execution timeout.
    Sync
    ResourceGroupIdstringNo

    The ID of the resource group.

    rg-acfmxazb4ph6aiy****

    Additional information about request parameters

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

    In request parameters, the values of ParameterKey and ParameterValue vary based on scenario types.

    • The following table describes the values of ParameterKey and ParameterValue that are supported by a resource replication scenario.
    ParameterKeyParameterValue
    DeletionPolicyThe deletion policy for resources. Valid values:Retain: retains resources when you delete the stack to which the resources are replicated.Delete: deletes resources by default when you delete the stack to which the resources are replicated. If you retain specific resources when the Delete Stack dialog box appears, the resources are retained.
    RegionIdThe destination region in which the resources you want to replicate reside. If you do not specify a destination region, the region of the source resources is used for the replicated resources.Example: cn-shanghai.
    ZoneIdThe destination zone in which the resources you want to replicate reside. If you replicate resources in the same region and you do not specify a destination zone, the zone of the source resources is used for the replicated resources. If you replicate resources across regions and you do not specify a destination zone, the system filters zones that are supported by all resources.Example: cn-shanghai-b.
    VpcIdThe destination VPC in which the resources you want to replicate reside. If you replicate resources in the same region and you do not specify a destination VPC, the VPC of the source resources is used for the replicated resources. If you replicate resources across regions and you do not specify a destination VPC, the system automatically creates a VPC in the destination region.Example: vpc-bp1hye0s8b69xokfu****.
    VSwitchIdThe destination vSwitch to which the resources you want to replicate are connected. If you replicate resources in the same region and you do not specify a destination vSwitch, the vSwitch of the source resources is used for the replicated resources. If you replicate resources across regions and you do not specify a destination vSwitch, the system automatically creates a vSwitch in the destination region.Example: vsw-bp11ufkwqwggtm1cj****.
    InstanceDataReplicationSpecifies whether to replicate ECS instance data. Valid value:true: replicates ECS instance data. If you replicate the data in the same region, the system creates a custom image for the source instance and creates an instance based on the image. If you replicate the data across regions, the system creates a custom image for the source instance, replicates the image to the destination region, and then creates an instance based on the image.false: does not replicate ECS instance data.

    Note If you set ParameterKey to InstanceDataReplication and ParameterValue to true, we recommend that you replicate resources after the source instance is stopped. This ensures data consistency.

    • The following table describes the values of ParameterKey and ParameterValue that are supported by a resource management scenario.

    Note For a resource management scenario, you must set ParameterKey to DeletionPolicy.

    ParameterKeyParameterValue
    DeletionPolicyThe deletion policy for resources. Valid values:Retain: retains resources when you delete the stack that you use to manage the resources.Delete: deletes resources by default when you delete the stack that you use to manage the resources. If you retain specific resources when the Delete Stack dialog box appears, the resources are retained.
    • The following table describes the values of ParameterKey and ParameterValue that are supported by a resource detection scenario.
    ParameterKeyParameterValue
    RegionIdsOne or more regions. Separate multiple regions with commas (,). If you do not specify a region, the region of the resource scenario is used. You cannot specify both RegionIds and SourceResources.

    Response parameters

    ParameterTypeDescriptionExample
    object
    RequestIdstring

    The ID of the request.

    221DA822-B8CF-50DF-A9D2-BA197BF97BD5
    TemplateScratchIdstring

    The ID of the scenario.

    ts-7f7a704cf71c49a6****

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "221DA822-B8CF-50DF-A9D2-BA197BF97BD5",
      "TemplateScratchId": "ts-7f7a704cf71c49a6****"
    }

    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 changedsee changesets
    Change itemChange content
    Input ParametersThe request parameters of the API has changed.
      Added Input Parameters: ResourceGroupId