All Products
Search
Document Center

CloudOps Orchestration Service:UpdateTemplate

Last Updated:Oct 26, 2026

Updates an existing template.

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

oos:UpdateTemplate

update

*template

acs:oos:{#regionId}:{#accountId}:template/{#templateName}

  • oos:tag
  • oos:TLSVersion
  • ram:PassRole

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-hangzhou

TemplateName

string

Yes

The name of the template. The name can contain letters, digits, hyphens (-), and underscores (_). It can be up to 200 characters in length and cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

MyTemplate

Content

string

Yes

The content of the template. The content must be in JSON or YAML format and can be up to 64 KB in size.

{ "FormatVersion": "OOS-2019-06-01", "Description": { "en": "Bulky starts the ECS instances", "zh-cn": "Start ECS instances in batches", "name-en": "Bulky Start Instances", "name-zh-cn": "Start Instances in Batches" }, "Parameters": { "regionId": { "Type": "String", "Label": { "en": "RegionId", "zh-cn": "Region ID" }, "AssociationProperty": "RegionId", "Default": "{{ ACS::RegionId }}" }, "targets": { "Type": "Json", "Label": { "en": "TargetInstance", "zh-cn": "Target Instances" }, "AssociationProperty": "Targets", "AssociationPropertyMetadata": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "regionId" } }, "rateControl": { "Label": { "en": "RateControl", "zh-cn": "Concurrency ratio for task execution" }, "Type": "Json", "AssociationProperty": "RateControl", "Default": { "Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10 } }, "OOSAssumeRole": { "Label": { "en": "OOSAssumeRole", "zh-cn": "RAM role assumed by OOS" }, "Type": "String", "Default": "OOSServiceRole" } }, "RamRole": "{{ OOSAssumeRole }}", "Tasks": [ { "Name": "getInstance", "Description": { "en": "Views the ECS instances", "zh-cn": "Query ECS instances" }, "Action": "ACS::SelectTargets", "Properties": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "{{ regionId }}", "Filters": [ "{{ targets }}" ] }, "Outputs": { "instanceIds": { "Type": "List", "ValueSelector": "Instances.Instance[].InstanceId" } } }, { "Name": "startInstance", "Action": "ACS::ECS::StartInstance", "Description": { "en": "Starts the ECS instances", "zh-cn": "Start instances" }, "Properties": { "regionId": "{{ regionId }}", "instanceId": "{{ ACS::TaskLoopItem }}" }, "Loop": { "RateControl": "{{ rateControl }}", "Items": "{{ getInstance.instanceIds }}" } } ], "Outputs": { "instanceIds": { "Type": "List", "Value": "{{ getInstance.instanceIds }}" } } }

Tags

object

No

The tag keys and values. You can specify 1 to 20 key-value pairs.

{"k1":"k2","k2":"v2"}

VersionName

string

No

The version name of the template.

v2

ResourceGroupId

string

No

The ID of the resource group.

rg-acfmxsn4m4******

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

2075899A-585D-4A41-A9B2-28DF4F534F

Template

object

The metadata of the template.

Hash

string

The SHA-256 hash value of the template content.

4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4

UpdatedDate

string

The time when the template was updated. The time is displayed in ISO 8601 format and in UTC.

2019-05-16T10:26:14Z

UpdatedBy

string

The user who updated the template.

root(1309000)

Tags

object

The tag keys and values. You can specify 1 to 20 key-value pairs.

{"k1":"k2","k2":"v2"}

TemplateName

string

The name of the template.

MyTemplate

TemplateVersion

string

The version of the template. The version is in the format of "v" followed by a number, starting from 1.

v2

TemplateFormat

string

The format of the template. The format is determined by the system and can be JSON or YAML.

JSON

Description

string

The description of the template.

Describe instances of given status

ResourceGroupId

string

The ID of the resource group.

rg-acfmxsn4m4******

CreatedBy

string

The user who created the template.

root(130920000)

CreatedDate

string

The time when the template was created. The time is displayed in ISO 8601 format and in UTC.

2019-05-16T10:26:14Z

TemplateId

string

The ID of the template.

t-94753deed38

HasTrigger

boolean

Indicates whether the template was successfully triggered.

true

ShareType

string

The sharing type of the template. Currently, the sharing type of templates created by users is Private.

Private

Examples

Success response

JSON format

{
  "RequestId": "2075899A-585D-4A41-A9B2-28DF4F534F",
  "Template": {
    "Hash": "4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4",
    "UpdatedDate": "2019-05-16T10:26:14Z",
    "UpdatedBy": "root(1309000)",
    "Tags": {
      "k1": "k2",
      "k2": "v2"
    },
    "TemplateName": "MyTemplate",
    "TemplateVersion": "v2",
    "TemplateFormat": "JSON",
    "Description": "Describe instances of given status",
    "ResourceGroupId": "rg-acfmxsn4m4******",
    "CreatedBy": "root(130920000)",
    "CreatedDate": "2019-05-16T10:26:14Z",
    "TemplateId": "t-94753deed38",
    "HasTrigger": true,
    "ShareType": "Private"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.