Queries the details of a template based on stacks, stack groups, change sets, or any custom template information.
Operation description
In this example, the details of a template whose ID is 5ecd1e10-b0e9-4389-a565-e4c15efc**** is queried. The region ID of the template is cn-hangzhou.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:GetTemplate |
get |
stack
template
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StackId |
string |
No |
The ID of the stack. Note
You must specify one of the following parameters: StackId, ChangeSetId, StackGroupName, and TemplateId. |
4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
| RegionId |
string |
No |
The region ID of the stack or stack group that uses the template. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| ChangeSetId |
string |
No |
The ID of the change set. Note
You must specify one of the following parameters: StackId, ChangeSetId, StackGroupName, and TemplateId. |
1f6521a4-05af-4975-afe9-bc4b45ad**** |
| TemplateId |
string |
No |
The ID of the template. This parameter applies to shared and private templates. If the template is a shared template, the value of TemplateId is the same as the value of TemplateARN. You can use the template ID to query a shared template. Note
You must specify one of the following parameters: StackId, ChangeSetId, StackGroupName, and TemplateId. |
5ecd1e10-b0e9-4389-a565-e4c15efc**** |
| TemplateVersion |
string |
No |
The version of the template. This parameter takes effect only if you specify TemplateId. Valid values: v1 to v100. |
v1 |
| TemplateStage |
string |
No |
The stage of the template. This parameter takes effect only if you specify StackId, ChangeSetId, or StackGroupName. Valid values:
|
Processed |
| IncludePermission |
string |
No |
Specifies whether to query the shared information about the template. Valid values:
Note
Only the template owner can query the shared information of a template. |
Enabled |
| StackGroupName |
string |
No |
The name of the stack group. Note
You must specify one of the following parameters: StackId, ChangeSetId, StackGroupName, and TemplateId. |
MyStackGroup |
| IncludeTags |
string |
No |
Specifies whether to query the information about tags. Valid values:
Note
This parameter takes effect only if you specify TemplateId. |
Enabled |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| TemplateARN |
string |
The Alibaba Cloud Resource Name (ARN) of the template. This parameter is returned only if you specify TemplateId. |
acs:ros:*:151266687691****:template/a52f81be-496f-4e1c-a286-8852ab54**** |
| Description |
string |
The description of the template. This parameter is returned only if you specify TemplateId. |
ROS template for create ECS instance. |
| RequestId |
string |
The ID of the request. |
B288A0BE-D927-4888-B0F7-B35EF84**** |
| CreateTime |
string |
The time when the template was created. This parameter is returned only if you specify TemplateId. Note
|
2020-11-18T08:49:26 |
| StackGroupName |
string |
The name of the stack group. This parameter is returned only if you specify StackGroupName. |
MyStackGroup |
| TemplateVersion |
string |
The version of the template. This parameter is returned only if you specify TemplateId. If the template is a shared template, this parameter is returned only if you set VersionOption to AllVersions. |
v1 |
| TemplateBody |
string |
The content of the template. |
{"ROSTemplateFormatVersion": "2015-09-01"} |
| ChangeSetId |
string |
The ID of the change set. This parameter is returned only if you specify ChangeSetId. |
e85abe0c-6528-43fb-ae93-fdf8de22**** |
| OwnerId |
string |
The ID of the Alibaba Cloud account to which the template belongs. This parameter is returned only if you specify TemplateId. |
151266687691**** |
| UpdateTime |
string |
The time when the template was last updated. This parameter is returned only if you specify TemplateId. Note
|
2020-12-07T06:11:48 |
| Permissions |
array<object> |
Details of the sharing status of the template. This parameter is returned only if you specify TemplateId and set IncludePermission to Enabled. Note
|
|
|
object |
|||
| VersionOption |
string |
The version option for the shared template. This parameter is returned only if you set ShareOption to ShareToAccounts. Valid values:
|
AllVersions |
| AccountId |
string |
The ID of the Alibaba Cloud account with which the template is shared. |
142437958638**** |
| ShareOption |
string |
The sharing option. The value ShareToAccounts indicates that the template is shared with one or more Alibaba Cloud accounts. |
ShareToAccounts |
| TemplateVersion |
string |
The version of the shared template. This parameter is returned only if you set ShareOption to ShareToAccounts and set VersionOption to Specified or Current. Valid values: v1 to v100. |
v1 |
| ShareSource |
string |
The service that is used for resource sharing. Valid values:
Note
|
ROS |
| TemplateName |
string |
The name of the template. This parameter is returned only if you specify TemplateId. Note
|
MyTemplate |
| RegionId |
string |
The region ID of the stack or stack group that uses the template. This parameter is returned only if you specify StackId, ChangeSetId, or StackGroupName. |
cn-hangzhou |
| TemplateId |
string |
The ID of the template. This parameter is returned only if you specify TemplateId. If the template is a shared template, the value of this parameter is the same as the value of TemplateARN. |
a52f81be-496f-4e1c-a286-8852ab54**** |
| StackId |
string |
The ID of the stack. This parameter is returned only if you specify StackId. |
4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
| ShareType |
string |
The sharing type of the template. This parameter is returned only if you specify TemplateId. Valid values:
|
Private |
| ResourceGroupId |
string |
The ID of the resource group. |
rg-acfmxazb4ph6aiy**** |
| Interface |
string |
The description of the web UI in the ROS console. |
{} |
| Tags |
array<object> |
The tags of the template. |
|
|
object |
The tag of the template. |
||
| Key |
string |
The tag key of the template. |
usage |
| Value |
string |
The tag value of the template. |
test |
| AdditionalInfo |
object |
Supplementary information for the public template. |
{"DeploymentDuration":null,"Title":"Self-Built_ElasticSearch_Snapshot_Saved_To_OSS","Labels":{"ResourceTypes":["ALIYUN::ECS::Instance","ALIYUN::ECS::SecurityGroup","ALIYUN::ECS::VPC","ALIYUN::ECS::VSwitch","ALIYUN::OSS::Bucket","ALIYUN::ROS::WaitCondition","ALIYUN::ROS::WaitConditionHandle"],"DeployTypes":["ROS"],"ApplicationScenes":["other"]},"Provider":"ROS","Categories":["Solution"]} |
Examples
Success response
JSON format
{
"TemplateARN": "acs:ros:*:151266687691****:template/a52f81be-496f-4e1c-a286-8852ab54****",
"Description": "ROS template for create ECS instance.",
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84****",
"CreateTime": "2020-11-18T08:49:26",
"StackGroupName": "MyStackGroup",
"TemplateVersion": "v1",
"TemplateBody": "{\"ROSTemplateFormatVersion\": \"2015-09-01\"}",
"ChangeSetId": "e85abe0c-6528-43fb-ae93-fdf8de22****",
"OwnerId": "151266687691****",
"UpdateTime": "2020-12-07T06:11:48",
"Permissions": [
{
"VersionOption": "AllVersions",
"AccountId": "142437958638****",
"ShareOption": "ShareToAccounts",
"TemplateVersion": "v1",
"ShareSource": "ROS"
}
],
"TemplateName": "MyTemplate",
"RegionId": "cn-hangzhou",
"TemplateId": "a52f81be-496f-4e1c-a286-8852ab54****",
"StackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf691****\t",
"ShareType": "Private",
"ResourceGroupId": "rg-acfmxazb4ph6aiy****",
"Interface": "{}",
"Tags": [
{
"Key": "usage",
"Value": "test"
}
],
"AdditionalInfo": {
"DeploymentDuration": null,
"Title": "Self-Built_ElasticSearch_Snapshot_Saved_To_OSS",
"Labels": {
"ResourceTypes": [
"ALIYUN::ECS::Instance",
"ALIYUN::ECS::SecurityGroup",
"ALIYUN::ECS::VPC",
"ALIYUN::ECS::VSwitch",
"ALIYUN::OSS::Bucket",
"ALIYUN::ROS::WaitCondition",
"ALIYUN::ROS::WaitConditionHandle"
],
"DeployTypes": [
"ROS"
],
"ApplicationScenes": [
"other"
]
},
"Provider": "ROS",
"Categories": [
"Solution"
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.