VM Related Interfaces

Get VM Attachable L3 Network List

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

Get the list of L3 Networks that can be attached to a Virtual Machine.

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth: 26f05abbc21441dc921a573eda1fed6b" \
-X GET http://localhost:8080/zstack/v1/vm-instances/16bf0d8cb1e346568e4cfba52c70a9c2/l3-networks-candidates

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
vmInstanceUuidStringurlVirtual Machine UUID 0.6
systemTags (optional)ListquerySystem Tags 0.6
userTags (optional)ListqueryUser Tags 0.6

API Response

Return Example

{
  "inventories": [
    {
      "uuid": "d2f77ca69b1448d3b8e063c3d551cf1b",
      "name": "private L3",
      "type": "L3BasicNetwork",
      "zoneUuid": "67a6601dc8dd476ebca371123ff03f14",
      "l2NetworkUuid": "94bdffb080b346e7a3ac2f44f574cc4a",
      "state": "Enabled",
      "createDate": "Apr 24, 2017 7:11:08 PM",
      "lastOpDate": "Apr 24, 2017 7:11:08 PM",
      "ipRanges": [
        {
          "uuid": "e15972969ac64d1ea01c0c228d969bcc",
          "l3NetworkUuid": "d2f77ca69b1448d3b8e063c3d551cf1b",
          "name": "ip range",
          "startIp": "192.168.0.10",
          "endIp": "192.168.0.100",
          "netmask": "255.255.255.0",
          "gateway": "192.168.0.1",
          "createDate": "Apr 24, 2017 7:11:08 PM",
          "lastOpDate": "Apr 24, 2017 7:11:08 PM"
        }
      ],
      "networkServices": [
        {
          "l3NetworkUuid": "d2f77ca69b1448d3b8e063c3d551cf1b",
          "networkServiceProviderUuid": "a493b6286d6e43f89e06062b7a4ad182",
          "networkServiceType": "DHCP"
        },
        {
          "l3NetworkUuid": "d2f77ca69b1448d3b8e063c3d551cf1b",
          "networkServiceProviderUuid": "a493b6286d6e43f89e06062b7a4ad182",
          "networkServiceType": "DNS"
        },
        {
          "l3NetworkUuid": "d2f77ca69b1448d3b8e063c3d551cf1b",
          "networkServiceProviderUuid": "a493b6286d6e43f89e06062b7a4ad182",
          "networkServiceType": "SNAT"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, indicates operation failure. This field is null when the operation succeeds. See error0.6
inventoriesListSee inventories0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause, the source error that triggered the current error. If there is no original error, this field is null0.6

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
nameStringResource name0.6
descriptionStringResource description0.6
typeString 0.6
zoneUuidStringData Center UUID0.6
l2NetworkUuidStringDistributed Switch UUID0.6
stateString 0.6
dnsDomainString 0.6
systemBoolean 0.6
categoryString 0.6
ipVersionIntegerIP Protocol Number3.1.0
enableIPAMBooleanEnable IP Address Management4.10.16
createDateTimestampCreation Time0.6
lastOpDateTimestampLast Operation Date0.6
dnsList 0.6
ipRangesListSee ipRanges0.6
networkServicesListSee networkServices0.6
hostRouteListSee hostRoute0.6
reservedIpRangesListSee reservedIpRanges4.10.16

ipRanges

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
l3NetworkUuidStringDistributed Port Group UUID0.6
nameStringResource name0.6
descriptionStringResource description0.6
startIpStringStart IP Address0.6
endIpStringEnd IP Address0.6
netmaskStringNetmask0.6
prefixLenStringPrefix Length3.1.0
gatewayStringGateway0.6
networkCidrStringNetwork CIDR0.6
ipVersionIntegerIP Protocol Number3.1.0
addressModeStringIPv6 Address Allocation Mode3.1.0
createDateTimestampCreation Time0.6
lastOpDateTimestampLast Operation Date0.6
ipRangeTypeIpRangeTypeSee ipRangeType3.9

ipRangeType

NameTypeDescriptionStarting Version
NormalIpRangeTypeNormal IP Range3.9
AddressPoolIpRangeTypeAddress Pool Range3.9

networkServices

NameTypeDescriptionStarting Version
l3NetworkUuidStringDistributed Port Group UUID0.6
networkServiceProviderUuidStringNetwork Service Provider UUID0.6
networkServiceTypeString 0.6

hostRoute

NameTypeDescriptionStarting Version
idLong 2.3
l3NetworkUuidStringDistributed Port Group UUID2.3
prefixString 2.3
nexthopString 2.3
createDateTimestampCreation Time2.3
lastOpDateTimestampLast Operation Date2.3

reservedIpRanges

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource4.10.16
l3NetworkUuidStringDistributed Port Group UUID4.10.16
nameStringResource name4.10.16
descriptionStringResource description4.10.16
startIpStringStart IP (contained in reserved IP range)4.10.16
endIpStringEnd IP (contained in reserved IP range)4.10.16
ipVersionIntegerIP Protocol Number4.10.16
createDateTimestampCreation Time4.10.16
lastOpDateTimestampLast Operation Date4.10.16

SDK Examples

Java SDK

GetVmAttachableL3NetworkAction action = new GetVmAttachableL3NetworkAction();
action.vmInstanceUuid = "eb2f2966162a47768578a0fb4016d75f";
action.sessionId = "9fe9dda1b076485baa9f3d49dacb0b3d";
GetVmAttachableL3NetworkAction.Result res = action.call();

Python SDK

action = GetVmAttachableL3NetworkAction()
action.vmInstanceUuid = "3cda5c14384230bc9055830d69e8536d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()