VM Related Interfaces

Get Virtual Machine NIC Attachable Distributed Port Groups

GET/zstack/v1/vm-instances/nics/{vmNicUuid}/l3-networks-candidates

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/nics/3382601183c9319384d5aa17ec956a3f/l3-networks-candidates

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
vmNicUuidStringurlVirtual Machine NIC UUID 4.1.0
systemTags (Optional)ListquerySystem Tag 4.1.0
userTags (Optional)ListqueryUser Tag 4.1.0

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "f8fc36eaff6f3253a134bab93823baf1",
      "name": "private L3",
      "type": "L3BasicNetwork",
      "zoneUuid": "9ef7d386414c3101adeecd45ec9a2d51",
      "l2NetworkUuid": "ad3adf2da22f36c2946d90fae7f99b19",
      "state": "Enabled",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "ipRanges": [
        {
          "uuid": "16f163ee55f93d4f8dca9fefcac41ecc",
          "l3NetworkUuid": "f8fc36eaff6f3253a134bab93823baf1",
          "name": "ip range",
          "startIp": "192.168.0.10",
          "endIp": "192.168.0.100",
          "netmask": "255.255.255.0",
          "gateway": "192.168.0.1",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ],
      "networkServices": [
        {
          "l3NetworkUuid": "f8fc36eaff6f3253a134bab93823baf1",
          "networkServiceProviderUuid": "f714dba2f49a3d6788aafbe8b5ab3dc2",
          "networkServiceType": "DHCP"
        },
        {
          "l3NetworkUuid": "f8fc36eaff6f3253a134bab93823baf1",
          "networkServiceProviderUuid": "f714dba2f49a3d6788aafbe8b5ab3dc2",
          "networkServiceType": "DNS"
        },
        {
          "l3NetworkUuid": "f8fc36eaff6f3253a134bab93823baf1",
          "networkServiceProviderUuid": "f714dba2f49a3d6788aafbe8b5ab3dc2",
          "networkServiceType": "SNAT"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation is successful. For details, see error4.1.0
inventoryListFor details, see inventory4.1.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10014.1.0
descriptionStringBrief description of the error4.1.0
detailsStringDetailed error information4.1.0
elaborationStringReserved field, defaults to null4.1.0
opaqueLinkedHashMapReserved field, defaults to null4.1.0
causeErrorCodeRoot cause. The source error that caused the current error. If there is no original error, this field is null4.1.0

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource4.1.0
nameStringResource name4.1.0
descriptionStringDetailed description of the resource4.1.0
typeString 4.1.0
zoneUuidStringData Center UUID4.1.0
l2NetworkUuidStringPort Group Distributed Switch UUID4.1.0
stateString 4.1.0
dnsDomainString 4.1.0
systemBoolean 4.1.0
categoryString 4.1.0
ipVersionIntegerIP protocol number4.1.0
enableIPAMBooleanEnable IP address management feature4.10.16
createDateTimestampCreate time4.1.0
lastOpDateTimestampLast modification time4.1.0
dnsList 4.1.0
ipRangesListFor details, see ipRanges4.1.0
networkServicesListFor details, see networkServices4.1.0
hostRouteListFor details, see ipRangesx4.1.0
reservedIpRangesListFor details, see reservedIpRanges4.10.16

ipRanges

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource4.1.0
l3NetworkUuidStringDistributed Port Group UUID4.1.0
nameStringResource name4.1.0
descriptionStringDetailed description of the resource4.1.0
startIpStringStart address4.1.0
endIpStringEnd address4.1.0
netmaskStringNetmask4.1.0
prefixLenStringPrefix length4.1.0
gatewayStringGateway4.1.0
networkCidrStringNetwork CIDR4.1.0
ipVersionIntegerIP protocol number4.1.0
addressModeStringIPv6 address allocation mode4.1.0
createDateTimestampCreate time4.1.0
lastOpDateTimestampLast modification time4.1.0
ipRangeTypeIpRangeTypeFor details, see ipRangeType4.1.0

ipRangeType

NameTypeDescriptionStarting Version
NormalIpRangeTypeNormal address range4.1.0
AddressPoolIpRangeTypeAddress pool range4.1.0

networkServices

NameTypeDescriptionStarting Version
l3NetworkUuidStringDistributed Port Group UUID4.1.0
networkServiceProviderUuidStringNetwork Service Provider Module UUID4.1.0
networkServiceTypeString 4.1.0

hostRoute

NameTypeDescriptionStarting Version
idLong 4.1.0
l3NetworkUuidStringDistributed Port Group UUID4.1.0
prefixString 4.1.0
nexthopString 4.1.0
createDateTimestampCreate time4.1.0
lastOpDateTimestampLast modification time4.1.0

reservedIpRanges

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource4.10.16
l3NetworkUuidStringDistributed Port Group UUID4.10.16
nameStringResource name4.10.16
descriptionStringDetailed description of the resource4.10.16
startIpStringStart IP (included in the reserved address range)4.10.16
endIpStringEnd IP (included in the reserved address range)4.10.16
ipVersionIntegerIP protocol number4.10.16
createDateTimestampCreate time4.10.16
lastOpDateTimestampLast modification time4.10.16

SDK Examples

Java SDK

GetCandidateL3NetworksForChangeVmNicNetworkAction action = new GetCandidateL3NetworksForChangeVmNicNetworkAction();
action.vmNicUuid = "3382601183c9319384d5aa17ec956a3f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateL3NetworksForChangeVmNicNetworkAction.Result res = action.call();

Python SDK

action = GetCandidateL3NetworksForChangeVmNicNetworkAction()
action.vmNicUuid = "3382601183c9319384d5aa17ec956a3f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()