Update Host
Headers
Authorization: OAuth the-session-uuidBody
{
"updateHost": {
"name": "example",
"description": "example",
"managementIp": "192.168.0.1"
},
"systemTags": [],
"userTags": []
}In the above example, 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 '{"updateHost":{"name":"example","description":"example","managementIp":"192.168.0.1"}}' \
http://localhost:8080/zstack/v1/hosts/fe98e821991a3c96af96fc7e458d2020/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, uniquely identifies the resource | 0.6 | |
| name (optional) | String | body (contained in updateHost structure) | Resource name | 0.6 | |
| description (optional) | String | body (contained in updateHost structure) | Resource description | 0.6 | |
| managementIp (optional) | String | body (contained in updateHost structure) | 0.6 | ||
| systemTags (optional) | List | body | System tag | 0.6 | |
| userTags (optional) | List | body | User tag | 0.6 |
API Response
Response Example
{
"inventory": {
"zoneUuid": "82c01885efdc3f789fa9130db6a00532",
"name": "example",
"uuid": "b3b5a4d4c6973932a29d4bee698fe9ca",
"clusterUuid": "c416a848e4e538f1b321169001869bbd",
"description": "example",
"managementIp": "192.168.0.1",
"hypervisorType": "KVM",
"state": "Enabled",
"status": "Connected",
"totalCpuCapacity": 4,
"availableCpuCapacity": 2,
"totalMemoryCapacity": 4,
"availableMemoryCapacity": 4
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. If null, the operation succeeded. See details error | 0.6 |
| inventory | HostInventory | See details inventory | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field, default is null | 0.6 |
| cause | ErrorCode | Root cause, the error that caused the current error. If there is no original error, this field is null | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| zoneUuid | String | Data Center UUID | 0.6 |
| name | String | Resource name | 0.6 |
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| clusterUuid | String | Cluster UUID | 0.6 |
| description | String | Resource description | 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 | Number of logical CPUs | 0.6 |
| ipmiAddress | String | IPMI address | 0.6 |
| ipmiUsername | String | IPMI username | 0.6 |
| ipmiPort | Integer | IPMI port | 0.6 |
| ipmiPowerStatus | String | IPMI power status | 0.6 |
| architecture | String | 0.6 | |
| nqn | String | NVMe Qualified Name | 4.10.6 |
| hostname | String | Host name | 4.10.20 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| cpuStatus | HwMonitorStatus | See details cpuStatus | 4.10.0 |
| memoryStatus | HwMonitorStatus | See details memoryStatus | 4.10.0 |
| diskStatus | HwMonitorStatus | See details diskStatus | 4.10.0 |
| nicStatus | HwMonitorStatus | See details nicStatus | 4.10.0 |
| gpuStatus | HwMonitorStatus | See details gpuStatus | 4.10.0 |
| powerSupplyStatus | HwMonitorStatus | See details powerSupplyStatus | 4.10.0 |
| fanStatus | HwMonitorStatus | See details fanStatus | 4.10.0 |
| raidStatus | HwMonitorStatus | See details raidStatus | 4.10.0 |
| temperatureStatus | HwMonitorStatus | See details temperatureStatus | 4.10.0 |
cpuStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
memoryStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
diskStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
nicStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
gpuStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
powerSupplyStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
fanStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
raidStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
temperatureStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
SDK Examples
Java SDK
UpdateHostAction action = new UpdateHostAction();
action.uuid = "fe98e821991a3c96af96fc7e458d2020";
action.name = "example";
action.description = "example";
action.managementIp = "192.168.0.1";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateHostAction.Result res = action.call();Python SDK
action = UpdateHostAction()
action.uuid = "fe98e821991a3c96af96fc7e458d2020"
action.name = "example"
action.description = "example"
action.managementIp = "192.168.0.1"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()