All Products
Search
Document Center

Resource Orchestration Service:GetTemplateParameterConstraints

Last Updated:Aug 12, 2025

Queries the valid values of the parameters in a template.

Operation description

Description

This topic provides an example of how to query the valid values for the ZoneInfo parameter in a template specific to the China (Hangzhou) region. The template is { "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "ZoneInfo": { "Type": "String" }, "InstanceType": { "Type": "String" } }, "Resources": { "ECS": { "Type": "ALIYUN::ECS::Instance", "Properties": { "ZoneId": { "Ref": "ZoneInfo" }, "InstanceType": { "Ref": "InstanceType" } } } } }.

For more information about the queryable parameters and template content, refer to Query parameter constraints.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:GetTemplateParameterConstraints

get

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

TemplateBody

string

No

The structure of the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body exceeds the upper limit, we recommended to use the HTTP POST + Body Param method to pass the parameter in the request body to avoid request failures caused by an excessively long URL.

Note

You can specify only one of the following parameters: TemplateBody, TemplateURL, TemplateId, and TemplateScratchId.

{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "ZoneInfo": { "Type": "String" }, "InstanceType": { "Type": "String" } }, "Resources": { "ECS": { "Type": "ALIYUN::ECS::Instance", "Properties": { "ZoneId": { "Ref": "ZoneInfo" }, "InstanceType": { "Ref": "InstanceType" } } } } }

RegionId

string

Yes

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

cn-hangzhou

TemplateURL

string

No

The URL of the file that contains the template body. The URL must point to a template that is located on an HTTP or HTTPS web server or in an Alibaba Cloud OSS bucket, such as oss://ros/template/demo or oss://ros/template/demo?RegionId=cn-hangzhou. The template must be 1 to 524,288 bytes in length. If the OSS region is not specified, the default is the same as the RegionId parameter.

Note

You can specify only one of the TemplateBody, TemplateURL, and TemplateId parameters.

oss://ros-template/demo

TemplateId

string

No

The ID of the template. This parameter applies to shared templates and private templates.

Note

You can specify only one of the TemplateBody, TemplateURL, and TemplateId parameters.

5ecd1e10-b0e9-4389-a565-e4c15efc****

TemplateVersion

string

No

The version of the template. If you do not specify this parameter, the latest version is used.

Note

TemplateVersion is valid only when TemplateId is specified.

v1

Parameters

array<object>

No

The parameters that are defined in the template.

object

No

ParameterKey

string

Yes

The name of the parameter that is defined in the template.

Note

The Parameters parameter is optional. If you specify Parameters, you must specify ParameterKey.

ZoneInfo

ParameterValue

string

Yes

The value of the parameter that is defined in the template.

Note

The Parameters parameter is optional. If you specify Parameters, you must specify ParameterValue.

cn-hangzhou-h

ParametersKeyFilter

array

No

The list of parameters to be queried.

string

No

The parameter to be queried.

ZoneInfo

ClientToken

string

No

A client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, refer to How to ensure idempotence.

123e4567-e89b-12d3-a456-42665544****

ParametersOrder

array

No

The dependency of the parameters.

string

No

The order of the parameter dependency.

Note

By default, the dependency of the parameters is specified by the Metadata parameter in the template.

["ZoneId", "InstanceType"]

StackId

string

No

The ID of the stack.

If you specify this parameter, the parameter constraints for an upgrade or downgrade scenario are queried.

c754d2a4-28f1-46df-b557-9586173a****

Response parameters

Parameter

Type

Description

Example

object

RequestId

string

The ID of the request.

9816785B-BCF8-514D-8B76-C1EC2BC954FC

ParameterConstraints

array<object>

The information about the parameter constraints.

object

ParameterKey

string

The name of the parameter.

ZoneInfo

Type

string

The type of the parameter.

String

AllowedValues

array

The list of valid values of the parameter.

string

The valid value of the parameter.

cn-hangzhou-h

Behavior

string

The behavior of the parameter. Valid values:

  • NoLimit: The parameter has no limit on its valid values.

  • NotSupport: The valid values of the parameter cannot be queried.

  • QueryError: The query failed.

Note

If AllowedValues is not returned, Behavior and BehaviorReason are returned to indicate the behavior of the parameter and the reason for the behavior.

NoLimit

BehaviorReason

string

The reason for the behavior of the parameter.

No resource property refer to the parameter

AssociationParameterNames

array

The names of the associated parameters.

string

The name of an associated parameter.

InstanceType

IllegalValueByParameterConstraints

array

The values that do not match the parameter constraints.

Note

If AllowedValues is returned, IllegalValueByParameterConstraints and IllegalValueByRules are returned to indicate the invalid values that are filtered out by the parameter constraints and template rules.

