Start Bare Metal Instance (StartBaremetalInstance)

API Request

URLs
PUT zstack/v1/baremetal/instances/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{   "startBaremetalInstance": {     "pxeBoot": false   },   "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 '{"startBaremetalInstance":{"pxeBoot":false}}' \ http://localhost:8080/zstack/v1/baremetal/instances/dc6931adfb8a38bf9919d46b1531e9e4/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
pxeBoot (Optional) Boolean body(included in the startBaremetalInstance structure) Whether to boot via network PXE 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": "0be601277df73fa7bdb114b9ece8aec3",     "name": "BM-1",     "description": "This is a baremetal instance.",     "zoneUuid": "9b4745853c913a549499e39c2f8db6c7",     "clusterUuid": "21f709c6a9783fcb80803dece29a712a",     "chassisUuid": "4c3e24bc9218382c83ff81e9205fdc47",     "imageUuid": "e425f9323a4e3463b3a308c5ecca6653",     "platform": "Linux",     "state": "Running",     "status": "Provisioned",     "createDate": "Nov 14, 2017 2:20:57 PM",     "lastOpDate": "Nov 14, 2017 2:20:57 PM",     "bmNics": [       {         "uuid": "de7f5a22aa483de88bb3ede1c7dd071f",         "baremetalInstanceUuid": "0be601277df73fa7bdb114b9ece8aec3",         "l3NetworkUuid": "41ebe67163003dec94da84c6c5224037",         "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
StartBaremetalInstanceAction action = new StartBaremetalInstanceAction(); action.uuid = "dc6931adfb8a38bf9919d46b1531e9e4"; action.pxeBoot = false; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; StartBaremetalInstanceAction.Result res = action.call();
Python SDK
action = StartBaremetalInstanceAction() action.uuid = "dc6931adfb8a38bf9919d46b1531e9e4" action.pxeBoot = false action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" res = action.call()

Destroy Bare Metal Instance (DestroyBaremetalInstance)

API Request

URLs
DELETE zstack/v1/baremetal/instances/{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/instances/8f34148a0cce3acf883c6f6b59eb8c0d?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
DestroyBaremetalInstanceAction action = new DestroyBaremetalInstanceAction(); action.uuid = "8f34148a0cce3acf883c6f6b59eb8c0d"; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DestroyBaremetalInstanceAction.Result res = action.call();
Python SDK
action = DestroyBaremetalInstanceAction() action.uuid = "8f34148a0cce3acf883c6f6b59eb8c0d" action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" res = action.call()

Expunge Bare Metal Instance (ExpungeBaremetalInstance)

API Request

URLs
PUT zstack/v1/baremetal/instances/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{   "expungeBaremetalInstance": {},   "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 '{"expungeBaremetalInstance":{}}' \ http://localhost:8080/zstack/v1/baremetal/instances/1016135ece1d3b189112cea52ae84d8d/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

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
ExpungeBaremetalInstanceAction action = new ExpungeBaremetalInstanceAction(); action.uuid = "1016135ece1d3b189112cea52ae84d8d"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; ExpungeBaremetalInstanceAction.Result res = action.call();
Python SDK
action = ExpungeBaremetalInstanceAction() action.uuid = "1016135ece1d3b189112cea52ae84d8d" 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.