Membuat templat. Katalog Layanan menyimpan templat berdasarkan parameter yang Anda tentukan dan mengembalikan URL templat.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
servicecatalog:CreateTemplate |
create |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateBody |
string |
Yes |
Format templat. Untuk informasi selengkapnya tentang sintaks templat, lihat Struktur Template Terraform. |
{ "ROSTemplateFormatVersion": "2015-09-01", "Transform": "Aliyun::Terraform-v1.1", "Workspace": { "main.tf": "variable \"name\" { default = \"auto_provisioning_group\"}" }, "Outputs": {} } |
| TemplateType |
string |
Yes |
Jenis templat produk. Nilai valid:
|
RosTerraformTemplate |
| TerraformVariables |
array<object> |
No |
Pengaturan variabel Template Terraform. Anda dapat mengonfigurasi variabel secara terstruktur. Katalog Layanan menerapkan pengaturan variabel ke templat. Catatan
Variabel harus didefinisikan dalam Template Terraform. |
|
|
object |
No |
|||
| VariableName |
string |
No |
The name of the variable. |
instance_type |
| Description |
string |
No |
The description of the variable. For more information about the format of variable descriptions, see Methods and suggestions for Terraform code development. |
{ "Label": { "zh-cn": "实例规格", "en": "Instance Type" }, "AllowedValues": [ "ecs.s6-c1m1.small", "ecs.s6-c1m2.large", "ecs.s6-c1m2.xlarge" ] } |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The ID of the request. |
0FEEF92D-4052-5202-87D0-3D8EC16F81BF |
| TemplateUrl |
string |
The URL of the template. |
oss://servicecatalog-cn-hangzhou/146611588617****/terraform/template/tpl-bp1217we23****/template.json |
Contoh
Respons sukses
JSONformat
{
"RequestId": "0FEEF92D-4052-5202-87D0-3D8EC16F81BF",
"TemplateUrl": "oss://servicecatalog-cn-hangzhou/146611588617****/terraform/template/tpl-bp1217we23****/template.json"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | A system error occurred. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.