Commit Graph

167 Commits

Author SHA1 Message Date
2d7423cdaa API: System endpoint, more health graphs (#8730)
* API: System endpoint, more health graphs

* Add new line api_functions

* Get count of relationships

Using eloquent

* Add new lines in Models
2018-05-18 23:36:06 -05:00
82072b3694 Fix for get_alert API method. Tested on MySQL-community 5.7.22 and MariaDB 10.2.14. (#8658) 2018-05-04 23:51:04 -05:00
ff0063b515 api: Add option to output graphs as base64 (#8535)
* Allow 'option' param in graph endpoint

* Update lint and update docs

* Uncomment api response

* Add imagedestroy on 'tobias_trim' section

* Add base64 to port endpoints also
2018-04-11 08:02:04 -05:00
7250376104 refactor: Don't access $_SESSION directly for Auth (#8513)
* Don't access $_SESSION directly for Auth

* fix style

* add property annotations
2018-04-07 21:55:28 +01:00
c22b31506e api: Added lattitude and longitude on devices/device fetch (#8515)
* 'lat' and 'lng' columns added on list_devices()

* 'lat' and 'lng' columns added on device fetch

Helped by https://github.com/laf

* Commit user.name changed
2018-04-07 13:29:46 +01:00
8cc8eb8dd2 refactor: Use elseif instead of else if (#8417) 2018-03-19 21:40:17 +00:00
59f99f1962 api: Added routes to delete,add/edit traffic bills (#8272)
* add API calls to delete,add/edit traffic bills

* scrutinizer fixes

* app needed

* explicitly use === null

* requested changes
2018-02-27 19:51:29 +00:00
10829893ec api: Added Billing Graphs & Data (#8245)
* Move Billing/Bandwidth Graphs to common format, extract data generation to central function

* Add API functions to access billing graphs and graph data

* Scrutinizer fixes

* Fix transfer graphs with from/to

* Scrutinizer Fix

* Fix docs, transfer page and missing from API param

* Document and fix reducefactor, Add Graph Stats to Graph Data

* Standardise times in graphdata

* Fixed renamed function for History GraphData
2018-02-20 14:57:56 +00:00
2018c9f804 api: Added History to Billing API Functions (#8209)
* Add Previous Period options to Bill API functions

* Add Bill History API Functions
2018-02-09 21:14:55 +00:00
87ce23bccd fix: Specify table name for list_devices sql query (#8132) 2018-01-22 21:10:39 +00:00
e12e6720f8 api: Added add_service_for_host endpoint to API (#8113)
* Add add_service_for_host endpoint to API

Signed-off-by: Rémy Jacquin <remy@remyj.fr>

* Change permissions to allow users to modify device

Signed-off-by: Rémy Jacquin <remy@remyj.fr>
2018-01-21 19:56:57 +00:00
06c46765f2 api: Added API calls for routing and resources management (#8017)
* api: Added API call for VRF listing

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* api: Added API call to retrive VRF by ID

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* api: Change list_vrf permissions

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* api: Added new api calls for routing and resources mgmt

* This commit includes list_cbgp, list_vlans,
list_ip_addresses, list_ip_networks and
get_network_ip_addresses calls

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* fix: Correct indentation issue in get_ip_addresses

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* api: Fix per device permissions and messages

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* Fix identation issues

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* api: Remove excessive result counters

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* api: Add list_locations api call

* Get devices by location not very comfortable
without list all locations api call

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* Spelling fix

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>
2018-01-18 15:43:15 +00:00
788c0bd6fb api: Added dependency info for devices/device api calls (#8058)
* Add dependency info for api

* Fix travis CI error

* Changed to dbFetchColumn

* Add hostnames for parent devices as well as IDs

* Merged the queries as laf suggested
2018-01-14 20:43:55 +00:00
7a76fa7216 fix: Fixed api response for failed device renames (#8081) 2018-01-12 22:26:57 -06:00
d6d4a3a69a api: Added API method to rename devices (#7895) 2017-12-19 09:32:31 +00:00
9d66d7c897 fix: Fixed api call to get_bill (#7875) 2017-12-07 22:56:31 +00:00
daa0773f48 api: Added support for wireless sensors (#7846)
* api: Added support for wireless sensors

* Added docs for new api calls
2017-12-06 22:27:30 +00:00
0728652d9d bug: Actually honour disabled api tokens (#7833) 2017-12-02 22:53:45 +00:00
e3082873f6 api: Added retrieve BGP sessions by ID (#7825)
* add support for retrieving BGP sessions via id

* fix syntax, use router params

* use count properly

* add get_bgp docs

* streamlined get_bgp sql query
2017-11-30 22:51:20 +00:00
5871ee1c67 fixed get_all_ports() for api (#7829) 2017-11-30 21:29:36 +00:00
f0a908cfb1 api: Add Permission checks to API (#7710)
* Add Permission checks to API

* Consistent API Returns and SQL restrictions on list_devices, list_bills

* Scrut fixes

* Restore global  for graph functions

* Minor fixes following review
2017-11-29 09:42:52 +00:00
c56f04e1e2 fix: Set API log start at 0 rather than 1(#7772) 2017-11-20 15:31:21 +00:00
c9728a1f71 refactor: Refactored authorizers to classes (#7497)
* Refactored authorizers to classes

* Merge changes for #7335

* ! fix php 5.3 incompatibility

* Update ADAuthorizationAuthorizer.php

* Fix get_user -> getUser

* Rename AuthorizerFactory to Auth, fix interface missing functions

* Add phpdocs to all interface methods and normalize the names a bit.

* Re-work auth_test.php AD bind tests to work properly with the new class.
Reflection is not the nicest tool, but I think it is appropriate here.
Handle exceptions more nicely in auth_test.php

* Restore AD getUseList fix

Not sure how it got removed

* fix auth_test.php style
2017-11-18 10:33:03 +00:00
c6a0c9d124 api: Added support for Oxidized asking for a single host (#7705) 2017-11-16 21:21:52 +00:00
00fc5bf0e8 API: Validate columns parameter against fields in table (#7717)
* Validate columns parameter against fields in table

* Removed unused return var

* Replace schema check from DB with yaml

* Style fixes
2017-11-14 09:15:12 -06:00
f8d7ccfe0d feature: Support for up/down detection of ping only devices.
* Added support for ping only devices.

* Renamed sql-schema/206 to 207.

* Discovery tried to detect the OS when it shouldn't.

* Updated db_schema.yaml

* Added ping icon.

* Don't show unused graphs and tabs when SNMP is disabled.

* Allow the user to specify OS of ping only devices.

* Removing custom OS now changes it to 'ping'.

* Removed unnecessary use of mres().

* UI select box for SNMP enable/disable.

* Hide device_ping_perf if ping is disable on device.

* Fixed SNMP settings update status messages.

* Added functionality to add ping only devices via the web ui.

* Added ping only option to addhost.php

* Added ping only support to snmp-scan.py

* Moved sql 208 to 211

* Fixed scrutinizer issues.

* Fixed broken ossearch.

* Added ping only support to the API.

* Updated API doc.

* Added (optional) to OS and hardware description. Hid Port Settings, Applications, Modules, Storage, Processors, Memory and Components from the edit menu

* Style fix.

* Updated ping icon.

* clean() instead of mres(). More escaping. Better help in snmp-scan.py and addhost.php

* Fixed scrutinizer issue.

* Always try SNMP in snmp-scan.py, new option for it in addhost.php. Slice instead of chunk in ajax_ossuggest.php. Other minor style changes.

* Updated sql modifications to insert the new column in the same place as in db_schema.yaml.
2017-10-27 22:59:25 -05:00
348f5012b1 api: Added sysname as filtering group for oxidized (#7485)
* Add sysname as filtering group for oxidized

* Updated Oxidized docs with new filtering option
2017-10-15 19:37:20 +01:00
20aa23508f api: Added simple OSPF API route 2017-09-07 20:04:36 +01:00
1d777693e1 feature: New IP parsing classes. Removes usage of Pear Net_IPv4 and Net_IPv6. (#7106)
* Refactor remove use of pear Net_IPv4 and Net_IPv6

Caution, I added tests to test the functionality of the new functions, but I'm not 100% certain the replaced usages match 100%.  Please test.

Left usage in generate-iplist.php because I'm not sure the use of that script, so I didn't want to implement additional functionality to support it.

Add support for ipv6 fo ipInNetwork() function

Add phpdocs to functions
Remove accidental inclusion

Use binary operations instead of string for networKFromIp()
Tidy up binary operations in ipInNetwork()

tidy parsing cidr network

Change to a class based implementation.

Update phpdocs.
Fully catch exceptions for hex parsing.

Fix mistake.

support older phpunit versions

Fix php shifting to negative with php 5

* Fix graph authorization. Uncaught exception and checking an ipv4 against an ipv6 network == fail.

* Also remove colons from hex strings.

* Fix typo in bgp polling
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
2017-08-08 14:14:58 -05:00
fc2041caaf api: Added api routes for eventlog, syslog, alertlog, authlog (#7071) 2017-07-27 19:56:38 +01:00
2ba7093d9c api: Added ability to call get_graph_by_port_hostname() with hostname or id (#6936)
* Fix bug get_graph_by_port_hostname() only hostname

From the documentation:

Function: get_graph_by_port_hostname top
Get a graph of a port for a particular device.

hostname can be either the device hostname or id

But the function is only works with a hostname and not with a ID.
I have modified a few things that solve the problem.

* Update api_functions.inc.php
2017-07-04 22:41:22 +01:00
0fd7f3f5ed Fix for API services bug #6894 (#6895)
* Fixed an issue with the output including all services from a host that had a single matched service  regardless of whether they matched the filter.

* Cleaned up some bits

* Updated based on murrants suggestions

* A couple small cleanups
2017-06-28 01:00:46 -05:00
52fabcb770 api: Add search by os to list_devices (#6861) 2017-06-19 19:49:43 +02:00
4ab358501d api: API allow cidr network searches of the ARP table (#6378)
* api: API allow cidr network searches of the ARP table

* Allow non-encoded / in request
I also noticed that all is allowed to be called without device, which the sql query does not support.
2017-04-07 21:05:46 +01:00
54deb1d429 fix: API call for graphs not working (#6184) (#6186)
* fix: API call for graphs not working (#6184)

* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md

* updated set_image_type to use new function
2017-03-13 16:39:43 +00:00
014682b60b api: Added new route for multiport bit graphs + asn list_bgp filter (#6129)
* api: Added new route for multiport bit graphs + asn list_bgp filter

* fixed scrut errors
2017-03-12 21:17:09 -05:00
dc41c0eae1 api: Expose ports in API requests for bills (#6069)
* Expose ports in API requests for bills
2017-03-03 20:40:15 +00:00
bbc7d71cf9 some small updates (#6022) 2017-02-27 14:39:02 +00:00
a8691680ab feature: Added ability to output graphs as svg (#5959)
* feature: Added ability to output graphs as svg

* Update graph.inc.php

* added ability to gzip various files for web servers
2017-02-22 06:08:18 -06:00
1c9cbc42f5 api: Add ability to return all device info for get_devices_by_group() (#5971)
* Changed GetDevicesFromGroup to output all columns if  is defined in url
2017-02-22 09:37:40 +00:00
debb945477 api: Limit get_graph_by_port_hostname() to one port and exclude deleted (#5936) 2017-02-17 21:19:15 +00:00
8b401fd05b api: Added the ability to list devices by location in the api (#5693)
* Adding location based filter for api-device calls

* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.

* configured linting etc, now pr should pass

* rebase and add entry to docs
2017-02-08 21:57:15 +00:00
7240741b69 web: Added IP and port calls to API 2017-02-07 09:46:09 +00:00
483c40eddd api: Added parent_id to VMs that have a host #3523 (#5621) 2017-01-26 22:38:43 +00:00
9bcb825560 api: Fixed zombie processes when generating graphs (#5597) 2017-01-25 13:16:59 -06:00
6df39b9bbd api: Added support for retrieving health information and graphs #5399 (#5446) 2017-01-19 10:09:20 +00:00
8636a3c3a2 fix: Correction on addHost function to handle the force_add parameter in api (#5329) 2017-01-06 21:47:00 +00:00
4671fb48ab fix: Restrict inventory api calls to the device requested (#5267) 2017-01-01 09:37:28 +00:00
6efdecfd95 fix: support columns filter in get_port_stats_by_port_hostname api call (#5230) 2016-12-23 20:54:13 +00:00
a970a8ddd1 fix: Fix get_port_stats_by_port_hostname() to only return non-deleted ports #5131 2016-12-08 15:40:00 +00:00