Go to main content
Oracle® ZFS Storage Appliance RESTful API Guide, Release OS8.7.0

Exit Print View

Updated: July 2017
 
 

Network Routes

Manages network routes.

Table 41  Manage Network Routes
Request
Path /api/network/v1
Description
POST
/routes
Create a new network route
GET
/routes/<route>
Get the specified network route properties
GET
/routes
List all network route objects
DELETE
/routes/<route>
Destroy the specified route object
GET
/routing
Get net routing properties
PUT
/routing
Modify net routing properties
Table 42  Network Route Properties
Name
Description
type
Type of route such as “system” or “static” (immutable)
family
Address family (either IPv4 or IPv6)
destination
Route destination address
gateway
Gateway address
interface
Network datalink interface

The href path to each route uses the route IDs set in the CLI, but these values can change as routes are modified. The API supports selecting single routes using unique properties within the route. The syntax is routes/<name>=<value> compared to routes/route-###.

List Routes

Lists all of the network routes created on an appliance.

Example Request:

GET /api/network/v1/routes HTTP/1.1
Authorization: Basic abcd1234MWE=
Host: zfssa.example.com:215
Accept: application/json

Example Result:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 192

{
    "routes": [{
        "destination": "0.0.0.0",
        "family": "IPv4",
        "gateway": "10.80.231.1",
        "href": "/api/network/v1/routing/route-000",
        "interface": "ixgbe0",
        "mask": 0,
        "route": "route-000",
        "type": "static"
    }, {
        "destination": "10.80.231.0",
        "family": "IPv4",
        "gateway": "10.80.231.58",
        "href": "/api/network/v1/routes/route-001",
        "interface": "ixgbe0",
        "mask": 24,
        "route": "route-001",
        "type": "system"
    }]
}

Get Route

Gets the properties for a single route.

Example Request:

GET /api/network/v1/routes/destination=10.80.231.0 HTTP/1.1
Authorization: Basic abcd1234MWE=
Host: zfssa.example.com:215
Accept: application/json

Example Result:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 192

{
    "route": {
        "destination": "10.80.231.0",
        "family": "IPv4",
        "gateway": "10.80.231.58",
        "href": "/api/network/v1/routes/route-001",
        "interface": "ixgbe0",
        "mask": 24,
        "route": "route-001",
        "type": "system"
    }
}

Add Route

Creates a new network route. The route href values can change if other routes are added to the system. No route information is returned on a create since the returned properties would be identical to the input properties. A successful create returns HTTP Status 204 (Created).

Example Request to Create a Static Route:

POST /api/network/v1/routes HTTP/1.1
Authorization: Basic abcd1234MWE=
Host: zfssa.example.com:215
Content-Type: application/json
Content-Length: 164

{
    "family": "IPv4",
    "destination": "0.0.0.0",
    "mask": "0",
    "gateway": "10.11.12.1",
    "interface": "ixgbe0"
}

Example Result:

HTTP/1.1 201 Created

Delete Route

Deletes an existing network route.

Example Request:

DELETE /api/network/v1/routes/route-001 HTTP/1.1
Authorization: Basic abcd1234MWE=
Host: zfssa.example.com:215

Example Result:

HTTP/1.1 204 No Content