Memvalidasi template yang digunakan untuk membuat stack dengan menentukan URL atau badan template.
Deskripsi operasi
This API operation validates only templates and does not involve user data. RAM authentication is not required.
This topic provides an example of how to validate a stack template. In this example, the TemplateURL of the template file is oss://ros/template/demo.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateURL |
string |
No |
Lokasi file yang berisi badan template. URL harus mengarah ke template yang berada di server web HTTP atau di bucket OSS Alibaba Cloud, seperti oss://ros/template/demo atau oss://ros/template/demo?RegionId=ap-southeast-1. Template dapat berukuran hingga 524.288 byte. Catatan
Jika Anda tidak menentukan wilayah bucket OSS, nilai parameter RegionId akan digunakan. Anda dapat menentukan TemplateBody atau TemplateURL, tetapi tidak keduanya. |
oss://ros/template/demo |
| RegionId |
string |
No |
ID wilayah template stack. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah Alibaba Cloud terbaru. |
cn-hangzhou |
| TemplateBody |
string |
No |
Struktur badan template. Badan template dapat memiliki panjang 1 hingga 524.288 byte. |
{"ROSTemplateFormatVersion":"2015-09-01"} |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Klien menghasilkan nilai, yang harus unik. Token dapat memiliki panjang hingga 64 karakter dan dapat berisi huruf, digit, tanda hubung (-), dan garis bawah (_). Untuk informasi lebih lanjut, lihat Cara memastikan idempotensi. |
123e4567-e89b-12d3-a456-42665544**** |
| ValidationOption |
string |
No |
Apakah akan mengaktifkan validasi tambahan untuk template. Nilai valid:
Catatan
Dibandingkan dengan EnableTerraformValidation, EnableFastTerraformValidation lebih cepat tetapi kurang komprehensif. |
None |
| UpdateInfoOptions |
array |
No |
Daftar opsi untuk informasi pembaruan. Daftar dapat berisi hingga dua opsi. |
|
|
string |
No |
The option for the update information. This option is used to control the generation of information about the stack update. Valid values:
Valid values:
|
ConsiderCondition |
Untuk informasi lebih lanjut tentang parameter permintaan umum, lihat Parameter umum.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| Description |
string |
The description of the stack template. |
No description |
| Parameters |
array<object> |
The list of input parameters. |
|
|
object |
The input parameter. |
[{"Description": "", "Label": "param_integer", "NoEcho": "false", "ParameterKey": "param_integer", "Type": "Number"},{ "Description": "", "Label": "param_float", "NoEcho": "false", "ParameterKey": "param_float", "Type": "Number"}] |
|
| RequestId |
string |
The request ID. |
B288A0BE-D927-4888-B0F7-B35EF84B6E6F |
| Outputs |
array<object> |
The list of template outputs. |
|
|
object |
|||
| OutputKey |
string |
The name of the template output. |
instance_id |
| Description |
string |
The description of the template output. |
The instance ID of my ECS. |
| Label |
string |
The alias of the template output. |
Instance ID |
| ResourceTypes |
object |
The information about the resource types that are used in the template. |
|
| Resources |
array |
The list of regular resource types. Duplicates are removed. |
|
|
string |
The regular resource type. |
ALIYUN::ECS::InstanceGroup |
|
| DataSources |
array |
The list of data source resource types. Duplicates are removed. |
|
|
string |
The data source resource type. |
DATASOURCE::VPC::Vpcs |
|
| Resources |
array<object> |
The list of regular resources that are defined in the template. Catatan
|
|
|
object |
|||
| ResourceType |
string |
The regular resource type. |
ALIYUN::ECS::InstanceGroup |
| ResourcePath |
string |
The path of the regular resource. The path is usually the same as the resource name. |
server |
| LogicalResourceIdPattern |
string |
The string pattern for the logical ID of the regular resource. For ROS templates, the following two cases exist:
For resources and modules in Terraform templates, the following two cases exist:
The following examples show the values for Terraform templates:
|
server |
| UpdateInfo |
object |
The information about the stack update. This parameter is not returned if Disabled is specified for UpdateInfoOptions. |
|
| ParametersAllowedToBeModified |
array |
The list of parameters that can be modified. |
|
|
string |
A parameter that can be modified. When you update a stack, if the template remains unchanged, you can change the value of this parameter without causing a validation error. |
param1 |
|
| ParametersCauseInterruptionIfModified |
array |
The list of parameters that cause resource interruptions if they are modified. Catatan
|
|
|
string |
A parameter that causes a resource interruption if it is modified. When you update a stack, if the template remains unchanged, changing the value of this parameter will cause a resource interruption. |
param1 |
|
| ParametersConditionallyAllowedToBeModified |
array |
The list of parameters that may be allowed to be modified. |
|
|
string |
A parameter that may be allowed to be modified. When you update a stack, if the template remains unchanged, whether a validation error is caused by a change to the value of this parameter depends on the new value. |
param2 |
|
| ParametersConditionallyCauseInterruptionIfModified |
array |
The list of parameters that may cause resource interruptions if they are modified. Catatan
|
|
|
string |
A parameter that may cause a resource interruption if it is modified. When you update a stack, if the template remains unchanged, changing the value of this parameter may cause a resource interruption. This depends on the new value and the update behavior of the resource. |
param2 |
|
| ParametersNotAllowedToBeModified |
array |
The list of parameters that cannot be modified. |
|
|
string |
A parameter that cannot be modified. When you update a stack, if the template remains unchanged, changing the value of this parameter will cause a validation error. |
param3 |
|
| ParametersUncertainlyAllowedToBeModified |
array |
The list of parameters whose modification permissions are uncertain. |
|
|
string |
A parameter whose modification permission is uncertain. When you update a stack, if the template remains unchanged, whether a validation error is caused by a change to the value of this parameter can be determined only at runtime. |
param4 |
|
| ParametersUncertainlyCauseInterruptionIfModified |
array |
The list of parameters that cause resource interruptions under uncertain conditions if they are modified. Catatan
|
|
|
string |
A parameter that causes a resource interruption under uncertain conditions if it is modified. When you update a stack, if the template remains unchanged, whether a resource interruption is caused by a change to the value of this parameter can be determined only at runtime. |
param4 |
|
| ParametersCauseReplacementIfModified |
array |
The list of parameters that cause replacement updates if they are modified. Catatan
|
|
|
string |
A parameter that causes a replacement update if it is modified. When you update a stack, if the template remains unchanged, changing the value of this parameter will cause a replacement update. |
param5 |
|
| ParametersConditionallyCauseReplacementIfModified |
array |
The list of parameters that may cause replacement updates if they are modified. Catatan
|
|
|
string |
A parameter that may cause a replacement update if it is modified. When you update a stack, if the template remains unchanged, changing the value of this parameter may cause a replacement update. This depends on the new value. |
param6 |
|
| ParametersUncertainlyCauseReplacementIfModified |
array |
The list of parameters that cause replacement updates under uncertain conditions if they are modified. Catatan
|
|
|
string |
A parameter that causes a replacement update under uncertain conditions if it is modified. When you update a stack, if the template remains unchanged, whether a replacement update is caused by a change to the value of this parameter can be determined only at runtime. |
param7 |
Contoh
Respons sukses
JSONformat
{
"Description": "No description",
"Parameters": [
[
{
"Description": "",
"Label": "param_integer",
"NoEcho": "false",
"ParameterKey": "param_integer",
"Type": "Number"
},
{
"Description": "",
"Label": "param_float",
"NoEcho": "false",
"ParameterKey": "param_float",
"Type": "Number"
}
]
],
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
"Outputs": [
{
"OutputKey": "instance_id",
"Description": "The instance ID of my ECS.",
"Label": "Instance ID"
}
],
"ResourceTypes": {
"Resources": [
"ALIYUN::ECS::InstanceGroup"
],
"DataSources": [
"DATASOURCE::VPC::Vpcs"
]
},
"Resources": [
{
"ResourceType": "ALIYUN::ECS::InstanceGroup",
"ResourcePath": "server",
"LogicalResourceIdPattern": "server"
}
],
"UpdateInfo": {
"ParametersAllowedToBeModified": [
"param1"
],
"ParametersCauseInterruptionIfModified": [
"param1"
],
"ParametersConditionallyAllowedToBeModified": [
"param2"
],
"ParametersConditionallyCauseInterruptionIfModified": [
"param2"
],
"ParametersNotAllowedToBeModified": [
"param3"
],
"ParametersUncertainlyAllowedToBeModified": [
"param4"
],
"ParametersUncertainlyCauseInterruptionIfModified": [
"param4"
],
"ParametersCauseReplacementIfModified": [
"param5"
],
"ParametersConditionallyCauseReplacementIfModified": [
"param6"
],
"ParametersUncertainlyCauseReplacementIfModified": [
"param7"
]
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.