Update Bare Metal Instance

PUT/zstack/v1/baremetal/instances/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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/actions

Parameter 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 updateBaremetalInstance structure)

Resource name

 

2.6.0

description (Optional)

String

body(included in the updateBaremetalInstance structure)

Detailed description of the resource

 

2.6.0

password (Optional)

String

body(included in the updateBaremetalInstance structure)

System ROOT password

 

2.6.0

platform (Optional)

String

body(included in the updateBaremetalInstance structure)

System platform

  • Linux

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
      }
    ]
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error2.6.0
inventoryBaremetalInstanceInventoryFor details, see inventory2.6.0

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource2.6.0
nameStringResource name2.6.0
descriptionStringDetailed description of the resource2.6.0
zoneUuidStringData Center UUID2.6.0
clusterUuidStringCluster UUID2.6.0
pxeServerUuidString 3.1.1
chassisUuidStringBare metal chassis UUID2.6.0
imageUuidStringImage UUID2.6.0
platformStringSystem platform2.6.0
stateString 2.6.0
statusString 2.6.0
createDateTimestampCreate time2.6.0
lastOpDateTimestampLast modification time2.6.0
bmNicsListFor details, see bmNics2.6.0

bmNics

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource2.6.0
baremetalInstanceUuidStringBare metal instance UUID2.6.0
l3NetworkUuidStringDistributed Port Group UUID2.6.0
baremetalBondingUuidStringBOND UUID3.4.0
macStringNetwork card MAC address2.6.0
ipStringIP address2.6.0
netmaskStringSubnet mask2.6.0
gatewayStringGateway2.6.0
metadataString 2.6.0
pxeBooleanWhether this is a PXE boot NIC2.6.0
createDateTimestampCreate time2.6.0
lastOpDateTimestampLast modification time2.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()