Creates a template.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
oos:CreateTemplate |
create |
*Template
|
|
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The ID of the region. |
cn-hangzhou |
| TemplateName |
string |
Yes |
The name of the template. The name can be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). The name cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD. |
MyTemplate |
| Content |
string |
Yes |
The content of the template. The content must be in the JSON or YAML format, and its maximum size is 64 KB. |
{"FormatVersion": "OOS-2019-06-01", "Description": "Describe instances of given status", "Parameters": {"Status": {"Type": "String", "Description": "(Required) The status of the Ecs instance."}}, "Tasks": [{"Properties": {"Parameters": {"Status": "{{ Status }}"}, "API": "DescribeInstances", "Service": "Ecs"}, "Name": "foo", "Action": "ACS::ExecuteApi"}]} |
| Tags |
object |
No |
The tag key-value pairs. You can specify 1 to 20 pairs. |
{"k1":"v1","k2":"v2"} |
| VersionName |
string |
No |
The version name of the template. |
v2 |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-acfmxsn4m4****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| TemplateType |
string |
The type of the template. |
Private |
| RequestId |
string |
The ID of the request. |
20758A-585D-4A41-A9B2-28DA8F4F534F |
| Template |
object |
The metadata of the template. |
|
| Hash |
string |
The SHA-256 value of the template content. |
4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4 |
| UpdatedDate |
string |
The time when the template was last updated. |
2019-05-16T10:26:14Z |
| UpdatedBy |
string |
The Alibaba Cloud account that last modified the template. |
root(130900000) |
| Tags |
object |
The tags of the template. |
{ "k1":"v1", "k2":"v2" } |
| TemplateName |
string |
The name of the template. |
MyTemplate |
| TemplateVersion |
string |
The version of the template. The version name consists of the letter v and a number starting from 1. |
v1 |
| TemplateFormat |
string |
The format of the template. The system automatically determines whether the format is JSON or YAML. |
JSON |
| Description |
string |
The description of the template. |
Describe instances of given status |
| ResourceGroupId |
string |
The ID of the resource group. |
rg-acfmxsn4m4****** |
| CreatedBy |
string |
The creator of the template. |
root(13090000) |
| CreatedDate |
string |
The time when the template was created. |
2019-05-16T10:26:14Z |
| TemplateId |
string |
The ID of the template. |
t-94753d38 |
| HasTrigger |
boolean |
Indicates whether the template has a trigger configured. |
true |
| ShareType |
string |
The share type of the template. Templates that you create are always Private. |
Private |
Examples
Success response
JSON format
{
"TemplateType": "Private",
"RequestId": "20758A-585D-4A41-A9B2-28DA8F4F534F",
"Template": {
"Hash": "4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4",
"UpdatedDate": "2019-05-16T10:26:14Z",
"UpdatedBy": "root(130900000)",
"Tags": {
"k1": "v1",
"k2": "v2"
},
"TemplateName": "MyTemplate",
"TemplateVersion": "v1",
"TemplateFormat": "JSON",
"Description": "Describe instances of given status",
"ResourceGroupId": "rg-acfmxsn4m4******",
"CreatedBy": "root(13090000)",
"CreatedDate": "2019-05-16T10:26:14Z",
"TemplateId": "t-94753d38",
"HasTrigger": true,
"ShareType": "Private"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.