Queries a list of private or shared 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 |
---|---|---|---|---|
ros:ListTemplates | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PageNumber | long | No | The page number. | 1 |
PageSize | long | No | The number of entries per page. | 10 |
TemplateName | string | No | 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 |
ShareType | string | No | The sharing type of the template. Valid values:
| Private |
Tag | array<object> | No | The tags. You can specify up to 20 tags. | |
object | No | The tag. | ||
Key | string | No | 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 |
Value | string | No | 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 |
ResourceGroupId | string | No | The ID of the resource group. | rg-acfmxazb4ph6aiy**** |
IncludeTags | string | No | Specifies whether to query the tag information. Valid values:
| Enabled |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"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 time | Summary of changes | Operation |
---|---|---|
2022-06-09 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |