通过 GET 调用 /resource_types/{TypeName}/template 查询单个资源类型对应的模板信息。
请求参数
名称 | 位置 | 类型 | 是否必须 | 描述 |
TypeName | URI | String | 是 | 资源类型名称。 |
返回参数
名称 | 参数类型 | 描述 |
ROSTemplateFormatVersion | String | 模板版本号。 |
Parameters | Json | 输入参数。输入参数中,定义了通过此模板创建资源栈时,需要指定的参数。这些参数用来订制每次资源栈创建的细节,比如用户名、密码,环境相关的 ECS 规格等。 |
Outputs | Json | 输出参数。输出参数定义了资源栈创建后,需要返回的信息。 |
Resources | Json | 资源。资源中给出了 ROS 通过模板部署的云资源的具体定义。每个资源在一个独立的 Resource 块中定义。 |
错误码
错误代码 | 描述 | Http 状态码 | 语义 |
InternalError | Server error. | 500 | 服务器端出现未知异常。 |
ResourceTypeNotFound | The Resource Type (%(type_name)s) could not be found. | 404 | 资源类型无法找到。 |
示例
请求示例
GET http://ros.aliyuncs.com/resource_types/ALIYUN::SLB::LoadBalancer/template HTTP/1.1
x-acs-signature-method: HMAC-SHA1
Authorization: acs ACSTQDkNtSMrZtwL:niea/6wW/HHwwiafneHX+oM3ALU=
Date: Fri, 11 Sep 2015 05:30:54 GMT
x-acs-signature-version: 1.0
x-sdk-client: Java/2.0.0
Accept: application/octet-stream
x-acs-version: 2015-09-01
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.6.0_27
Host: ros.aliyuncs.com
Connection: keep-alive
返回示例
HTTP/1.1 200 OK
Date: Fri, 11 Sep 2015 05:30:12 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 1694
Connection: close
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: X-Requested-With, X-Sequence, _aop_secret, _aop_signature
Access-Control-Max-Age: 172800
X-Acs-Request-Id: A21A4B12-CCD7-42F0-9A62-DE8347D88385
Server: Jetty(7.2.2.v20101205)
{
"ROSTemplateFormatVersion" : "2015-09-01",
"Parameters" : {
"InternetChargeType" : {
"AllowedValues" : [
"paybybandwidth",
"paybytraffic"
],
"Type" : "String",
"Description" : "The charging type of network billing."
},
"AddressType" : {
"AllowedValues" : [
"internet",
"intranet"
],
"Type" : "String",
"Description" : "The type of address."
},
"Bandwidth" : {
"Description" : "The bandwidth in Mbps of network.",
"Type" : "Number",
"MinValue" : 1,
"MaxValue" : 1000
},
"VpcId" : {
"Type" : "String",
"Description" : "The id of virtual private cloud."
},
"VSwitchId" : {
"Type" : "String",
"Description" : "The id of software-based network switch."
},
"LoadBalancerName" : {
"Type" : "String",
"Description" : "The display name of load balance."
}
},
"Outputs" : {
"LoadBalancerId" : {
"Value" : "{\"Fn::GetAtt\": [\"LoadBalance\", \"LoadBalancerId\"]}",
"Description" : "The id of load balance generated"
}
},
"Resources" : {
"LoadBalance" : {
"Type" : "ALIYUN::SLB::LoadBalancer",
"Properties" : {
"InternetChargeType" : {
"Ref" : "InternetChargeType"
},
"AddressType" : {
"Ref" : "AddressType"
},
"Bandwidth" : {
"Ref" : "Bandwidth"
},
"VpcId" : {
"Ref" : "VpcId"
},
"VSwitchId" : {
"Ref" : "VSwitchId"
},
"LoadBalancerName" : {
"Ref" : "LoadBalancerName"
}
}
}
}
}
在文档使用中是否遇到以下问题
更多建议
匿名提交