SetVmClockTrack
API Request
URLs
PUT zstack/v1/vm-instances/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"setVmClockTrack": {
"track": "guest"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"setVmClockTrack":{"track":"guest"}}' http://localhost:8080/zstack/v1/vm-instances/cc0a313462243900b6c843ff427b7f0e/actionsRequest Parameters
| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 4.1.0 | |
| track | String | body (contained in the setVmClockTrack structure) |
|
4.1.0 | |
| systemTags | List | body | Optional. The system tags. | 4.1.0 | |
| userTags | List | body | Optional. The user tags. | 4.1.0 |
API Response
If the API succeeded, an empty JSON structure {} is returned. If the API
failed, the returned JSON structure includes an error field. For
example,
{
"inventory": {
"uuid": "19d64f55a9723e59849c0f9357a0dded",
"name": "Test-VM",
"description": "web server VM",
"zoneUuid": "553326a3b554380ca4e4b2976efa4df5",
"clusterUuid": "c9a8ba243c5a3d59b144e4e1ace143a2",
"imageUuid": "e4297acdd9b43e3f9b7a8ec74211a3f2",
"hostUuid": "f841ef12962037369ea4d8f3ba4c9c28",
"lastHostUuid": "3b6273ea6b1a384584178e11f05bf1f0",
"instanceOfferingUuid": "9ce1349c65ff3c80a423267837f5f34e",
"rootVolumeUuid": "5319e0ae2b483949bf25b059a674dbc8",
"platform": "Linux",
"defaultL3NetworkUuid": "c715b758cd843ac997ccdfbbcc9097cc",
"type": "UserVm",
"hypervisorType": "KVM",
"memorySize": 8.589934592E9,
"cpuNum": 1.0,
"allocatorStrategy": "LastHostPreferredAllocatorStrategy",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Stopped",
"vmNics": [
{
"uuid": "8585080b6b5236a5875e8162c062e551",
"vmInstanceUuid": "19d64f55a9723e59849c0f9357a0dded",
"usedIpUuid": "c0bbe89468fa3b2aa6dc4e8aaa6df3f7",
"l3NetworkUuid": "c715b758cd843ac997ccdfbbcc9097cc",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"allVolumes": [
{
"uuid": "5319e0ae2b483949bf25b059a674dbc8",
"name": "Root-Volume-For-VM-19d64f55a9723e59849c0f9357a0dded",
"primaryStorageUuid": "0e4e3cf961873074b8b3eca3bc693ece",
"vmInstanceUuid": "19d64f55a9723e59849c0f9357a0dded",
"diskOfferingUuid": "f1b95ad6d26e336e8809764ec2936fd2",
"rootImageUuid": "e4297acdd9b43e3f9b7a8ec74211a3f2",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-5319e0ae2b483949bf25b059a674dbc8/5319e0ae2b483949bf25b059a674dbc8.qcow2",
"type": "Root",
"format": "qcow2",
"size": 1.073741824E11,
"actualSize": 2.147483648E10,
"deviceId": 0.0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.1.0 |
| inventory | VmInstanceInventory | See inventory. | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | The brief description of the error. | 4.1.0 |
| details | String | The details about the error. | 4.1.0 |
| elaboration | String | The reserved field. Default value: null. | 4.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.1.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.1.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.1.0 |
| name | String | The resource name. | 4.1.0 |
| description | String | The detailed description of the resource. | 4.1.0 |
| zoneUuid | String | The zone UUID. | 4.1.0 |
| clusterUuid | String | The cluster UUID. | 4.1.0 |
| imageUuid | String | The image UUID. | 4.1.0 |
| hostUuid | String | The host UUID. | 4.1.0 |
| lastHostUuid | String | 4.1.0 | |
| instanceOfferingUuid | String | The instance offering UUID. | 4.1.0 |
| rootVolumeUuid | String | The root volume UUID. | 4.1.0 |
| platform | String | 4.1.0 | |
| defaultL3NetworkUuid | String | 4.1.0 | |
| type | String | 4.1.0 | |
| hypervisorType | String | 4.1.0 | |
| memorySize | Long | 4.1.0 | |
| cpuNum | Integer | 4.1.0 | |
| cpuSpeed | Long | 4.1.0 | |
| allocatorStrategy | String | 4.1.0 | |
| createDate | Timestamp | The creation time. | 4.1.0 |
| lastOpDate | Timestamp | The last update time. | 4.1.0 |
| state | String | 4.1.0 | |
| vmNics | List | See vmNics. | 4.1.0 |
| allVolumes | List | See allVolumes. | 4.1.0 |
#vmNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.1.0 |
| vmInstanceUuid | String | The VM UUID. | 4.1.0 |
| l3NetworkUuid | String | The L3 network UUID. | 4.1.0 |
| ip | String | The cluster UUID. | 4.1.0 |
| mac | String | The image UUID. | 4.1.0 |
| hypervisorType | String | The host UUID. | 4.1.0 |
| netmask | String | 4.1.0 | |
| gateway | String | The instance offering UUID. | 4.1.0 |
| metaData | String | The root volume UUID. | 4.1.0 |
| ipVersion | Integer | The cluster UUID. | 4.1.0 |
| deviceId | Integer | The image UUID. | 4.1.0 |
| type | String | The host UUID. | 4.1.0 |
| createDate | Timestamp | The creation time. | 4.1.0 |
| lastOpDate | Timestamp | The last update time. | 4.1.0 |
| usedIps | List | See usedIps. | 4.1.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.1.0 |
| ipRangeUuid | String | The IP range UUID. | 4.1.0 |
| l3NetworkUuid | String | The L3 network UUID. | 4.1.0 |
| ipVersion | Integer | The IP version. | 4.1.0 |
| ip | String | The IP address. | 4.1.0 |
| netmask | String | The netmask. | 4.1.0 |
| gateway | String | The gateway. | 4.1.0 |
| usedFor | String | 4.1.0 | |
| ipInLong | long | 4.1.0 | |
| vmNicUuid | String | The VM NIC UUID. | 4.1.0 |
| createDate | Timestamp | The creation time. | 4.1.0 |
| lastOpDate | Timestamp | The last update time. | 4.1.0 |
#allVolumes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.1.0 |
| name | String | The resource name. | 4.1.0 |
| description | String | The detailed description of the resource. | 4.1.0 |
| primaryStorageUuid | String | The primary storage UUID. | 4.1.0 |
| vmInstanceUuid | String | The VM UUID. | 4.1.0 |
| diskOfferingUuid | String | The disk offering UUID. | 4.1.0 |
| rootImageUuid | String | The root volume image UUID. | 4.1.0 |
| installPath | String | The installation path of the volume on the primary storage. | 4.1.0 |
| type | String | The volume type. | 4.1.0 |
| format | String | The volume type. | 4.1.0 |
| size | Long | The volume size. | 4.1.0 |
| actualSize | Long | The actual size of the volume. | 4.1.0 |
| deviceId | Integer | 4.1.0 | |
| state | String | Indicates whether the disk is enabled. | 4.1.0 |
| status | String | The volume status. | 4.1.0 |
| createDate | Timestamp | The creation time. | 4.1.0 |
| lastOpDate | Timestamp | The last update time. | 4.1.0 |
| isShareable | Boolean | Indicates whether the volume is a shared volume. | 4.1.0 |
| volumeQos | String | The volume QoS, for example, total=1048576 | 4.1.0 |
SDK Sample
Java
SDK
SetVmClockTrackAction action = new SetVmClockTrackAction();
action.uuid = "cc0a313462243900b6c843ff427b7f0e";
action.track = "guest";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetVmClockTrackAction.Result res = action.call();Python
SDK
SetVmClockTrackAction action = SetVmClockTrackAction()
action.uuid = "cc0a313462243900b6c843ff427b7f0e"
action.track = "guest"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetVmClockTrackAction.Result res = action.call()