Queries templates. Multiple methods are supported to filter templates.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
oos:ListTemplates |
get |
Template
Template
|
|
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:
|
YAML |
| ShareType |
string |
No |
The share type of the template. Valid values:
|
Private |
| CreatedBy |
string |
No |
The creator of 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:
|
Popularity |
| SortOrder |
string |
No |
The order in which you want to sort the results. Valid values:
|
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:
Valid values:
|
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 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 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 |
| 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.