You can call this operation to validate the template that is used to create stacks.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ValidateTemplate

The operation that you want to perform. Set the value to ValidateTemplate.

RegionId String No cn-hangzhou

The region ID of the stack template. You can call the DescribeRegions operation to query the most recent region list.

TemplateBody String No {"ROSTemplateFormatVersion":"2015-09-01"}

The structure that contains the template body. The template body must be 1 to 51,200 bytes in length.

You must specify either the TemplateBody parameter or the TemplateURL parameter. But you cannot specify both of them.

TemplateURL String No oss://ros/template/demo

The URL for the file that contains the template body. The URL must point to a template located in an HTTP or HTTPS web server or an Alibaba Cloud OSS bucket. Examples: oss://ros/template/demo and oss://ros/template/demo?RegionId=cn-hangzhou. If the region of the OSS bucket is not specified, the RegionId parameter value is used by default. The template can be up to 524,288 bytes in length.

You must specify either the TemplateBody parameter or the TemplateURL parameter. But you cannot specify both of them.

Response parameters

Parameter Type Example Description
Description String No description

The description of the stack template.

Parameters [{"Description": "", "Label": "param_integer", "NoEcho": "false", "ParameterKey": "param_integer", "Type": "Number"},{ "Description": "", "Label": "param_float", "NoEcho": "false", "ParameterKey": "param_float", "Type": "Number"}]

The input parameters of the stack template. The input parameters define the parameters that you need to specify to create stacks based on the template. These parameters specify information about a stack, such as username, password, and environment-related ECS instance type.

RequestId String B288A0BE-D927-4888-B0F7-B35EF84B6E6

The ID of the request.

Examples

Sample requests


http(s)://ros.aliyuncs.com/? Action=ValidateTemplate
&<Common request parameters>

Sample success responses

XML format

<ValidateTemplateResponse>
       <Description type="string">No description</Description>
       <Parameters class="array">
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">param_integer</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_integer</ParameterKey>
                     <Type type="string">Number</Type>
              </Parameter>
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">param_float</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_float</ParameterKey>
                     <Type type="string">Number</Type>
              </Parameter>
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">param_bool</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_bool</ParameterKey>
                     <Type type="string">Boolean</Type>
              </Parameter>
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">param_json_list</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_json_list</ParameterKey>
                     <Type type="string">Json</Type>
              </Parameter>
              <Parameter class="object">
                     <Default class="object">
                            <c class="array"></c>
                     </Default>
                     <Description type="string"></Description>
                     <Label type="string">param_has_default</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_has_default</ParameterKey>
                     <Type type="string">Json</Type>
              </Parameter>
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">UpdateVersion</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">UpdateVersion</ParameterKey>
                     <Type type="string">Number</Type>
              </Parameter>
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">param_str</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_str</ParameterKey>
                     <Type type="string">String</Type>
              </Parameter>
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">param_list</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_list</ParameterKey>
                     <Type type="string">CommaDelimitedList</Type>
              </Parameter>
              <Parameter class="object">
                     <Description type="string"></Description>
                     <Label type="string">param_json_dict</Label>
                     <NoEcho type="string">false</NoEcho>
                     <ParameterKey type="string">param_json_dict</ParameterKey>
                     <Type type="string">Json</Type>
              </Parameter>
       </Parameters>
       <RequestId type="string">B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
</ValidateTemplateResponse>

JSON format

{
	"Parameters":[
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"Number",
			"Label":"param_integer",
			"ParameterKey":"param_integer"
		},
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"Number",
			"Label":"param_float",
			"ParameterKey":"param_float"
		},
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"Boolean",
			"Label":"param_bool",
			"ParameterKey":"param_bool"
		},
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"Json",
			"Label":"param_json_list",
			"ParameterKey":"param_json_list"
		},
		{
			"Default":{
				"c":[]
			},
			"NoEcho":"false",
			"Description":"",
			"Type":"Json",
			"Label":"param_has_default",
			"ParameterKey":"param_has_default"
		},
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"Number",
			"Label":"UpdateVersion",
			"ParameterKey":"UpdateVersion"
		},
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"String",
			"Label":"param_str",
			"ParameterKey":"param_str"
		},
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"CommaDelimitedList",
			"Label":"param_list",
			"ParameterKey":"param_list"
		},
		{
			"NoEcho":"false",
			"Description":"",
			"Type":"Json",
			"Label":"param_json_dict",
			"ParameterKey":"param_json_dict"
		}
	],
	"Description":"No description",
	"RequestId":"B288A0BE-D927-4888-B0F7-B35EF84B6E6F"
}

Error codes

For a list of error codes, visit the API Error Center.

For more information about errors common to all operations, see Common errors.

Error code

Error message

HTTP status code

Description

InvalidTemplate

{reason}.

400

The error message returned because the specified template is invalid. reason indicates the specific reason.