VM Related Interfaces

Update VM Template

PUT/zstack/v1/vm-instances/templatedVmInstance/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateTemplatedVmInstance": {
    "name": "templated-vm",
    "description": "description",
    "cpuNum": 1,
    "memorySize": 1073741824
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateTemplatedVmInstance":{"name":"templated-vm","description":"description","cpuNum":1,"memorySize":1073741824}}' \
http://localhost:8080/zstack/v1/vm-instances/templatedVmInstance/d6d9c2ac923b34cd9c060b6dbb68757c/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlUUID of the resource, uniquely identifying the resource 4.2.6
name (Optional)Stringbody(included in the updateTemplatedVmInstance structure)Resource name 4.2.6
description (Optional)Stringbody(included in the updateTemplatedVmInstance structure)Detailed description of the resource 4.2.6
cpuNum (Optional)Integerbody(included in the updateTemplatedVmInstance structure)CPU Number 4.2.6
memorySize (Optional)Longbody(included in the updateTemplatedVmInstance structure)Memory Size 4.2.6
systemTags (Optional)ListbodySystem Tag 4.2.6
userTags (Optional)ListbodyUser Tag 4.2.6

API Response

Response Example

{
  "inventory": {
    "uuid": "27fc31bc109231a799d943c0cf320f24",
    "name": "templatedVmInstance",
    "zoneUuid": "be052721ef9c35e4a4385418e4316d04",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.2.6
inventoryTemplatedVmInstanceInventoryFor details, see inventory4.2.6
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error4.2.6

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource4.2.6
nameStringResource name4.2.6
zoneUuidStringData Center UUID4.2.6
createDateTimestampCreate time4.2.6
lastOpDateTimestampLast modification time4.2.6

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

UpdateTemplatedVmInstanceAction action = new UpdateTemplatedVmInstanceAction();
action.uuid = "d6d9c2ac923b34cd9c060b6dbb68757c";
action.name = "templated-vm";
action.description = "description";
action.cpuNum = 1;
action.memorySize = 1073741824;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateTemplatedVmInstanceAction.Result res = action.call();

Python SDK

UpdateTemplatedVmInstanceAction action = UpdateTemplatedVmInstanceAction()
action.uuid = "d6d9c2ac923b34cd9c060b6dbb68757c"
action.name = "templated-vm"
action.description = "description"
action.cpuNum = 1
action.memorySize = 1073741824
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateTemplatedVmInstanceAction.Result res = action.call()