CreateL3Network

API Request

URLs
POST zstack/v1/l3-networks
Headers
Authorization: OAuth the-session-uuid
Body
{   "params": {     "name": "Test-L3Network",     "type": "L3BasicNetwork",     "l2NetworkUuid": "f29d1122065540c9a495e70893f813b9",     "category": "Private",     "system": false   },   "systemTags": [],   "userTags": [] }
Note: 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 POST -d '{"params":{"name":"Test-L3Network","type":"L3BasicNetwork","l2NetworkUuid":"bb059728e72f3ff1b3ae2fc9caba3dce","category":"Private","system":false}}' \ http://localhost:8080/zstack/v1/l3-networks
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The L3 network name. 0.6
description String body (contained in the params structure) Optional. The detailed description of the L3 network. 0.6
type String body (contained in the params structure) Optional. The L3 network type.
  • L3BasicNetwork
  • L3VpcNetwork
0.6
l2NetworkUuid String body (contained in the params structure) The L2 network UUID. 0.6
ipVersion String body (contained in the params structure) Optional. The IP version.
  • 4
  • 6
3.1.0
system boolean body (contained in the params structure) Optional. Whether the L3 network can be applied to appliance VM instances. 0.6
dnsDomain String body (contained in the params structure) Optional. The DNS domain. 0.6
resourceUuid String body (contained in the params structure) Optional. The resource UUID. If specified, the L3 network will use the specified value as UUID. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6
category String body (contained in the params structure) Optional. The network type, which must be used with the system tags. If system is set to true, this parameter can be set to Public or Private.
  • Public
  • Private
  • System
2.2
Note:
  • When you create an L3 network in ZStack, you can specify the port mirroring network by adding the mirrorNetwork option to SystemTags.
    • Format of the mirrorNetwork option: mirrorNetwork::{L3NetworkVOUuid}
    • Example: mirrorNetwork::1c707a63817b4f29b1235fa1f76c0ccc

API Response

Sample Response
{   "inventory": {     "name": "Test-L3Network",     "l2NetworkUuid": "1bfca1892b674df28d26d9a3c0f609f9",     "category": "Private"   } }
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
inventory L3NetworkInventory See inventory. 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
#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 The L3 network type. 0.6
zoneUuid String The zone UUID. 0.6
l2NetworkUuid String The L2 network UUID. 0.6
state String The state of the L3 network. 0.6
dnsDomain String The DNS domain. 0.6
system Boolean Whether the L3 network can be applied to appliance VM instances. 0.6
category String The network type, which must be used with the system tags. If system is set to true, this parameter can be set to Public or Private. 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. 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 L3 network UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
startIp String 0.6
endIp String 0.6
netmask String 0.6
prefixLen String The prefix length. 3.1.0
gateway String 0.6
networkCidr String 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 0.6
#hostRoute
Name Type Description Starting Version
id Long 2.3
l3NetworkUuid String The L3 network 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
CreateL3NetworkAction action = new CreateL3NetworkAction(); action.name = "Test-L3Network"; action.type = "L3BasicNetwork"; action.l2NetworkUuid = "bb059728e72f3ff1b3ae2fc9caba3dce"; action.category = "Private"; action.system = false; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateL3NetworkAction.Result res = action.call();
Python SDK
CreateL3NetworkAction action = CreateL3NetworkAction() action.name = "Test-L3Network" action.type = "L3BasicNetwork" action.l2NetworkUuid = "bb059728e72f3ff1b3ae2fc9caba3dce" action.category = "Private" action.system = false action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" CreateL3NetworkAction.Result res = action.call()

DeleteL3Network

API Request

URLs
DELETE zstack/v1/l3-networks/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth 9e78fa4cfc8a49baadb763cd62ac6a3f" \ -X DELETE http://localhost:8080/zstack/v1/l3-networks/76490f9cd26d4c8a9501cc5a5312aa99?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
deleteMode String body Optional. The delete mode. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{     "error": {         "code": "SYS.1001",         "description": "A message or a operation timeout",         "details": "Create VM on KVM timeout after 300s"     } }

SDK Sample

Java SDK
DeleteL3NetworkAction action = new DeleteL3NetworkAction(); action.uuid = "c19ee03770c6486b85abc58ea10f017a"; action.deleteMode = "Permissive"; action.sessionId = "b8b93037f8064e219bdcbe9dd9a9f366"; DeleteL3NetworkAction.Result res = action.call();
Python SDK
DeleteL3NetworkAction action = DeleteL3NetworkAction() action.uuid = "8c4a39676be64072b20e7b7dc4b0ccc7" action.deleteMode = "Permissive" action.sessionId = "e0e4140009fc4b95af7197bffc64f7c0" DeleteL3NetworkAction.Result res = action.call()

QueryL3Network

API Request

URLs
GET zstack/v1/l3-networks GET zstack/v1/l3-networks/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth 98858a4b613f46a4815c34c1c930b34e" \ -X GET http://localhost:8080/zstack/v1/l3-networks
Note:
For example, query the private L3 network.
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth 98858a4b613f46a4815c34c1c930b34e" \ -X GET http://localhost:8080/zstack/v1/l3-networks?q=category=Private
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth c1148725103644bc8e2879d72fa47389" \ -X GET http://localhost:8080/zstack/v1/l3-networks/9d119c003bb54d4781443bbc7febcd7f

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryL3Network, and pressing the Tab key.

API Response

Sample Response
{   "inventories": [     {       "name": "Test-L3Network",       "l2NetworkUuid": "8bcf5b824378406494d81ffdae56bde3"     }   ] }
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 L3 network type. 0.6
zoneUuid String The zone UUID. 0.6
l2NetworkUuid String The L2 network UUID. 0.6
state String The state of the L3 network. 0.6
dnsDomain String The DNS domain. 0.6
system Boolean Whether the L3 network can be applied to appliance VM instances. 0.6
category String The network type, which must be used with the system tags. If system is set to true, this parameter can be set to Public or Private. 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. 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 L3 network UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
startIp String 0.6
endIp String 0.6
netmask String 0.6
prefixLen String The prefix length. 3.1.0
gateway String 0.6
networkCidr String 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 0.6
#hostRoute
Name Type Description Starting Version
id Long 2.3
l3NetworkUuid String The L3 network 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
QueryL3NetworkAction action = new QueryL3NetworkAction(); action.conditions = asList(); action.sessionId = "58f4bcc9b20f46bfaba379ca0c739535"; QueryL3NetworkAction.Result res = action.call();
Python SDK
QueryL3NetworkAction action = QueryL3NetworkAction() action.conditions = [] action.sessionId = "2f99e245b0f04712941da401ecab7173" QueryL3NetworkAction.Result res = action.call()

























Back to Top

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.