mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* api: Added API call for VRF listing Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * api: Added API call to retrive VRF by ID Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * api: Change list_vrf permissions Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * api: Added new api calls for routing and resources mgmt * This commit includes list_cbgp, list_vlans, list_ip_addresses, list_ip_networks and get_network_ip_addresses calls Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * fix: Correct indentation issue in get_ip_addresses Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * api: Fix per device permissions and messages Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * Fix identation issues Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * api: Remove excessive result counters Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * api: Add list_locations api call * Get devices by location not very comfortable without list all locations api call Signed-off-by: Misha Komarovskiy <zombah@gmail.com> * Spelling fix Signed-off-by: Misha Komarovskiy <zombah@gmail.com>
71 lines
1.0 KiB
Markdown
71 lines
1.0 KiB
Markdown
source: API/Switching.md
|
|
|
|
### `list_vlans`
|
|
|
|
Get a list of all VLANs.
|
|
|
|
Route: `/api/v0/resources/vlans`
|
|
|
|
Input:
|
|
|
|
-
|
|
|
|
Example:
|
|
```curl
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/vlans
|
|
```
|
|
|
|
Output:
|
|
```json
|
|
{
|
|
"status": "ok",
|
|
"vlans": [
|
|
{
|
|
"vlan_id": "31",
|
|
"device_id": "10",
|
|
"vlan_vlan": "1",
|
|
"vlan_domain": "1",
|
|
"vlan_name": "default",
|
|
"vlan_type": "ethernet",
|
|
"vlan_mtu": null
|
|
},
|
|
...
|
|
],
|
|
"count": 100
|
|
}
|
|
```
|
|
|
|
### `get_vlans`
|
|
|
|
Get a list of all VLANs for a given device.
|
|
|
|
Route: `/api/v0/devices/:hostname/vlans`
|
|
|
|
- hostname can be either the device hostname or id
|
|
|
|
Input:
|
|
|
|
-
|
|
|
|
Example:
|
|
```curl
|
|
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devices/localhost/vlans
|
|
```
|
|
|
|
Output:
|
|
```json
|
|
{
|
|
"status": "ok",
|
|
"count": 0,
|
|
"vlans": [
|
|
{
|
|
"vlan_vlan": "1",
|
|
"vlan_domain": "1",
|
|
"vlan_name": "default",
|
|
"vlan_type": "ethernet",
|
|
"vlan_mtu": null
|
|
}
|
|
]
|
|
}
|
|
```
|