Skip to content

Commit d263d0d

Browse files
authored
CW 1 + 2 support (#16)
* feat: Remove the src folder and adjust all tests * feat: Start the implementation of the new alerting provisioning and library feature * feat: Update the documentation and GitHub Actions * feat: Migrate to urllib3 and adapt all necessary files * feat: Add new service account features * fix: Update the correlation support * fix: Optimize the imports * fix: Update the setup.py * docs: Update the documentation
1 parent d9ceaf7 commit d263d0d

File tree

126 files changed

+13767
-5416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+13767
-5416
lines changed

.github/workflows/integrationtest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616

1717
- name: Install the requirements
1818
run: pip install -r requirements.txt
1919

2020
- name: Execute the integrationtests
21-
run: python3 -m unittest discover tests/integrationtest
21+
run: python3 --version && python3 -m unittest discover tests/integrationtest
2222
env:
2323
GRAFANA_HOST: ${{ secrets.GRAFANA_HOST }}
2424
GRAFANA_TOKEN: ${{ secrets.GRAFANA_TOKEN }}

.github/workflows/publish-to-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414

1515
steps:
1616
- name: Checkout the repository and the branch
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818

1919
- name: Set up Python
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v4
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
architecture: x64

.github/workflows/pull-request-checks.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
python-version: [ '3.x' ]
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
architecture: x64
@@ -35,10 +35,10 @@ jobs:
3535
python-version: [ '3.x' ]
3636

3737
steps:
38-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v3
3939

4040
- name: Set up Python
41-
uses: actions/setup-python@v2
41+
uses: actions/setup-python@v4
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444
architecture: x64
@@ -48,7 +48,7 @@ jobs:
4848
run: pip install -r requirements.txt
4949

5050
- name: Execute the linting checks
51-
uses: reviewdog/action-flake8@v3.2.0
51+
uses: reviewdog/action-flake8@v3.6.0
5252
with:
5353
github_token: ${{ secrets.GITHUB_TOKEN }}
5454
flake8_args: --config=.flake8
@@ -60,13 +60,13 @@ jobs:
6060
python-version: [ '3.x' ]
6161

6262
steps:
63-
- uses: actions/checkout@v2
63+
- uses: actions/checkout@v3
6464
with:
6565
persist-credentials: false
6666
fetch-depth: 0
6767

6868
- name: Set up Python
69-
uses: actions/setup-python@v2
69+
uses: actions/setup-python@v4
7070
with:
7171
python-version: ${{ matrix.python-version }}
7272
architecture: x64
@@ -79,7 +79,7 @@ jobs:
7979
run: export PYTHONPATH=$PWD && pytest --junitxml=pytest.xml --cov=. tests/unittests | tee pytest-coverage.txt
8080

8181
- name: Execute the coverage checks
82-
uses: MishaKav/[email protected].16
82+
uses: MishaKav/[email protected].37
8383
with:
8484
github_token: ${{ secrets.GITHUB_TOKEN }}
8585
pytest-coverage-path: ./pytest-coverage.txt
@@ -94,7 +94,7 @@ jobs:
9494
run: pydoc-markdown --render-toc && rm -rf docs/content && mv build/docs/* docs
9595

9696
- name: Check changed files
97-
uses: tj-actions/verify-changed-files@v8.8
97+
uses: tj-actions/verify-changed-files@v12.0
9898
id: verify-changed-files
9999
with:
100100
files: |
@@ -113,5 +113,4 @@ jobs:
113113
if: steps.verify-changed-files.outputs.files_changed == 'true'
114114
with:
115115
github_token: ${{ secrets.GITHUB_TOKEN }}
116-
branch: ${{ github.head_ref }}
117-
force: true
116+
branch: ${{ github.head_ref }}

README.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ In general my focus inside this project is to implement and deliver old and new
1616
- Create/ Update a dashboard
1717
- Delete a dashboard
1818
- Get permissions of a dashboard
19+
- Get permissions of a dashboard by uid
1920
- Update the permissions of a dashboard
21+
- Update the permissions of a dashboard by uid
2022
- Get all dashboard versions
23+
- Get all dashboard versions by uid
2124
- Get dashboard version of a specific dashboard
25+
- Get dashboard version of a specific dashboard by uid
2226
- Restore a dashboard version of a specific dashboard
27+
- Restore a dashboard version of a specific dashboard by uid
2328
- Compare two dashboard versions and extract the diff between booth dashboards
2429

2530
### Folder
@@ -102,6 +107,28 @@ In general my focus inside this project is to implement and deliver old and new
102107
- Delete a notification channel by uid
103108
- Test a notification channel
104109

110+
### Alerting Provisioning
111+
- Get alert rule
112+
- Add alert rule
113+
- Update alert rule
114+
- Update ethe interval fo the alert rule group
115+
- Delete alert rule
116+
- Get all contact points
117+
- Add contact point
118+
- Update contact point
119+
- Delete contact point
120+
- Get notification policies
121+
- Add notification policies
122+
- Get all mute timings
123+
- Get mute timings
124+
- Add mute timing
125+
- Update mute timing
126+
- Delete mute timing
127+
- Get all message templates
128+
- Get message template
129+
- Create or update message template
130+
- Delete message template
131+
105132
### Organization
106133
- Get current organisation
107134
- Update the current organisation name
@@ -280,14 +307,22 @@ In general my focus inside this project is to implement and deliver old and new
280307
- Remove team role assignment
281308
- Reset basic roles to their default
282309

283-
## Feature timeline
284-
285-
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.
286-
287-
| API endpoint group | Implementation week | Maintainer | PR | State |
288-
|:------------------:|:-------------------:|:----------:|:--:|:-----:|
289-
| [Library Element HTTP API](https://grafana.com/docs/grafana/latest/http_api/library_element/) | 34 | | | |
290-
| [Alerting Provisioning HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/) | 36 | | | |
310+
### Library
311+
- Get all library elements
312+
- Get library element by uid
313+
- Get library element by name
314+
- Get library element connections
315+
- Create library element
316+
- Update library element
317+
- Delete library element
318+
319+
### Correlations
320+
- Get correlation
321+
- Get all correlations by datasource uid
322+
- Get all correlations
323+
- Create correlations
324+
- Update correlations
325+
- Delete correlations
291326

292327
## Installation
293328

0 commit comments

Comments
 (0)