Adding Template Information
Function
This API is used to add information to a template.
URI
POST /v1/sms/vm/template
Request
Request parameters
For details about the request parameters, see Table 1.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
template |
Yes |
String |
Template information. For details, see Table 2. |
disks |
Yes |
String |
Disk information. For details, see Table 7. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Template name |
is_template |
Yes |
Boolean |
Whether the object is a template. The value is true if a user saves the template, and false if the user does not save the template and directly create a task. |
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. |
publicip |
No |
Object |
EIP information. For details, see Table 6. |
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 |
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
{ "template": { "name": "template name", "is_template":"false",// false indicates creating a task, and true indicates saving the template. "region":"my-kualalumpur-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":c3.2xlarge.4, "publicip": { "id":"1111", "ip ":"x.x.x.x", "type": "5_bgp", "bandwidth_size":10, "bandwidth_share_type":"PER" } }, "disks":[ { "index":0, "name":"Disk 01", "disktype":"DESS_SSD_FC", "size":40 } ] }
- Example response
{ "id": "aaaa-bbbb-cccc-dddd" }
Status Codes
See Status Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot