Go to main content

Oracle® ZFS Storage Appliance RESTful API Guide, Release OS8.8.0

Exit Print View

Updated: November 2018
 
 

Network Datalinks

The network datalinks command provides datalink management on the appliance. You can list, modify, create, and delete datalink resources.

Table 31  Network Datalink Commands
Request
Append to Path /network/v1
Description
POST
/datalinks
Create a new network datalink
GET
/datalinks/datalink
Get the specified network datalink properties
GET
/datalinks
List all network datalink objects
PUT
/datalinks/datalink
Modify the specified network datalink object
DELETE
/datalinks/datalink
Destroy the specified datalink object
Table 32  Physical Device Datalink Properties
Property
Type
Description
class
String
“device” (“immutable”)
label
NetworkLabel
Label
links
ChooseOne
Links [“igb1”, “igb0”, “ixgbe2”, “ixgbe3”, “igb4”, “igb3”, “ixgbe1”, “igb2”, “igb5”]
jumbo
Boolean
Use Jumbo Frames [“true”, “false”] (“deprecated”)
mtu
PositiveInteger
Max transmission unit (MTU)
speed
ChooseOne
Link Speed [“auto”, “10”, “100”, “1000”, “10000”]
duplex
ChooseOne
Link Duplex [“auto”, “half”, “full”]
Table 33  VNIC Device Datalink Properties
Property
Type
Description
class
String
“vnic” (“immutable”)
label
NetworkLabel
Label
links
ChooseOne
Links [“ixgbe0”]
mtu
PositiveInteger
Max transmission unit (MTU)
id
VLAN
VLAN ID
Table 34  VLAN Device Datalink Properties
Property
Type
Description
class
String
“vlan” (“immutable”)
label
NetworkLabel
Label
links
ChooseOne
Links [“ixgbe0”]
mtu
PositiveInteger
Max transmission unit (MTU)
id
VLAN
VLAN ID
Table 35  Aggregation Based Device Datalink Properties
Property
Type
Description
class
String
“aggregation” (“immutable”)
label
NetworkLabel
Label
links
ChooseN
Links [“igb1”, “igb0”, “ixgbe2”, “ixgbe3”, “igb4”, “igb3”, “ixgbe1”, “igb2”, “igb5”]
jumbo
Boolean
Use Jumbo Frames [“true”, “false”] (“deprecated”)
mtu
PositiveInteger
Max transmission unit (MTU)
policy
ChooseOne
Policy [“L2”, “L3”, “L4”, “L2+L3”, “L2+L4”, “L3+L4”]
mode
ChooseOne
Mode [“active”, “passive”, “off”]
timer
ChooseOne
Timer [“short”, “long”]
key
Integer
Aggregation Key (“immutable”)
Table 36  IP-Partition-Based Device Datalink Properties
Property
Type
Description
class
String
“partition” (“immutable”)
label
NetworkLabel
Label
links
ChooseOne
Links
pkey
Pkey
Partition Key
linkmode
ChooseOne
Link Mode [“cm”, “ud”]

List Network Datalinks

Lists all configured datalinks on the appliance. Each object in the datalinks list contains an href to get the operation on a single datalink resource along with datalink properties.

Example Request:

GET /api/network/v1/datalinks HTTP/1.1
Host: zfs-storage.example.com
Accept: application/json

Example JSON Data:

{
    "datalinks": [{
        "href": "/api/network/v1/datalinks/ixgbe0",
        ...
    }, {
        "href": "/api/network/v1/datalinks/ixgbe1",
        ...
    }, {
        "href": "/api/network/v1/datalinks/ixgbe2",
        ...
    }, {
        "href": "/api/network/v1/datalinks/ixgbe3",
        ...
    }]
}

Get Network Datalink

The GET method returns a JSON object that contains a datalink property with a list of datalink objects.

GET /api/network/v1/datalinks/ixgbe0 HTTP/1.1 Host: zfs-storage.example.com

Accept: application/json

Example JSON Data:

{
    "datalink": {
        "class": "device",
        "datalink": "ixgbe0",
        "duplex": "auto",
        "href": "/api/network/v1/datalinks/ixgbe0",
        "jumbo": false,
        "label": "Untitled Datalink",
        "links": [
            "ixgbe0"
        ],
        "mac": "0:21:28:a1:d9:68",
        "mtu": 1500,
        "speed": "auto"
    }
}

Create Network Datalink

The POST command creates a new datalink. One additional property that is needed when creating a new datalink is the class property, which defines the class of datalink to create. The datalinks class is defined during datalink creation and can be one of the following class types:

  • device – Create a device-based datalink

  • vnic – Create a VNIC-based datalink

  • vlan – Create a VLAN-based datalink

  • aggregation – Create an aggregation-based datalink

  • partition – Create an IB partition datalink

The properties map to the same CLI properties available in the "configuration net datalinks" menu.

Example Request:

POST /api/network/v1/datalinks HTTP/1.1
Host: zfs-storage.example.com:215
X-Auth-User: root
X-Auth-Key: password
Content-Type: application/json
Content-Length: 78

{
    "class": "device",
    "jumbo": true,
    "links": ["ixgbe2"],
    "label": "TestDataLink"
}

Example Response:

HTTP/1.1 201 Created
X-Zfssa-Appliance-Api: 1.0
Location: /api/network/v1/datalinks/ixgbe2

Modify Network Datalink

The PUT method is used to modify datalink properties. For details on setting up datalinks, see the CLI documentation.

Example Request:

PUT /api/network/v1/datalinks/ixgbe2 HTTP/1.1

{"jumbo": true}

Example Response:

HTTP/1.1 202 Accepted
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 219

{
    "datalink": {
        "href": "/api/network/v1/datalinks/ixgbe2",
        "class": "device",
        "label": "MyDataLink",
        "links": ["ixgbe2"],
        "mac": "0:21:28:a1:d9:6a",
        "mtu": 9000,
        "duplex": "auto",
        "jumbo": true,
        "speed": "auto"
    }
}

Delete Network Datalink

This command removes the datalink from the system. Use the href path to delete the specified datalink.

Example Request:

DELETE /api/network/v1/datalinks/ixgbe2 HTTP/1.1

Example Responses:

HTTP/1.1 204 No Content