Added new API route to obtain available ports for a device #356

Merged
merged 2 commits into from Dec 1, 2014

Projects

None yet

2 participants

@laf
Member
laf commented Nov 30, 2014

Call:

curl -H "X-Auth-Token: APITOKEN" http://librenms.org/api/v0/devices/localhost/ports

curl -H "X-Auth-Token: APITOKEN" http://librenms.org/api/v0/devices/localhost/ports?columns=port_id,ifDescr,ifName,ifOperStatus,ifAdminStatus

Output:

{
"status": "ok",
"err-msg": "",
"count": 5,
"ports": [
{
"ifName": "lo"
},
{
"ifName": "eth0"
},
{
"ifName": "eth1"
},
{
"ifName": "eth2"
},
{
"ifName": "eth3"
}
]
}

{
"status": "ok",
"err-msg": "",
"count": 5,
"ports": [
{
"port_id": "126",
"ifDescr": "lo",
"ifName": "lo",
"ifOperStatus": "up",
"ifAdminStatus": "up"
},
{
"port_id": "127",
"ifDescr": "eth0",
"ifName": "eth0",
"ifOperStatus": "up",
"ifAdminStatus": "up"
},
{
"port_id": "128",
"ifDescr": "eth1",
"ifName": "eth1",
"ifOperStatus": "down",
"ifAdminStatus": "down"
},
{
"port_id": "129",
"ifDescr": "eth2",
"ifName": "eth2",
"ifOperStatus": "down",
"ifAdminStatus": "down"
},
{
"port_id": "130",
"ifDescr": "eth3",
"ifName": "eth3",
"ifOperStatus": "up",
"ifAdminStatus": "up"
}
]
}

@laf laf added the enhancement label Nov 30, 2014
@paulgear paulgear merged commit 0a7a1a0 into librenms:master Dec 1, 2014

1 check passed

ci/scrutinizer Scrutinizer: 6 new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment