UpdateBareMetal2ProvisionNetwork
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.
{
"updateBareMetal2ProvisionNetwork": {
"name": "NEW_BM_PROVISION_NETWORK",
"description": "This is a new bare metal provision network.",
"dhcpInterface": "ens0",
"dhcpRangeStartIp": "10.0.0.100",
"dhcpRangeEndIp": "10.0.0.200",
"dhcpRangeNetmask": "255.255.255.0",
"dhcpRangeGateway": "10.0.0.1"
},
"systemTags": [],
"userTags": []
}

Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateBareMetal2ProvisionNetwork":{"name":"NEW_BM_PROVISION_NETWORK","description":"This is a new bare metal provision network.","dhcpInterface":"ens0","dhcpRangeStartIp":"10.0.0.100","dhcpRangeEndIp":"10.0.0.200","dhcpRangeNetmask":"255.255.255.0","dhcpRangeGateway":"10.0.0.1"}}' http://localhost:8080/zstack/v1/baremetal2/provision-networks/597f524b0c70326d87f654a78f82b304/actions
Request Parameters
Name | Type | Location | Description | Valid Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The deployment network UUID. | 4.0.0 | |
name | String | body(contained in the updateBareMetal2ProvisionNetwork structure) | Optional. The deployment network name. | 4.0.0 | |
description | String | body(contained in the updateBareMetal2ProvisionNetwork structure) | Optional. The detailed description of the deployment network. | 4.0.0 | |
dhcpInterface | String | body(contained in the updateBareMetal2ProvisionNetwork structure) | Optional. The name of the DHCP NIC. | 4.0.0 | |
dhcpRangeStartIp | String | body(contained in the updateBareMetal2ProvisionNetwork structure) | Optional. The starting IP address that DHCP assigns to a bare metal instance. | 4.0.0 | |
dhcpRangeEndIp | String | body(contained in the updateBareMetal2ProvisionNetwork structure) | Optional. The ending IP address that DHCP assigns to a bare metal instance. | 4.0.0 | |
dhcpRangeNetmask | String | body(contained in the updateBareMetal2ProvisionNetwork structure) | Optional. 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 | body(contained in the updateBareMetal2ProvisionNetwork structure) | Optional. The gateway IP address. | 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": "71a316af965a48949b55603ab30be6e8",
"zoneUuid": "c052ae4b7fa447848f25e1c7fab543d2",
"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
UpdateBareMetal2ProvisionNetworkAction action = new UpdateBareMetal2ProvisionNetworkAction();
action.uuid = "597f524b0c70326d87f654a78f82b304";
action.name = "NEW_BM_PROVISION_NETWORK";
action.description = "This is a new bare metal provision network.";
action.dhcpInterface = "ens0";
action.dhcpRangeStartIp = "10.0.0.100";
action.dhcpRangeEndIp = "10.0.0.200";
action.dhcpRangeNetmask = "255.255.255.0";
action.dhcpRangeGateway = "10.0.0.1";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateBareMetal2ProvisionNetworkAction.Result res = action.call();
Python
SDK
UpdateBareMetal2ProvisionNetworkAction action = UpdateBareMetal2ProvisionNetworkAction()
action.uuid = "597f524b0c70326d87f654a78f82b304"
action.name = "NEW_BM_PROVISION_NETWORK"
action.description = "This is a new bare metal provision network."
action.dhcpInterface = "ens0"
action.dhcpRangeStartIp = "10.0.0.100"
action.dhcpRangeEndIp = "10.0.0.200"
action.dhcpRangeNetmask = "255.255.255.0"
action.dhcpRangeGateway = "10.0.0.1"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateBareMetal2ProvisionNetworkAction.Result res = action.call()