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) | 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 | 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 | 0.6 | |
| instanceOfferingUuid | String | The instance offering Uuid. | 0.6 |
| rootVolumeUuid | String | The root volume Uuid. | 0.6 |
| platform | String | 0.6 | |
| architecture | String | 0.6 | |
| defaultL3NetworkUuid | String | 0.6 | |
| type | String | 0.6 | |
| hypervisorType | String | 0.6 | |
| memorySize | Long | 0.6 | |
| cpuNum | Integer | 0.6 | |
| cpuSpeed | Long | 0.6 | |
| allocatorStrategy | String | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| state | String | 0.6 | |
| guestOsType | String | 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 | 4.7.13 | |
| mac | String | 4.7.13 | |
| hypervisorType | String | 4.7.13 | |
| netmask | String | 4.7.13 | |
| gateway | String | 4.7.13 | |
| metaData | String | 4.7.13 | |
| ipVersion | Integer | 4.7.13 | |
| driverType | String | 4.7.13 | |
| internalName | String | 4.7.13 | |
| deviceId | Integer | 4.7.13 | |
| type | String | 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 | 5.0.0 | |
| ip | String | 5.0.0 | |
| netmask | String | 5.0.0 | |
| gateway | String | 5.0.0 | |
| usedFor | String | The allocation reason. | 5.0.0 |
| ipInLong | long | 5.0.0 | |
| ipInBinary | byte[] | 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 | 4.7.13 | |
| installPath | String | 4.7.13 | |
| type | String | 4.7.13 | |
| format | String | 4.7.13 | |
| size | Long | 4.7.13 | |
| actualSize | Long | 4.7.13 | |
| deviceId | Integer | 4.7.13 | |
| state | String | 4.7.13 | |
| status | String | 4.7.13 | |
| createDate | Timestamp | The creation date. | 4.7.13 |
| lastOpDate | Timestamp | The last operation date. | 4.7.13 |
| isShareable | Boolean | 4.7.13 | |
| volumeQos | String | 4.7.13 | |
| lastDetachDate | Timestamp | 4.7.13 | |
| lastVmInstanceUuid | String | 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 | 4.7.13 | |
| isoUuid | String | 4.7.13 | |
| isoInstallPath | String | 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
UpdateConsolePasswordAction action = UpdateConsolePasswordAction()
action.uuid = "efa69f6385e93855a2b07f4de8908fb1"
action.password = "new-password-123"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateConsolePasswordAction.Result res = action.call()