Create PXE Server (CreateBaremetalPxeServer)

API Request

URLs
POST zstack/v1/baremetal/pxeservers
Headers
Authorization: OAuth the-session-uuid
Body
{   "params": {     "zoneUuid": "4d813a1e8053335d931094e4f41c0cad",     "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"   },   "systemTags": [],   "userTags": [] }
Note: 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 POST -d '{"params":{"zoneUuid":"4d813a1e8053335d931094e4f41c0cad","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"}}' \ http://localhost:8080/zstack/v1/baremetal/pxeservers
Parameter List
Name Type Location Description Allowed Values Starting Version
name String body(included in the params structure) Resource name 2.6.0
description (Optional) String body(included in the params structure) Detailed description of the resource 2.6.0
dhcpInterface String body(included in the params structure) DHCP request listening NIC 2.6.0
dhcpRangeBegin (Optional) String body(included in the params structure) DHCP address range start 2.6.0
dhcpRangeEnd (Optional) String body(included in the params structure) DHCP address range end 2.6.0
dhcpRangeNetmask (Optional) String body(included in the params structure) DHCP address range netmask 2.6.0
systemTags (Optional) List body System Tag 2.6.0
userTags (Optional) List body User Tag 2.6.0
zoneUuid String body(included in the params structure) Data Center UUID 0.6
hostname String body(included in the params structure) 0.6
sshUsername String body(included in the params structure) 0.6
sshPassword String body(included in the params structure) 0.6
sshPort (Optional) Integer body(included in the params structure) 0.6
storagePath String body(included in the params structure) 0.6
resourceUuid (Optional) String body(included in the params structure) 0.6
tagUuids (Optional) List body(included in the params structure) Tag UUID list 3.4.0

API Response

Response Example
{   "inventory": {     "uuid": "e958961c7785304691d49ec5ac7df64d",     "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": "Connecting"   } }
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 BaremetalPxeServerInventory 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 3.1.1
zoneUuid String Data Center UUID 3.1.1
name String Resource name 3.1.1
description String Detailed description of the resource 3.1.1
hostname String Deployment server address 3.1.1
sshUsername String Deployment server SSH account 3.1.1
sshPassword String Deployment server SSH password 3.1.1
sshPort Integer Deployment server SSH port 3.1.1
storagePath String Deployment server storage path 3.1.1
dhcpInterface String DHCP request listening NIC 3.1.1
dhcpInterfaceAddress String DHCP request listening NIC IP address 3.1.1
dhcpRangeBegin String DHCP address range start 3.1.1
dhcpRangeEnd String DHCP address range end 3.1.1
dhcpRangeNetmask String DHCP subnet mask 3.1.1
state String Deployment server running state 3.1.1
status String Deployment server connection status 3.1.1
createDate Timestamp Create time 3.1.1
lastOpDate Timestamp Last modification time 3.1.1
totalCapacity Long Storage path total capacity 3.1.1
availableCapacity Long Storage path available capacity 3.1.1
attachedClusterUuids List Deployment server attached cluster UUID list 3.1.1

SDK Examples

Java SDK
CreateBaremetalPxeServerAction action = new CreateBaremetalPxeServerAction(); action.zoneUuid = "4d813a1e8053335d931094e4f41c0cad"; action.name = "test"; action.hostname = "127.0.0.1"; action.sshUsername = "root"; action.sshPassword = "password"; action.sshPort = 22; action.storagePath = "/zstack_bm_cache"; action.dhcpInterface = "eth0"; action.dhcpRangeBegin = "10.0.0.1"; action.dhcpRangeEnd = "10.0.0.255"; action.dhcpRangeNetmask = "255.255.255.0"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateBaremetalPxeServerAction.Result res = action.call();
Python SDK
action = CreateBaremetalPxeServerAction() action.zoneUuid = "4d813a1e8053335d931094e4f41c0cad" action.name = "test" action.hostname = "127.0.0.1" action.sshUsername = "root" action.sshPassword = "password" action.sshPort = 22 action.storagePath = "/zstack_bm_cache" action.dhcpInterface = "eth0" action.dhcpRangeBegin = "10.0.0.1" action.dhcpRangeEnd = "10.0.0.255" action.dhcpRangeNetmask = "255.255.255.0" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" res = action.call()

Delete PXE Server (DeleteBaremetalPxeServer)

API Request

URLs
DELETE 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 DELETE http://localhost:8080/zstack/v1/baremetal/pxeservers/da517231390c368b91440d0bda783ba1?deleteMode=Permissive
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource, uniquely identifying the resource 2.6.0
deleteMode (Optional) String query Delete mode 2.6.0
systemTags (Optional) List query System Tag 2.6.0
userTags (Optional) List query User Tag 2.6.0

API Response

This API returns an empty JSON structure {} on success. On error, the returned JSON structure contains an error field, for example:
{ 	"error": { 		"code": "SYS.1001", 		"description": "A message or a operation timeout", 		"details": "Create VM on KVM timeout after 300s" 	} }

SDK Examples

Java SDK
DeleteBaremetalPxeServerAction action = new DeleteBaremetalPxeServerAction(); action.uuid = "da517231390c368b91440d0bda783ba1"; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteBaremetalPxeServerAction.Result res = action.call();
Python SDK
action = DeleteBaremetalPxeServerAction() action.uuid = "da517231390c368b91440d0bda783ba1" action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" res = action.call()

Start PXE Server (StartBaremetalPxeServer)

API Request

URLs
PUT zstack/v1/baremetal/pxeservers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{   "startBaremetalPxeServer": {},   "systemTags": [],   "userTags": [] }
Note: 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 '{"startBaremetalPxeServer":{}}' \ http://localhost:8080/zstack/v1/baremetal/pxeservers/340b1f6b12ab305aa05c12ded00020e7/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
systemTags (Optional) List body System Tag 2.6.0
userTags (Optional) List body User Tag 2.6.0

API Response

Response Example
{   "inventory": {     "uuid": "ac3a53373cfd328b8932bdd29f4886dd",     "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"   } }
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
#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

SDK Examples

Java SDK
StartBaremetalPxeServerAction action = new StartBaremetalPxeServerAction(); action.uuid = "340b1f6b12ab305aa05c12ded00020e7"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; StartBaremetalPxeServerAction.Result res = action.call();
Python SDK
action = StartBaremetalPxeServerAction() action.uuid = "340b1f6b12ab305aa05c12ded00020e7" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" res = action.call()






Archives

Download Document Archives

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Cannot be empty.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.