ChangeBareMetal2ProvisionNetworkState
API Request
URLs
PUT zstack/v1/baremetal2/provision-networks/{uuid}/actions
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.
{
"changeBareMetal2ProvisionNetworkState": {
"stateEvent": "enable"
},
"systemTags": [],
"userTags": []
}

Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeBareMetal2ProvisionNetworkState":{"stateEvent":"enable"}}' http://localhost:8080/zstack/v1/baremetal2/provision-networks/9d2b61e0abba3dd5830fe13bde6fc935/actions
Request Parameters
Name | Type | Location | Description | Valid Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The deployment network UUID. | 4.0.0 | |
stateEvent | String | body(contained in the changeBareMetal2ProvisionNetworkState structure) | The event that changes the state of the chassis. |
|
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": "0f0a5bd7eaef49d2a4ddff9507afa4e8",
"zoneUuid": "1d5a403dcfdb4b6fa581540579e5d5cb",
"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
ChangeBareMetal2ProvisionNetworkStateAction action = new ChangeBareMetal2ProvisionNetworkStateAction();
action.uuid = "9d2b61e0abba3dd5830fe13bde6fc935";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeBareMetal2ProvisionNetworkStateAction.Result res = action.call();
Python
SDK
ChangeBareMetal2ProvisionNetworkStateAction action = ChangeBareMetal2ProvisionNetworkStateAction()
action.uuid = "9d2b61e0abba3dd5830fe13bde6fc935"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeBareMetal2ProvisionNetworkStateAction.Result res = action.call()