All Products
Search
Document Center

Resource Orchestration Service:ListTemplates

Last Updated:Sep 12, 2024

Queries a list of private or shared templates.

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
ros:ListTemplatesget
  • Template
    acs:ros:{#regionId}:{#accountId}:template/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberlongNo

The page number.
Pages start from page 1.
Default value: 1.

1
PageSizelongNo

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

10
TemplateNamestringNo

The template name. This parameter takes effect only when ShareType is set to Private. The name can be up to 255 characters in length, and can contain digits, letters, hyphens (-), and underscores (_). The name must start with a digit or letter.

MyTemplate
ShareTypestringNo

The sharing type of the template.

Valid values:

  • Private (default): The template belongs to the template owner.
  • Shared: The template is shared with other users.
  • Official: The template is the shared template of the official version.
Private
Tagarray<object>No

The tags. You can specify up to 20 tags.

objectNo

The tag.

KeystringNo

The key of the tag. This parameter takes effect only when ShareType is set to Private.

You can specify up to 20 tag keys.

usage
ValuestringNo

The value of the tag. This parameter takes effect only when ShareType is set to Private.

You can specify up to 20 tag values.

deploy
ResourceGroupIdstringNo

The ID of the resource group.
For more information about resource groups, see the "Resource Group" section of What is Resource Management?

rg-acfmxazb4ph6aiy****
IncludeTagsstringNo

Specifies whether to query the tag information. Valid values:

  • Enabled
  • Disabled (default)
Enabled

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
TotalCountinteger

The total number of templates.

1
PageSizeinteger

The number of entries per page.

10
RequestIdstring

The request ID.

C3A8413B-1F16-4DED-AC3E-61A00718DE8A
PageNumberinteger

The page number.
Pages start from page 1.

1
Templatesarray<object>

The templates.

object

The template.

TemplateARNstring

The Alibaba Cloud Resource Name (ARN) of the template.

acs:ros:*:151266687691****:template/a52f81be-496f-4e1c-a286-8852ab54****
UpdateTimestring

The time when the template was last updated.

2019-10-15T08:17:14.000000
Descriptionstring

The description of the template.

test-description
CreateTimestring

The time when the template was created.

2019-10-15T08:17:14.000000
TemplateNamestring

The template name.

demo
TemplateVersionstring

The latest version of the template.

v1
TemplateIdstring

The template ID.

4d4f5aa2-3260-4e47-863b-763fbb12****
OwnerIdstring

The ID of the Alibaba Cloud account to which the template belongs.

151266687691****
ShareTypestring

The sharing type of the template.

Valid values:

  • Private: The template belongs to the template owner.
  • Shared: The template is shared with other users.
Private
ResourceGroupIdstring

The ID of the resource group.

rg-acfmxazb4ph6aiy****
Tagsarray<object>

The tags of the template.

object

The tag of the template.

Keystring

The key of the tag.

usage
Valuestring

The value of the tag.

test

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "PageSize": 10,
  "RequestId": "C3A8413B-1F16-4DED-AC3E-61A00718DE8A",
  "PageNumber": 1,
  "Templates": [
    {
      "TemplateARN": "acs:ros:*:151266687691****:template/a52f81be-496f-4e1c-a286-8852ab54****",
      "UpdateTime": "2019-10-15T08:17:14.000000",
      "Description": "test-description",
      "CreateTime": "2019-10-15T08:17:14.000000",
      "TemplateName": "demo",
      "TemplateVersion": "v1",
      "TemplateId": "4d4f5aa2-3260-4e47-863b-763fbb12****",
      "OwnerId": "151266687691****",
      "ShareType": "Private",
      "ResourceGroupId": "rg-acfmxazb4ph6aiy****",
      "Tags": [
        {
          "Key": "usage",
          "Value": "test"
        }
      ]
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2022-06-09The request parameters of the API has changed. The response structure of the API has changedView Change Details