Skip to content

Latest commit

 

History

History
154 lines (119 loc) · 2.27 KB

File metadata and controls

154 lines (119 loc) · 2.27 KB

Data - Routes

A HTTP GET to /api/edge/data.json?data=routes obtains route information.

Response

Root

Name Type Values Description

success

String

A boolean encapsulated in a string (e.g. "0" or "1")

Whether the API request was successful.

output

Array (Object)

Array of route

The output to the data request.

route Object

Name Type Values Description

pfx

String

String

The route prefix.

nh

Array (Object)

nh Object(s)

The route next hop information.

nh Object

Name Type Values Description

t

String

String

The type (in the format route-type, Selected, FIB e.g. S>*).

metric

String

String

The metric information.

bh (Optional)

String

A boolean encapsulated in a string (e.g. "0" or "1")

Whether this interface is a blackhole.

via (Optional)

String

String

The next hop address information.

intf (Optional)

String

String

The next hop interface.

route-type Types

Name Type Description

S

Static

A static route (used by blackhole, interface, gateway).

C

connected

Connected route.

O

ospf

Connected OSPF route.

R

rip

Connected RIP route.

K

kernel

Connected Kernel route.

Selected Types

Name Type Description

>

Selected

The route is able to be used.

Not Selected

The route is not able to be used (but is in the config file).

FIB Types

Name Type Description

*

In FIB

The route is in the Forwarding Information Base (FIB).

Not In FIB

The route is not in the Forwarding Information Base (FIB).

Examples

Successful Response

GET /api/edge/data.json?data=routes Response
{"success": "1", "output": [{"pfx": "0.0.0.0/0", "nh": [{"t": "S>*", "metric": "210/0", "via": "xxx.xxx.xxx.xxx", "intf": "eth0"}]}, {"pfx": "xxx.xxx.xxx.xxx/21", "nh": [{"t": "C>*", "intf": "eth0"}]}, {"pfx": "127.0.0.0/8", "nh": [{"t": "C>*", "intf": "lo"}]}, {"pfx": "192.168.0.0/24", "nh": [{"t": "C>*", "intf": "eth1"}]}]}