AttachBareMetal2ProvisionNetworkToCluster
API Request
URLs
POST zstack/v1/baremetal2/clusters/{clusterUuid}/provision-networks/{networkUuid}
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {},
"systemTags": [],
"userTags": []
}

Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' \
http://localhost:8080/zstack/v1/baremetal2/clusters/2ed064d2addf3644bdd69aaa187c0ca9/provision-networks/ce03631365e0340bbd99a0092508abff
Request Parameters
Name | Type | Location | Description | Valid Value | Starting Version |
---|---|---|---|---|---|
clusterUuid | String | url | The cluster UUID. | 4.0.0 | |
networkUuid | String | url | The deployment network UUID. | 4.0.0 | |
systemTags | List | body | Optional. The system tags. | 4.0.0 | |
userTags | List | body | Optional. The user tags. | 4.0.0 |
API Response
Sample Response
{
"inventory": {
"uuid": "bc86a5d650424baaab9f875bfe3337bd",
"zoneUuid": "3f7405e07ab54cd9bdcfa6008c398be1",
"name": "BM_PROVISION_NETWORK",
"description": "This is a bare metal provision network.",
"dhcpInterface": "eth0",
"dhcpRangeStartIp": "192.168.0.10",
"dhcpRangeEndIp": "192.168.0.100",
"dhcpRangeNetmask": "255.255.255.0",
"dhcpRangeGateway": "192.168.0.1",
"dhcpRangeNetworkCidr": "192.168.0.10/24",
"state": "Enabled",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.0.0 |
inventory | BareMetal2ProvisionNetworkInventory | See inventory. | 4.0.0 |
#error
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.0.0 |
description | String | The brief description of the error. | 4.0.0 |
details | String | The details about the error. | 4.0.0 |
elaboration | String | The reserved field. Default value: null. | 4.0.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 4.0.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.0.0 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The deployment network UUID. | 4.0.0 |
zoneUuid | String | The zone UUID. | 4.0.0 |
name | String | The name of the deployment network. | 4.0.0 |
description | String | The detailed description of the deployment network. | 4.0.0 |
dhcpInterface | String | The name of the DHCP NIC. | 4.0.0 |
dhcpRangeStartIp | String | The starting IP address that DHCP assigns to a bare metal instance. | 4.0.0 |
dhcpRangeEndIp | String | The ending IP address that DHCP assigns to a bare metal instance. | 4.0.0 |
dhcpRangeNetmask | String | The netmask of the IP range from which the DHCP server assigns an IP address to a bare metal instance. | 4.0.0 |
dhcpRangeGateway | String | The gateway IP address. | 4.0.0 |
dhcpRangeNetworkCidr | String | The CIDR block. | 4.0.0 |
state | String | The state of the deployment network. | 4.0.0 |
createDate | Timestamp | The time when the deployment network was created. | 4.0.0 |
lastOpDate | Timestamp | The time when the deployment network was last modified. | 4.0.0 |
attachedClusterUuids | List | 4.0.0 |
SDK Sample
Java
SDK
AttachBareMetal2ProvisionNetworkToClusterAction action = new AttachBareMetal2ProvisionNetworkToClusterAction();
action.clusterUuid = "2ed064d2addf3644bdd69aaa187c0ca9";
action.networkUuid = "ce03631365e0340bbd99a0092508abff";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachBareMetal2ProvisionNetworkToClusterAction.Result res = action.call();
Python
SDK
AttachBareMetal2ProvisionNetworkToClusterAction action = AttachBareMetal2ProvisionNetworkToClusterAction()
action.clusterUuid = "2ed064d2addf3644bdd69aaa187c0ca9"
action.networkUuid = "ce03631365e0340bbd99a0092508abff"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachBareMetal2ProvisionNetworkToClusterAction.Result res = action.call()