diff --git a/README.md b/README.md index f6b216f..8fb0fc1 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,28 @@ In general my focus inside this project is to implement and deliver old and new - Update playlist - Delete playlist +### Reporting +- Send report + +### Query History +- Add query to history +- Delete query inside the history +- Update query inside the history +- Search inside the query history +- Star a query inside the history +- Unstar a query inside the history + +### Other HTTP +- Get frontend settings +- Renew login session +- Get health status +- Get metrics + +### Licensing +- Check license availability +- Manually force license refresh +- Remove the license from the database + ## Feature timeline The following table describes the plan to implement the rest of the Grafana API functionality. Please, open an issue and vote them up, if you prefer a faster implementation of an API functionality. @@ -178,16 +200,12 @@ The following table describes the plan to implement the rest of the Grafana API | API endpoint group | Implementation week | Maintainer | PR | State | |:------------------:|:-------------------:|:----------:|:--:|:-----:| | [Admin HTTP API](https://grafana.com/docs/grafana/latest/http_api/admin/) | | | | | -| [Annotations HTTP API](https://grafana.com/docs/grafana/latest/http_api/annotations/) | | | | | -| [Authentication HTTP API](https://grafana.com/docs/grafana/latest/http_api/auth/) | | | | | -| [External Group Sync HTTP API](https://grafana.com/docs/grafana/latest/http_api/external_group_sync/) | | | | | +| [Annotations HTTP API](https://grafana.com/docs/grafana/latest/http_api/annotations/) | 23 | [ZPascal](https://github.com/ZPascal) | | | +| [Authentication HTTP API](https://grafana.com/docs/grafana/latest/http_api/auth/) | 23 | [ZPascal](https://github.com/ZPascal) | | | +| [External Group Sync HTTP API](https://grafana.com/docs/grafana/latest/http_api/external_group_sync/) | 23 | [ZPascal](https://github.com/ZPascal) | | | | [Fine-grained access control HTTP API](https://grafana.com/docs/grafana/latest/http_api/access_control/) | | | | | -| [HTTP Preferences API](https://grafana.com/docs/grafana/latest/http_api/preferences/) | | | | | -| [Library Element HTTP API](https://grafana.com/docs/grafana/latest/http_api/library_element/) | | | | | -| [Licensing HTTP API](https://grafana.com/docs/grafana/latest/http_api/licensing/) | 22 | [ZPascal](https://github.com/ZPascal) | | | -| [Other HTTP API](https://grafana.com/docs/grafana/latest/http_api/other/) | 22 | [ZPascal](https://github.com/ZPascal) | | | -| [Query History API](https://grafana.com/docs/grafana/latest/http_api/query_history/) | 22 | [ZPascal](https://github.com/ZPascal) | | | -| [Reporting API](https://grafana.com/docs/grafana/latest/http_api/reporting/) | 22 | [ZPascal](https://github.com/ZPascal) | | | +| [HTTP Preferences API](https://grafana.com/docs/grafana/latest/http_api/preferences/) | 23 | [ZPascal](https://github.com/ZPascal) | | | +| [Library Element HTTP API](https://grafana.com/docs/grafana/latest/http_api/library_element/) | | | | | ## Installation diff --git a/docs/content/index.md b/docs/content/index.md index b0cdbfe..a7df0d7 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -21,11 +21,12 @@ The following list describes the currently supported features of the Grafana API - [ ] [HTTP Preferences API](https://grafana.com/docs/grafana/latest/http_api/preferences/) - [x] [HTTP Snapshot API](https://grafana.com/docs/grafana/latest/http_api/snapshot/) - [ ] [Library Element HTTP API](https://grafana.com/docs/grafana/latest/http_api/library_element/) -- [ ] [Licensing HTTP API](https://grafana.com/docs/grafana/latest/http_api/licensing/) +- [x] [Query History API](https://grafana.com/docs/grafana/latest/http_api/query_history/) +- [x] [Licensing HTTP API](https://grafana.com/docs/grafana/latest/http_api/licensing/) - [x] [Organization HTTP API](https://grafana.com/docs/grafana/latest/http_api/org/) -- [ ] [Other HTTP API](https://grafana.com/docs/grafana/latest/http_api/other/) +- [x] [Other HTTP API](https://grafana.com/docs/grafana/latest/http_api/other/) - [x] [Playlist HTTP API](https://grafana.com/docs/grafana/latest/http_api/playlist/) -- [ ] [Reporting API](https://grafana.com/docs/grafana/latest/http_api/reporting/) +- [x] [Reporting API](https://grafana.com/docs/grafana/latest/http_api/reporting/) - [x] [Short URL HTTP API](https://grafana.com/docs/grafana/latest/http_api/short_url/) - [x] [Team HTTP API](https://grafana.com/docs/grafana/latest/http_api/team/) - [x] [User HTTP API](https://grafana.com/docs/grafana/latest/http_api/user/) diff --git a/docs/grafana_api_sdk.md b/docs/grafana_api_sdk.md index b0cdbfe..a7df0d7 100644 --- a/docs/grafana_api_sdk.md +++ b/docs/grafana_api_sdk.md @@ -21,11 +21,12 @@ The following list describes the currently supported features of the Grafana API - [ ] [HTTP Preferences API](https://grafana.com/docs/grafana/latest/http_api/preferences/) - [x] [HTTP Snapshot API](https://grafana.com/docs/grafana/latest/http_api/snapshot/) - [ ] [Library Element HTTP API](https://grafana.com/docs/grafana/latest/http_api/library_element/) -- [ ] [Licensing HTTP API](https://grafana.com/docs/grafana/latest/http_api/licensing/) +- [x] [Query History API](https://grafana.com/docs/grafana/latest/http_api/query_history/) +- [x] [Licensing HTTP API](https://grafana.com/docs/grafana/latest/http_api/licensing/) - [x] [Organization HTTP API](https://grafana.com/docs/grafana/latest/http_api/org/) -- [ ] [Other HTTP API](https://grafana.com/docs/grafana/latest/http_api/other/) +- [x] [Other HTTP API](https://grafana.com/docs/grafana/latest/http_api/other/) - [x] [Playlist HTTP API](https://grafana.com/docs/grafana/latest/http_api/playlist/) -- [ ] [Reporting API](https://grafana.com/docs/grafana/latest/http_api/reporting/) +- [x] [Reporting API](https://grafana.com/docs/grafana/latest/http_api/reporting/) - [x] [Short URL HTTP API](https://grafana.com/docs/grafana/latest/http_api/short_url/) - [x] [Team HTTP API](https://grafana.com/docs/grafana/latest/http_api/team/) - [x] [User HTTP API](https://grafana.com/docs/grafana/latest/http_api/user/) diff --git a/src/grafana_api/licensing.py b/src/grafana_api/licensing.py index b0a7234..4b0f143 100644 --- a/src/grafana_api/licensing.py +++ b/src/grafana_api/licensing.py @@ -79,7 +79,7 @@ def manually_force_license_refresh(self): else: return api_call - def remove_license_from_dashboard(self): + def remove_license_from_database(self): """The method includes a functionality to removes the license stored in the Grafana database Required Permissions: diff --git a/tests/unittests/test_licensing.py b/tests/unittests/test_licensing.py index 72bbd14..d5b1d16 100644 --- a/tests/unittests/test_licensing.py +++ b/tests/unittests/test_licensing.py @@ -52,16 +52,16 @@ def test_manually_force_license_refresh_no_result(self, call_the_api_mock): licensing.manually_force_license_refresh() @patch("src.grafana_api.api.Api.call_the_api") - def test_remove_license_from_dashboard(self, call_the_api_mock): + def test_remove_license_from_database(self, call_the_api_mock): model: APIModel = APIModel(host=MagicMock(), token=MagicMock()) licensing: Licensing = Licensing(grafana_api_model=model) call_the_api_mock.return_value.status_code = 200 - self.assertEqual(None, licensing.remove_license_from_dashboard()) + self.assertEqual(None, licensing.remove_license_from_database()) @patch("src.grafana_api.api.Api.call_the_api") - def test_remove_license_from_dashboard_no_result(self, call_the_api_mock): + def test_remove_license_from_database_no_result(self, call_the_api_mock): model: APIModel = APIModel(host=MagicMock(), token=MagicMock()) licensing: Licensing = Licensing(grafana_api_model=model) @@ -71,4 +71,4 @@ def test_remove_license_from_dashboard_no_result(self, call_the_api_mock): call_the_api_mock.return_value = mock with self.assertRaises(Exception): - licensing.remove_license_from_dashboard() + licensing.remove_license_from_database()