2017-11-18 19:19:18 -06:00
|
|
|
### `list_bgp`
|
|
|
|
|
|
|
|
List the current BGP sessions.
|
|
|
|
|
|
|
|
Route: `/api/v0/bgp`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
- hostname = Either the devices hostname or id.
|
2020-02-26 14:29:44 +01:00
|
|
|
- asn = The local ASN you would like to filter by
|
2020-04-05 17:16:16 +02:00
|
|
|
- remote_asn = Filter by remote peer ASN
|
|
|
|
- remote_address = Filter by remote peer address
|
|
|
|
- local_address = Filter by local address
|
2020-02-26 14:29:44 +01:00
|
|
|
|
|
|
|
|
2017-11-18 19:19:18 -06:00
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-11-18 19:19:18 -06:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/bgp
|
2017-12-24 00:55:41 +03:00
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/bgp?hostname=host.example.com
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/bgp?asn=1234
|
2020-02-26 14:29:44 +01:00
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/bgp?remote_asn=1234
|
2020-04-05 17:16:16 +02:00
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/bgp?local_address=1.1.1.1&remote_address=2.2.2.2
|
2017-11-18 19:19:18 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-10-21 02:47:40 +02:00
|
|
|
|
2017-11-18 19:19:18 -06:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
2018-02-01 20:52:38 +01:00
|
|
|
"message": "",
|
2017-11-18 19:19:18 -06:00
|
|
|
"bgp_sessions": [
|
2017-12-24 00:55:41 +03:00
|
|
|
{
|
|
|
|
"bgpPeer_id": "4",
|
|
|
|
"device_id": "2",
|
|
|
|
"astext": "",
|
|
|
|
"bgpPeerIdentifier": "1234:1b80:1:12::2",
|
|
|
|
"bgpPeerRemoteAs": "54321",
|
|
|
|
"bgpPeerState": "established",
|
|
|
|
"bgpPeerAdminStatus": "running",
|
|
|
|
"bgpLocalAddr": "1234:1b80:1:12::1",
|
|
|
|
"bgpPeerRemoteAddr": "0.0.0.0",
|
|
|
|
"bgpPeerInUpdates": "3",
|
|
|
|
"bgpPeerOutUpdates": "1",
|
|
|
|
"bgpPeerInTotalMessages": "0",
|
|
|
|
"bgpPeerOutTotalMessages": "0",
|
|
|
|
"bgpPeerFsmEstablishedTime": "0",
|
|
|
|
"bgpPeerInUpdateElapsedTime": "0",
|
|
|
|
"context_name": ""
|
|
|
|
},
|
2019-06-20 13:53:45 -05:00
|
|
|
...
|
2017-12-24 00:55:41 +03:00
|
|
|
],
|
|
|
|
"count": 100
|
2017-11-18 19:19:18 -06:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2017-11-30 22:51:20 +00:00
|
|
|
### `get_bgp`
|
|
|
|
|
|
|
|
Retrieves a BGP session by ID
|
|
|
|
|
|
|
|
Route: `/api/v0/bgp/:id`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-11-30 22:51:20 +00:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/bgp/4
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-11-30 22:51:20 +00:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"bgp_session": [
|
|
|
|
{
|
|
|
|
"bgpPeer_id": "4",
|
|
|
|
"device_id": "2",
|
|
|
|
"astext": "",
|
|
|
|
"bgpPeerIdentifier": "1234:1b80:1:12::2",
|
|
|
|
"bgpPeerRemoteAs": "54321",
|
|
|
|
"bgpPeerState": "established",
|
|
|
|
"bgpPeerAdminStatus": "running",
|
|
|
|
"bgpLocalAddr": "1234:1b80:1:12::1",
|
|
|
|
"bgpPeerRemoteAddr": "0.0.0.0",
|
|
|
|
"bgpPeerInUpdates": "3",
|
|
|
|
"bgpPeerOutUpdates": "1",
|
|
|
|
"bgpPeerInTotalMessages": "0",
|
|
|
|
"bgpPeerOutTotalMessages": "0",
|
|
|
|
"bgpPeerFsmEstablishedTime": "0",
|
|
|
|
"bgpPeerInUpdateElapsedTime": "0",
|
|
|
|
"context_name": ""
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"count": 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-08-13 00:58:47 +02:00
|
|
|
### `edit_bgp_descr`
|
|
|
|
|
|
|
|
This is a POST type request
|
|
|
|
Set the BGP session description by ID
|
|
|
|
|
|
|
|
Route: `/api/v0/bgp/:id`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
- id = The id of the BGP Peer Session.
|
|
|
|
- bgp_descr = The description for the bgpPeerDescr field on the BGP Session.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```curl
|
|
|
|
curl -v -H 'X-Auth-Token: YOURAPITOKENHERE' --data '{"bgp_descr": "Your description here"}' https://librenms.org/api/v0/bgp/4
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"message": "BGP description for peer X.X.X.X on device 1 updated to Your description here"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
### `list_cbgp`
|
|
|
|
|
|
|
|
List the current BGP sessions counters.
|
|
|
|
|
|
|
|
Route: `/api/v0/routing/bgp/cbgp`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
- hostname = Either the devices hostname or id
|
2018-01-18 18:43:15 +03:00
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/bgp/cbgp
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/bgp/cbgp?hostname=host.example.com
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"bgp_counters": [
|
|
|
|
{
|
|
|
|
"device_id": "9",
|
|
|
|
"bgpPeerIdentifier": "192.168.99.31",
|
|
|
|
"afi": "ipv4",
|
|
|
|
"safi": "multicast",
|
|
|
|
"AcceptedPrefixes": "2",
|
|
|
|
"DeniedPrefixes": "0",
|
|
|
|
"PrefixAdminLimit": "0",
|
|
|
|
"PrefixThreshold": "0",
|
|
|
|
"PrefixClearThreshold": "0",
|
|
|
|
"AdvertisedPrefixes": "11487",
|
|
|
|
"SuppressedPrefixes": "0",
|
|
|
|
"WithdrawnPrefixes": "10918",
|
|
|
|
"AcceptedPrefixes_delta": "-2",
|
|
|
|
"AcceptedPrefixes_prev": "2",
|
|
|
|
"DeniedPrefixes_delta": "0",
|
|
|
|
"DeniedPrefixes_prev": "0",
|
|
|
|
"AdvertisedPrefixes_delta": "-11487",
|
|
|
|
"AdvertisedPrefixes_prev": "11487",
|
|
|
|
"SuppressedPrefixes_delta": "0",
|
|
|
|
"SuppressedPrefixes_prev": "0",
|
|
|
|
"WithdrawnPrefixes_delta": "-10918",
|
|
|
|
"WithdrawnPrefixes_prev": "10918",
|
|
|
|
"context_name": ""
|
|
|
|
},
|
|
|
|
...
|
|
|
|
],
|
|
|
|
"count": 100
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### `list_ip_addresses`
|
|
|
|
|
|
|
|
List all IPv4 and IPv6 addresses.
|
|
|
|
|
|
|
|
Route: `/api/v0/resources/ip/addresses`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/ip/addresses
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"ip_addresses": [
|
|
|
|
{
|
|
|
|
"ipv4_address_id": "69",
|
|
|
|
"ipv4_address": "127.0.0.1",
|
|
|
|
"ipv4_prefixlen": "8",
|
|
|
|
"ipv4_network_id": "55",
|
|
|
|
"port_id": "135",
|
|
|
|
"context_name": ""
|
|
|
|
},
|
|
|
|
...
|
|
|
|
],
|
|
|
|
"count": 55
|
|
|
|
}
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```
|
2019-10-21 02:47:40 +02:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
### `get_network_ip_addresses`
|
|
|
|
|
|
|
|
Get all IPv4 and IPv6 addresses for particular network.
|
|
|
|
|
|
|
|
Route: `/api/v0/resources/ip/networks/:id/ip`
|
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
- id must be integer
|
2018-01-18 18:43:15 +03:00
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/ip/networks/55/ip
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"addresses": [
|
|
|
|
{
|
|
|
|
"ipv4_address_id": "69",
|
|
|
|
"ipv4_address": "127.0.0.1",
|
|
|
|
"ipv4_prefixlen": "8",
|
|
|
|
"ipv4_network_id": "55",
|
|
|
|
"port_id": "135",
|
|
|
|
"context_name": ""
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"count": 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### `list_ip_networks`
|
|
|
|
|
|
|
|
List all IPv4 and IPv6 networks.
|
|
|
|
|
|
|
|
Route: `/api/v0/resources/ip/networks`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/ip/networks
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"ip_networks": [
|
|
|
|
{
|
|
|
|
"ipv4_network_id": "1",
|
|
|
|
"ipv4_network": "127.0.0.0/8",
|
|
|
|
"context_name": ""
|
|
|
|
},
|
|
|
|
...
|
|
|
|
],
|
|
|
|
"count": 100
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2017-11-18 19:19:18 -06:00
|
|
|
### `list_ipsec`
|
|
|
|
|
|
|
|
List the current IPSec tunnels which are active.
|
|
|
|
|
|
|
|
Route: `/api/v0/routing/ipsec/data/:hostname`
|
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
- hostname can be either the device hostname or id
|
2017-11-18 19:19:18 -06:00
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-11-18 19:19:18 -06:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/ipsec/data/localhost
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-11-18 19:19:18 -06:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
2018-02-01 20:52:38 +01:00
|
|
|
"message": "",
|
2017-11-18 19:19:18 -06:00
|
|
|
"count": 0,
|
|
|
|
"ipsec": [
|
|
|
|
"tunnel_id": "1",
|
|
|
|
"device_id": "1",
|
|
|
|
"peer_port": "0",
|
|
|
|
"peer_addr": "127.0.0.1",
|
|
|
|
"local_addr": "127.0.0.2",
|
|
|
|
"local_port": "0",
|
|
|
|
"tunnel_name": "",
|
|
|
|
"tunnel_status": "active"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-11-18 19:19:18 -06:00
|
|
|
> Please note, this will only show active VPN sessions not all configured.
|
2017-12-23 02:37:33 +03:00
|
|
|
|
|
|
|
### `list_ospf`
|
|
|
|
|
|
|
|
List the current OSPF neighbours.
|
|
|
|
|
|
|
|
Route: `/api/v0/ospf`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
- hostname = Either the devices hostname or id.
|
2017-12-23 02:37:33 +03:00
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-12-23 02:37:33 +03:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ospf
|
2017-12-24 00:55:41 +03:00
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ospf?hostname=host.example.com
|
2017-12-23 02:37:33 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2017-12-23 02:37:33 +03:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"ospf_neighbours": [
|
|
|
|
{
|
|
|
|
"device_id": "1",
|
|
|
|
"port_id": "0",
|
|
|
|
"ospf_nbr_id": "172.16.1.145.0",
|
|
|
|
"ospfNbrIpAddr": "172.16.1.145",
|
|
|
|
"ospfNbrAddressLessIndex": "0",
|
|
|
|
"ospfNbrRtrId": "172.16.0.140",
|
|
|
|
"ospfNbrOptions": "82",
|
|
|
|
"ospfNbrPriority": "1",
|
|
|
|
"ospfNbrState": "full",
|
|
|
|
"ospfNbrEvents": "5",
|
|
|
|
"ospfNbrLsRetransQLen": "0",
|
|
|
|
"ospfNbmaNbrStatus": "active",
|
|
|
|
"ospfNbmaNbrPermanence": "dynamic",
|
|
|
|
"ospfNbrHelloSuppressed": "false",
|
|
|
|
"context_name": ""
|
2017-12-24 00:55:41 +03:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"count": 1
|
2017-12-23 02:37:33 +03:00
|
|
|
}
|
|
|
|
```
|
2018-01-18 18:43:15 +03:00
|
|
|
|
2021-06-16 21:31:05 +03:00
|
|
|
### `list_ospf_ports`
|
|
|
|
|
|
|
|
List the current OSPF ports.
|
|
|
|
|
|
|
|
Route: `/api/v0/ospf_ports`
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ospf_ports
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"ospf_ports": [
|
|
|
|
{
|
|
|
|
"id": 189086,
|
|
|
|
"device_id": 43,
|
|
|
|
"port_id": 2838,
|
|
|
|
"ospf_port_id": "10.10.2.86.0",
|
|
|
|
"ospfIfIpAddress": "10.10.2.86",
|
|
|
|
"ospfAddressLessIf": 0,
|
|
|
|
"ospfIfAreaId": "0.0.0.0",
|
|
|
|
"ospfIfType": "pointToPoint",
|
|
|
|
"ospfIfAdminStat": "enabled",
|
|
|
|
"ospfIfRtrPriority": 128,
|
|
|
|
"ospfIfTransitDelay": 1,
|
|
|
|
"ospfIfRetransInterval": 5,
|
|
|
|
"ospfIfHelloInterval": 10,
|
|
|
|
"ospfIfRtrDeadInterval": 40,
|
|
|
|
"ospfIfPollInterval": 90,
|
|
|
|
"ospfIfState": "pointToPoint",
|
|
|
|
"ospfIfDesignatedRouter": "0.0.0.0",
|
|
|
|
"ospfIfBackupDesignatedRouter": "0.0.0.0",
|
|
|
|
"ospfIfEvents": 33,
|
|
|
|
"ospfIfAuthKey": "",
|
|
|
|
"ospfIfStatus": "active",
|
|
|
|
"ospfIfMulticastForwarding": "unicast",
|
|
|
|
"ospfIfDemand": "false",
|
|
|
|
"ospfIfAuthType": "0",
|
|
|
|
"ospfIfMetricIpAddress": "10.10.2.86",
|
|
|
|
"ospfIfMetricAddressLessIf": 0,
|
|
|
|
"ospfIfMetricTOS": 0,
|
|
|
|
"ospfIfMetricValue": 10,
|
|
|
|
"ospfIfMetricStatus": "active",
|
|
|
|
"context_name": null
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"count": 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
### `list_vrf`
|
|
|
|
|
|
|
|
List the current VRFs.
|
|
|
|
|
|
|
|
Route: `/api/v0/routing/vrf`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
2019-06-20 13:53:45 -05:00
|
|
|
- hostname = Either the devices hostname or id
|
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
**OR**
|
2019-06-20 13:53:45 -05:00
|
|
|
|
|
|
|
- vrfname = The VRF name you would like to filter by
|
2018-01-18 18:43:15 +03:00
|
|
|
|
|
|
|
Example:
|
2019-10-21 02:47:40 +02:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/vrf
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/vrf?hostname=host.example.com
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/vrf?vrfname=Mgmt-vrf
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"vrfs": [
|
|
|
|
{
|
|
|
|
"vrf_id": "2",
|
|
|
|
"vrf_oid": "8.77.103.109.116.45.118.114.102",
|
|
|
|
"vrf_name": "Mgmt-vrf",
|
|
|
|
"mplsVpnVrfRouteDistinguisher": "",
|
|
|
|
"mplsVpnVrfDescription": "",
|
|
|
|
"device_id": "8"
|
|
|
|
},
|
|
|
|
...
|
|
|
|
],
|
|
|
|
"count": 100
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### `get_vrf`
|
|
|
|
|
|
|
|
Retrieves VRF by ID
|
|
|
|
|
|
|
|
Route: `/api/v0/routing/vrf/:id`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
Example:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/vrf/2
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
2019-06-20 13:53:45 -05:00
|
|
|
|
2018-01-18 18:43:15 +03:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"vrf": [
|
|
|
|
{
|
|
|
|
"vrf_id": "2",
|
|
|
|
"vrf_oid": "8.77.103.109.116.45.118.114.102",
|
|
|
|
"vrf_name": "Mgmt-vrf",
|
|
|
|
"mplsVpnVrfRouteDistinguisher": "",
|
|
|
|
"mplsVpnVrfDescription": "",
|
|
|
|
"device_id": "8"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"count": 1
|
|
|
|
}
|
|
|
|
```
|
2022-01-20 15:15:23 +01:00
|
|
|
|
|
|
|
### `list_mpls_services`
|
|
|
|
|
|
|
|
List MPLS services
|
|
|
|
|
|
|
|
Route: `/api/v0/routing/mpls/services`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
- hostname = Either the devices hostname or id
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/mpls/services
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/mpls/services?hostname=host.example.com
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"mpls_services": [
|
|
|
|
{
|
|
|
|
"svc_id": 1671,
|
|
|
|
"svc_oid": 27,
|
|
|
|
"device_id": 4,
|
|
|
|
"svcRowStatus": "active",
|
|
|
|
"svcType": "tls",
|
|
|
|
"svcCustId": 1,
|
|
|
|
"svcAdminStatus": "up",
|
|
|
|
"svcOperStatus": "up",
|
|
|
|
"svcDescription": "",
|
|
|
|
"svcMtu": 9008,
|
|
|
|
"svcNumSaps": 1,
|
|
|
|
"svcNumSdps": 0,
|
|
|
|
"svcLastMgmtChange": 2,
|
|
|
|
"svcLastStatusChange": 168,
|
|
|
|
"svcVRouterId": 0,
|
|
|
|
"svcTlsMacLearning": "enabled",
|
|
|
|
"svcTlsStpAdminStatus": "disabled",
|
|
|
|
"svcTlsStpOperStatus": "down",
|
|
|
|
"svcTlsFdbTableSize": 250,
|
|
|
|
"svcTlsFdbNumEntries": 0,
|
|
|
|
"hostname": "host.example.com"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"count": 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### `list_mpls_saps`
|
|
|
|
|
|
|
|
List MPLS SAPs
|
|
|
|
|
|
|
|
Route: `/api/v0/routing/mpls/saps`
|
|
|
|
|
|
|
|
Input:
|
|
|
|
|
|
|
|
- hostname = Either the devices hostname or id
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```curl
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/mpls/saps
|
|
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/routing/mpls/saps?hostname=host.example.com
|
|
|
|
```
|
|
|
|
|
|
|
|
Output:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": "ok",
|
|
|
|
"saps": [
|
|
|
|
{
|
|
|
|
"sap_id": 1935,
|
|
|
|
"svc_id": 1660,
|
|
|
|
"svc_oid": 7,
|
|
|
|
"sapPortId": 16108921125,
|
|
|
|
"ifName": "1/1/c2/1",
|
|
|
|
"device_id": 3,
|
|
|
|
"sapEncapValue": "0",
|
|
|
|
"sapRowStatus": "active",
|
|
|
|
"sapType": "epipe",
|
|
|
|
"sapDescription": "",
|
|
|
|
"sapAdminStatus": "up",
|
|
|
|
"sapOperStatus": "down",
|
|
|
|
"sapLastMgmtChange": 2,
|
|
|
|
"sapLastStatusChange": 0,
|
|
|
|
"hostname": "hostname=host.example.com"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"count": 1
|
|
|
|
}
|
|
|
|
```
|