Queries templates. Supports multiple filtering methods.
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 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:
|
YAML |
| ShareType |
string |
No |
The share type. Valid values:
|
Private |
| CreatedBy |
string |
No |
The creator of the template.
|
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:
|
Popularity |
| SortOrder |
string |
No |
The sort order. Valid values:
|
Descending |
| HasTrigger |
boolean |
No |
Specifies whether the template has a trigger. |
true |
| TemplateType |
string |
No |
The template type. Valid values:
Valid values:
|
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 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 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 |
| 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.