The network datalinks command provides datalink management on the appliance. You can list, modify, create, and delete datalink resources.
|
|
|
|
|
|
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", ... }] }
The GET methods 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" } }
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: zfssa.example.com:215 X-Auth-User: root X-Auth-Key: letmein 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
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" } }
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