Queries templates. Multiple methods are supported to filter templates.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
oos:ListTemplates | get | *Template acs:oos:{#regionId}:{#accountId}:template/* *Template acs:oos:{#regionId}:{#accountId}:template/{#templateName} |
| 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:
| private |
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. | false |
Response parameters
Examples
Sample success responses
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": "v2.1"
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-11-08 | The response structure of the API has changed | View Change Details |
2024-07-11 | The request parameters of the API has changed | View Change Details |
2023-12-08 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |