Network ResourcesDistributed Port Group Related Interfaces

UpdatePortGroup

PUT/zstack/v1/l3-networks/port-group/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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/actions

Request 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.

  • Public
  • Private
  • System

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
  }
}
NameTypeDescriptionStarting Version
successboolean 4.2.0
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.4.2.0
inventoryL3NetworkInventorySee inventory.4.2.0

error

NameTypeDescriptionStarting Version
codeStringThe error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.0.6
descriptionStringThe brief description of the error.0.6
detailsStringThe details about the error.0.6
elaborationStringThe reserved field. Default value: null.0.6
opaqueLinkedHashMapThe reserved field. Default value: null.0.6
causeErrorCodeThe root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.0.6
nameStringThe resource name.0.6
descriptionStringThe detailed description of the resource.0.6
typeString 0.6
zoneUuidStringThe Data Center UUID.0.6
l2NetworkUuidStringThe port group Distributed Switch UUID.0.6
stateString 0.6
dnsDomainString 0.6
systemBoolean 0.6
categoryString 0.6
ipVersionIntegerThe IP protocol number.3.1.0
createDateTimestampThe creation date.0.6
lastOpDateTimestampThe last operation date.0.6
dnsList 0.6
ipRangesListSee ipRanges.0.6
networkServicesListSee networkServices.0.6
hostRouteListSee hostRoute.2.3

ipRanges

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.0.6
l3NetworkUuidStringThe Distributed Port Group UUID.0.6
nameStringThe resource name.0.6
descriptionStringThe detailed description of the resource.0.6
startIpStringThe start IP address.0.6
endIpStringThe end IP address.0.6
netmaskStringThe netmask.0.6
prefixLenStringThe prefix length.3.1.0
gatewayStringThe gateway.0.6
networkCidrStringThe network CIDR.0.6
ipVersionIntegerThe IP protocol number.3.1.0
addressModeStringThe IPv6 address allocation mode.3.1.0
createDateTimestampThe creation date.0.6
lastOpDateTimestampThe last operation date.0.6
ipRangeTypeIpRangeTypeSee ipRangeType.3.9

ipRangeType

NameTypeDescriptionStarting Version
NormalIpRangeTypeNormal address range.3.9
AddressPoolIpRangeTypeAddress pool range.3.9

networkServices

NameTypeDescriptionStarting Version
l3NetworkUuidStringThe Distributed Port Group UUID.0.6
networkServiceProviderUuidStringThe network service provider UUID.0.6
networkServiceTypeString 0.6

hostRoute

NameTypeDescriptionStarting Version
idLong 2.3
l3NetworkUuidStringThe Distributed Port Group UUID.2.3
prefixString 2.3
nexthopString 2.3
createDateTimestampThe creation date.2.3
lastOpDateTimestampThe 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()