UpdatePortGroup
Headers
Authorization: OAuth the-session-uuidBody
{
"updatePortGroup": {
"name": "Test-L3Network"
},
"systemTags": [],
"userTags": []
}In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updatePortGroup":{"name":"Test-L3Network"}}' \
http://localhost:8080/zstack/v1/l3-networks/port-group/a1a3a4bea5e73628b591081fde9f019a/actionsRequest Parameters
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | The resource UUID. |
| 4.2.0 |
name | String | body(contained in the updatePortGroup structure) | The resource name. |
| 4.2.0 |
description | String | body(contained in the updatePortGroup structure) | Optional. The detailed description of the resource. |
| 4.2.0 |
dnsDomain | String | body(contained in the updatePortGroup structure) | Optional. The DNS domain. |
| 4.2.0 |
category | String | body(contained in the updatePortGroup structure) | Optional. The network type. It must be used with the system tag. When system is true, it can be set to Public or Private. |
| 4.2.0 |
system | Boolean | body(contained in the updatePortGroup structure) | Optional. Whether it is used for a system Virtual Machine. |
| 4.2.0 |
systemTags | List | body | Optional. The system tags. |
| 4.2.0 |
userTags | List | body | Optional. The user tags. |
| 4.2.0 |
API Response
Sample Response
{
"inventory": {
"vSwitchUuid": "d0d6d19b51ef3ec18b9607a51ac8fa47",
"vlanMode": "ACCESS",
"vlanId": 100,
"uuid": "20f61c97cf2e32e58bed3812144de79d",
"name": "port-group-1",
"description": "Test",
"type": "portGroup",
"zoneUuid": "231b37f483e93801bad53885c1fe3cdb",
"l2NetworkUuid": "60cbdcfee56831cdb8324aa7d9797032",
"state": "Enabled",
"system": false,
"category": "Private",
"enableIPAM": false
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.2.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.2.0 |
| inventory | L3NetworkInventory | See inventory. | 4.2.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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| type | String | 0.6 | |
| zoneUuid | String | The Data Center UUID. | 0.6 |
| l2NetworkUuid | String | The port group Distributed Switch UUID. | 0.6 |
| state | String | 0.6 | |
| dnsDomain | String | 0.6 | |
| system | Boolean | 0.6 | |
| category | String | 0.6 | |
| ipVersion | Integer | The IP protocol number. | 3.1.0 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| dns | List | 0.6 | |
| ipRanges | List | See ipRanges. | 0.6 |
| networkServices | List | See networkServices. | 0.6 |
| hostRoute | List | See hostRoute. | 2.3 |
ipRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| l3NetworkUuid | String | The Distributed Port Group UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| startIp | String | The start IP address. | 0.6 |
| endIp | String | The end IP address. | 0.6 |
| netmask | String | The netmask. | 0.6 |
| prefixLen | String | The prefix length. | 3.1.0 |
| gateway | String | The gateway. | 0.6 |
| networkCidr | String | The network CIDR. | 0.6 |
| ipVersion | Integer | The IP protocol number. | 3.1.0 |
| addressMode | String | The IPv6 address allocation mode. | 3.1.0 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| ipRangeType | IpRangeType | See ipRangeType. | 3.9 |
ipRangeType
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | IpRangeType | Normal address range. | 3.9 |
| AddressPool | IpRangeType | Address pool range. | 3.9 |
networkServices
| Name | Type | Description | Starting Version |
|---|---|---|---|
| l3NetworkUuid | String | The Distributed Port Group UUID. | 0.6 |
| networkServiceProviderUuid | String | The network service provider UUID. | 0.6 |
| networkServiceType | String | 0.6 |
hostRoute
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | 2.3 | |
| l3NetworkUuid | String | The Distributed Port Group UUID. | 2.3 |
| prefix | String | 2.3 | |
| nexthop | String | 2.3 | |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
Java SDK
UpdatePortGroupAction action = new UpdatePortGroupAction();
action.uuid = "a1a3a4bea5e73628b591081fde9f019a";
action.name = "Test-L3Network";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdatePortGroupAction.Result res = action.call();Python SDK
UpdatePortGroupAction action = UpdatePortGroupAction()
action.uuid = "a1a3a4bea5e73628b591081fde9f019a"
action.name = "Test-L3Network"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdatePortGroupAction.Result res = action.call()