Call /stacks/preview by POST to preview the stack information of the specified template.
Request parameters
Name
Location
Type
Required
Description
x-acs-region-id
header
String
Yes
Region where the stack is to be created. See ROS region list.
Name
body
String
Yes
Name of the stack, which must comply with the regular expression ^[a-zA-Z][a-zA-Z0-9_.-]*$. It can contain up to 255 characters.
Template
body
JSON
Yes
Template is in JSON format. Currently, the maximum template size is 512 KB by default. The parameter value is adjustable.
Parameters
body
JSON
Yes
Parameters required to create the stack. The keys must be specified in the template.
DisableRollback
body
Boolean
No
Whether to disable rollback when the stack fails to be created. “True” indicates that rollback is disabled. That is, rollback is not performed when the stack creation fails. “False” indicates that rollback is not disabled. That is, rollback is performed when the stack creation fails.
TimeoutMins
body
Integer
Yes
Timeout time for stack creation, in minutes. The default value is 60.
Returned parameters
Name
Parameter type
Description
Description
String
Stack description.
Updated
String
Update time, which follows the ISO8601 standard and uses UTC time. The format is YYYY-MM-DDThh:mm:ssZ.
Parameters
JSON
Stack parameter set in JSON format.
Created
String
Stack creation time, which follows the ISO8601 standard and uses UTC time. The format is YYYY-MM-DDThh:mm:ssZ.
Region
String
Region where the stack is located.
TemplateDescription
String
Template description.
Webhook
String
Custom callback function.
Id
String
Stack ID.
Resources
JSON
Detailed information about stack resources, which is a resource set in JSON format.
Name
String
Stack name.
DisableRollback
Boolean
Whether to disable rollback when the stack fails to be created. “True” indicates that rollback is disabled. That is, rollback is not performed when the stack creation fails. “False” indicates that rollback is not disabled. That is, rollback is performed when the stack creation fails.
TimeoutMins
Integer
Timeout time for stack creation, in minutes.
Error codes
Error code
Description
HTTP status code
Meaning
InternalError
Server error.
500
Server-side unknown exception.
NotSupported
%(feature)s is not supported.
404
Unsupported parameter.
InvalidTemplateVersion
Template version was not provided.
400
Invalid template version.
InvalidTemplateVersion
Ambiguous versions (%s).
400
Invalid template version.
InvalidTemplateSection
The Parameter (%(key)s) has no attributes.
400
Incorrect template attributes.
StackValidationFailed
Each Resource must contain a Type key.
400
Resources must contain the Type attribute.
StackValidationFailed
Resources must contain Resource. Found a [%s] instead.
400
Resources must contain Resource.
StackValidationFailed
Invalid deletion policy “%s”.
400
Invalid deletion policy.
StackValidationFailed
“%s” deletion policy not supported.
400
Invalid deletion policy.
StackValidationFailed
Unknown Property %s.
400
Unknown property.
InvalidSchemaError
Property %(prop)s: %(ua)s and %(im)s cannot both be True.
400
Incorrect template format.
Example
Request example
POST http://ros.aliyuncs.com/stacks/preview HTTP/1.1