All Products
Search
Document Center

ValidateTemplateContent

Last Updated: Sep 02, 2019

You can call this operation to check whether a template is valid.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateTemplate The operation that you want to perform. Set this parameter to
ValidateTemplateContent.
Content String Yes {“FormatVersion”: “OOS-2019-06-01”, “Description”: “Describe instances of given status”, “Parameters”: {“Status”: {“Type”: “String”, “Description”: “(Required) The status of the Ecs instance.”}}, “Tasks”: [{“Properties”: {“Parameters”: {“Status”: “{{ Status }}”}, “API”: “DescribeInstances”, “Service”: “Ecs”}, “Name”: “foo”, “Action”: “ACS::ExecuteApi”}]} The content of the template. The content must be in JSON or YAML format. Length constraint: Maximum length of 64 KB.

Response parameters

Parameter Type Example Description
RequestId String ADF2066B-4017-4EF0-861C-C0FF3A9F1ED4 The ID of the request.
Outputs Map {} The output of the template.
Parameters Map {
“Status”: {
“Description”: “(Required) The status of the Ecs instance.”,
“Type”: “String”
}
}
The parameters of the template.
RamRole String OOSServiceRole The role of the RAM user.
Tasks String - The tasks defined in the template.
└ Name String foo The name of the task.
└ Properties Map - The properties of the task.
└ API String DescribeInstances The name of the operation.
└ Parameters Map {
“Status”: “{{ Status }}”
}
The parameters of the operation.
└ Service String ECS The name of the service.

Examples

Sample request

  1. https://oos.cn-hangzhou.aliyuncs.com/?Action=ValidateTemplateContent
  2. &Content=%7B%22FormatVersion%22%3A+%22OOS-2019-06-01%22%2C+%22Description%22%3A+%22Descirbe+instances+of+given+status%22%2C+%22Parameters%22%3A+%7B%22Status%22%3A+%7B%22Type%22%3A+%22String%22%2C+%22Description%22%3A+%22%28Required%29+The+status+of+the+Ecs+instance.%22%7D%7D%2C+%22Tasks%22%3A+%5B%7B%22Properties%22%3A+%7B%22Parameters%22%3A+%7B%22Status%22%3A+%22%7B%7B+Status+%7D%7D%22%7D%2C+%22API%22%3A+%22DescribeInstances%22%2C+%22Service%22%3A+%22ECS%22%7D%2C+%22Name%22%3A+%22describeInstances%22%2C+%22Action%22%3A+%22ACS%3A%3AExecuteAPI%22%7D%5D%7D
  3. &<Common request parameters>

Sample success response
JSON format

  1. {
  2. "RequestId": "ADF2066B-4017-4EF0-861C-C0FF3A9F1ED4",
  3. "Outputs": {},
  4. "Parameters": {
  5. "Status": {
  6. "Description": "(Required) The status of the Ecs instance.",
  7. "Type": "String"
  8. }
  9. },
  10. "RamRole": "OOSServiceRole",
  11. "Tasks": [
  12. {
  13. "Name": "foo",
  14. "Properties": {
  15. "API": "DescribeInstances",
  16. "Parameters": {
  17. "Status": "{{ Status }}"
  18. },
  19. "Service": "Ecs"
  20. }
  21. }
  22. ]
  23. }

Error codes

Error code HTTP status code Error message Description
InvalidVersion 400 Specified parameter Version is not valid. The error message returned because the specified version is invalid. Specify a valid version in the URL and try again.
InvalidAction.NotFound 400 Specified api is not found, please check your url and method. The error message returned because the specified operation does not exist. Enter the correct Action in the URL.
Throttling.User 400 Request was denied due to user flow control. The error message returned because too many requests have been sent over a short period of time. Try again later.
User.NoPermission 401 User has no permission to do the action: ({api_name}) The error message returned because the user does not have the permission to call this operation. Check whether the current user has the permission to call the OOS API in the RAM console.
InvalidStsToken 400 Invalid STS token to do the action: ({api_name}) The error message returned because the specified STS token is invalid.
ExpiredStsToken 400 Expired STS token to do the action: ({api_name}) The error message returned because the specified STS token has expired.
InvalidAccountType 400 The account type ({account_type}) was not supported. The error message returned because the specified account type is not supported.
TemplateValidationError 400 {reason} The error message returned because the template failed the validation due to violations of data type, value range, or other constraints.
InvalidTemplateDependency 400 The specified dependency {location} key: {key} is not in {keys} The error message returned because the specified parameter name is not defined in the template.