librenms-librenms/doc/API/Switching.md
Misha Komarovskiy 06c46765f2 api: Added API calls for routing and resources management (#8017)
* 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>
2018-01-18 15:43:15 +00:00

1.0 KiB

source: API/Switching.md

list_vlans

Get a list of all VLANs.

Route: /api/v0/resources/vlans

Input:

Example:

curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/vlans

Output:

{
    "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 -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devices/localhost/vlans

Output:

{
    "status": "ok",
    "count": 0,
    "vlans": [
    {
   "vlan_vlan": "1",
   "vlan_domain": "1",
   "vlan_name": "default",
   "vlan_type": "ethernet",
   "vlan_mtu": null
    }
  ]
}