Document navigation

UpdateKVMHost

API Request

URLs

PUT zstack/v1/hosts/kvm/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid
Body
{
"updateKVMHost": {
"username": "userName",
"password": "password",
"sshPort": 22.0
  },
"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 '{"updateKVMHost":{"username":"userName","password":"password","sshPort":22.0}}' \
http://localhost:8080/zstack/v1/hosts/kvm/477399a02a343bf2971d86c531053f9e/actions

Request Parameters

Name Type Location Description Optional Value Starting Version
username String body (contained in the updateKVMHost structure) Optional. The username. 0.6
password String body (contained in the updateKVMHost structure) Optional. The password. 0.6
sshPort Integer body (contained in the updateKVMHost structure) Optional. The SSH port. 0.6
uuid String url The resource UUID. 0.6
name String body (contained in the updateKVMHost structure) Optional. The resource name. 0.6
description String body (contained in the updateKVMHost structure) Optional. The detailed description of the resource. 0.6
managementIp String body (contained in the updateKVMHost structure) Optional. The host management address. IPv4 addresses, IPv6 addresses, and DNS names are supported. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response
{
"inventory": {
"zoneUuid": "d31e6ae8ef1e4d63be02c3be94093e90",
"name": "example",
"uuid": "3bfeb74997084a7fa53b7afaf709b6d1",
"clusterUuid": "cec3beee49bb4697905c556e462b3dbe",
"description": "example",
"managementIp": "192.168.0.1",
"hypervisorType": "KVM",
"state": "Enabled",
"status": "Connected",
"totalCpuCapacity": 4.0,
"availableCpuCapacity": 2.0,
"totalMemoryCapacity": 4.0,
"availableMemoryCapacity": 4.0
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory HostInventory See inventory. 0.6
#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. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
zoneUuid String The zone UUID. 0.6
name String The resource name. 0.6
uuid String The resource UUID. 0.6
clusterUuid String The cluster UUID. 0.6
description String The detailed description of the resource. 0.6
managementIp String 0.6
hypervisorType String 0.6
state String 0.6
status String 0.6
totalCpuCapacity Long 0.6
availableCpuCapacity Long 0.6
cpuSockets Integer 0.6
totalMemoryCapacity Long 0.6
availableMemoryCapacity Long 0.6
cpuNum Integer 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
UpdateKVMHostAction action = new UpdateKVMHostAction();
action.username = "userName";
action.password = "password";
action.sshPort = 22.0;
action.uuid = "ca5abd5b6d8c491e87c129dd8458e85a";
action.sessionId = "86935baec2b04df38590f99f5116f045";
UpdateKVMHostAction.Result res = action.call();
Python SDK
UpdateKVMHostAction action = UpdateKVMHostAction()
action.username = "userName"
action.password = "password"
action.sshPort = 22.0
action.uuid = "dfe24a4ad70947bbac06b06acbf47297"
action.sessionId = "043064e67c5c414c904df55e29efd658"
UpdateKVMHostAction.Result res = action.call()
API Reference | 5.5.30 | ZStack Cloud · ZCF | ZStack Resource Center