Update Template
Operation description
When updating a template, please note:
If you specify
TemplateBodyorTemplateURL, the template version will be incremented by 1 after a successful update. For example, the version changes from v1 to v2.If neither
TemplateBodynorTemplateURLis specified, the template version remains unchanged.A template can have up to 100 versions. If the version limit is reached, the template update will fail, and you need to recreate the template.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:UpdateTemplate |
update |
*template
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateURL |
string |
No |
The location of the file containing the template body. The URL must point to a template located on a web server (HTTP or HTTPS) or in an Alibaba Cloud OSS bucket (e.g., oss://ros/template/demo, oss://ros/template/demo?RegionId=cn-hangzhou), with a maximum size of 524,288 bytes. Note
If the OSS region is not specified, it defaults to the same as the You can only specify one of |
oss://ros/template/demo |
| TemplateName |
string |
No |
The name of the template. |
MyTemplate |
| Description |
string |
No |
The description of the template. The maximum length is 256 characters. |
It is a demo. |
| TemplateBody |
string |
No |
The structure of the template body. The length should be between 1 and 524,288 bytes. If the content is long, it is recommended to use HTTP POST + Body Param to pass the parameter in the request body to avoid request failure due to an overly long URL. Note
You must and can only specify one of |
{"ROSTemplateFormatVersion":"2015-09-01"} |
| TemplateId |
string |
Yes |
The template ID. Supports both shared and private templates. |
5ecd1e10-b0e9-4389-a565-e4c15efc**** |
| ValidationOptions |
array |
No |
Validation options. By default, no options are enabled, and strict validation is performed. |
|
|
string |
No |
Validation options. Values:
|
BasicValidation |
|
| RotateStrategy |
string |
No |
Template version rotation strategy. Values:
Note
|
None |
| IsDraft |
boolean |
No |
Whether to update the Draft (draft) version. Values:
|
false |
For details on common request parameters, see Common Parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
Request ID. |
8C5D90E1-66B6-496C-9371-3807F8DA80A8 |
| TemplateId |
string |
Template ID. |
5ecd1e10-b0e9-4389-a565-e4c15efc**** |
| TemplateVersion |
string |
The template version affected by this operation. |
v2 |
Examples
Success response
JSON format
{
"RequestId": "8C5D90E1-66B6-496C-9371-3807F8DA80A8",
"TemplateId": "5ecd1e10-b0e9-4389-a565-e4c15efc****",
"TemplateVersion": "v2"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.