These commands manage network routes.
|
|
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-###.
Lists all of the network routes created on an appliance.
Example Request:
GET /api/network/v1/routes HTTP/1.1 Authorization: Basic abcd1234MWE= Host: zfs-storage.example.com:215 Accept: application/json
Example Result:
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 192 { "routes": [{ "destination": "ipaddr-0", "family": "IPv4", "gateway": "ipaddr-1", "href": "/api/network/v1/routing/route-000", "interface": "ixgbe0", "mask": 0, "route": "route-000", "type": "static" }, { "destination": "ipaddr-2", "family": "IPv4", "gateway": "ipaddr-3", "href": "/api/network/v1/routes/route-001", "interface": "ixgbe0", "mask": 24, "route": "route-001", "type": "system" }] }
Gets the properties for a single route.
Example Request:
GET /api/network/v1/routes/destination=ipaddr-1 HTTP/1.1 Authorization: Basic abcd1234MWE= Host: zfs-storage.example.com:215 Accept: application/json
Example Result:
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 192 { "route": { "destination": "ipaddr-1", "family": "IPv4", "gateway": "ipaddr-2", "href": "/api/network/v1/routes/route-001", "interface": "ixgbe0", "mask": 24, "route": "route-001", "type": "system" } }
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: zfs-storage.example.com:215 Content-Type: application/json Content-Length: 164 { "family": "IPv4", "destination": "ipaddr-0", "mask": "0", "gateway": "ipaddr-1", "interface": "ixgbe0" }
Example Result:
HTTP/1.1 201 Created
Deletes an existing network route.
Example Request:
DELETE /api/network/v1/routes/route-001 HTTP/1.1 Authorization: Basic abcd1234MWE= Host: zfs-storage.example.com:215
Example Result:
HTTP/1.1 204 No Content