All Products
Search
Document Center

Resource Orchestration Service:GetTemplateParameterConstraints

Last Updated:Jun 10, 2026

Mengkueri nilai valid parameter dalam templat.

Deskripsi operasi

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.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

ros:GetTemplateParameterConstraints

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

TemplateBody

string

No

Struktur badan templat. Badan templat harus memiliki panjang 1 hingga 524.288 byte. Jika panjang badan templat melebihi batas atas, kami menyarankan untuk menggunakan metode HTTP POST + Body Param untuk meneruskan parameter di badan permintaan guna menghindari kegagalan permintaan yang disebabkan oleh URL yang terlalu panjang.

Catatan

Anda hanya dapat menentukan salah satu parameter berikut: TemplateBody, TemplateURL, TemplateId, dan 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

ID wilayah. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah terbaru.

cn-hangzhou

TemplateURL

string

No

URL file yang berisi badan templat. URL harus mengarah ke templat yang berada di server web HTTP atau HTTPS atau di Bucket OSS Alibaba Cloud, seperti oss://ros/template/demo atau oss://ros/template/demo?RegionId=cn-hangzhou. Templat harus memiliki panjang 1 hingga 524.288 byte. Jika wilayah OSS tidak ditentukan, defaultnya sama dengan parameter RegionId.

Catatan

Anda hanya dapat menentukan salah satu parameter TemplateBody, TemplateURL, dan TemplateId.

oss://ros-template/demo

TemplateId

string

No

ID templat. Parameter ini berlaku untuk templat bersama dan templat pribadi.

Catatan

Anda hanya dapat menentukan salah satu parameter TemplateBody, TemplateURL, dan TemplateId.

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

TemplateVersion

string

No

Versi templat. Jika Anda tidak menentukan parameter ini, versi terbaru akan digunakan.

Catatan

TemplateVersion hanya valid jika TemplateId ditentukan.

v1

Parameters

array<object>

No

Parameter yang didefinisikan dalam templat.

object

No

ParameterKey

string

Yes

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

Catatan

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.

Catatan

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

cn-hangzhou-h

ParametersKeyFilter

array

No

Daftar parameter yang akan dikueri.

string

No

The parameter to be queried.

ZoneInfo

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan token, tetapi Anda harus memastikan bahwa token tersebut unik di antara permintaan yang berbeda. Token dapat memiliki panjang hingga 64 karakter, dan dapat berisi huruf, angka, tanda hubung (-), dan garis bawah (_). Untuk informasi lebih lanjut, lihat Cara memastikan idempotensi.

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

ParametersOrder

array

No

Dependensi parameter.

string

No

The order of the parameter dependency.

Catatan

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

["ZoneId", "InstanceType"]

StackId

string

No

ID stack.

Jika Anda menentukan parameter ini, batasan parameter untuk skenario Peningkatan atau menurunkan spesifikasi akan dikueri.

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

Elemen respons

Element

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.

array<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.

Catatan

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.

Catatan

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.

Catatan

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.

Catatan

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.

Catatan

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

Contoh

Respons sukses

JSONformat

{
  "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"
        }
      ]
    }
  ]
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.