Update PXE Server

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateBaremetalPxeServer": {
    "name": "test",
    "dhcpRangeBegin": "10.0.0.200",
    "dhcpRangeNetmask": "255.255.255.0"
  },
  "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 '{"updateBaremetalPxeServer":{"name":"test","dhcpRangeBegin":"10.0.0.200","dhcpRangeNetmask":"255.255.255.0"}}' \
http://localhost:8080/zstack/v1/baremetal/pxeservers/da1ddf8e5ca838ea9fa55f20946dded6/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlUUID of the resource, uniquely identifying the resource 2.6.0
name (Optional)Stringbody(included in the updateBaremetalPxeServer structure)Resource name 2.6.0
description (Optional)Stringbody(included in the updateBaremetalPxeServer structure)Detailed description of the resource 2.6.0
dhcpInterface (Optional)Stringbody(included in the updateBaremetalPxeServer structure)DHCP request listening NIC 2.6.0
dhcpRangeBegin (Optional)Stringbody(included in the updateBaremetalPxeServer structure)DHCP address range start 2.6.0
dhcpRangeEnd (Optional)Stringbody(included in the updateBaremetalPxeServer structure)DHCP address range end 2.6.0
dhcpRangeNetmask (Optional)Stringbody(included in the updateBaremetalPxeServer structure)DHCP address range netmask 2.6.0
systemTags (Optional)ListbodySystem Tag 2.6.0
userTags (Optional)ListbodyUser Tag 2.6.0

API Response

Response Example

{
  "inventory": {
    "uuid": "1a88afcfd21b35aa82da9f4b734826b7",
    "name": "test",
    "hostname": "127.0.0.1",
    "sshUsername": "root",
    "sshPassword": "password",
    "sshPort": 22,
    "storagePath": "/zstack_bm_cache",
    "dhcpInterface": "eth0",
    "dhcpRangeBegin": "10.0.0.1",
    "dhcpRangeEnd": "10.0.0.255",
    "dhcpRangeNetmask": "255.255.255.0",
    "state": "Enabled",
    "status": "Connected"
  }
}
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
inventoryBaremetalPxeServerInventoryFor 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 resource3.1.1
zoneUuidStringData Center UUID3.1.1
nameStringResource name3.1.1
descriptionStringDetailed description of the resource3.1.1
hostnameStringDeployment server address3.1.1
sshUsernameStringDeployment server SSH account3.1.1
sshPasswordStringDeployment server SSH password3.1.1
sshPortIntegerDeployment server SSH port3.1.1
storagePathStringDeployment server storage path3.1.1
dhcpInterfaceStringDHCP request listening NIC3.1.1
dhcpInterfaceAddressStringDHCP request listening NIC IP address3.1.1
dhcpRangeBeginStringDHCP address range start3.1.1
dhcpRangeEndStringDHCP address range end3.1.1
dhcpRangeNetmaskStringDHCP subnet mask3.1.1
stateStringDeployment server running state3.1.1
statusStringDeployment server connection status3.1.1
createDateTimestampCreate time3.1.1
lastOpDateTimestampLast modification time3.1.1
totalCapacityLongStorage path total capacity3.1.1
availableCapacityLongStorage path available capacity3.1.1
attachedClusterUuidsListDeployment server attached cluster UUID list3.1.1

SDK Examples

Java SDK

UpdateBaremetalPxeServerAction action = new UpdateBaremetalPxeServerAction();
action.uuid = "da1ddf8e5ca838ea9fa55f20946dded6";
action.name = "test";
action.dhcpRangeBegin = "10.0.0.200";
action.dhcpRangeNetmask = "255.255.255.0";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateBaremetalPxeServerAction.Result res = action.call();

Python SDK

action = UpdateBaremetalPxeServerAction()
action.uuid = "da1ddf8e5ca838ea9fa55f20946dded6"
action.name = "test"
action.dhcpRangeBegin = "10.0.0.200"
action.dhcpRangeNetmask = "255.255.255.0"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()