Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e014cce
Optimze the GitHub action, the logging type and add the alertig funct…
ZPascal Jan 23, 2022
da1f39c
Move API to legacy endpoint
ZPascal Feb 1, 2022
160c65f
First API calls (V8 alerting support)
ZPascal Feb 2, 2022
5a328d3
Merge 160c65fcf5202414fcffc6236afab7abf758ef79 into 27ab591bb9584117b…
Feb 2, 2022
85e0f32
Add coverage badge and documentation
github-actions[bot] Feb 2, 2022
4499495
Add v8 support
ZPascal Feb 3, 2022
8651111
Merge branch 'CW-4-add-alerting' of https://github.com/ZPascal/grafan…
ZPascal Feb 3, 2022
ea4f730
Merge 86511110b000c5d68fcacae37d9566757917666f into 27ab591bb9584117b…
Feb 3, 2022
1830f85
Add coverage badge and documentation
github-actions[bot] Feb 3, 2022
ab545bc
Restructure code, tests and add Grafana V8 alert support
ZPascal Feb 6, 2022
9c258ed
Update coverage badge
ZPascal Feb 6, 2022
b3dd925
Merge 9c258ed1f74d928f2aae20668250050fba65a1be into 27ab591bb9584117b…
Feb 6, 2022
cdd5399
Add coverage badge and documentation
github-actions[bot] Feb 6, 2022
3b0b074
WIP
ZPascal Feb 9, 2022
135bb1e
Merge branch 'CW-4-add-alerting' of https://github.com/ZPascal/grafan…
ZPascal Feb 9, 2022
1b8268b
Merge 135bb1ebe7791e220137c4d606562c8f2defb1d2 into 27ab591bb9584117b…
Feb 9, 2022
1016e03
Add coverage badge and documentation
github-actions[bot] Feb 9, 2022
9f950ff
Add General folder support (#3)
ZPascal Feb 12, 2022
309ef93
Update setup.py
ZPascal Feb 12, 2022
a2e303e
Optimze the GitHub action, the logging type and add the alertig funct…
ZPascal Jan 23, 2022
24c4ab2
Move API to legacy endpoint
ZPascal Feb 1, 2022
60de7f1
First API calls (V8 alerting support)
ZPascal Feb 2, 2022
df2a781
Add v8 support
ZPascal Feb 3, 2022
41b19c8
Add coverage badge and documentation
github-actions[bot] Feb 2, 2022
40e0e34
Restructure code, tests and add Grafana V8 alert support
ZPascal Feb 6, 2022
644bab7
Add coverage badge and documentation
github-actions[bot] Feb 3, 2022
954d7d7
WIP
ZPascal Feb 9, 2022
a997882
Add coverage badge and documentation
github-actions[bot] Feb 6, 2022
118568d
Add coverage badge and documentation
github-actions[bot] Feb 9, 2022
f6f0582
Fix merge conflicts
ZPascal Feb 12, 2022
33d4655
WIP
ZPascal Feb 12, 2022
2d1a2d2
Merge 33d4655fe6b426d479064115e1634dd79e069654 into 309ef93e62accf9b4…
Feb 12, 2022
67369c8
Add coverage badge and documentation
github-actions[bot] Feb 12, 2022
9d1909f
WIP
ZPascal Feb 15, 2022
4770ed7
WIP
ZPascal Feb 15, 2022
9f46a07
Merge 4770ed763a6239b7ae6b547095316b5f85ffdb2a into 309ef93e62accf9b4…
Feb 15, 2022
939dbbc
Add coverage badge and documentation
github-actions[bot] Feb 15, 2022
6c0c446
Rename the util class to api class
ZPascal Feb 18, 2022
574586c
Merge 6c0c446b61a948efe61087acc4802df2e776bf2d into 309ef93e62accf9b4…
Feb 18, 2022
7ec251f
Add coverage badge and documentation
github-actions[bot] Feb 18, 2022
47630ee
Update the docs
ZPascal Feb 28, 2022
92c6674
Merge branch 'CW-4-add-alerting' of https://github.com/ZPascal/grafan…
ZPascal Feb 28, 2022
cdbb30f
Merge 92c6674b0c4c24eb9302aa46fdcde52efacb0424 into 309ef93e62accf9b4…
Feb 28, 2022
bfa1213
Add coverage badge and documentation
github-actions[bot] Feb 28, 2022
90da34d
Add doc strings and integrationtest
ZPascal Mar 2, 2022
279945e
Merge branch 'CW-4-add-alerting' of https://github.com/ZPascal/grafan…
ZPascal Mar 2, 2022
62fedfb
Merge 279945e7b359afec0c3b8a9058cdb23d29d7474a into 309ef93e62accf9b4…
Mar 2, 2022
25563e3
Add coverage badge and documentation
github-actions[bot] Mar 2, 2022
7a82107
Add new docstrings
ZPascal Mar 5, 2022
0f00683
Merge branch 'CW-4-add-alerting' of https://github.com/ZPascal/grafan…
ZPascal Mar 5, 2022
468b88f
Merge 0f006839a6add9980608a28a2881ea2477db5167 into 309ef93e62accf9b4…
Mar 5, 2022
36367e2
Add coverage badge and documentation
github-actions[bot] Mar 5, 2022
a65f1f0
Add initegration tests and update the documentation
ZPascal Mar 20, 2022
8c14a30
Add initegration tests and update the documentation
ZPascal Mar 20, 2022
0802959
Add the documentation and update the tests
ZPascal Mar 20, 2022
bb8c4c8
Update the documentation
ZPascal Mar 20, 2022
bfe165a
Update the documentation
ZPascal Mar 20, 2022
ccc939a
Merge bfe165ad124b5d49aaaeeb843e3bac07f41a026b into 309ef93e62accf9b4…
Mar 20, 2022
853e70f
Add coverage badge and documentation
github-actions[bot] Mar 20, 2022
3dbee09
Update the documentation creation process
ZPascal Mar 21, 2022
233b08d
Update the documentation creation process
ZPascal Mar 21, 2022
7c46c8f
Update the github action
ZPascal Mar 21, 2022
452d550
Merge 7c46c8fe7a822ff0884dd3b87752f5c5b420ab8d into 309ef93e62accf9b4…
Mar 21, 2022
b81bcfd
Add coverage badge and documentation
github-actions[bot] Mar 21, 2022
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
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ exclude_lines =
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if __name__ == .__main__.:
if __name__ == .__main__.:
8 changes: 8 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ jobs:
--wheel
--outdir dist/

- name: Setup the GitHub user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Update the GitHub pages documentation
run: cd docs && mkdocs gh-deploy --force && cd ..

- name: Publish distribution package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,30 @@ jobs:
hide-badge: true
create-new-commit: true

- name: "Check if coverage badge file existence"
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "docs/coverage.svg"

- name: Generate coverage badge
if: steps.check_files.outputs.files_exists == 'false'
run: coverage-badge -o docs/coverage.svg -f
run: coverage-badge -f -o docs/coverage.svg

- name: Generate documentation
run: pydoc-markdown --render-toc && mv build/docs/* docs

- name: Check changed files
uses: tj-actions/verify-changed-files@v8.8
id: verify-changed-files
with:
files: |
docs

- name: Commit files
if: steps.check_files.outputs.files_exists == 'false'
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --force docs/coverage.svg
git commit -m "Add coverage badge"
git add --force docs
git commit -m "Add coverage badge and documentation"

- name: Push changes
if: steps.check_files.outputs.files_exists == 'false'
uses: ad-m/github-push-action@master
if: steps.verify-changed-files.outputs.files_changed == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
Expand Down
102 changes: 82 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,94 @@ The repository includes an SDK for the Grafana API. It's possible to communicate
### Search
- Execute a custom query against the Grafana search endpoint

### Datasource
- Get all datasources
- Get the datasource by id
- Get the datasource by uid
- Get the datasource by name
- Get the datasource id by name
- Create a new datasource
- Update a datasource
- Delete a datasource by id
- Delete a datasource by uid
- Delete a datasource by name
- Query a datasource by id
- Enabled datasource permissions
- Disable datasource permissions
- Get datasource permissions
- Add datasource permissions
- Delete datasource permissions

### Legacy Alerting
- Get alerts
- Get alerts by dashboard ids
- Get alert by id
- Pause alert by id
- Unpause alert by id

### Alerting
- Get all Alertmanager alerts
- Create or update Alertmanager alerts
- Get Alertmanager group alerts

- Get all Alertmanager silences
- Get Alertmanager silence by id
- Create or update Alertmanager silence
- Delete Alertmanager silence by id
- Get Alertmanager status
- Get the Alertmanager config
- Create or update the Alertmanager config
- Delete the Alertmanager config
- Test the Alertmanager receivers
- Get Prometheus alerts
- Get Prometheus rules
- Get Ruler rules
- Get a Ruler group
- Get Ruler groups by the namespace
- Create or update the Ruler group by the namespace
- Delete a Ruler group
- Delete a Ruler namespace
- Test a datasource rule
- Test a recipient rule
- Get the NGAlert organization configuration
- Get the NGAlert Alertmanager configuration by the organization
- Create or update the NGAlert organization configuration
- Delete the NGAlert organization configuration

### Alerting Channels
- Get all notification channels
- Get all notification channels (lookup)
- Get a notification channel by id
- Get a notification channel by uid
- Create an notification channel
- Update a notification channel by id
- Update a notification channel by uid
- Delete a notification channel by id
- Delete a notification channel by uid
- Test a notification channel

## 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/) | | | | |
| [Alerting HTTP API](https://grafana.com/docs/grafana/latest/http_api/alerting/) | 4 | [ZPascal](https://github.com/ZPascal) | | Planned |
| [Alerting Notification Channels HTTP API](https://grafana.com/docs/grafana/latest/http_api/alerting_notification_channels/) | 4 | [ZPascal](https://github.com/ZPascal) | | Planned |
| [Annotations HTTP API](https://grafana.com/docs/grafana/latest/http_api/annotations/) | | | | |
| [Authentication HTTP API](https://grafana.com/docs/grafana/latest/http_api/auth/) | | | | |
| [Data source HTTP API](https://grafana.com/docs/grafana/latest/http_api/data_source/) | 5 | [ZPascal](https://github.com/ZPascal) | | Planned |
| [Datasource Permissions HTTP API](https://grafana.com/docs/grafana/latest/http_api/datasource_permissions/) | | | | |
| [External Group Sync HTTP API](https://grafana.com/docs/grafana/latest/http_api/external_group_sync/) | | | | |
| [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/) | | | | |
| [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/) | | | | |
| [Organization HTTP API](https://grafana.com/docs/grafana/latest/http_api/org/) | | | | |
| [Other HTTP API](https://grafana.com/docs/grafana/latest/http_api/other/) | | | | |
| [Playlist HTTP API](https://grafana.com/docs/grafana/latest/http_api/playlist/) | | | | |
| [Reporting API](https://grafana.com/docs/grafana/latest/http_api/reporting/) | | | | |
| [Short URL HTTP API](https://grafana.com/docs/grafana/latest/http_api/short_url/) | | | | |
| [Team HTTP API](https://grafana.com/docs/grafana/latest/http_api/team/) | | | | |
| [User HTTP API](https://grafana.com/docs/grafana/latest/http_api/user/) | | | | |
| [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/) | | | | |
| [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/) | | | | |
| [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/) | | | | |
| [Organization HTTP API](https://grafana.com/docs/grafana/latest/http_api/org/) | 13 | | | In process |
| [Other HTTP API](https://grafana.com/docs/grafana/latest/http_api/other/) | | | | |
| [Playlist HTTP API](https://grafana.com/docs/grafana/latest/http_api/playlist/) | | | | |
| [Reporting API](https://grafana.com/docs/grafana/latest/http_api/reporting/) | | | | |
| [Short URL HTTP API](https://grafana.com/docs/grafana/latest/http_api/short_url/) | 13 | | | In process |
| [Team HTTP API](https://grafana.com/docs/grafana/latest/http_api/team/) | | | | |
| [User HTTP API](https://grafana.com/docs/grafana/latest/http_api/user/) | | | | |

## Installation

Expand Down
Empty file removed docs/.placeholder
Empty file.
Loading