Modifying Template Information
Function
This API is used to modify the template information.
URI
PUT /v1/sms/vm/template/{id}
Request
Request parameters
For details about the request parameter, see Table 1.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| template | Yes | String | Template information. For details, see Table 2. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Template name |
| region | Yes | String | Region name |
| target_server_name | Yes | String | Name of the target ECS |
| availability_zone | Yes | String | AZ |
| volumetype | Yes | String | Disk type |
| vpc | Yes | Object | VPC information. The value is {} if the VPC is automatically created. For details, see Table 3. |
| security_groups | Yes | Array | Security group. The value is [] if the security group is automatically created. For details, see Table 4. |
| nics | Yes | Array | Subnet information. The value is [] if the subnet is automatically created. For details, see Table 5. |
| flavors | No | Array | ECS specifications. The value is [] if the ECS is automatically created. For details, see Table 6. |
| publicip | No | Object | EIP information. For details, see Table 7. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | VPC ID |
| name | Yes | String | VPC name |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | Security group ID |
| name | Yes | String | Security group name |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | Subnet ID |
| name | Yes | String | Subnet name |
| cidr | Yes | String | Gateway/mask |
| ip | No | String | Private IP address |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | ECS specification ID |
| name | Yes | String | ECS flavor |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | EIP ID, which is mandatory for a newly assigned one. |
| ip | No | String | EIP address, which is mandatory for a newly assigned one. |
| type | Yes | String | EIP type. The default value is 5_bgp. |
| bandwidth_size | Yes | Integer | Bandwidth size (Mbit/s). The value ranges from 1 to 2000. The minimum increment for bandwidth adjustment varies depending on the bandwidth range. The minimum increment is 1 Mbit/s if the allowed bandwidth ranges from 0 to 300 Mbit/s (with 300 Mbit/s included). The minimum increment is 50 Mbit/s if the allowed bandwidth ranges 300 Mbit/s to 1000 Mbit/s (with 1000 Mbit/s included). The minimum increment is 500 Mbit/s if the allowed bandwidth is greater than 1000 Mbit/s. NOTE: This parameter is mandatory when sharetype is set to PER and is optional when sharetype is set to WHOLE with an ID specified. |
| bandwidth_share_type | No | String | Bandwidth sharing type. Enumerated values: PER (indicates exclusive bandwidth) and WHOLE (indicates sharing). The default value is PER. |
Response
| Parameter | Type | Description |
|---|---|---|
| id | String | ID |
Example
- Example request
PUT /v1/sms/vm/template { "template": { "name": "template name", "is_template":"false",// false indicates creating a task, and true indicates saving the template. "region":"cn-north-1", "target_server_name":"target server 1", "availability_zone":"az1-dc1", //AZ name "volumetype": "DESS_SSD_FC", "vpc": { "id":"0dae26c9-9a70-4392-93f3-87d53115d171", "name":"vpc1" }, "security_groups":[ { "id":"507ca48f-814c-4293-8706-300564d54620", "name":"default" } ], "nics":[ { "id":"157ee789-03ea-45b1-a698-76c92660dd83", "name": "subnet-1637", "cidr": "192.168.0.0/24", "ip":"192.168.0.0" } ], "flavors":[ { "id": "c3.2xlarge.4", "name": "c3.2xlarge.4", } ], "publicip": { "id":"1111", "ip ":"x.x.x.x", "type": "5_bgp", "bandwidth_size":10, "bandwidth_share_type":"PER" } } } - Example response
None
Status Code
For details, see Status Code.
Error Code
For details, see Error Code.
Last Article: Adding Template Information
Next Article: Deleting a Template with a Specified ID
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.