Query PXE Server

GET/zstack/v1/baremetal/pxeservers
GET/zstack/v1/baremetal/pxeservers/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/pxeservers?q=uuid=b56be5d49df637308e7db1ae725a311e
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/pxeservers/fdefdaf042463cfb8939563c5f910c8f

Queryable Fields

Run the CLI command tool, enter QueryBaremetalPxeServer and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "90afdd2b218b376592a25421e396597e",
      "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
inventoriesListFor details, see inventories2.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

inventories

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

QueryBaremetalPxeServerAction action = new QueryBaremetalPxeServerAction();
action.conditions = asList("uuid=543c0df623633fe0a0158e955b1a5702");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBaremetalPxeServerAction.Result res = action.call();

Python SDK

action = QueryBaremetalPxeServerAction()
action.conditions = ["uuid=a065f4830c9f301ead495e941ce7bd4e"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()