net.route¶
Summary¶
Resource | Operation | Description |
---|---|---|
Route | POST /api/app/v1/net/route | Get static IPv4 routes |
DELETE /api/app/v1/net/route | Delete static IPv4 route | |
POST /api/app/v1/net/route/component | Add static IPv4 component route | |
DELETE /api/app/v1/net/route/component | Delete IPv4 component route | |
PUT /api/app/v1/net/route/load | Load IPv4 routes from filestore | |
PUT /api/app/v1/net/route/save | Save IPv4 routes to filestore | |
POST /api/app/v1/net/route6 | Add static IPv4 route | |
DELETE /api/app/v1/net/route6 | Delete static IPv6 route | |
PUT /api/app/v1/net/route6/load | Load IPv6 routes from filestore | |
PUT /api/app/v1/net/route6/save | Save IPv6 routes to filestore | |
GET /api/app/v1/net/route6_list | Get static IPv6 routes | |
GET /api/app/v1/net/route_list | Get static IPv4 routes | |
GET /api/app/v1/net/route_list/component | Get IPv4 component routes | |
GET /api/app/v1/net/routes | Download routes from filestore | |
POST /api/app/v1/net/routes | Load routes from file |
Details¶
-
POST
/api/app/v1/net/route
¶ Add static IPv4 route.
New in version 1.0.
Query Parameters: - dest (required) – Destination IP address (or subnet) in IPv4 format
- mask (required) – Netmask in IPv4 format
- gateway (required) – Gateway (next hop) in IPv4 format
- interface (required) – Interface name (eth0, eth1, aux0, aux1)
- module (optional) – Module the interface belongs to. If omitted route will be set on the appliance
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - get routes
- 401 Unauthorized – Access Denied
Accepted Authorization: admin
Example 1 - Request: Set route on the appliance:
POST /api/app/v1/net/route?dest=30.10.0.0&mask=255.255.255.0&gateway=192.168.0.1&interface=eth0 HTTP/1.1 Accept: text/html
Example 1 - Response: Set route on the appliance:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 2 - Request: Set route on WCG P1:
POST /api/app/v1/net/route?dest=30.10.0.0&mask=255.255.255.0&gateway=192.168.0.1&interface=eth0&module=wcg HTTP/1.1 Accept: text/html
Example 2 - Response: Set route on WCG P1:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 3 - Request: Invalid gateway for the interface:
POST /api/app/v1/net/route?dest=30.10.0.0&mask=255.255.255.0&gateway=192.168.0.7&interface=eth0 HTTP/1.1 Accept: text/html
Example 3 - Response: Invalid gateway for the interface:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Invalid gateway '10.206.22.254'", "Status": "Failure" }
-
DELETE
/api/app/v1/net/route
¶ Delete single static IPv4 route.
New in version 1.0.
Query Parameters: - dest (required) – Destination IP address(or subnet) in IPv4 format
- mask (required) – Netmask in IPv4 format
- gateway (required) – Gateway (next hop) in IPv4 format
- interface (required) – Interface name. (eth0, eth1, aux0, aux1)
- module (optional) – Module the interface belongs to. If ommitted route will be set on the appliance
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - delete route
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
- 500 Internal Server Error – Server Error - invalid module
Accepted Authorization: admin
Example 1 - Request: Delete route on the appliance:
DELETE /api/app/v1/net/route?dest=30.10.0.0&mask=255.255.255.0&gateway=192.168.0.1&interface=eth0 HTTP/1.1 Accept: text/html
Example 1 - Response: Delete route on the appliance:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 2 - Request: Delete route on WCG P1:
DELETE /api/app/v1/net/route?dest=30.10.0.0&mask=255.255.255.0&gateway=192.168.0.1&interface=eth0&module=wcg HTTP/1.1 Accept: text/html
Example 2 - Response: Delete route on WCG P1:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 3 - Request: Invalid gateway for the interface:
DELETE /api/app/v1/net/route?dest=30.10.0.0&mask=255.255.255.0&gateway=192.168.0.7&interface=eth0 HTTP/1.1 Accept: text/html
Example 3 - Response: Invalid gateway for the interface:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Invalid gateway '10.206.22.254'", "Status": "Failure" }
-
POST
/api/app/v1/net/route/component
¶ Add single IPv4 component route.
New in version 1.0.
Query Parameters: - dest (required) – Destination IP address(or subnet) in IPv4 format
- mask (required) – Netmask in IPv4 format
- module (required) – Module to set the route on (only wcg and esg supported)
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - route added
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
Accepted Authorization: admin
Example 1 - Request: Add component route on WCG P1:
POST /api/app/v1/net/route/component?dest=40.10.0.0&mask=255.255.255.0&module=wcg HTTP/1.1 Accept: text/html
Example 1 - Response: Add component route on WCG P1:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 2 - Request: Invalid module:
POST /api/app/v1/net/route?dest=40.10.0.0&mask=255.255.255.0&module=abc HTTP/1.1 Accept: text/html
Example 2 - Response: Invalid module:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Invalid module: None", "Status": "Failure" }
-
DELETE
/api/app/v1/net/route/component
¶ Delete single IPv4 component route.
New in version 1.0.
Query Parameters: - dest (required) – Destination IP address (or subnet) in IPv4 format
- mask (required) – Netmask in IPv4 format
- module (required) – Module to delete the route from (only wcg and esg supported)
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - delete route
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
Accepted Authorization: admin
Example 1 - Request: Delete component route:
DELETE /api/app/v1/net/route/component?dest=40.10.0.0&mask=255.255.255.0&interface=eth0 HTTP/1.1 Accept: text/html
Example 1 - Response: Delete component route:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 2 - Request: Invalid module:
DELETE /api/app/v1/net/route?dest=40.10.0.0&mask=255.255.255.0&module=abc HTTP/1.1 Accept: text/html
Example 2 - Response: Invalid module:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Invalid module: None", "Status": "Failure" }
-
PUT
/api/app/v1/net/route/load
¶ Load multiple IPv4 routes from filestore server.
New in version 1.0.
Query Parameters: - location (required) – Filestore alias the routes are saved too
- file (required) – Route file on the filestore
- action (required) – Add or Delete (del)
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - routes loaded
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - filestore does not exist
Accepted Authorization: admin
Example 1 - Request: Add IPv4 routes from filestore:
PUT /api/app/v1/net/route/load?location=myfilestore&file=ipv4_rules.txt&action=add HTTP/1.1 Accept: text/html
Example 1 - Response: Add IPv4 routes from filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "Total added 1 routes. 0 failed." }
Example 2 - Request: Delete IPv4 routes from filestore:
PUT /api/app/v1/net/route/load?location=myfilestore&file=ipv4_rules.txt&action=del HTTP/1.1 Accept: text/html
Example 2 - Response: Delete IPv4 routes from filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "Total deleted 1 routes. 0 failed." }
-
PUT
/api/app/v1/net/route/save
¶ Save multiple IPv4 routes to filestore server.
New in version 1.0.
Query Parameters: - location (required) – Filestore alias name
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - routes saved
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
Accepted Authorization: admin
Example 1 - Request: Save routes to a filestore:
PUT /api/app/v1/net/route/save?location=myfilestore HTTP/1.1 Accept: text/html
Example 1 - Response: Save routes to a filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "'Route_appliance_20170502102731.txt' has been saved to ftp://anonymous@10.206.6.131/." }
Example 2 - Request: Invalid filestore:
PUT /api/app/v1/net/route/save?location=notmyfilestore HTTP/1.1 Accept: application/json
Example 2 - Response: Invalid filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Alias notmyfilestore does not exist.", "Status": "Failure" }
Example 3 - Request: Save routes to a URL:
PUT /api/app/v1/net/route/save?url=ftp://ftp_route:ftp_route_password@10.206.6.131/ HTTP/1.1 Accept: text/html
Example 3 - Response: Save routes to a URL:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "'Route_travis-latest-email-85_20180430153335.txt' has been saved to ftp://ftp_route@10.206.6.131/" }
-
POST
/api/app/v1/net/route6
¶ Add single static IPv6 route.
New in version 1.0.
Query Parameters: - dest (required) – Destination IP address (or subnet) in IPv6 format
- prefixlen (required) – Prefix Length
- gateway (required) – Gateway (next hop) in IPv6 format
- interface (required) – Interface name. (eth0, eth1, aux0, aux1)
- module (optional) – Module the interface belongs to. If ommitted route will be set on the appliance
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - route added
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
Accepted Authorization: admin
Example 1 - Request: Add IPv6 route on the appliance:
POST /api/app/v1/net/route6?dest=2804:10:206:4::&prefix=62&gateway=2017::0010&interface=eth0 HTTP/1.1 Accept: text/html
Example 1 - Response: Add IPv6 route on the appliance:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 2 - Request: Add IPv6 route on WCG P1:
POST /api/app/v1/net/route6?dest=2804:10:206:4::&prefix=62&gateway=2017::0010&interface=eth0&module=wcg HTTP/1.1 Accept: text/html
Example 2 - Response: Add IPv6 route on WCG P1:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 3 - Request: Invalid gateway for the interface:
POST /api/app/v1/net/route6?dest=2804:10:206:4::&prefix=62&gateway=2017::001R&interface=eth0&module=wcg HTTP/1.1 Accept: text/html
Example 3 - Response: Invalid gateway for the interface:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Invalid gateway '2017::001R'", "Status": "Failure" }
-
DELETE
/api/app/v1/net/route6
¶ Delete single static IPv6 route.
New in version 1.0.
Query Parameters: - dest (required) – Destination IP address(or subnet) in IPv6 format
- prefixlen (required) – IPv6 Prefix Length
- gateway (required) – Gateway (next hop) in IPv6 format
- interface (required) – Interface name. (eth0, eth1, aux0, aux1)
- module (optional) – Module the interface belongs to. If ommitted route will be set on the appliance
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - delete route
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
Accepted Authorization: admin
Example 1 - Request: Delete IPv6 route on the appliance:
DELETE /api/app/v1/net/route?dest=2804:10:206:4::&prefix=62&gateway=2017::0010&interface=eth0 HTTP/1.1 Accept: text/html
Example 1 - Response: Delete IPv6 route on the appliance:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 2 - Request: Delete IPv6 route on WCG P1:
DELETE /api/app/v1/net/route?dest=2804:10:206:4::&prefix=62&gateway=2017::001&interface=eth0&module=wcg HTTP/1.1 Accept: text/html
Example 2 - Response: Delete IPv6 route on WCG P1:
HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }
Example 3 - Request: Invalid gateway for the interface:
DELETE /api/app/v1/net/route?dest=2804:10:206:4::&prefix=62&gateway=2017::001R&interface=eth0&module=wcg HTTP/1.1 Accept: text/html
Example 3 - Response: Invalid gateway for the interface:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Invalid gateway '2017::001R'", "Status": "Failure" }
-
PUT
/api/app/v1/net/route6/load
¶ Load multiple IPv6 routes from filestore server.
New in version 1.0.
Query Parameters: - location (required) – Filestore alias the routes are saved too
- file (required) – Route file on the filestore
- action (required) – Add or Delete (del)
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - routes loaded
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - filestore does not exist
Accepted Authorization: admin
Example 1 - Request: Add IPv6 routes from filestore:
PUT /api/app/v1/net/route6/load?location=myfilestore&file=ipv6_rules.txt&action=add HTTP/1.1 Accept: text/html
Example 1 - Response: Add IPv6 routes from filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "Total added 1 routes. 0 failed." }
Example 2 - Request: Delete IPv6 routes from filestore:
PUT /api/app/v1/net/route6/load?location=myfilestore&file=ipv6_rules.txt&action=del HTTP/1.1 Accept: text/html
Example 2 - Response: Delete IPv6 routes from filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "Total deleted 1 routes. 0 failed." }
-
PUT
/api/app/v1/net/route6/save
¶ Save multiple IPv6 routes to filestore server.
New in version 1.0.
Query Parameters: - location (required) – Filestore alias name
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - routes saved
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - filestore does not exist
Accepted Authorization: admin
Example 1 - Request: Save IPv6 routes to a filestore:
PUT /api/app/v1/net/route6/save?location=myfilestore HTTP/1.1 Accept: text/html
Example 1 - Response: Save IPv6 routes to a filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "'Route6_mason67_20170502104420.txt' has been saved to ftp://anonymous@10.206.6.131/." }
Example 2 - Request: Invalid filestore:
PUT /api/app/v1/net/route6/save?location=notmyfilestore HTTP/1.1 Accept: text/html
Example 2 - Response: Invalid filestore:
HTTP/1.1 200 OK Content-Type: application/json { "Reason": "Alias notmyfilestore does not exist.", "Status": "Failure" }
Example 3 - Request: Save routes to a URL:
PUT /api/app/v1/net/route6/save?url=ftp://ftp_route:ftp_route_passwd@10.206.6.131/ HTTP/1.1 Accept: text/html
Example 3 - Response: Save routes to a URL:
HTTP/1.1 200 OK Content-Type: application/json { "Info": "'Route6_travis-latest-email-85_20180430153335.txt' has been saved to ftp://ftp_route@10.206.6.131/"
-
GET
/api/app/v1/net/route6_list
¶ Get static IPv6 route list.
New in version 1.0.
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - get IPv6 routes
- 401 Unauthorized – Access Denied
Accepted Authorization: admin, audit
Example 1 - Request: Get IPv6 routes:
GET /api/app/v1/net/route6_list HTTP/1.1 Accept: text/html
Example 1 - Response: Get IPv6 routes:
HTTP/1.1 200 OK Content-Type: application/json { "route_list": [ { "dest": "2804:10:206:4::", "gateway": "2017::0002", "interface": "c", "module": "app", "prefix": "64", "valid": "Y" } ] }
-
GET
/api/app/v1/net/route_list
¶ Get static IPv4 route.
New in version 1.0.
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - get routes
- 401 Unauthorized – Access Denied
Accepted Authorization: admin, audit
Example 1 - Request: Get IPv4 routes:
GET /api/app/v1/net/route_list HTTP/1.1 Accept: text/html
Example 1 - Response: Get IPv4 routes:
HTTP/1.1 200 OK Content-Type: application/json { "route_list": [ { "dest": "30.10.0.0", "gateway": "10.206.7.254", "interface": "c", "mask": "255.255.0.0", "valid": "Y" } ] }
-
GET
/api/app/v1/net/route_list/component
¶ Get Ipv4 component route list.
New in version 1.0.
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - get component routes
- 401 Unauthorized – Access Denied
Accepted Authorization: admin, audit
Example 1 - Request: Get IPv4 component routes:
GET /api/app/v1/net/route_list/component HTTP/1.1 Accept: text/html
Example 1 - Response: Get IPv4 component routes:
HTTP/1.1 200 OK Content-Type: application/json { "route_list": [ { "dest": "40.10.0.0", "mask": "255.255.0.0", "module": "proxy", "valid": "Y" } ] }
-
GET
/api/app/v1/net/routes
¶ Download routes from filestore.
New in version 1.0.
Note
This API call doesn’t use basic auth. Use the login API from the Authentication module to get a token.
Query Parameters: - location (required) – Filestore alias the routes are saved too
- type (required) – Type of route to download. ipv4 or ipv6
- token (required) – Authentication Token
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - delete route
- 400 Bad Request – Bad Request Error - invalid parameter, invalid token
- 401 Unauthorized – Access Denied
Example 1 - Request: Download IPv4 routes:
GET /api/app/v1/net/route?location=myfilestore&type=ipv4&token=<AUTH_TOKEN> HTTP/1.1 Accept: text/html
Example 1 - Response: Download IPv4 routes:
HTTP/1.1 200 OK Content-Type: text/plain <ROUTES_FILE_CONTENT>
-
POST
/api/app/v1/net/routes
¶ Upload multiple routes (IPv4 or IPv6) from web browser.
New in version 1.0.
Note
This API call uses form data. Craft your requests accordingly.
Note
This API call doesn’t use basic auth. Use the login API from the Authentication module to get a token.
Query Parameters: - type (required) – Type of routes (IPv4 or IPv6)
- file (required) – Route file on the filestore
- action (required) – Add or Delete(del)
- token (required) – Auth token
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Success - routes loaded
- 400 Bad Request – Bad Request Error - invalid parameter
- 401 Unauthorized – Access Denied
Example 1 - Request: Add IPv4 routes from file:
POST /api/app/v1/net/routes HTTP/1.1 --form 'file=@/root/routes4.txt' --form 'type=ipv4' --form 'action=add' Accept: text/plain
Example 1 - Response: Add IPv4 routes from file:
HTTP/1.1 200 OK Content-Type: text/html <html><head>{"success" : true}</head></html>