Update Bare Metal Instance
Headers
Authorization: OAuth the-session-uuidBody
{
"updateBaremetalInstance": {
"name": "BM-1-RENAMED"
},
"systemTags": [],
"userTags": []
}In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that these 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 '{"updateBaremetalInstance":{"name":"BM-1-RENAMED"}}' \
http://localhost:8080/zstack/v1/baremetal/instances/eb538a2a8f17342697593ac468b93d1a/actionsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | UUID of the resource, uniquely identifying the resource |
| 2.6.0 |
name (Optional) | String | body(included in the | Resource name |
| 2.6.0 |
description (Optional) | String | body(included in the | Detailed description of the resource |
| 2.6.0 |
password (Optional) | String | body(included in the | System ROOT password |
| 2.6.0 |
platform (Optional) | String | body(included in the | System platform |
| 2.6.0 |
systemTags (Optional) | List | body | System Tag |
| 2.6.0 |
userTags (Optional) | List | body | User Tag |
| 2.6.0 |
API Response
Response Example
{
"inventory": {
"uuid": "30073bc1b10e3b5eba5db9e54436b1dd",
"name": "BM-1",
"description": "This is a baremetal instance.",
"zoneUuid": "99b8c0883a563feb849fe7c6b0b0b97d",
"clusterUuid": "38324d028b28352fad5236f861ba7aeb",
"chassisUuid": "692781dfb73d32d5907ef33199d97db6",
"imageUuid": "a54bab6133d83045a8941368520eff77",
"platform": "Linux",
"state": "Stopped",
"status": "Provisioned",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"bmNics": [
{
"uuid": "5233971bebdd352c9d708617a23311a4",
"baremetalInstanceUuid": "30073bc1b10e3b5eba5db9e54436b1dd",
"l3NetworkUuid": "dce0c157a45d38209afbb615743435aa",
"mac": "6c:b3:11:1b:0b:1e",
"ip": "192.168.0.10",
"netmask": "255.255.255.0",
"gateway": "192.168.0.1",
"pxe": false
}
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error | 2.6.0 |
| inventory | BaremetalInstanceInventory | For details, see inventory | 2.6.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier of the error, for example 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 source error that triggered the current error. If there is no original error, this field is null | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifying the resource | 2.6.0 |
| name | String | Resource name | 2.6.0 |
| description | String | Detailed description of the resource | 2.6.0 |
| zoneUuid | String | Data Center UUID | 2.6.0 |
| clusterUuid | String | Cluster UUID | 2.6.0 |
| pxeServerUuid | String | 3.1.1 | |
| chassisUuid | String | Bare metal chassis UUID | 2.6.0 |
| imageUuid | String | Image UUID | 2.6.0 |
| platform | String | System platform | 2.6.0 |
| state | String | 2.6.0 | |
| status | String | 2.6.0 | |
| createDate | Timestamp | Create time | 2.6.0 |
| lastOpDate | Timestamp | Last modification time | 2.6.0 |
| bmNics | List | For details, see bmNics | 2.6.0 |
bmNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifying the resource | 2.6.0 |
| baremetalInstanceUuid | String | Bare metal instance UUID | 2.6.0 |
| l3NetworkUuid | String | Distributed Port Group UUID | 2.6.0 |
| baremetalBondingUuid | String | BOND UUID | 3.4.0 |
| mac | String | Network card MAC address | 2.6.0 |
| ip | String | IP address | 2.6.0 |
| netmask | String | Subnet mask | 2.6.0 |
| gateway | String | Gateway | 2.6.0 |
| metadata | String | 2.6.0 | |
| pxe | Boolean | Whether this is a PXE boot NIC | 2.6.0 |
| createDate | Timestamp | Create time | 2.6.0 |
| lastOpDate | Timestamp | Last modification time | 2.6.0 |
SDK Examples
Java SDK
UpdateBaremetalInstanceAction action = new UpdateBaremetalInstanceAction();
action.uuid = "eb538a2a8f17342697593ac468b93d1a";
action.name = "BM-1-RENAMED";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateBaremetalInstanceAction.Result res = action.call();Python SDK
action = UpdateBaremetalInstanceAction()
action.uuid = "eb538a2a8f17342697593ac468b93d1a"
action.name = "BM-1-RENAMED"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()