All Products
Search
Document Center

CloudOps Orchestration Service:ListTemplates

Last Updated:Aug 28, 2026

Queries templates. Multiple methods are supported to filter templates.

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:ListTemplates

get

Template

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

Template

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

  • oos:tag
  • oos:TLSVersion
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The ID of the region in which you want to query templates.

cn-hangzhou

TemplateName

string

No

The name of the template. All templates whose names contain the specified template name are to be returned.

MyTemplate

TemplateFormat

string

No

The format of the template. Valid values:

  • JSON

  • YAML

YAML

ShareType

string

No

The share type of the template. Valid values:

  • Public

  • Private

Private

CreatedBy

string

No

The creator of the template.

  • To query the template provided by Alibaba Cloud, set this parameter to ACS.

  • To query the template created by a user, set this parameter to the ID of the template or the name of the user who creates the template.

ACS

CreatedDateBefore

string

No

Specifies to query the template that is created at or before the specified time.

The value must be in the YYYY-MM-DDThh:mm::ssZ format.

2019-05-16T10:26:14Z

CreatedDateAfter

string

No

Specifies to query the template that is created at or later than the specified time.

The value must be in the YYYY-MM-DDThh:mm:ssZ format.

2019-05-16T10:26:14Z

Tags

object

No

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

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

Category

string

No

The type of the template. Valid values include TimerTrigger, EventTrigger, AlarmTrigger, and Other.

TimerTrigger

MaxResults

integer

No

The number of entries per page. Valid values: 10 to 100. Default value: 50.

50

NextToken

string

No

The token that is used to retrieve the next page of results.

xxx

SortField

string

No

The field that is used to sort the templates to be queried. Valid values:

  • TotalExecutionCount (default): The system sorts the returned templates based on the total number of times that the templates are used.

  • Popularity: The system sorts the returned templates based on the popularity of the templates.

  • TemplateName: The system sorts the returned templates based on the names of the templates.

  • CreatedDate: The system sorts the returned templates based on the points in time when the templates are created.

  • UpdatedDate: The system sorts the returned templates based on the points in time when the templates are updated.

Popularity

SortOrder

string

No

The order in which you want to sort the results. Valid values:

  • Ascending: ascending order.

  • Descending: descending order. This is the default value.

Descending

HasTrigger

boolean

No

Specifies whether to query the template that is configured with a trigger.

true

TemplateType

string

No

The type of the template. Valid values:

  • Automation: the template for automated tasks.

  • State: the template for configuration inventories.

  • Package: the template for software packages.

Valid values:

  • Automation :

    Automation

  • State :

    State

  • Package :

    Package

Automation

ResourceGroupId

string

No

The ID of the resource group.

rg-acfmxsn4m4******

IsFavorite

boolean

No

Specifies whether the template is added to favorites.

true

IsExample

boolean

No

Specifies whether the template is an example template.

true

Response elements

Element

Type

Description

Example

object

NextToken

string

The token that is used to retrieve the next page of results.

xxx

RequestId

string

The ID of the request.

BEF54BA-17B6-449F-A219-49ACB157E3

MaxResults

integer

The number of entries returned on each page.

50

Templates

array<object>

The template metadata.

array<object>

Hash

string

The SHA256 value of the template content.

4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4

UpdatedDate

string

The time when the template was last updated.

2019-05-16T10:26:14Z

UpdatedBy

string

The user who last updated the template.

root(13092000)

TemplateType

string

The template type.

private

Tags

object

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

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

TemplateName

string

The template name.

MyTemplate

TemplateVersion

string

The template version. The version contains the letter v and a number. The number starts from 1.

v1

TemplateFormat

string

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

JSON

Popularity

integer

The popularity of the public template. Valid values: 1-10. A greater value indicates higher popularity. If ShareType is set to Private, the value of this parameter is -1.

Note

This parameter is valid only if ShareType is set to Public.

8

TotalExecutionCount

integer

The number of times for which the private template is executed. If ShareType is set to Public, the value of this parameter is -1.

Note

This parameter is valid only if ShareType is set to Private.

5

Description

string

The template description.

Describe instances of given status

ResourceGroupId

string

The ID of the resource group.

rg-acfmxsn4m4******

CreatedBy

string

The user who created the template.

root(1309200)

CreatedDate

string

The creation time of the template.

2019-05-16T10:26:14Z

Category

string

The template type.

TimerTrigger

HasTrigger

boolean

Indicates whether the template was configured with a trigger.

true

TemplateId

string

The template ID.

t-94753deed38

ShareType

string

The share type of the template. The share type of a template created by a user is Private. Valid values:

  • Public

  • Private

Public

IsFavorite

boolean

Indicates whether the template is added to favorites.

true

Publisher

string

The user who published the template.

aliyun

Constraints

string

The template constraints.

{ "InstanceTypeFamilies": ["ecs.g8y", "ecs.c8y"], "ImageTypes": ["system"], "OSPlatforms": ["CentOS", "Ubuntu"], "OSVersions": ["CentOS7.9 64bit"] }

VersionName

string

The version name.

3

Examples

Success response

JSON format

{
  "NextToken": "xxx",
  "RequestId": "BEF54BA-17B6-449F-A219-49ACB157E3",
  "MaxResults": 50,
  "Templates": [
    {
      "Hash": "4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4",
      "UpdatedDate": "2019-05-16T10:26:14Z",
      "UpdatedBy": "root(13092000)",
      "TemplateType": "private",
      "Tags": {
        "k1": "v1",
        "k2": "v2"
      },
      "TemplateName": "MyTemplate",
      "TemplateVersion": "v1",
      "TemplateFormat": "JSON",
      "Popularity": 8,
      "TotalExecutionCount": 5,
      "Description": "Describe instances of given status",
      "ResourceGroupId": "rg-acfmxsn4m4******",
      "CreatedBy": "root(1309200)",
      "CreatedDate": "2019-05-16T10:26:14Z",
      "Category": "TimerTrigger",
      "HasTrigger": true,
      "TemplateId": "t-94753deed38",
      "ShareType": "Public",
      "IsFavorite": true,
      "Publisher": "aliyun",
      "Constraints": "{\n  \"InstanceTypeFamilies\": [\"ecs.g8y\", \"ecs.c8y\"],\n  \"ImageTypes\": [\"system\"],\n  \"OSPlatforms\": [\"CentOS\", \"Ubuntu\"],\n  \"OSVersions\": [\"CentOS7.9 64bit\"]\n}",
      "VersionName": "3"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.