any

The value that does not match the parameter constraints.

Note

If AllowedValues is returned, the invalid values that are filtered out by the parameter constraints and template rules are returned in the IllegalValueByParameterConstraints and IllegalValueByRules parameters.

cn-hangzhou-h

IllegalValueByRules

array

The values that do not match the template rules.

Note

If AllowedValues is returned, IllegalValueByParameterConstraints and IllegalValueByRules are returned to indicate the invalid values that are filtered out by the parameter constraints and template rules.

any

The value that does not match the template rules.

Note

If AllowedValues is returned, the invalid values that are filtered out by the parameter constraints and template rules are returned in the IllegalValueByParameterConstraints and IllegalValueByRules parameters.

cn-hangzhou-h

NotSupportResources

array<object>

The details of the unsupported resources.

object

The details of the unsupported resource.

This parameter is returned when the value of Behavior is NotSupport.

ResourceType

string

The resource type.

ALIYUN::ECS::InstanceGroup

PropertyName

string

The name of the resource property.

InstanceName

QueryErrors

array<object>

The details of the query failure.

object

The details of the query failure.

This parameter is returned when the value of Behavior is QueryError.

ErrorMessage

string

The error details.

ALIYUN::ECS::InstanceGroup

ResourceName

string

The name of the resource.

MyECS

ResourceType

string

The resource type.

InstanceType is needed while query DataDisk

OriginalConstraints

array<object>

The information about the original constraints.

object

The information about the original constraint.

ResourceName

string

The name of the resource that is defined in the template.

MyECS

AllowedValues

array

The list of valid values of the parameter.

any

The valid value of the parameter.

cn-hangzhou-a

ResourceType

string

The resource type.

ALIYUN::ECS::InstanceGroup

PropertyName

string

The name of the property.

ZoneId

Behavior

string

The behavior of the parameter.

QueryError

BehaviorReason

string

The reason for the behavior of the parameter.

No resource property refer to the parameter

PropertiesData

string

The query parameters that are used during the query of parameter constraints.

{ "ZoneId":"cn-hangzhou-h", "SystemDiskCategory":"cloud_essd" }

RequestInfo

string

The request information of the operation that is called to query the parameter constraints of a cloud service.

ecs:2014-05-26:DescribeAvailableResource:4C5B6929-EB64-5086-A821-9CCB553A5AE9

QueryTimeoutDetails

array<object>

The details of the query timeout.

object

The details of the query timeout.

ResourceType

string

The resource type.

ALIYUN::RDS::DBInstance

ResourceName

string

The name of the resource.

rds

ErrorMessage

string

The error message.

query property SlaveZoneIds.* in resource rds error, error message: query 8 seconds timeout

Examples

Success response

JSON format

{
  "RequestId": "9816785B-BCF8-514D-8B76-C1EC2BC954FC",
  "ParameterConstraints": [
    {
      "ParameterKey": "ZoneInfo",
      "Type": "String",
      "AllowedValues": [
        "cn-hangzhou-h"
      ],
      "Behavior": "NoLimit",
      "BehaviorReason": "No resource property refer to the parameter",
      "AssociationParameterNames": [
        "InstanceType"
      ],
      "IllegalValueByParameterConstraints": [
        "cn-hangzhou-h"
      ],
      "IllegalValueByRules": [
        "cn-hangzhou-h"
      ],
      "NotSupportResources": [
        {
          "ResourceType": "ALIYUN::ECS::InstanceGroup",
          "PropertyName": "InstanceName"
        }
      ],
      "QueryErrors": [
        {
          "ErrorMessage": "ALIYUN::ECS::InstanceGroup",
          "ResourceName": "MyECS",
          "ResourceType": "InstanceType is needed while query DataDisk"
        }
      ],
      "OriginalConstraints": [
        {
          "ResourceName": "MyECS",
          "AllowedValues": [
            "cn-hangzhou-a"
          ],
          "ResourceType": "ALIYUN::ECS::InstanceGroup\n",
          "PropertyName": "ZoneId",
          "Behavior": "QueryError",
          "BehaviorReason": "No resource property refer to the parameter",
          "PropertiesData": "{\n    \"ZoneId\":\"cn-hangzhou-h\",\n    \"SystemDiskCategory\":\"cloud_essd\"\n}",
          "RequestInfo": "ecs:2014-05-26:DescribeAvailableResource:4C5B6929-EB64-5086-A821-9CCB553A5AE9"
        }
      ],
      "QueryTimeoutDetails": [
        {
          "ResourceType": "ALIYUN::RDS::DBInstance",
          "ResourceName": "rds",
          "ErrorMessage": "query property SlaveZoneIds.* in resource rds error, error message: query 8 seconds timeout"
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.