Go to main content
Oracle® ZFS Storage Appliance RESTful API Guide, Release 2013.1.4.0

Exit Print View

Updated: April 2015
 
 

Network Interfaces

Table 36  Network Interface Commands
Request
Path /api/network/v1
Description
POST
/interfaces
Create a new network interface
GET
/interfaces/<interface>
Get the specified network interface properties
GET
/interfaces
List all network interface objects
PUT
/interfaces/<interface>
Modify the specified network interface object
DELETE
/interfaces/<interface>
Destroy the specified interface object
Table 37  Network Interface Properties
Name
Description
admin
Flag indicating if administration is allowed on this interface
class
Class type ("ip", "ipmp") (immutable after create)
curaddrs
Current IP Addresses (immutable)
enable
Flag indicating if this interface is enabled
label
User label for interface
links
Chose a network link for this interface
state
State of Interface (immutable)
v4addrs
IPv4 Addresses
v6dhcp
IPv4 DHCP flag
v6addrs
IPv6 Addresses
v6dhcp
IPv6 DHCP flag

List Network Interfaces

Lists all of the configured network interfaces.

Example Request:

GET /api/network/v1/interfaces HTTP/1.1
Authorization: Basic abcd1234MWE=
Host: zfssa.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": ["10.80.231.58/24"]
        ...
    }, {
        "href": "/api/network/v1/interfaces/ixgbe1",
        "v4addrs": ["10.80.231.59/24"]
        ...
    }, {
        "href": "/api/network/v1/interfaces/ixgbe2",
        "v4addrs": ["10.80.231.60/24"]
        ...
    }, {
        "href": "/api/network/v1/interfaces/ixgbe3",
        "v4addrs": ["10.80.231.61/24"]
        ...
    }]
}

Get Network Interface

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: zfssa.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": ["10.80.231.58/24"],
        "enable": true,
        "href": "/api/network/v1/interfaces/ixgbe0",
        "interface": "ixgbe0",
        "label": "Untitled Interface",
        "links": ["ixgbe0"],
        "state": "up",
        "v4addrs": ["10.80.231.58/24"],
        "v4dhcp": false,
        "v6addrs": [],
        "v6dhcp": false
    }
}

Create Network Interface

Creates a new network interface.

Example Request:

POST /api/network/v1/interfaces HTTP/1.1
Host: zfssa.example.com:215
X-Auth-User: root
X-Auth-Key: letmein
Content-Type: application/json
Content-Length: 78

{
    "class": "ip",
    "links": ["ixgbe3"],
    "v4addrs":"192.168.1.9/24"
}

Example Response:

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

Modify Network Interface

Modifies an existing network interface.

Example Request:

PUT /api/network/v1/interfaces/ixgbe3 HTTP/1.1

{
    "v4addrs": ["192.168.1.99/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.168.1.9/24"],
    "enable": true,
    "href": "/api/network/v1/interfaces/ixgbe3",
    "interface": "ixgbe3",
    "label": "Demo Rest",
    "links": ["ixgbe3"],
    "state": "failed",
    "v4addrs": ["192.168.1.99/24"]
    "v4dhcp": false,
    "v6addrs": [],
    "v6dhcp": false
}

Delete Network Interface

Deletes an existing network interface.

Example Request:

DELETE /api/network/v1/interfaces/ixgbe3 HTTP/1.1
Authorization: Basic abcd1234MWE=
Host: zfssa.example.com:215

Example Result:

HTTP/1.1 204 No Content