|
|
This command lists all of the configured network interfaces.
Example Request:
GET /api/network/v1/interfaces HTTP/1.1 Authorization: Basic abcd1234MWE= Host: zfs-storage.example.com:215 Accept: application/json
Example Response:
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 369 { "interfaces": {[ "href": "/api/network/v1/interfaces/ixgbe0", "v4addrs": ["ipaddr-1"] ... }, { "href": "/api/network/v1/interfaces/ixgbe1", "v4addrs": ["ipaddr-2"] ... }, { "href": "/api/network/v1/interfaces/ixgbe2", "v4addrs": ["ipaddr-3"] ... }, { "href": "/api/network/v1/interfaces/ixgbe3", "v4addrs": ["ipaddr-4"] ... }] }
This command gets the full list of properties for a specified network interface.
Example Request:
GET /api/network/v1/interfaces/ixgbe0 HTTP/1.1 Authorization: Basic abcd1234MWE= Host: zfs-storage.example.com:215 Accept: application/json
Example Response:
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 292 { "interface": { "admin": true, "class": "ip", "curaddrs": ["ipaddr-1"], "enable": true, "href": "/api/network/v1/interfaces/ixgbe0", "interface": "ixgbe0", "label": "Untitled Interface", "links": ["ixgbe0"], "state": "up", "v4addrs": ["ipaddr-1"], "v4dhcp": false, "v6addrs": [], "v6dhcp": false } }
This command creates a new network interface.
Example Request:
POST /api/network/v1/interfaces 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": "ip", "links": ["ixgbe3"], "v4addrs":"192.0.2.0/24" }
Example Response:
HTTP/1.1 201 Created X-Zfssa-Appliance-Api: 1.0 Location: /api/network/v1/interfaces/ixgbe3
This command modifies an existing network interface.
Example Request:
PUT /api/network/v1/interfaces/ixgbe3 HTTP/1.1 { "v4addrs": ["192.0.2.0/24"], "interface": "Demo Rest" }
Example Response:
HTTP/1.1 202 Accepted X-Zfssa-Appliance-Api: 1.0 Content-Type: application/json Content-Length: 219 { "admin": true, "class": "ip", "curaddrs": ["192.0.2.0/24"], "enable": true, "href": "/api/network/v1/interfaces/ixgbe3", "interface": "ixgbe3", "label": "Demo Rest", "links": ["ixgbe3"], "state": "failed", "v4addrs": ["192.0.2.0/24"] "v4dhcp": false, "v6addrs": [], "v6dhcp": false }
This command deletes an existing network interface.
Example Request:
DELETE /api/network/v1/interfaces/ixgbe3 HTTP/1.1 Authorization: Basic abcd1234MWE= Host: zfs-storage.example.com:215
Example Result:
HTTP/1.1 204 No Content