mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Define Port Groups (#12402)
* Define Port Groups * . * . * . * API Calls * . * . * . * minor changes * . * update forms * remove link * . * change column settings * change migration * change update position * db migration fix * . * . * . * add missing doc reference * update test data * update test data * update test data * . * . * . * . * . * . * . * . * port group association in seperate table * . * . * show all found groups on port * select multiple Portgroups per Port * change on migration file * change query to eloquent * Code changes * move port group menu to ports main menu * port group update to eloquent * . * . * update to new setting way * add missing merge parameter * Use select2 and port some things to Laravel some fixes, hopefully no new added bugs * schema * don't use on update restrict unfortunately * remove unused import and revert changes Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
71
doc/API/Port_Groups.md
Normal file
71
doc/API/Port_Groups.md
Normal file
@@ -0,0 +1,71 @@
|
||||
source: API/Port_Groups.md
|
||||
path: blob/master/doc/
|
||||
|
||||
### `get_portgroups`
|
||||
|
||||
List all port groups.
|
||||
|
||||
Route: `/api/v0/portgroups`
|
||||
|
||||
Input (JSON):
|
||||
|
||||
-
|
||||
|
||||
Examples:
|
||||
|
||||
```curl
|
||||
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/portgroups
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"status": "ok",
|
||||
"message": "Found 1 port groups",
|
||||
"count": 1,
|
||||
"groups": [
|
||||
{
|
||||
"id": "1",
|
||||
"name": "Testing",
|
||||
"desc": "Testing"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### `add_portgroup`
|
||||
|
||||
Add a new port group. Upon success, the ID of the new port group is returned
|
||||
and the HTTP response code is `201`.
|
||||
|
||||
Route: `/api/v0/port_groups`
|
||||
|
||||
Input (JSON):
|
||||
|
||||
- `name`: *required* - The name of the port group
|
||||
- `desc`: *optional* - Description of the port group
|
||||
|
||||
Examples:
|
||||
|
||||
Dynamic Example:
|
||||
|
||||
```curl
|
||||
curl -H 'X-Auth-Token: YOURAPITOKENHERE' \
|
||||
-X POST \
|
||||
-d '{"name": "New Port Group", \
|
||||
"desc": "A very fancy port group"}' \
|
||||
https://librenms.org/api/v0/port_groups
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"id": 86,
|
||||
"message": "Port group New Port Group created"
|
||||
}
|
||||
```
|
@@ -74,6 +74,7 @@ Output from the API currently is via two output types:
|
||||
- [Devices](Devices.md)
|
||||
- [DeviceGroups](DeviceGroups.md)
|
||||
- [Ports](Ports.md)
|
||||
- [Port_Groups](Port_Groups.md)
|
||||
- [PortGroups](PortGroups.md)
|
||||
- [Alerts](Alerts.md)
|
||||
- [Routing](Routing.md)
|
||||
|
Reference in New Issue
Block a user