Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,41 @@ 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.

| 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

Expand Down
7 changes: 4 additions & 3 deletions docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
7 changes: 4 additions & 3 deletions docs/grafana_api_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
2 changes: 1 addition & 1 deletion src/grafana_api/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/unittests/test_licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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()