All Products
Search
Document Center

Resource Orchestration Service:UpdateTemplate

Last Updated:Sep 12, 2024

Updates a template by specifying the template URL or template details.

Operation description

When you update a template, take note of the following items:

  • If you specify TemplateBody or TemplateURL, the existing version number is automatically incremented by 1 after the template is updated. For example, the version is changed from v1 to v2.
  • If you do not specify TemplateBody or TemplateURL, the version number remains unchanged.
  • A template can have up to 100 versions. If the number of templates reaches the upper limit, the template fails to be updated. You must create another template.

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:UpdateTemplateupdate
  • template
    acs:ros:{#regionId}:{#accountId}:template/{#templateId}
    none
none

Request syntax

POST /V2/UpdateTemplate

GET /V2/UpdateTemplate

Request parameters

ParameterTypeRequiredDescriptionExample
TemplateURLstringNo

The URL of the file that contains the template body. The URL must point to a template located in an HTTP or HTTPS web server or an Alibaba Cloud OSS bucket. Examples: oss://ros/template/demo and oss://ros/template/demo?RegionId=cn-hangzhou. The template can be up to 524,288 bytes in length, and the URL can be up to 1,024 bytes in length.

Note If the region of the OSS bucket is not specified, the RegionId value is used.

You can specify only one of the TemplateBody and TemplateURL parameters.

oss://ros/template/demo
TemplateNamestringNo

The name of the template.

The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

MyTemplate
DescriptionstringNo

The description of the template. It can be up to 256 characters in length.

It is a demo.
TemplateBodystringNo

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length.

If the length of the template body is longer than required, we recommend that you add parameters to the HTTP POST request body to avoid request failures due to excessive length of URLs.

You can specify only one of the TemplateBody and TemplateURL parameters.

{"ROSTemplateFormatVersion":"2015-09-01"}
TemplateIdstringYes

The ID of the template. This parameter applies to shared and private templates.

5ecd1e10-b0e9-4389-a565-e4c15efc****

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

8C5D90E1-66B6-496C-9371-3807F8DA80A8
TemplateIdstring

The ID of the template.

5ecd1e10-b0e9-4389-a565-e4c15efc****

Examples

Sample success responses

JSONformat

{
  "RequestId": "8C5D90E1-66B6-496C-9371-3807F8DA80A8",
  "TemplateId": "5ecd1e10-b0e9-4389-a565-e4c15efc****"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-08-08The response structure of the API has changedView Change Details
2024-08-01The request parameters of the API has changedView Change Details
2024-01-12The internal configuration of the API is changed, but the call is not affectedView Change Details