UpdateConsolePassword
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.
{
"updateConsolePassword": {
"password": "new-password-123"
},
"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 '{"updateConsolePassword":{"password":"new-password-123"}}' \
http://localhost:8080/zstack/v1/vm-instances/efa69f6385e93855a2b07f4de8908fb1/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource Uuid. | 5.4.2 | |
| password | String | body(contain in the updateConsolePasswordstructure) | The password. | 5.4.2 | |
| systemTags | List | body | Optional. The system tags. | 5.4.2 | |
| userTags | List | body | Optional. The user tags. | 5.4.2 |
API Response
Sample Response
{
"inventory": {
"uuid": "12e95e232863327c846cfd4752a18abd",
"name": "Test-VM-Updated",
"state": "Running"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 5.4.2 |
| inventory | VmInstanceInventory | See inventory. | 5.4.2 |
| error | ErrorCode | Error code, null if operation succeeds, non-null if operation fails, see error. | 5.4.2 |
#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. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.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. | 3.7.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| zoneUuid | String | The zone Uuid. | 0.6 |
| clusterUuid | String | The cluster Uuid. | 0.6 |
| imageUuid | String | The image Uuid. | 0.6 |
| hostUuid | String | The host Uuid. | 0.6 |
| lastHostUuid | String | The last host UUID. | 0.6 |
| instanceOfferingUuid | String | The instance offering Uuid. | 0.6 |
| rootVolumeUuid | String | The root volume Uuid. | 0.6 |
| platform | String | The platform. | 0.6 |
| architecture | String | The architecture. | 0.6 |
| defaultL3NetworkUuid | String | The default L3 network UUID. | 0.6 |
| type | String | The resource type. | 0.6 |
| hypervisorType | String | The hypervisor type. | 0.6 |
| memorySize | Long | The memory size. | 0.6 |
| cpuNum | Integer | The number of CPUs. | 0.6 |
| cpuSpeed | Long | The CPU speed. | 0.6 |
| allocatorStrategy | String | The allocator strategy. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| state | String | The resource state. | 0.6 |
| guestOsType | String | The guest OS type. | 4.1.2 |
| vmNics | List | See vmNics. | 0.6 |
| allVolumes | List | See | 0.6 |
| vmCdRoms | List | See vmCdRoms. | 0.6 |
#vmNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource Uuid. | 4.7.13 |
| vmInstanceUuid | String | The VM instance Uuid. | 4.7.13 |
| l3NetworkUuid | String | The L3 network Uuid. | 4.7.13 |
| ip | String | The IP address. | 4.7.13 |
| mac | String | The MAC address. | 4.7.13 |
| hypervisorType | String | The hypervisor type. | 4.7.13 |
| netmask | String | The netmask. | 4.7.13 |
| gateway | String | The gateway IP address. | 4.7.13 |
| metaData | String | The metadata. | 4.7.13 |
| ipVersion | Integer | The IP version. | 4.7.13 |
| driverType | String | The driver type. | 4.7.13 |
| internalName | String | The internal name. | 4.7.13 |
| deviceId | Integer | The device ID. | 4.7.13 |
| type | String | The resource type. | 4.7.13 |
| state | String | The NIC state. | 4.7.13 |
| createDate | Timestamp | The creation date. | 4.7.13 |
| lastOpDate | Timestamp | The last operation date. | 4.7.13 |
| usedIps | List | See usedIps. | 4.7.13 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource Uuid. | 5.0.0 |
| ipRangeUuid | String | The IP range Uuid. | 5.0.0 |
| l3NetworkUuid | String | The L3 network Uuid. | 5.0.0 |
| ipVersion | Integer | The IP version. | 5.0.0 |
| ip | String | The IP address. | 5.0.0 |
| netmask | String | The netmask. | 5.0.0 |
| gateway | String | The gateway IP address. | 5.0.0 |
| usedFor | String | The allocation reason. | 5.0.0 |
| ipInLong | long | The IP address represented as a long integer. | 5.0.0 |
| ipInBinary | byte[] | The IP in binary. | 5.2.0 |
| vmNicUuid | String | The VM NIC Uuid. | 5.0.0 |
| createDate | Timestamp | The creation date. | 5.0.0 |
| lastOpDate | Timestamp | The last operation date. | 5.0.0 |
#allVolumes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource Uuid. | 4.7.13 |
| name | String | The resource name. | 4.7.13 |
| description | String | Optional. The detailed description of the resource. | 4.7.13 |
| primaryStorageUuid | String | The primary storage Uuid. | 4.7.13 |
| vmInstanceUuid | String | The VM instance Uuid. | 4.7.13 |
| diskOfferingUuid | String | The disk offering Uuid. | 4.7.13 |
| rootImageUuid | String | The root image UUID. | 4.7.13 |
| installPath | String | The installation path. | 4.7.13 |
| type | String | The resource type. | 4.7.13 |
| format | String | The format. | 4.7.13 |
| size | Long | The size. | 4.7.13 |
| actualSize | Long | The actual size. | 4.7.13 |
| deviceId | Integer | The device ID. | 4.7.13 |
| state | String | The resource state. | 4.7.13 |
| status | String | The resource status. | 4.7.13 |
| createDate | Timestamp | The creation date. | 4.7.13 |
| lastOpDate | Timestamp | The last operation date. | 4.7.13 |
| isShareable | Boolean | Whether the resource is shareable. | 4.7.13 |
| volumeQos | String | The volume QoS. | 4.7.13 |
| lastDetachDate | Timestamp | The last detach date. | 4.7.13 |
| lastVmInstanceUuid | String | The last VM instance UUID. | 4.7.13 |
#vmCdRoms
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource Uuid. | 4.7.13 |
| vmInstanceUuid | String | The VM instance Uuid. | 4.7.13 |
| deviceId | Integer | The device ID. | 4.7.13 |
| isoUuid | String | The ISO UUID. | 4.7.13 |
| isoInstallPath | String | The ISO install path. | 4.7.13 |
| name | String | The resource name. | 4.7.13 |
| description | String | The detailed description of the resource. | 4.7.13 |
| createDate | Timestamp | The creation date. | 4.7.13 |
| lastOpDate | Timestamp | The last operation date. | 4.7.13 |
SDK Sample
Java
SDK
UpdateConsolePasswordAction action = new UpdateConsolePasswordAction();
action.uuid = "efa69f6385e93855a2b07f4de8908fb1";
action.password = "new-password-123";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateConsolePasswordAction.Result res = action.call();Python
SDK
action = UpdateConsolePasswordAction()
action.uuid = "efa69f6385e93855a2b07f4de8908fb1"
action.password = "new-password-123"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()