All Products
Search
Document Center

CloudOps Orchestration Service:UpdateTemplate

Last Updated:Mar 03, 2024

Updates the information about an existing 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
oos:UpdateTemplateWRITE
  • template
    acs:oos:{#regionId}:{#accountId}:template/{#templateName}
  • oos:tag
none

Request syntax

POST /UpdateTemplate

GET /UpdateTemplate

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The ID of the region.

cn-hangzhou
TemplateNamestringYes

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

MyTemplate
ContentstringYes

The content of the template. The content must be in the JSON or YAML format, and its maximum size is 64 KB.

{ "FormatVersion": "OOS-2019-06-01", "Description": { "en": "Bulky starts the ECS instances", "name-en": "Bulky Start Instances", }, "Parameters": { "regionId": { "Type": "String", "Label": { "en": "RegionId", }, "AssociationProperty": "RegionId", "Default": "{{ ACS::RegionId }}" }, "targets": { "Type": "Json", "Label": { "en": "TargetInstance", }, "AssociationProperty": "Targets", "AssociationPropertyMetadata": { "ResourceType": "ALIYUN::ECS::Instance", "RegionId": "regionId" } }, "rateControl": { "Label": { "en": "RateControl", }, "Type": "Json", "AssociationProperty": "RateControl", "Default": { "Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10 } }, "OOSAssumeRole": { "Label": { "en": "OOSAssumeRole", }, "Type": "String", "Default": "OOSServiceRole" } }, "RamRole": "{{ OOSAssumeRole }}", "Tasks": \[ { "Name": "getInstance", "Description": { "en": "Views the 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", }, "Properties": { "regionId": "{{ regionId }}", "instanceId": "{{ ACS::TaskLoopItem }}" }, "Loop": { "RateControl": "{{ rateControl }}", "Items": "{{ getInstance.instanceIds }}" } } ], "Outputs": { "instanceIds": { "Type": "List", "Value": "{{ getInstance.instanceIds }}" } } }
TagsobjectNo

The tag keys and values. The number of key-value pairs ranges from 1 to 20.

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

The name of the template version.

v2
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmxsn4m4******

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

The metadata of the template.

Hashstring

The SHA-256 value of the template content.

4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4
UpdatedDatestring

The time when the information about the template was last modified.

2019-05-16T10:26:14Z
UpdatedBystring

The user who last modified the information about the template.

root(1309000)
Tagsobject

The tag keys and values. The number of key-value pairs ranges from 1 to 20.

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

The name of the template.

MyTemplate
TemplateVersionstring

The version of the template. The name of the version consists of the letter v and a number. The number starts from 1.

v2
TemplateFormatstring

The format of the template. The system automatically determines whether the format is JSON or YAML.

JSON
Descriptionstring

The description of the template.

Describe instances of given status
ResourceGroupIdstring

The ID of the resource group.

rg-acfmxsn4m4******
CreatedBystring

The user who created the template.

root(130920000)
CreatedDatestring

The time when the template was created.

2019-05-16T10:26:14Z
TemplateIdstring

The ID of the template.

t-94753deed38
HasTriggerboolean

Indicates whether the template is configured with a trigger.

true
ShareTypestring

The share type of the template. The share type of a user-created template is Private.

Private

Examples

Sample success responses

JSONformat

{
  "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

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