Commit Graph

150 Commits

Author SHA1 Message Date
Joe Clarke
018597e7bb Add support for a maintenance boolean in API results. (#15904)
* Add support for a maintenance boolean in API results.

If a device is under maintenance, it would be nice to see that from the
API. This can help drive other automation workflows where LibreNMS forms
a cornerstone in the management source of truth.

* Revert changes made by VSCode formatting.

* Revert two more formatting changes.

* Create a new API endpoint for GETing maintenance status.

This uses the same endpoint name as for setting a device to maintenance
but with a GET verb.

---------

Co-authored-by: Joe Clarke <jclarke@cisco.com>
2024-04-19 19:52:22 -05:00
richard-ririe
08ae2fdbc0 Add API endpoints to update and delete Device Groups (#15774)
* API: Update device groups

* API: Delete device groups
2024-02-05 13:02:36 -06:00
richard-ririe
4277c3387a API: Add/Remove devices from static devicegroups (#15775) 2024-01-31 13:09:14 -06:00
Nick Lockhart
f3e0f3eb93 Add port description API endpoints and documentation (#15578)
* Add port description API endpoints and documentation

* Change "update_port_description" behaviour to mimic webUI behaviour

* Fix code style issue

* Fix another code style issue
2024-01-22 23:07:13 +00:00
Stef
5733942aa2 WebUI - Alert Rule Editor: new notes field (#15631)
* add a new notes field to the rule editor. use a bigger text field for sql queries to avoid mistakes...
* add api doc
* allow notes field from the collection
* add a sample notes to the collection
* lint and db schema
* unmix some schema changes from a nother PR
* unmix schema update No°2
* unmix schema update No°3 - silly me
* add strip_tags, minor optimisation, db default value
* apply linting
* db_schema empty '' as default
* update db_schema.yaml
* default value changed as 'BLOB, TEXT, GEOMETRY or JSON column 'notes' can't have a default value'
* better keep the migration in 2023...
* Update 2023_12_12_171400_alert_rule_note.php
* Update create-alert-item.inc.php

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2024-01-17 09:09:19 +01:00
Tony Murray
389cdcbcb2 Fix API add_device markdown (#15684) 2024-01-09 23:36:59 +00:00
Tony Murray
e7114e33f9 API add_device: Add ping_ping fallback option (#15637)
* API add_device: Add ping_ping fallback option
improve docs a little

* More docs refinement
2023-12-17 18:08:37 +01:00
Stef
ad805f4504 more filter options for the BGP peer API endpoint (#15599)
* Add more filter options for the BGP API endpoint. bgp_descr, bgp_state and bgp_adminstate

* typo and lint

* Adress family filter would also be helpful. casting AS1234 Like inputs to plain numbers

* linting again...
2023-11-29 21:58:30 +01:00
VTS
47c6842b01 API: get poller group (#15493)
* API: get poller group

* missed string in doc

* return all poller groups if name/id aren't specified

* add missing doc link

* style fixes

* more style

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-11-01 22:33:35 -05:00
Tony Murray
0e453e5938 API: allow add device to set location (#15469) 2023-10-18 02:00:39 -05:00
VTS
7381c2046c API get_location (#14779)
* api endpoint to get specific location

* missing nl

* fix missed styleci error

* make requested change
2023-08-03 19:35:20 -05:00
richard-ririe
4c8e5fc783 Add API endpoint to get service graphs (#15138)
* Add API endpoint to get service graphs

* Docs: Add missing title to get_graph_by_service
2023-07-19 22:19:43 -05:00
tarik
3ad19607d0 adding human readable version of /api/v0/fdb/{mac}/detail (#15045)
* adding human readable version of /api/v0/fdb/{mac}/detail

* adding last seen field in human readable format

* fixing styling issue

* fixing another styling issue

* removing stale variable

* adding a limit to number of results returned in order to limit memory issues

* adding the documentation for fdb_detail api

* Wording fix

* wording fix again. smh

---------

Co-authored-by: Justin Lentz <monkeybrains7@gmail.com>
2023-07-07 23:24:50 -05:00
Stef
82bd437e47 Syslog sink over http for logstash (or any json source) (#14424)
* inital commit of a new syslog sink over http

* cosmetics

* cosmetics fix...

* cosmetic fix again

* cosmetics fix again

* its nice now...

* add non blocking option

* Syslog Sink integrated as API PUT method

* lint fix

* Update includes/html/api_functions.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Update includes/html/api_functions.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Update includes/html/api_functions.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* change to POST, fix decoding issue and json exception

* logstash/json documentation added. syslog documentation a bit re-structured

* lint fix

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-03-15 08:14:38 -05:00
Andy Norwood
3023aa7e0f API: add display query to list_devices function (#14747)
* add display query type

* add display to query examples

* fix typo
2023-02-08 18:36:20 +02:00
electrocret
1e5e26492e Use Oxidized API client and add support for groups on config get (#14750)
* Use API client and add support for groups.

* Being Stylish.

* Update incorrect doc
2023-02-01 11:49:29 -06:00
Andy Norwood
d091788f28 API list_devices update with sysName, location_id and type (#14731)
* Add sysName, location_id, type to list_devices

* Add new list_devices type
2022-12-15 08:25:11 -06:00
Tony Murray
752bbc1531 Port search API search more than one fields (#14646)
* Fix port search columns

* Port search API search more than one fields
Fixup port APIs
Change validate_column_list api helper to throw a renderable exception on error and return the valid columns
DeviceCache::get() can handle a bigger range of input

* whitespace

* Refactor exceptions a bit

* change throws type to be more generic

* Lint fixes
2022-11-18 16:27:56 -06:00
electrocret
4c0ebb6f74 Add Columns to search_ports API function (#14348)
* Add Columns to search_ports function

* StyleCI

* StyleCI

* Add to Docs

* Suggested If fix
2022-11-17 10:18:09 -06:00
Talk Straight Ltd
9826fa9089 feat: Add sortorder parameter to list_logs (#14600) 2022-11-08 18:20:34 +01:00
bp0
384e0449c1 API: allow delete location by id (#14334)
* API: allow delete location by id

Otherwise impossible to delete location "".

* docs/API: location can be name or id for edit and delete
2022-09-13 09:03:55 -05:00
bp0
6cc9694780 docs/API: Move list_locations from devices to locations (#14328)
* Remove list_locations from devices

Moving to locations

* Add list_locations to locations

Moved from devices
2022-09-08 22:16:52 -05:00
Jarod2801
176cb0cf48 Update index.md (#14178)
Added a missing space in front oh the "-H 'X-Auth...".
The missing space causes the curl command not to work
2022-08-04 18:00:55 -05:00
Jellyfrog
670f964e98 Validate: use "database version" instead of "mysql version" (#14158)
* Validate: use "database version" instead of "mysql version"

* wip

* wip
2022-07-29 11:36:18 -05:00
rhinoau
d248e6561f Standardize device and device group maintenance API (#14153)
* Standardise device and devicegroup maintenance API

* styleci fixes
2022-07-28 11:38:46 -05:00
wrongecho
060c87c535 Documentation typos (#14099)
* Update Templates.md

withing > within

* Update index.md

Small typos correction

* Update Performance.md

Typos/Rewording

* Update Performance.md
2022-07-09 09:32:59 -05:00
rhinoau
d53d9b3b89 Corrected curl creation examples (#14081) 2022-07-01 10:45:58 +02:00
Chris A. Evans
5a085f79e5 Feature: Add support to REST API for creating Maintenance Schedules for Device Groups (#13985)
* Add support to REST API for creating Maintenance Schedules for Device Groups

* Update documentation to include the maintenance_devicegroup API endpoint

* Fix quotes

* Fix whitespace

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-05-27 10:38:47 -05:00
Tony Murray
8df92a5f2b API: device_add support display field (#13846)
* API: device_add support display field
remove legacy code path
update docs
A few improvements to the new code too

* some fixes, port_association_mode was not available

* hand version -> snmpver translation
2022-03-15 06:54:02 -05:00
Josh Silvas
a9e111f3eb Adds API call to update port notes on devices. (#13834)
* Adds API call to update port notes on devices.

* Lint fixes.

* Fixes file permissions to proper values.
2022-03-10 22:29:08 +01:00
Knut Petter Ølberg
3926f1aaff Update Switching.md (#13786)
Fix typo in example
2022-02-14 23:05:20 +01:00
Jellyfrog
8f474dd4d4 Rework documentation (#13709)
* Rework documentation

* Slightly adjust theme

* wip

* fixes

* Remove unneeded header

* Re-added Acknowledgement.md file

* Added Acknowledgement.md to mkdocs.yml

Co-authored-by: Neil Lathwood <gh+n@laf.io>
2022-02-08 23:02:28 +00:00
Andrea Beccaris
0fc2f9e4c9 Add API-routes for listing MPLS SAPs and services (#13561)
* add apis for mpsl services and saps

* updated docs

* removed dbFetch, orm instead

* changed queries

* Removed unused variables

* Update api_functions.inc.php

* Update api_functions.inc.php

* Update api_functions.inc.php

* Update api_functions.inc.php

Co-authored-by: laf <gh+n@laf.io>
2022-01-20 08:15:23 -06:00
Tony Murray
4b64d33d13 API detect if new location should be fixed by default (#13637) 2021-12-27 17:32:50 -06:00
VTS
1ac60e3b1d set fixed_coordinates via api (#13593)
* set fixed_coordinates via api

* update api doc

* fix style problem

* Update Locations.md

* Update api_functions.inc.php

* Update api_functions.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-12-23 15:32:02 -06:00
Claude Brown
6bf97c6ac9 API 'list_parents_of_host' - mostly doco, but one small code enhancement (#13567)
* Allow 'list_devices' to query by exact device-id

* Remove 'http://' prefix from --dev-addr in doco for 'mkdocs serve'

* Document 'list_parents_of_host' API call by reference to 'list_devices' call

* Remove possibility of SQL injection attacks

* Remove possibility of SQL injection attacks
2021-11-25 22:38:50 +01:00
Federico Cuello
5aa69d3250 Update Ports.md (#13493)
Fix ports_with_associated_mac output block (missing closing)
2021-11-10 19:23:21 +01:00
Nathan Manzi
fb7d89c4c3 Add get_ports_by_group API function (#13361)
* implement api route get_ports_by_group

* Update API docs for new get_ports_by_group

* Fix misspelling of function names and routes
2021-10-18 20:47:37 -05:00
SourceDoctor
708d1ebb87 API Call to set instant Maintenance mode (#13237)
* API Call to set instance Maintenance mode

* .

* remove unused code

* update query

* Use recent code

* remove accidental line return

* fix duration in success string

* style fix

* Try to fix bad code merge

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-09-28 21:54:52 +02:00
SourceDoctor
11dfbc02b7 API Call to assign/remove a Portgroup to Ports (#13245)
* API Call to assign/remove a Portgroup to Ports

* .

* .
2021-09-21 08:41:01 -05:00
SourceDoctor
0d499b538b API port search by arbitrary field (#13231)
* DB Field specific Port Search

* .

* seperate function for API Call

* second parameter now optional

* code adjustments

* Update api_functions.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-09-19 19:28:42 -05:00
SourceDoctor
a8ca79152c API add_device: respond with more device information (#13251)
* Advanced Response Information API add_device

* .
2021-09-19 18:47:50 -05:00
geg347
6dbefd4a61 Adding API route to set bgpPeerDescr field (#13056)
* Adding API route to set bgpPeerDescr field

* Fixing CI test

* Fixing CI test part 2

* Adding validation of bgpPeerId as integer and changing SQL request with question mark syntax.

* Fixing CI test

* Following murrant's advices to protect against SQL injection

* Use built in json function

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-08-13 00:58:47 +02:00
Kevin Zink
93209a0fc8 API mac search (#12964)
* API find a switchport with the mac from device

* fix style

* convert SQL to Eloquent

* convert SQL to Eloquent

* git mistake

* Global use App\Models\Port

* git mistake partII

* Refractor Eloquent - Not finish but easier to help for others

* Better Eloquent Query without filter option

* Validation

* fix style

* Add filter option and DOC

* convert to the better macToHex method

* add a maxToHex unit test

* fix style

* fix style

* fix syle - seems my dev:check is running again :-)

* Fix phpStan

* phpStan #2
2021-08-09 19:33:04 -05:00
Bennet Gallein
574eb1f0f0 Billing: add peak in and out (#13006)
* feat(api): added max in/out per bill_history period

* chore(Docs): updated docs to include in/out max values

* chore(formatting): style-ci

* chore(db): update db-schema

* fix(db): reverted wrong changes in schema

* fix: wrong table name in migration

* feat(billing-history-frontend): added max in/out values to frontend bill-history

* chore: renamed to peak instead of min/max
2021-07-26 10:37:52 -05:00
Sean
bcedc0ed77 Improve Markdown syntax in Document (#12949)
* Use GitLab instead of Gitlab

Only change text part, the Alert.Transport.Gitlab class left as is.

* Fix href in document

* Move section in document

The agent list in this document is sorted by alphabetical order,
"SDFS info" is the only exception.

* Remove trailing spaces in document

* Align code in document

* Fix Markdown in document

- Escape underline
- Add syntax highlight
- Add two space in the end of line to make it a newline
- Add newline before list or code section

* Update LibreNMS/Alert/Transport/Gitlab.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-06-16 21:16:21 +02:00
Misha Komarovskiy
e670097bf6 API: Add api call to list OSPF ports (#12955)
Signed-off-by: Misha Komarovskiy <zombah@gmail.com>
2021-06-16 20:31:05 +02:00
SourceDoctor
4b9e480118 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>
2021-04-06 17:25:08 -05:00
Mathieu Poussin
a0882af549 API: Allow logs to be filtered by min/max id (#12471)
* Allow logs to be filtered by min/max id

* typo
2021-01-28 08:50:58 -06:00
Richard Lawley
c6c046f172 Document flattened Inventory API function (#12404) 2021-01-02 00:07:33 +01:00