Bare Metal Management
Bare Metal Template Related Interfaces
AddPreconfigurationTemplate
API Request
POST zstack/v1/baremetal/preconfigurationsAuthorization: OAuth the-session-uuid{
"params": {
"name": "centos-7.2-minimal",
"description": "centos-7.2-minimal kickstart file",
"distribution": "centos7.2-x86_64",
"type": "kickstart",
"content": "..."
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"centos-7.2-minimal","description":"centos-7.2-minimal kickstart file","distribution":"centos7.2-x86_64","type":"kickstart","content":"..."}}' \
http://localhost:8080/zstack/v1/baremetal/preconfigurations| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body(included in the params structure) |
Resource name | 3.4.0 | |
| description (Optional) | String | body(included in the params structure) |
Detailed description of the resource | 3.4.0 | |
| distribution | String | body(included in the params structure) |
Applicable operating system distribution | 3.4.0 | |
| type | String | body(included in the params structure) |
Template type |
|
3.4.0 |
| content | String | body(included in the params structure) |
Template content | 3.4.0 | |
| resourceUuid (Optional) | String | body(included in the params structure) |
Resource UUID | 3.4.0 | |
| systemTags (Optional) | List | body | System Tag | 3.4.0 | |
| userTags (Optional) | List | body | User Tag | 3.4.0 | |
| tagUuids (Optional) | List | body(included in the params structure) |
Tag UUID List | 3.4.0 |
API Response
{
"inventory": {
"uuid": "8d837ba978a4462eada4cd80f395617f",
"name": "centos_7_x86_64_mini_v1.cfg",
"description": "centos-7-minimal kickstart file",
"distribution": "centos-7-x86_64",
"type": "kickstart",
"content": "...",
"md5sum": "4448ac513c464e86aeb7eb75417c9345",
"isPredefined": false,
"state": "Enabled",
"createDate": "Aug 15, 2025 5:35:30 AM",
"lastOpDate": "Aug 15, 2025 5:35:30 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | 3.4.0 |
| inventory | PreconfigurationTemplateInventory | For details, see inventory | 3.4.0 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifying the resource | 3.4.0 |
| name | String | Resource name | 3.4.0 |
| description | String | Detailed description of the resource | 3.4.0 |
| distribution | String | Applicable operating system distribution | 3.4.0 |
| type | String | Template type | 3.4.0 |
| content | String | Template content | 3.4.0 |
| md5sum | String | Template MD5 | 3.4.0 |
| isPredefined | Boolean | Whether it is system predefined | 3.4.0 |
| state | String | State | 3.4.0 |
| createDate | Timestamp | Create time | 3.4.0 |
| lastOpDate | Timestamp | Last modification time | 3.4.0 |
SDK Examples
AddPreconfigurationTemplateAction action = new AddPreconfigurationTemplateAction();
action.name = "centos-7.2-minimal";
action.description = "centos-7.2-minimal kickstart file";
action.distribution = "centos7.2-x86_64";
action.type = "kickstart";
action.content = "...";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddPreconfigurationTemplateAction.Result res = action.call();action = AddPreconfigurationTemplateAction()
action.name = "centos-7.2-minimal"
action.description = "centos-7.2-minimal kickstart file"
action.distribution = "centos7.2-x86_64"
action.type = "kickstart"
action.content = "..."
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()DeletePreconfigurationTemplate
API Request
DELETE zstack/v1/baremetal/preconfigurations/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/baremetal/preconfigurations/a605200589a54c25962a351d2d7995ea?deleteMode=Permissive| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifying the resource | 3.4.0 | |
| deleteMode (Optional) | String | query | Delete mode | 3.4.0 | |
| systemTags (Optional) | List | query | System Tag | 3.4.0 | |
| userTags (Optional) | List | query | User Tag | 3.4.0 |
API Response
{} 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
DeletePreconfigurationTemplateAction action = new DeletePreconfigurationTemplateAction();
action.uuid = "d24775f1fff14a8e9d67a9d889db8a81";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeletePreconfigurationTemplateAction.Result res = action.call();action = DeletePreconfigurationTemplateAction()
action.uuid = "3a4fc05bf396447880dfd3fa4cf965b1"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()ChangePreconfigurationTemplateState
API Request
PUT zstack/v1/baremetal/preconfigurations/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"changePreconfigurationTemplateState": {
"stateEvent": "disable"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changePreconfigurationTemplateState":{"stateEvent":"disable"}}' \
http://localhost:8080/zstack/v1/baremetal/preconfigurations/48e32bae102b30ccb921f582a33cee14/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifying the resource | 3.4.0 | |
| stateEvent | String | body(included in the changePreconfigurationTemplateState structure) |
State event |
|
3.4.0 |
| systemTags (Optional) | List | body | System Tag | 3.4.0 | |
| userTags (Optional) | List | body | User Tag | 3.4.0 |
API Response
{
"inventory": {
"uuid": "edf8b9576a5d408fb135c20aa7dcefd3",
"name": "centos_7_x86_64_mini_v1.cfg",
"description": "centos-7-minimal kickstart file",
"distribution": "centos-7-x86_64",
"type": "kickstart",
"content": "...",
"md5sum": "f79f67ab6c3445029b187d14bf7e3b99",
"isPredefined": false,
"state": "Enabled",
"createDate": "Aug 15, 2025 5:33:55 AM",
"lastOpDate": "Aug 15, 2025 5:33:55 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | 3.4.0 |
| inventory | PreconfigurationTemplateInventory | For details, see inventory | 3.4.0 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifying the resource | 3.4.0 |
| name | String | Resource name | 3.4.0 |
| description | String | Detailed description of the resource | 3.4.0 |
| distribution | String | Applicable operating system distribution | 3.4.0 |
| type | String | Template type | 3.4.0 |
| content | String | Template content | 3.4.0 |
| md5sum | String | Template MD5 | 3.4.0 |
| isPredefined | Boolean | Whether it is system predefined | 3.4.0 |
| state | String | State | 3.4.0 |
| createDate | Timestamp | Create time | 3.4.0 |
| lastOpDate | Timestamp | Last modification time | 3.4.0 |
SDK Examples
ChangePreconfigurationTemplateStateAction action = new ChangePreconfigurationTemplateStateAction();
action.uuid = "48e32bae102b30ccb921f582a33cee14";
action.stateEvent = "disable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangePreconfigurationTemplateStateAction.Result res = action.call();action = ChangePreconfigurationTemplateStateAction()
action.uuid = "48e32bae102b30ccb921f582a33cee14"
action.stateEvent = "disable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()UpdatePreconfigurationTemplate
API Request
PUT zstack/v1/baremetal/preconfigurations/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updatePreconfigurationTemplate": {
"name": "centos-7.2-minimal",
"description": "centos-7.2-minimal kickstart file",
"distribution": "centos7.2-x86_64",
"type": "kickstart",
"content": "..."
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updatePreconfigurationTemplate":{"name":"centos-7.2-minimal","description":"centos-7.2-minimal kickstart file","distribution":"centos7.2-x86_64","type":"kickstart","content":"..."}}' \
http://localhost:8080/zstack/v1/baremetal/preconfigurations/f04791eda033444aad3a49a081a00129/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifying the resource | 3.4.0 | |
| name (Optional) | String | body(included in the updatePreconfigurationTemplate structure) |
Resource name | 3.4.0 | |
| description (Optional) | String | body(included in the updatePreconfigurationTemplate structure) |
Detailed description of the resource | 3.4.0 | |
| distribution (Optional) | String | body(included in the updatePreconfigurationTemplate structure) |
Applicable operating system distribution | 3.4.0 | |
| type (Optional) | String | body(included in the updatePreconfigurationTemplate structure) |
Template type |
|
3.4.0 |
| content (Optional) | String | body(included in the updatePreconfigurationTemplate structure) |
Template content | 3.4.0 | |
| systemTags (Optional) | List | body | System Tag | 3.4.0 | |
| userTags (Optional) | List | body | User Tag | 3.4.0 |
API Response
{
"inventory": {
"uuid": "c583420a47754a768162d7001f32153f",
"name": "centos_7_x86_64_mini_v1.cfg",
"description": "centos-7-minimal kickstart file",
"distribution": "centos-7-x86_64",
"type": "kickstart",
"content": "...",
"md5sum": "abeabe93030f4ec399ae74c72cff8425",
"isPredefined": false,
"state": "Enabled",
"createDate": "Aug 15, 2025 5:37:41 AM",
"lastOpDate": "Aug 15, 2025 5:37:41 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | 3.4.0 |
| inventory | PreconfigurationTemplateInventory | For details, see inventory | 3.4.0 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifying the resource | 3.4.0 |
| name | String | Resource name | 3.4.0 |
| description | String | Detailed description of the resource | 3.4.0 |
| distribution | String | Applicable operating system distribution | 3.4.0 |
| type | String | Template type | 3.4.0 |
| content | String | Template content | 3.4.0 |
| md5sum | String | Template MD5 | 3.4.0 |
| isPredefined | Boolean | Whether it is system predefined | 3.4.0 |
| state | String | State | 3.4.0 |
| createDate | Timestamp | Create time | 3.4.0 |
| lastOpDate | Timestamp | Last modification time | 3.4.0 |
SDK Examples
UpdatePreconfigurationTemplateAction action = new UpdatePreconfigurationTemplateAction();
action.uuid = "f3805241353a47a89096cbc8e7a94bd7";
action.name = "centos-7.2-minimal";
action.description = "centos-7.2-minimal kickstart file";
action.distribution = "centos7.2-x86_64";
action.type = "kickstart";
action.content = "...";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdatePreconfigurationTemplateAction.Result res = action.call();action = UpdatePreconfigurationTemplateAction()
action.uuid = "1a74223f271d4ff0af9bb7e7de79ce91"
action.name = "centos-7.2-minimal"
action.description = "centos-7.2-minimal kickstart file"
action.distribution = "centos7.2-x86_64"
action.type = "kickstart"
action.content = "..."
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()QueryPreconfigurationTemplate
API Request
GET zstack/v1/baremetal/preconfigurations
GET zstack/v1/baremetal/preconfigurations/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/preconfigurations?q=uuid=6b34fcf11d6732ba851203bc602b46b7curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/preconfigurations/ed428c815ff43f1ebc97483767b1a6e4Queryable Fields
Run the CLI command tool, enter QueryPreconfigurationTemplate and press Tab to view all queryable fields and resource names that can be queried across tables.
API Response
{
"inventories": [
{
"uuid": "7242ff1b38c94a00b888c1033ca6223a",
"name": "centos_7_x86_64_mini_v1.cfg",
"description": "centos-7-minimal kickstart file",
"distribution": "centos-7-x86_64",
"type": "kickstart",
"content": "...",
"md5sum": "f01edfbe076f4e24bd346fab494e5de0",
"isPredefined": false,
"state": "Enabled",
"createDate": "Aug 15, 2025 5:38:34 AM",
"lastOpDate": "Aug 15, 2025 5:38:34 AM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | 3.4.0 |
| inventories | List | For details, see inventories | 3.4.0 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifying the resource | 3.4.0 |
| name | String | Resource name | 3.4.0 |
| description | String | Detailed description of the resource | 3.4.0 |
| distribution | String | Applicable operating system distribution | 3.4.0 |
| type | String | Template type | 3.4.0 |
| content | String | Template content | 3.4.0 |
| md5sum | String | Template MD5 | 3.4.0 |
| isPredefined | Boolean | Whether it is system predefined | 3.4.0 |
| state | String | State | 3.4.0 |
| createDate | Timestamp | Create time | 3.4.0 |
| lastOpDate | Timestamp | Last modification time | 3.4.0 |
SDK Examples
QueryPreconfigurationTemplateAction action = new QueryPreconfigurationTemplateAction();
action.conditions = asList("uuid=c3cd8741c2fb3ba88f0493ec77b8fad6");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryPreconfigurationTemplateAction.Result res = action.call();action = QueryPreconfigurationTemplateAction()
action.conditions = ["uuid=deb4635e9984326b818d0433dfd78576"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()Bare Metal Cluster Related Interfaces
CreateBaremetalPxeServer
API Request
POST zstack/v1/baremetal/pxeserversAuthorization: OAuth the-session-uuid{
"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 -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| 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) |
The hostname. | 0.6 | |
| sshUsername | String | body(included in the params structure) |
The SSH username. | 0.6 | |
| sshPassword | String | body(included in the params structure) |
The SSH password. | 0.6 | |
| sshPort (Optional) | Integer | body(included in the params structure) |
Optional. The SSH port. | 0.6 | |
| storagePath | String | body(included in the params structure) |
The storage path. | 0.6 | |
| resourceUuid (Optional) | String | body(included in the params structure) |
Optional. The resource UUID. | 0.6 | |
| tagUuids (Optional) | List | body(included in the params structure) |
Tag UUID list | 3.4.0 |
API Response
{
"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 | Whether the operation succeeded. | 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 |
| 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 |
| 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
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();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()DeleteBaremetalPxeServer
API Request
DELETE zstack/v1/baremetal/pxeservers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/baremetal/pxeservers/da517231390c368b91440d0bda783ba1?deleteMode=Permissive| 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
{} 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
DeleteBaremetalPxeServerAction action = new DeleteBaremetalPxeServerAction();
action.uuid = "da517231390c368b91440d0bda783ba1";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteBaremetalPxeServerAction.Result res = action.call();action = DeleteBaremetalPxeServerAction()
action.uuid = "da517231390c368b91440d0bda783ba1"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()StartBaremetalPxeServer
API Request
PUT zstack/v1/baremetal/pxeservers/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 | Whether the operation succeeded. | 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 |
| 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
StartBaremetalPxeServerAction action = new StartBaremetalPxeServerAction();
action.uuid = "340b1f6b12ab305aa05c12ded00020e7";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StartBaremetalPxeServerAction.Result res = action.call();action = StartBaremetalPxeServerAction()
action.uuid = "340b1f6b12ab305aa05c12ded00020e7"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()StopBaremetalPxeServer
API Request
PUT zstack/v1/baremetal/pxeservers/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"stopBaremetalPxeServer": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"stopBaremetalPxeServer":{}}' \
http://localhost:8080/zstack/v1/baremetal/pxeservers/26a3032ad77330df8de53c6d89f02f12/actions| 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
{
"inventory": {
"uuid": "743173fddfb0319fa9b21827875c1341",
"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": "Disconnected"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 |
| 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
StopBaremetalPxeServerAction action = new StopBaremetalPxeServerAction();
action.uuid = "26a3032ad77330df8de53c6d89f02f12";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StopBaremetalPxeServerAction.Result res = action.call();action = StopBaremetalPxeServerAction()
action.uuid = "26a3032ad77330df8de53c6d89f02f12"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()UpdateBaremetalPxeServer
API Request
PUT zstack/v1/baremetal/pxeservers/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateBaremetalPxeServer": {
"name": "test",
"dhcpRangeBegin": "10.0.0.200",
"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 -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| 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 updateBaremetalPxeServer structure) |
Resource name | 2.6.0 | |
| description (Optional) | String | body(included in the updateBaremetalPxeServer structure) |
Detailed description of the resource | 2.6.0 | |
| dhcpInterface (Optional) | String | body(included in the updateBaremetalPxeServer structure) |
DHCP request listening NIC | 2.6.0 | |
| dhcpRangeBegin (Optional) | String | body(included in the updateBaremetalPxeServer structure) |
DHCP address range start | 2.6.0 | |
| dhcpRangeEnd (Optional) | String | body(included in the updateBaremetalPxeServer structure) |
DHCP address range end | 2.6.0 | |
| dhcpRangeNetmask (Optional) | String | body(included in the updateBaremetalPxeServer 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 |
API Response
{
"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"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 |
| 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 |
| 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
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();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()QueryBaremetalPxeServer
API Request
GET zstack/v1/baremetal/pxeservers
GET zstack/v1/baremetal/pxeservers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/pxeservers?q=uuid=b56be5d49df637308e7db1ae725a311ecurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/pxeservers/fdefdaf042463cfb8939563c5f910c8fQueryable 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
{
"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"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 |
| inventories | List | For details, see inventories | 2.6.0 |
| 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 |
| 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
QueryBaremetalPxeServerAction action = new QueryBaremetalPxeServerAction();
action.conditions = asList("uuid=543c0df623633fe0a0158e955b1a5702");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBaremetalPxeServerAction.Result res = action.call();action = QueryBaremetalPxeServerAction()
action.conditions = ["uuid=a065f4830c9f301ead495e941ce7bd4e"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()AttachBaremetalPxeServerToCluster
API Request
POST zstack/v1/clusters/{clusterUuid}/pxeservers/{pxeServerUuid}Authorization: OAuth the-session-uuid{
"params": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' \
http://localhost:8080/zstack/v1/clusters/47b43452a77a309e9c9e1b3b23a9e978/pxeservers/b069eaeb0e2c355aaabca9738fb8332b| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| pxeServerUuid | String | url | Deployment server UUID | 3.1.1 | |
| clusterUuid | String | url | Bare metal cluster UUID | 3.1.1 | |
| systemTags (Optional) | List | body | System Tag | 3.1.1 | |
| userTags (Optional) | List | body | User Tag | 3.1.1 |
API Response
{
"inventory": {
"uuid": "976aafa241603b26acb48dce89e29dec",
"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": "Disconnected"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | 3.1.1 |
| inventory | BaremetalPxeServerInventory | For details, see inventory | 3.1.1 |
| 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 |
| 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
AttachBaremetalPxeServerToClusterAction action = new AttachBaremetalPxeServerToClusterAction();
action.pxeServerUuid = "b069eaeb0e2c355aaabca9738fb8332b";
action.clusterUuid = "47b43452a77a309e9c9e1b3b23a9e978";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachBaremetalPxeServerToClusterAction.Result res = action.call();action = AttachBaremetalPxeServerToClusterAction()
action.pxeServerUuid = "b069eaeb0e2c355aaabca9738fb8332b"
action.clusterUuid = "47b43452a77a309e9c9e1b3b23a9e978"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()DetachBaremetalPxeServerFromCluster
API Request
DELETE zstack/v1/clusters/{clusterUuid}/pxeservers/{pxeServerUuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/clusters/42ade7c792e43f138f8b693294ad9b4c/pxeservers/2e9c8220a3ea3dbf9f8c3cb66567ff52| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| pxeServerUuid | String | url | Deployment server UUID | 3.1.1 | |
| clusterUuid | String | url | Bare metal cluster UUID | 3.1.1 | |
| systemTags (Optional) | List | query | System Tag | 3.1.1 | |
| userTags (Optional) | List | query | User Tag | 3.1.1 |
API Response
{
"inventory": {
"uuid": "bcd0703a8bbb394fa4e819ad90297b48",
"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": "Disconnected"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | 3.1.1 |
| inventory | BaremetalPxeServerInventory | For details, see inventory | 3.1.1 |
| 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 |
| 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
DetachBaremetalPxeServerFromClusterAction action = new DetachBaremetalPxeServerFromClusterAction();
action.pxeServerUuid = "2e9c8220a3ea3dbf9f8c3cb66567ff52";
action.clusterUuid = "42ade7c792e43f138f8b693294ad9b4c";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachBaremetalPxeServerFromClusterAction.Result res = action.call();action = DetachBaremetalPxeServerFromClusterAction()
action.pxeServerUuid = "2e9c8220a3ea3dbf9f8c3cb66567ff52"
action.clusterUuid = "42ade7c792e43f138f8b693294ad9b4c"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()ReconnectBaremetalPxeServer
API Request
PUT zstack/v1/baremetal/pxeservers/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"reconnectBaremetalPxeServer": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"reconnectBaremetalPxeServer":{}}' \
http://localhost:8080/zstack/v1/baremetal/pxeservers/65273a162ba83a4d99abc6ede60e6eeb/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifying the resource | 3.1.1 | |
| systemTags (Optional) | List | body | System Tag | 3.1.1 | |
| userTags (Optional) | List | body | User Tag | 3.1.1 |
API Response
{
"inventory": {
"uuid": "95c83db8181c31ea84f2ed95b3800501",
"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 | Whether the operation succeeded. | 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 | 3.1.1 |
| inventory | BaremetalPxeServerInventory | For details, see inventory | 3.1.1 |
| 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 |
| 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
ReconnectBaremetalPxeServerAction action = new ReconnectBaremetalPxeServerAction();
action.uuid = "65273a162ba83a4d99abc6ede60e6eeb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ReconnectBaremetalPxeServerAction.Result res = action.call();action = ReconnectBaremetalPxeServerAction()
action.uuid = "65273a162ba83a4d99abc6ede60e6eeb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()Bare Metal Instance Related Interfaces
BatchCreateBaremetalChassis
API Request
POST zstack/v1/baremetal/chassis/from-fileAuthorization: OAuth the-session-uuid{
"params": {
"baremetalChassisInfo": "FILE CONTENT ENCODE BY BASE64"
},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"baremetalChassisInfo":"FILE CONTENT ENCODE BY BASE64"}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/from-file| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| baremetalChassisInfo | String | body(included in the params structure) |
Bare metal chassis information encoded in base64 | 3.1.1 | |
| longJobName (Optional) | String | body(included in the params structure) |
Long job name | 3.1.1 | |
| longJobDescription (Optional) | String | body(included in the params structure) |
Long job description | 3.1.1 | |
| resourceUuid (Optional) | String | body(included in the params structure) |
Resource UUID | 3.1.1 | |
| systemTags (Optional) | List | body | System Tag | 3.1.1 | |
| userTags (Optional) | List | body | User Tag | 3.1.1 | |
| tagUuids (Optional) | List | body(included in the params structure) |
Tag UUID list | 3.4.0 |
API Response
{
"inventory": {
"uuid": "cec9662c5cc534779833c89d8104aa7d",
"name": "APIBatchCreateBaremetalChassisMsg",
"apiId": "85ef8b327b0a3c71a53827b30892f327",
"jobName": "APIBatchCreateBaremetalChassisMsg",
"jobData": "{\"createMessages\":[]",
"jobResult": "",
"state": "Succeeded",
"managementNodeUuid": "31c1228477b6310b9eb28a75e892b046"
}
}| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifying the resource | 2.2.4 |
| name | String | Resource name | 2.2.4 |
| description | String | Detailed description of the resource | 2.2.4 |
| apiId | String | API ID used to correlate with TaskProgress | 2.2.4 |
| jobName | String | Task name | 2.2.4 |
| jobData | String | Task data | 2.2.4 |
| jobResult | String | Task result | 2.2.4 |
| targetResourceUuid | String | Target resource UUID | 2.2.4 |
| managementNodeUuid | String | Management Node UUID | 2.2.4 |
| createDate | Timestamp | Create time | 2.2.4 |
| lastOpDate | Timestamp | Last modification time | 2.2.4 |
| state | LongJobState | For details, see state | 2.2.4 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name | 2.2.4 |
| ordinal | int | The ordinal number. | 2.2.4 |
SDK Examples
BatchCreateBaremetalChassisAction action = new BatchCreateBaremetalChassisAction();
action.baremetalChassisInfo = "FILE CONTENT ENCODE BY BASE64";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
BatchCreateBaremetalChassisAction.Result res = action.call();action = BatchCreateBaremetalChassisAction()
action.baremetalChassisInfo = "FILE CONTENT ENCODE BY BASE64"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()CheckBaremetalChassisConfigFile
API Request
POST zstack/v1/baremetal/chassis/from-file/checkAuthorization: OAuth the-session-uuid{
"params": {
"baremetalChassisInfo": "FILE CONTENT ENCODE BY BASE64"
},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"baremetalChassisInfo":"FILE CONTENT ENCODE BY BASE64"}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/from-file/check| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| baremetalChassisInfo | String | body(included in the params structure) |
Bare metal chassis information encoded in base64 | 3.1.1 | |
| systemTags (Optional) | List | body | System Tag | 3.1.1 | |
| userTags (Optional) | List | body | User Tag | 3.1.1 |
API Response
{} 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
CheckBaremetalChassisConfigFileAction action = new CheckBaremetalChassisConfigFileAction();
action.baremetalChassisInfo = "FILE CONTENT ENCODE BY BASE64";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckBaremetalChassisConfigFileAction.Result res = action.call();action = CheckBaremetalChassisConfigFileAction()
action.baremetalChassisInfo = "FILE CONTENT ENCODE BY BASE64"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()CreateBaremetalChassis
API Request
POST zstack/v1/baremetal/chassisAuthorization: OAuth the-session-uuid{
"params": {
"name": "test",
"clusterUuid": "bf598e729e61382ab2486ac40f25c425",
"ipmiAddress": "1.1.1.1",
"ipmiPort": 623,
"ipmiUsername": "root",
"ipmiPassword": "password"
},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"test","clusterUuid":"bf598e729e61382ab2486ac40f25c425","ipmiAddress":"1.1.1.1","ipmiPort":623,"ipmiUsername":"root","ipmiPassword":"password"}}' \
http://localhost:8080/zstack/v1/baremetal/chassis| 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 | |
| clusterUuid | String | body(included in the params structure) |
Cluster UUID | 2.6.0 | |
| ipmiAddress | String | body(included in the params structure) |
IPMI address | 2.6.0 | |
| ipmiPort (Optional) | Integer | body(included in the params structure) |
IPMI port | 2.6.0 | |
| ipmiUsername | String | body(included in the params structure) |
IPMI username | 2.6.0 | |
| ipmiPassword | String | body(included in the params structure) |
IPMI password | 2.6.0 | |
| resourceUuid (Optional) | String | body(included in the params structure) |
Resource UUID | 2.6.0 | |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 | |
| tagUuids (Optional) | List | body(included in the params structure) |
Tag UUID list | 3.4.0 |
API Response
{
"inventory": {
"uuid": "40fae70b4c573bdfad57d031eaba0eb0",
"ipmiAddress": "1.1.1.1",
"ipmiPort": 623,
"ipmiUsername": "root",
"ipmiPassword": "password",
"state": "Enabled",
"status": "HWInfoUnknown"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | BaremetalChassisInventory | For details, see inventory | 2.6.0 |
| 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 |
| 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 | The pxe server UUID. | 3.1.1 |
| ipmiAddress | String | IPMI address | 2.6.0 |
| ipmiPort | Integer | IPMI port | 2.6.0 |
| ipmiUsername | String | IPMI username | 2.6.0 |
| state | String | The resource state. | 2.6.0 |
| status | String | The resource status. | 2.6.0 |
| createDate | Timestamp | Create time | 2.6.0 |
| lastOpDate | Timestamp | Last modification time | 2.6.0 |
SDK Examples
CreateBaremetalChassisAction action = new CreateBaremetalChassisAction();
action.name = "test";
action.clusterUuid = "bf598e729e61382ab2486ac40f25c425";
action.ipmiAddress = "1.1.1.1";
action.ipmiPort = 623;
action.ipmiUsername = "root";
action.ipmiPassword = "password";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateBaremetalChassisAction.Result res = action.call();action = CreateBaremetalChassisAction()
action.name = "test"
action.clusterUuid = "bf598e729e61382ab2486ac40f25c425"
action.ipmiAddress = "1.1.1.1"
action.ipmiPort = 623
action.ipmiUsername = "root"
action.ipmiPassword = "password"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()DeleteBaremetalChassis
API Request
DELETE zstack/v1/baremetal/chassis/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/baremetal/chassis/b4962c6429d23e93b9473f5aee202496?deleteMode=Permissive| 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
{} 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
DeleteBaremetalChassisAction action = new DeleteBaremetalChassisAction();
action.uuid = "b4962c6429d23e93b9473f5aee202496";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteBaremetalChassisAction.Result res = action.call();action = DeleteBaremetalChassisAction()
action.uuid = "b4962c6429d23e93b9473f5aee202496"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()UpdateBaremetalChassis
API Request
PUT zstack/v1/baremetal/chassis/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateBaremetalChassis": {
"name": "test",
"ipmiAddress": "1.1.1.1",
"ipmiPort": 623,
"ipmiUsername": "root",
"ipmiPassword": "password"
},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateBaremetalChassis":{"name":"test","ipmiAddress":"1.1.1.1","ipmiPort":623,"ipmiUsername":"root","ipmiPassword":"password"}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/cd68e7a048d831768c622a18accd5885/actions| 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 updateBaremetalChassis structure) |
Resource name | 2.6.0 | |
| description (Optional) | String | body(included in the updateBaremetalChassis structure) |
Detailed description of the resource | 2.6.0 | |
| ipmiAddress (Optional) | String | body(included in the updateBaremetalChassis structure) |
IPMI address | 2.6.0 | |
| ipmiPort (Optional) | Integer | body(included in the updateBaremetalChassis structure) |
IPMI port | 2.6.0 | |
| ipmiUsername (Optional) | String | body(included in the updateBaremetalChassis structure) |
IPMI username | 2.6.0 | |
| ipmiPassword (Optional) | String | body(included in the updateBaremetalChassis structure) |
IPMI password | 2.6.0 | |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{
"inventory": {
"uuid": "2a0f218999633ee9a79fe655206b8671",
"ipmiAddress": "1.1.1.1",
"ipmiPort": 623,
"ipmiUsername": "root",
"ipmiPassword": "password",
"state": "Enabled",
"status": "Available"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | BaremetalChassisInventory | For details, see inventory | 2.6.0 |
| 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 |
| 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 | The pxe server UUID. | 3.1.1 |
| ipmiAddress | String | IPMI address | 2.6.0 |
| ipmiPort | Integer | IPMI port | 2.6.0 |
| ipmiUsername | String | IPMI username | 2.6.0 |
| state | String | The resource state. | 2.6.0 |
| status | String | The resource status. | 2.6.0 |
| createDate | Timestamp | Create time | 2.6.0 |
| lastOpDate | Timestamp | Last modification time | 2.6.0 |
SDK Examples
UpdateBaremetalChassisAction action = new UpdateBaremetalChassisAction();
action.uuid = "cd68e7a048d831768c622a18accd5885";
action.name = "test";
action.ipmiAddress = "1.1.1.1";
action.ipmiPort = 623;
action.ipmiUsername = "root";
action.ipmiPassword = "password";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateBaremetalChassisAction.Result res = action.call();action = UpdateBaremetalChassisAction()
action.uuid = "cd68e7a048d831768c622a18accd5885"
action.name = "test"
action.ipmiAddress = "1.1.1.1"
action.ipmiPort = 623
action.ipmiUsername = "root"
action.ipmiPassword = "password"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()QueryBaremetalChassis
API Request
GET zstack/v1/baremetal/chassis
GET zstack/v1/baremetal/chassis/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/chassis?q=uuid=fcdbdc973fe138d991cb9e4c0c96bf24curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/chassis/74db6aa9f4593fddbe914d86510e9244Queryable Fields
Run the CLI command tool, enter QueryBaremetalChassis and press Tab to view all queryable fields and resource names that can be queried across tables.
API Response
{
"inventories": [
{
"uuid": "adf78dd20777349f8b1a9f31b5b1de71",
"ipmiAddress": "1.1.1.1",
"ipmiPort": 623,
"ipmiUsername": "root",
"ipmiPassword": "password",
"state": "Enabled",
"status": "Available"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 |
| inventories | List | For details, see inventories | 2.6.0 |
| 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 |
| 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 | The pxe server UUID. | 3.1.1 |
| ipmiAddress | String | IPMI address | 2.6.0 |
| ipmiPort | Integer | IPMI port | 2.6.0 |
| ipmiUsername | String | IPMI username | 2.6.0 |
| state | String | The resource state. | 2.6.0 |
| status | String | The resource status. | 2.6.0 |
| createDate | Timestamp | Create time | 2.6.0 |
| lastOpDate | Timestamp | Last modification time | 2.6.0 |
SDK Examples
QueryBaremetalChassisAction action = new QueryBaremetalChassisAction();
action.conditions = asList("uuid=79aa822340b2328793e624e0416cc55a");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBaremetalChassisAction.Result res = action.call();action = QueryBaremetalChassisAction()
action.conditions = ["uuid=41375a72ff0d381fac8f50f5b8e7a27f"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()InspectBaremetalChassis
API Request
PUT zstack/v1/baremetal/chassis/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"inspectBaremetalChassis": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"inspectBaremetalChassis":{}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/514c293bdd6c3bc38f0dd5050f85642d/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Bare metal chassis UUID | 2.6.0 | |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{
"inventory": {
"uuid": "a4871bb97ab03c818419484564fadbfb",
"ipmiAddress": "1.1.1.1",
"ipmiPort": 623,
"ipmiUsername": "root",
"ipmiPassword": "password",
"state": "Enabled",
"status": "PxeBooting"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | BaremetalChassisInventory | For details, see inventory | 2.6.0 |
| 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 |
| 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 | The pxe server UUID. | 3.1.1 |
| ipmiAddress | String | IPMI address | 2.6.0 |
| ipmiPort | Integer | IPMI port | 2.6.0 |
| ipmiUsername | String | IPMI username | 2.6.0 |
| state | String | The resource state. | 2.6.0 |
| status | String | The resource status. | 2.6.0 |
| createDate | Timestamp | Create time | 2.6.0 |
| lastOpDate | Timestamp | Last modification time | 2.6.0 |
SDK Examples
InspectBaremetalChassisAction action = new InspectBaremetalChassisAction();
action.uuid = "514c293bdd6c3bc38f0dd5050f85642d";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
InspectBaremetalChassisAction.Result res = action.call();action = InspectBaremetalChassisAction()
action.uuid = "514c293bdd6c3bc38f0dd5050f85642d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()ChangeBaremetalChassisState
API Request
PUT zstack/v1/baremetal/chassis/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"changeBaremetalChassisState": {
"stateEvent": "enable"
},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeBaremetalChassisState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/1a600f11b61e3585bbd26d06166ff640/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifying the resource | 2.6.0 | |
| stateEvent | String | body(included in the changeBaremetalChassisState structure) |
State event |
|
2.6.0 |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{
"inventory": {
"uuid": "506008545fa7391cb2586ae7d6180696",
"ipmiAddress": "1.1.1.1",
"ipmiPort": 623,
"ipmiUsername": "root",
"ipmiPassword": "password",
"state": "Enabled",
"status": "Available"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 | BaremetalChassisInventory | For details, see inventory | 2.6.0 |
| 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 |
| 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 | The pxe server UUID. | 3.1.1 |
| ipmiAddress | String | IPMI address | 2.6.0 |
| ipmiPort | Integer | IPMI port | 2.6.0 |
| ipmiUsername | String | IPMI username | 2.6.0 |
| state | String | The resource state. | 2.6.0 |
| status | String | The resource status. | 2.6.0 |
| createDate | Timestamp | Create time | 2.6.0 |
| lastOpDate | Timestamp | Last modification time | 2.6.0 |
SDK Examples
ChangeBaremetalChassisStateAction action = new ChangeBaremetalChassisStateAction();
action.uuid = "1a600f11b61e3585bbd26d06166ff640";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeBaremetalChassisStateAction.Result res = action.call();action = ChangeBaremetalChassisStateAction()
action.uuid = "1a600f11b61e3585bbd26d06166ff640"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()GetBaremetalChassisPowerStatus
API Request
GET zstack/v1/baremetal/chassis/{uuid}/powerstatusAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/chassis/1fcf1caf5dae30f08ff995620a5bdffd/powerstatus| 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 | query | System Tag | 2.6.0 | |
| userTags (Optional) | List | query | User Tag | 2.6.0 |
API Response
{
"status": "ON"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| status | String | Power status | 2.6.0 |
| success | boolean | Whether the operation succeeded. | 2.6.0 |
| 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 |
| 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
GetBaremetalChassisPowerStatusAction action = new GetBaremetalChassisPowerStatusAction();
action.uuid = "1fcf1caf5dae30f08ff995620a5bdffd";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetBaremetalChassisPowerStatusAction.Result res = action.call();action = GetBaremetalChassisPowerStatusAction()
action.uuid = "1fcf1caf5dae30f08ff995620a5bdffd"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()PowerOnBaremetalChassis
API Request
PUT zstack/v1/baremetal/chassis/{chassisUuid}/actionsAuthorization: OAuth the-session-uuid{
"powerOnBaremetalChassis": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"powerOnBaremetalChassis":{}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/7405d7ceb46634528618789cde730795/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| chassisUuid | String | url | Bare metal chassis UUID | 2.6.0 | |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{} 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
PowerOnBaremetalChassisAction action = new PowerOnBaremetalChassisAction();
action.chassisUuid = "7405d7ceb46634528618789cde730795";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
PowerOnBaremetalChassisAction.Result res = action.call();action = PowerOnBaremetalChassisAction()
action.chassisUuid = "7405d7ceb46634528618789cde730795"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()PowerResetBaremetalChassis
API Request
PUT zstack/v1/baremetal/chassis/{chassisUuid}/actionsAuthorization: OAuth the-session-uuid{
"powerResetBaremetalChassis": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"powerResetBaremetalChassis":{}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/8a947fc86c0c3e1d89462722af254ddf/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| chassisUuid | String | url | Bare metal chassis UUID | 2.6.0 | |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{} 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
PowerResetBaremetalChassisAction action = new PowerResetBaremetalChassisAction();
action.chassisUuid = "8a947fc86c0c3e1d89462722af254ddf";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
PowerResetBaremetalChassisAction.Result res = action.call();action = PowerResetBaremetalChassisAction()
action.chassisUuid = "8a947fc86c0c3e1d89462722af254ddf"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()PowerOffBaremetalChassis
API Request
PUT zstack/v1/baremetal/chassis/{chassisUuid}/actionsAuthorization: OAuth the-session-uuid{
"powerOffBaremetalChassis": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"powerOffBaremetalChassis":{}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/ee53c6d1f4ad3ebb8971aa5933d6f9d6/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| chassisUuid | String | url | Bare metal chassis UUID | 2.6.0 | |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{} 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
PowerOffBaremetalChassisAction action = new PowerOffBaremetalChassisAction();
action.chassisUuid = "ee53c6d1f4ad3ebb8971aa5933d6f9d6";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
PowerOffBaremetalChassisAction.Result res = action.call();action = PowerOffBaremetalChassisAction()
action.chassisUuid = "ee53c6d1f4ad3ebb8971aa5933d6f9d6"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()Bare Metal Instance Related Interfaces
StartBaremetalInstance
API Request
PUT zstack/v1/baremetal/instances/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 | Whether the operation succeeded. | 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 |
| 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 |
| 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 | The pxe server UUID. | 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 | The resource state. | 2.6.0 |
| status | String | The resource status. | 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 |
| 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 | The metadata. | 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
StartBaremetalInstanceAction action = new StartBaremetalInstanceAction();
action.uuid = "dc6931adfb8a38bf9919d46b1531e9e4";
action.pxeBoot = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StartBaremetalInstanceAction.Result res = action.call();action = StartBaremetalInstanceAction()
action.uuid = "dc6931adfb8a38bf9919d46b1531e9e4"
action.pxeBoot = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()DestroyBaremetalInstance
API Request
DELETE zstack/v1/baremetal/instances/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/baremetal/instances/8f34148a0cce3acf883c6f6b59eb8c0d?deleteMode=Permissive| 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
{} 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
DestroyBaremetalInstanceAction action = new DestroyBaremetalInstanceAction();
action.uuid = "8f34148a0cce3acf883c6f6b59eb8c0d";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DestroyBaremetalInstanceAction.Result res = action.call();action = DestroyBaremetalInstanceAction()
action.uuid = "8f34148a0cce3acf883c6f6b59eb8c0d"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()ExpungeBaremetalInstance
API Request
PUT zstack/v1/baremetal/instances/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"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 -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| 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
{} 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
ExpungeBaremetalInstanceAction action = new ExpungeBaremetalInstanceAction();
action.uuid = "1016135ece1d3b189112cea52ae84d8d";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ExpungeBaremetalInstanceAction.Result res = action.call();action = ExpungeBaremetalInstanceAction()
action.uuid = "1016135ece1d3b189112cea52ae84d8d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()RecoverBaremetalInstance
API Request
PUT zstack/v1/baremetal/instances/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"recoverBaremetalInstance": {},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"recoverBaremetalInstance":{}}' \
http://localhost:8080/zstack/v1/baremetal/instances/0a71736890e437928f90415a276ca245/actions| 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
{
"inventory": {
"uuid": "38471d80059739568ee29b580ee00314",
"name": "BM-1",
"description": "This is a baremetal instance.",
"zoneUuid": "cd3f0df2f33d3d47af58fa92d45e0ed3",
"clusterUuid": "fc7f9da7d8a53a939a4163619a2e6264",
"chassisUuid": "36d14ed4da51339eae615f7716724d25",
"imageUuid": "4eec69d4ae423807bf38164c6d592d86",
"platform": "Linux",
"state": "Stopped",
"status": "Provisioned",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"bmNics": [
{
"uuid": "9e01966b83283f9b967be10fe13ce8bf",
"baremetalInstanceUuid": "38471d80059739568ee29b580ee00314",
"l3NetworkUuid": "294c0bcaa1e43fae9abaadef23d72e24",
"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 | Whether the operation succeeded. | 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 |
| 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 |
| 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 | The pxe server UUID. | 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 | The resource state. | 2.6.0 |
| status | String | The resource status. | 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 |
| 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 | The metadata. | 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
RecoverBaremetalInstanceAction action = new RecoverBaremetalInstanceAction();
action.uuid = "0a71736890e437928f90415a276ca245";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RecoverBaremetalInstanceAction.Result res = action.call();action = RecoverBaremetalInstanceAction()
action.uuid = "0a71736890e437928f90415a276ca245"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()UpdateBaremetalInstance
API Request
PUT zstack/v1/baremetal/instances/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateBaremetalInstance": {
"name": "BM-1-RENAMED"
},
"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 -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| 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 |
|
2.6.0 |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{
"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
}
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 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 |
| 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 |
| 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 | The pxe server UUID. | 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 | The resource state. | 2.6.0 |
| status | String | The resource status. | 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 |
| 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 | The metadata. | 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
UpdateBaremetalInstanceAction action = new UpdateBaremetalInstanceAction();
action.uuid = "eb538a2a8f17342697593ac468b93d1a";
action.name = "BM-1-RENAMED";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateBaremetalInstanceAction.Result res = action.call();action = UpdateBaremetalInstanceAction()
action.uuid = "eb538a2a8f17342697593ac468b93d1a"
action.name = "BM-1-RENAMED"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()StopBaremetalInstance
API Request
PUT zstack/v1/baremetal/instances/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"stopBaremetalInstance": {
"type": "grace"
},
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"stopBaremetalInstance":{"type":"grace"}}' \
http://localhost:8080/zstack/v1/baremetal/instances/d106a65de4e43667a794a0606a05f724/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource, uniquely identifying the resource | 2.6.0 | |
| type (Optional) | String | body(included in the stopBaremetalInstance structure) |
Bare metal instance shutdown mode |
|
2.6.0 |
| systemTags (Optional) | List | body | System Tag | 2.6.0 | |
| userTags (Optional) | List | body | User Tag | 2.6.0 |
API Response
{
"inventory": {
"uuid": "4bf8e15fe39c3b0d8055b7074a522d2d",
"name": "BM-1",
"description": "This is a baremetal instance.",
"zoneUuid": "541a4429a399336288dcbb83fe2573b4",
"clusterUuid": "30efc0a59ac53afeb1d4d1fe2226a0a9",
"chassisUuid": "7bd2492307033fedb5311dd23ddf2bbd",
"imageUuid": "441390c7c83c3592ac29e6f1e38d392f",
"platform": "Linux",
"state": "Stopped",
"status": "Provisioned",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"bmNics": [
{
"uuid": "f81e9b15830538b9b826e113146f1ed1",
"baremetalInstanceUuid": "4bf8e15fe39c3b0d8055b7074a522d2d",
"l3NetworkUuid": "811f43fa4f9f34b9a3a1756911ad9fc1",
"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 | Whether the operation succeeded. | 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 |
| 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 |
| 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 | The pxe server UUID. | 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 | The resource state. | 2.6.0 |
| status | String | The resource status. | 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 |
| 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 | The metadata. | 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
StopBaremetalInstanceAction action = new StopBaremetalInstanceAction();
action.uuid = "d106a65de4e43667a794a0606a05f724";
action.type = "grace";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
StopBaremetalInstanceAction.Result res = action.call();action = StopBaremetalInstanceAction()
action.uuid = "d106a65de4e43667a794a0606a05f724"
action.type = "grace"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()RebootBaremetalInstance
API Request
PUT zstack/v1/baremetal/instances/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"rebootBaremetalInstance": {
"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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"rebootBaremetalInstance":{"pxeBoot":false}}' \
http://localhost:8080/zstack/v1/baremetal/instances/c3be8e4c6f783f0c9aecd9600b2c3768/actions| 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 | |
| pxeBoot (Optional) | Boolean | body(included in the rebootBaremetalInstance structure) |
Whether to boot via network PXE | 2.6.0 |
API Response
{
"inventory": {
"uuid": "227ea410fadd38668fb7dd5679d3f095",
"name": "BM-1",
"description": "This is a baremetal instance.",
"zoneUuid": "946022bde3053bf29c7cbbf466241c7f",
"clusterUuid": "a7b427907a883ae2acf0a6d408eae0e5",
"chassisUuid": "0746a3cc213a345d89d31bfd82b00e12",
"imageUuid": "828c0bc2e8f132bc924ed0a616860e66",
"platform": "Linux",
"state": "Rebooting",
"status": "Provisioned",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"bmNics": [
{
"uuid": "fe99549e3f4f3683b4fb37f623de9115",
"baremetalInstanceUuid": "227ea410fadd38668fb7dd5679d3f095",
"l3NetworkUuid": "99f6eb7273e936f3ad638ba00b474a4b",
"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 | Whether the operation succeeded. | 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 |
| 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 |
| 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 | The pxe server UUID. | 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 | The resource state. | 2.6.0 |
| status | String | The resource status. | 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 |
| 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 | The metadata. | 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
RebootBaremetalInstanceAction action = new RebootBaremetalInstanceAction();
action.uuid = "c3be8e4c6f783f0c9aecd9600b2c3768";
action.pxeBoot = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RebootBaremetalInstanceAction.Result res = action.call();action = RebootBaremetalInstanceAction()
action.uuid = "c3be8e4c6f783f0c9aecd9600b2c3768"
action.pxeBoot = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()QueryBaremetalInstance
API Request
GET zstack/v1/baremetal/instances
GET zstack/v1/baremetal/instances/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/instances?q=uuid = 93c50425e0ed3b2884027db70620db38curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/instances/f52fb05bdd0837bdbc28dd08a529526cQueriable Fields
Run the CLI command, enter QueryBaremetalInstance and press Tab to view all queriable fields and resource names that can be queried across tables.
API Response
{
"inventories": [
{
"uuid": "9d3a2dd0d48c3220a40a66a33874f25a",
"name": "BM-1",
"description": "This is a baremetal instance.",
"zoneUuid": "4d1bf4f2ab113292808be87ad9ff553b",
"clusterUuid": "e24ee969ccc83aa287713ec2dca4e8e0",
"chassisUuid": "da16af4bb6c43b8fba2b5ba918e0cdbb",
"imageUuid": "70ff9f3ae5863fcfab60999afdf55219",
"platform": "Linux",
"state": "Running",
"status": "Provisioned",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"bmNics": [
{
"uuid": "8fb718abb0bd3ce99215d446cd6dba1d",
"baremetalInstanceUuid": "9d3a2dd0d48c3220a40a66a33874f25a",
"l3NetworkUuid": "8b40c2c7a19e3c96b4bca63b56909898",
"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 | Whether the operation succeeded. | 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 |
| inventories | List | For details, see inventories | 2.6.0 |
| 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 |
| 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 | The pxe server UUID. | 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 | The resource state. | 2.6.0 |
| status | String | The resource status. | 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 |
| 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 | The metadata. | 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
QueryBaremetalInstanceAction action = new QueryBaremetalInstanceAction();
action.conditions = asList("uuid = 7fac9998fb703185a8b6655af59d0d21");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBaremetalInstanceAction.Result res = action.call();action = QueryBaremetalInstanceAction()
action.conditions = ["uuid = a52323ca9c6132eeb0dc607570fb988f"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()Bare Metal Network APIs
CreateBaremetalBonding
API Request
POST zstack/v1/baremetal/network/bondingsAuthorization: OAuth the-session-uuid{
"params": {
"chassisUuid": "8a3fddc82d1536ad8f695d25d84404f2",
"name": "bond0",
"mode": 1,
"slaves": "[\"d4:ae:52:6e:d1:0d\", \"d4:ae:52:6e:d1:0e\"]",
"opts": "miimon\u003d100"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"chassisUuid":"8a3fddc82d1536ad8f695d25d84404f2","name":"bond0","mode":1,"slaves":"[\"d4:ae:52:6e:d1:0d\", \"d4:ae:52:6e:d1:0e\"]","opts":"miimon=100"}}' \
http://localhost:8080/zstack/v1/baremetal/network/bondings| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| chassisUuid | String | body (contained in params structure) |
Bare Metal Chassis UUID | 3.4.0 | |
| name | String | body (contained in params structure) |
NIC Bonding Name | 3.4.0 | |
| mode | Integer | body (contained in params structure) |
NIC Bonding Mode | 3.4.0 | |
| slaves | String | body (contained in params structure) |
NIC Bonding Slaves MAC Address | 3.4.0 | |
| opts (Optional) | String | body (contained in params structure) |
NIC Bonding Options | 3.4.0 | |
| resourceUuid (Optional) | String | body (contained in params structure) |
Resource UUID | 3.4.0 | |
| systemTags (Optional) | List | body | System Tags | 3.4.0 | |
| userTags (Optional) | List | body | User Tags | 3.4.0 | |
| tagUuids (Optional) | List | body (contained in params structure) |
Tag UUID List | 3.4.0 |
API Response
{
"inventory": {
"uuid": "badccdb49c6e4ad599696948457f5277",
"chassisUuid": "6442d12334e44aee96fc74c2fc8ea8f9",
"name": "bond0",
"mode": 1,
"slaves": "[\"d4:ae:52:6e:d1:0d\", \"d4:ae:52:6e:d1:0e\"]",
"opts": "miimon\u003d100",
"createDate": "Aug 15, 2025 5:32:54 AM",
"lastOpDate": "Aug 15, 2025 5:32:54 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 0.6 |
| error | ErrorCode | Error code. If not null, the operation failed. When the operation succeeds, this field is null. See error for details. | 3.4.0 |
| inventory | BaremetalBondingInventory | See inventory for details. | 3.4.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, a globally unique identifier for 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, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause, the source error that caused the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 3.4.0 |
| chassisUuid | String | Bare Metal Chassis UUID | 3.4.0 |
| name | String | NIC Bonding Name | 3.4.0 |
| mode | Integer | NIC Bonding Mode | 3.4.0 |
| slaves | String | Slave MAC Address, comma separated | 3.4.0 |
| opts | String | NIC Bonding Options | 3.4.0 |
| createDate | Timestamp | Create Time | 3.4.0 |
| lastOpDate | Timestamp | Last Modification Time | 3.4.0 |
SDK Examples
CreateBaremetalBondingAction action = new CreateBaremetalBondingAction();
action.chassisUuid = "8a3fddc82d1536ad8f695d25d84404f2";
action.name = "bond0";
action.mode = 1;
action.slaves = "["d4:ae:52:6e:d1:0d", "d4:ae:52:6e:d1:0e"]";
action.opts = "miimon=100";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateBaremetalBondingAction.Result res = action.call();action = CreateBaremetalBondingAction()
action.chassisUuid = "8a3fddc82d1536ad8f695d25d84404f2"
action.name = "bond0"
action.mode = 1
action.slaves = "["d4:ae:52:6e:d1:0d", "d4:ae:52:6e:d1:0e"]"
action.opts = "miimon=100"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()QueryBaremetalBonding
API Request
GET zstack/v1/baremetal/network/bondings
GET zstack/v1/baremetal/network/bondings/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/network/bondings?q=uuid=10d30b226f093a4c9ccd911575406e7bcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/network/bondings/e0ea2452b6be30a6a7fbfc01dd5e70f5Queryable Fields
Run the CLI command tool, enter QueryBaremetalBonding and press Tab to view all queryable fields and resource names that can be queried across tables.
API Response
{
"inventories": [
{
"uuid": "d2ab26c55a664a85ae2df0b8cee6ede7",
"chassisUuid": "6b0cde704099460b9a96a0c451186467",
"name": "bond0",
"mode": 1,
"slaves": "[\"d4:ae:52:6e:d1:0d\", \"d4:ae:52:6e:d1:0e\"]",
"opts": "miimon\u003d100",
"createDate": "Aug 15, 2025 5:36:54 AM",
"lastOpDate": "Aug 15, 2025 5:36:54 AM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 0.6 |
| error | ErrorCode | Error code. If not null, the operation failed. When the operation succeeds, this field is null. See error for details. | 3.4.0 |
| inventories | List | See inventories for details. | 3.4.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, a globally unique identifier for 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, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause, the source error that caused the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 3.4.0 |
| chassisUuid | String | Bare Metal Chassis UUID | 3.4.0 |
| name | String | NIC Bonding Name | 3.4.0 |
| mode | Integer | NIC Bonding Mode | 3.4.0 |
| slaves | String | Slave MAC Address, comma separated | 3.4.0 |
| opts | String | NIC Bonding Options | 3.4.0 |
| createDate | Timestamp | Create Time | 3.4.0 |
| lastOpDate | Timestamp | Last Modification Time | 3.4.0 |
SDK Examples
QueryBaremetalBondingAction action = new QueryBaremetalBondingAction();
action.conditions = asList("uuid=eb879ea0b5b93f12aefb1a8bb21cf135");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBaremetalBondingAction.Result res = action.call();action = QueryBaremetalBondingAction()
action.conditions = ["uuid=3c90a0f5fb763620ab38cc6184732ea3"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()