Commit 6de44a0
Cacti Restuful API V0.1 (#6310)
* inital commit
* remove composer files
* Update api/public/index.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update api/include/db_functions.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add API Versioning
- Group Endpoint types together
- Add initial V1 endpoint groups
- Leverage the slim route collector class
* Migrate db functions to Cacti core db functions
* remove dedicated config file
* Update README.md
* Update db_functions.php
- include global and not the lib/database
- remove redudant db_connect function
* Sanity checks
- Ensure arrays are initialized before iterating
* Update db_functions.php
* Add logging
* helper function for parameter validation
* Update api/include/db_functions.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Sanitize error message
* Update db_functions.php
use the proper cacti db function
Leverage the read_config_option function instead of standalone db query
* Update api/include/db_functions.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Cleaning up from pre migration to core cacti functions
* clean up
* update tholds endpoint
Call on the validate parameters helper function
* call on db_fetch_cell for thold db_function
* Update api/public/index.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Creat automation networks api endpoint
Call the proper db prepared function for prepared statments
* automation status endpoint
* data source stats status endpoint
* add validations (more to come)
* validations
* Update api/include/arrays.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update api/include/db_functions.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update api/include/arrays.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update api/include/db_functions.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor validation error handling in API routes
This changes adds a small bit of PSR formatting to the code, and reduces the length of the $validation_error by renaming to $verror for redability.
* Clean up whitespace in arrays.php
* Refactor SQL queries for improved readability
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: TheWitness <thewitness@cacti.net>1 parent 697e231 commit 6de44a0
5 files changed
Lines changed: 832 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments