All Products
Search
Document Center

CloudOps Orchestration Service:ListTemplates

Last Updated:Sep 02, 2026

Queries templates. Supports multiple filtering methods.

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 region ID.

cn-hangzhou

TemplateName

string

No

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

MyTemplate

TemplateFormat

string

No

The template format. Valid values:

  • JSON

  • YAML

YAML

ShareType

string

No

The share type. Valid values:

  • Public

  • Private

Private

CreatedBy

string

No

The creator of the template.

  • For official templates provided by Alibaba Cloud, the value is ACS.

  • For templates created by users, you can specify a UID or a username to filter templates.

ACS

CreatedDateBefore

string

No

Filters templates whose creation time is earlier than or equal to the specified time.

Format: YYYY-MM-DDThh:mm:ssZ

2019-05-16T10:26:14Z

CreatedDateAfter

string

No

Filters templates whose creation time is later than or equal to the specified time.

Format: YYYY-MM-DDThh:mm:ssZ

2019-05-16T10:26:14Z

Tags

object

No

The tags in key-value pairs. The number of key-value pairs ranges from 1 to 20.

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

Category

string

No

The template category, such as TimerTrigger, EventTrigger, AlarmTrigger, or 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 used to retrieve the next page of results. This value is obtained from the response of the current page if more results are available.

xxx

SortField

string

No

The field used to sort the query results. Valid values:

  • TotalExecutionCount (default): total number of executions

  • Popularity: popularity

  • TemplateName: template name

  • CreatedDate: creation time

  • UpdatedDate: update time

Popularity

SortOrder

string

No

The sort order. Valid values:

  • Ascending: ascending order

  • Descending (default): descending order

Descending

HasTrigger

boolean

No

Specifies whether the template has a trigger.

true

TemplateType

string

No

The template type. Valid values:

  • Automation: automation

  • State: configuration inventory

  • Package: software package

Valid values:

  • Automation :

    Automation

  • State :

    State

  • Package :

    Package

Automation

ResourceGroupId

string

No

The resource group ID.

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 used to retrieve the next page of results. This value is obtained from the response of the current page if more results are available.

xxx

RequestId

string

The request ID.

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

MaxResults

integer

The number of entries per page.

50

Templates

array<object>

The template metadata.

array<object>

Hash

string

The SHA-256 hash 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 tags in key-value pairs. 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, in the format of "v" followed by a number starting from 1.

v1

TemplateFormat

string

The template format. The system determines the format, which is JSON or YAML.

JSON

Popularity

integer

The popularity of the public template. The value ranges from 1 to 10. A higher value indicates greater popularity. If ShareType is Private, the value of this field is -1.

Note

This field is meaningful only when ShareType is Public.

8

TotalExecutionCount

integer

The total number of executions for the private template. If ShareType is Public, the value of this field is -1.

Note

This field is meaningful only when ShareType is Private.

5

Description

string

The template description.

Describe instances of given status

ResourceGroupId

string

The resource group ID.

rg-acfmxsn4m4******

CreatedBy

string

The creator of the template.

root(1309200)

CreatedDate

string

The time when the template was created.

2019-05-16T10:26:14Z

Category

string

The template type.

TimerTrigger

HasTrigger

boolean

Indicates whether the template was successfully triggered.

true

TemplateId

string

The template ID.

t-94753deed38

ShareType

string

The share type of the template. Templates created by users have a share type of Private. Valid values:

  • Public

  • Private

Public

IsFavorite

boolean

Specifies whether the template is added to favorites.

true

Publisher

string

The publisher.

aliyun

Constraints

string

The 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.