调用GetTemplate获取一个模版,包括内容。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetTemplate |
系统规定参数。取值:GetTemplate。 |
TemplateName | String | 是 | MyTemplate |
模板名称。内容限制为字母、数字、中划线、下划线,长度200字符。 |
RegionId | String | 否 | cn-hangzhou |
地域ID |
TemplateVersion | String | 否 | v1 |
模板版本。格式:“v”+数字。取值范围:v1-v200。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Content | String | "{\n \"FormatVersion\": \"OOS-2019-06-01\",\n \"Parameters\": {\n \"Status\": {\n \"Type\": \"String\",\n \"Description\": \"(Required) The ID of the ECS instance.\"\n }\n },\n \"Tasks\": [\n {\n \"Name\": \"bar\",\n \"Properties\": {\n \"Parameters\": {\n \"Status\": \"{{ Status }}\"\n },\n \"API\": \"DescribeInstances\",\n \"Service\": \"Ecs\"\n },\n \"Action\": \"acs::ExecuteAPI\",\n \"Outputs\": {\n \"InstanceIds\": {\n \"ValueSelector\": \".Instances.Instance[].InstanceId\",\n \"Type\": \"List\"\n }\n }\n }\n ],\n \"Outputs\": {\n \"InstanceIds\": {\n \"Value\": \" {{ bar.InstanceIds }} \",\n \"Type\": \"List\"\n }\n }\n}\n" |
模板内容 |
RequestId | String | FAAFCA45-AB65-4049-BFE0-868E1C8025AF |
请求ID |
Template | Struct |
模板元信息 |
|
CreatedBy | String | root(1300000) |
模板创建者 |
CreatedDate | String | 2019-05-16T10:26:14Z |
模板创建时间 |
Description | String | Describe instances of given status |
模板说明 |
HasTrigger | Boolean | true |
是否成功触发 |
Hash | String | 4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4 |
模板内容的SHA256 |
ShareType | String | Private |
模板共享类型。目前用户创建的模板的共享类型均为 Private。 |
Tags | Map | {"k1":"k2","k2":"v2"} |
标签键及值,键值对数量限制为1至20。 |
TemplateFormat | String | JSON |
模板格式。系统字段判断,为JSON或YAML。 |
TemplateId | String | t-94753d38 |
模板ID |
TemplateName | String | MyTemplate |
模板名称 |
TemplateVersion | String | v1 |
模板版本。以“v”+数字的形式,数字从1开始。 |
UpdatedBy | String | root(130000) |
模板更新者 |
UpdatedDate | String | 2019-05-16T10:26:14Z |
模板更新时间 |
示例
请求示例
http(s)://oos.cn-hangzhou.aliyuncs.com/?Action=GetTemplate
&TemplateName=MyTemplate
&<公共请求参数>
正常返回示例
XML
格式
<GetTemplateResponse>
<Content>{
"FormatVersion": "OOS-2019-06-01",
"Parameters": {
"Status": {
"Type": "String",
"Description": "(Required) The ID of the ECS instance."
}
},
"Tasks": [
{
"Name": "bar",
"Properties": {
"Parameters": {
"Status": "{{ Status }}"
},
"API": "DescribeInstances",
"Service": "Ecs"
},
"Action": "acs::ExecuteAPI",
"Outputs": {
"InstanceIds": {
"ValueSelector": ".Instances.Instance[].InstanceId",
"Type": "List<String>"
}
}
}
],
"Outputs": {
"InstanceIds": {
"Value": " {{ bar.InstanceIds }} ",
"Type": "List<String>"
}
}
}
</Content>
<RequestId>FAAFCA45-AB65-4049-BFE0-868E1C8025AF</RequestId>
<Template>
<CreatedBy>root(130000)</CreatedBy>
<CreatedDate>2019-05-27T10:32:52Z</CreatedDate>
<UpdatedBy>root(130000)</UpdatedBy>
<UpdatedDate>2019-05-27T08:46:33Z</UpdatedDate>
<Description></Description>
<Hash>62eac5c64b9dae5c41e1e8b648baad95f812cab4f9221a5283edb882b5f8d712</Hash>
<ShareType>Private</ShareType>
<TemplateFormat>JSON</TemplateFormat>
<TemplateName>MyTemplate</TemplateName>
<TemplateId>t-9475828d38</TemplateId>
<TemplateVersion>v1</TemplateVersion>
</Template>
</GetTemplateResponse>
JSON
格式
{
"Content": "{\n \"FormatVersion\": \"OOS-2019-06-01\",\n \"Parameters\": {\n \"Status\": {\n \"Type\": \"String\",\n \"Description\": \"(Required) The ID of the ECS instance.\"\n }\n },\n \"Tasks\": [\n {\n \"Name\": \"bar\",\n \"Properties\": {\n \"Parameters\": {\n \"Status\": \"{{ Status }}\"\n },\n \"API\": \"DescribeInstances\",\n \"Service\": \"Ecs\"\n },\n \"Action\": \"acs::ExecuteAPI\",\n \"Outputs\": {\n \"InstanceIds\": {\n \"ValueSelector\": \".Instances.Instance[].InstanceId\",\n \"Type\": \"List<String>\"\n }\n }\n }\n ],\n \"Outputs\": {\n \"InstanceIds\": {\n \"Value\": \" {{ bar.InstanceIds }} \",\n \"Type\": \"List<String>\"\n }\n }\n}\n",
"RequestId": "FAAFCA45-AB65-4049-BFE0-868E1C8025AF",
"Template": {
"CreatedBy": "root(130000)",
"CreatedDate": "2019-05-27T10:32:52Z",
"UpdatedBy": "root(130000)",
"UpdatedDate": "2019-05-27T08:46:33Z",
"Description": "",
"Hash": "62eac5c64b9dae5c41e1e8b648baad95f812cab4f9221a5283edb882b5f8d712",
"ShareType": "Private",
"TemplateFormat": "JSON",
"TemplateName": "MyTemplate",
"TemplateId": "t-9475828d38",
"TemplateVersion": "v1"
}
}
错误码
访问错误中心查看更多错误码。