mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
api: Expose ports in API requests for bills (#6069)
* Expose ports in API requests for bills
This commit is contained in:
committed by
Neil Lathwood
parent
680ef0645f
commit
dc41c0eae1
@@ -1711,7 +1711,14 @@ Output:
|
||||
"allowed": "10Mbps",
|
||||
"used": "0bps",
|
||||
"percent": 0,
|
||||
"overuse": "-"
|
||||
"overuse": "-",
|
||||
"ports": [
|
||||
{
|
||||
"device_id": "168",
|
||||
"port_id": "35146",
|
||||
"ifName": "eth0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1771,7 +1778,14 @@ Output:
|
||||
"allowed": "10Mbps",
|
||||
"used": "0bps",
|
||||
"percent": 0,
|
||||
"overuse": "-"
|
||||
"overuse": "-",
|
||||
"ports": [
|
||||
{
|
||||
"device_id": "168",
|
||||
"port_id": "35146",
|
||||
"ifName": "eth0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -1272,6 +1272,9 @@ function list_bills()
|
||||
$bill['used'] = $used;
|
||||
$bill['percent'] = $percent;
|
||||
$bill['overuse'] = $overuse;
|
||||
|
||||
$bill['ports'] = dbFetchRows("SELECT `D`.`device_id`,`P`.`port_id`,`P`.`ifName` FROM `bill_ports` AS `B`, `ports` AS `P`, `devices` AS `D` WHERE `B`.`bill_id` = ? AND `P`.`port_id` = `B`.`port_id` AND `D`.`device_id` = `P`.`device_id`", array($bill["bill_id"]));
|
||||
|
||||
$bills[] = $bill;
|
||||
}
|
||||
$count = count($bills);
|
||||
|
Reference in New Issue
Block a user