This API is used to query the template of a resource type.
The output template parameters of this API are related to the input parameters that you have specified, but the parameters may be different.
GET /v1/{project_id}/resource_types/{type_name}/template
For details about the parameters, see Table 1.
Parameter |
In |
Type |
Mandatory |
Description |
|---|---|---|---|---|
template_type |
query |
String |
No |
Specifies the resource template type. The valid types are cfn and hot. |
Parameter |
In |
Type |
Description |
|---|---|---|---|
outputs |
body |
Dict |
Includes key-value pairs of the output data. |
heat_template_version |
body |
String |
Specifies the version of the HOT template. |
HeatTemplateFormatVersion |
body |
String |
Specifies the version of the CFN template. |
description |
body |
String |
Describes the stack template. |
parameters |
body |
Dict |
Specifies the key-value pairs of template parameters. |
resources |
body |
Dict |
Specifies the template resources. |
GET /v1/95d02433133a4c0a87ba6967474a2ad3/resource_types/OS%3A%3AHeat%3A%3ARandomString/template
{
"Outputs": {
"value": {
"Description": "The random string generated by this resource. This value is also available by referencing the resource.",
"Value": "{"Fn::GetAtt": ["RandomString", "value"]}"
},
"show": {
"Description": "Detailed information about resource.",
"Value": "{"Fn::GetAtt": ["RandomString", "show"]}"
}
},
"HeatTemplateFormatVersion": "2012-12-12",
"Resources": {
"RandomString": {
"Type": "OS::Heat::RandomString",
"Properties": {
"length": {
"Ref": "length"
},
"salt": {
"Ref": "salt"
},
"character_sequences": {
"Fn::Split": [
",",
{
"Ref": "character_sequences"
}
]
},
"character_classes": {
"Fn::Split": [
",",
{
"Ref": "character_classes"
}
]
},
"sequence": {
"Ref": "sequence"
}
}
}
},
"Description": "Initial template of RandomString",
"Parameters": {
"length": {
"Default": 32,
"Type": "Number",
"Description": "Length of the string to generate.",
"MaxValue": 512,
"MinValue": 1
},
"salt": {
"Type": "String",
"Description": "Value which can be set or changed on stack update to trigger the resource for replacement with a new random string. The salt value itself is ignored by the random generator."
},
"character_sequences": {
"Type": "CommaDelimitedList",
"Description": "A list of character sequences and their constraints to generate the random string from."
},
"character_classes": {
"Default": [
{
"class": "lettersdigits",
"min": 1
}
],
"Type": "CommaDelimitedList",
"Description": "A list of character class and their constraints to generate the random string from."
},
"sequence": {
"Type": "String",
"Description": "Sequence of characters to build the random string from.",
"AllowedValues": [
"lettersdigits",
"letters",
"lowercase",
"uppercase",
"digits",
"hexdigits",
"octdigits"
]
}
}
}
Return Code |
Type |
Description |
|---|---|---|
200 |
OK |
Request was successful. |
Return Code |
Type |
Description |
|---|---|---|
400 |
Bad Request |
The server failed to process the request. |
401 |
Unauthorized |
Authorization failed. |
404 |
Not found |
The requested resources are not found. |