Document navigation

GetVmAttachableL3Network

API Request

URLs
GET zstack/v1/vm-instances/{vmInstanceUuid}/l3-networks-candidates
Headers
Authorization: OAuth the-session-uuid
Curl Sample
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
Request Parameters
Name Type Location Description Optional Value Starting Version
vmInstanceUuid String url The VM instance UUID. 0.6
systemTags List query Optional. The system tags. 0.6
userTags List query Optional. The user tags. 0.6

API Response

Sample Response
{
  "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"
        }
      ]
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventories List See inventories. 0.6
#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
#inventories
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 The resource type. 0.6
zoneUuid String The zone UUID. 0.6
l2NetworkUuid String The L2 network UUID. 0.6
state String The resource state. 0.6
dnsDomain String The DNS domain. 0.6
system Boolean The system. 0.6
category String The category. 0.6
ipVersion Integer The IP version. 3.1.0
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
dns List The DNS server address. 0.6
ipRanges List See ipRanges. 0.6
networkServices List See networkServices. 0.6
hostRoute List See hostRoute. 0.6
#ipRanges
Name Type Description Starting Version
uuid String The resource UUID. 0.6
l3NetworkUuid String The L3 network 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. 0.6
endIp String The end IP. 0.6
netmask String The netmask. 0.6
prefixLen String The netmask length. 3.1.0
gateway String The gateway IP address. 0.6
networkCidr String The network cidr. 0.6
ipVersion Integer The IP version. 3.1.0
addressMode String The allocation mode of the IPv6 address. 3.1.0
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
#networkServices
Name Type Description Starting Version
l3NetworkUuid String The L3 network UUID. 0.6
networkServiceProviderUuid String The network service provider UUID. 0.6
networkServiceType String The network service type. 0.6
#hostRoute
Name Type Description Starting Version
id Long The resource ID. 2.3
l3NetworkUuid String The L3 network UUID. 2.3
prefix String The prefix. 2.3
nexthop String The next hop. 2.3
createDate Timestamp The creation date. 2.3
lastOpDate Timestamp The last operation date. 2.3

SDK Sample

Java SDK
GetVmAttachableL3NetworkAction action = new GetVmAttachableL3NetworkAction();
action.vmInstanceUuid = "eb2f2966162a47768578a0fb4016d75f";
action.sessionId = "9fe9dda1b076485baa9f3d49dacb0b3d";
GetVmAttachableL3NetworkAction.Result res = action.call();
Python SDK
action = GetVmAttachableL3NetworkAction()
action.vmInstanceUuid = "2c39b050a8984491922aeadbbdd8ed48"
action.sessionId = "006575fef83c43c68f7bfb9c05f6b05c"
res = action.call()
API Reference | 5.5.38 | ZStack Cloud · ZCF | ZStack Resource Center