Skip to content

Commit b5f8324

Browse files
authored
fix: Add the missing alerting header (#24)
* fix: Add the missing alerting header * feat: Add coverage badge and documentation
1 parent 6187ef9 commit b5f8324

File tree

6 files changed

+85
-27
lines changed

6 files changed

+85
-27
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
git config --local user.email "github-actions[bot]@users.noreply.github.com"
107107
git config --local user.name "github-actions[bot]"
108108
git add --force docs
109-
git commit -m "Add coverage badge and documentation"
109+
git commit -m "docs: Add coverage badge and documentation"
110110
111111
- name: Push changes
112112
uses: ad-m/github-push-action@master

docs/content/grafana_api/alerting-provisioning.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ The method includes a functionality to get the alert rule specified by the uid
7676
#### add\_alert\_rule
7777

7878
```python
79-
def add_alert_rule(alert_rule: AlertRule)
79+
def add_alert_rule(alert_rule: AlertRule, disable_provenance: bool = False)
8080
```
8181

8282
The method includes a functionality to create a new alert rule
8383

8484
**Arguments**:
8585

8686
- `alert_rule` _AlertRule_ - Specify the alert rule
87+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
8788

8889

8990
**Raises**:
@@ -101,7 +102,9 @@ The method includes a functionality to create a new alert rule
101102
#### update\_alert\_rule
102103

103104
```python
104-
def update_alert_rule(uid: str, alert_rule: AlertRule)
105+
def update_alert_rule(uid: str,
106+
alert_rule: AlertRule,
107+
disable_provenance: bool = False)
105108
```
106109

107110
The method includes a functionality to update an existing alert rule
@@ -110,6 +113,7 @@ The method includes a functionality to update an existing alert rule
110113

111114
- `uid` _str_ - Specify the alert rule uid
112115
- `alert_rule` _AlertRule_ - Specify the alert rule
116+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
113117

114118

115119
**Raises**:
@@ -127,8 +131,11 @@ The method includes a functionality to update an existing alert rule
127131
#### update\_the\_interval\_of\_a\_alert\_rule\_group
128132

129133
```python
130-
def update_the_interval_of_a_alert_rule_group(folder_uid: str, group: str,
131-
alert_rule_group_interval: int)
134+
def update_the_interval_of_a_alert_rule_group(
135+
folder_uid: str,
136+
group: str,
137+
alert_rule_group_interval: int,
138+
disable_provenance: bool = False)
132139
```
133140

134141
The method includes a functionality to update the interval of a alert rule group
@@ -138,6 +145,7 @@ The method includes a functionality to update the interval of a alert rule group
138145
- `folder_uid` _str_ - Specify the folder uid
139146
- `group` _str_ - Specify the group
140147
- `alert_rule_group_interval` _int_ - Specify the alert rule group interval
148+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
141149

142150

143151
**Raises**:
@@ -155,14 +163,15 @@ The method includes a functionality to update the interval of a alert rule group
155163
#### delete\_alert\_rule
156164

157165
```python
158-
def delete_alert_rule(uid: str)
166+
def delete_alert_rule(uid: str, disable_provenance: bool = False)
159167
```
160168

161169
The method includes a functionality to delete an alert rule
162170

163171
**Arguments**:
164172

165173
- `uid` _str_ - Specify the alert rule uid
174+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
166175

167176

168177
**Raises**:
@@ -198,14 +207,16 @@ The method includes a functionality to get all contact points
198207
#### add\_contact\_point
199208

200209
```python
201-
def add_contact_point(embedded_contact_point: EmbeddedContactPoint)
210+
def add_contact_point(embedded_contact_point: EmbeddedContactPoint,
211+
disable_provenance: bool = False)
202212
```
203213

204214
The method includes a functionality to create a contact point
205215

206216
**Arguments**:
207217

208218
- `embedded_contact_point` _EmbeddedContactPoint_ - Specify the embedded contact point
219+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
209220

210221

211222
**Raises**:
@@ -224,7 +235,8 @@ The method includes a functionality to create a contact point
224235

225236
```python
226237
def update_contact_point(uid: str,
227-
embedded_contact_point: EmbeddedContactPoint)
238+
embedded_contact_point: EmbeddedContactPoint,
239+
disable_provenance: bool = False)
228240
```
229241

230242
The method includes a functionality to update a contact point
@@ -233,6 +245,7 @@ The method includes a functionality to update a contact point
233245

234246
- `uid` _str_ - Specify the uid of the contact point
235247
- `embedded_contact_point` _EmbeddedContactPoint_ - Specify the embedded contact point
248+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
236249

237250

238251
**Raises**:
@@ -294,14 +307,15 @@ The method includes a functionality to get the notification policy tree
294307
#### add\_notification\_policies
295308

296309
```python
297-
def add_notification_policies(route: Route)
310+
def add_notification_policies(route: Route, disable_provenance: bool = False)
298311
```
299312

300313
The method includes a functionality to set the notification policy tree
301314

302315
**Arguments**:
303316

304317
- `route` _Route_ - Specify the alert rule routes
318+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
305319

306320

307321
**Raises**:
@@ -363,14 +377,16 @@ The method includes a functionality to get a mute timings specified by the name
363377
#### add\_mute\_timing
364378

365379
```python
366-
def add_mute_timing(mute_time_interval: MuteTimeInterval)
380+
def add_mute_timing(mute_time_interval: MuteTimeInterval,
381+
disable_provenance: bool = False)
367382
```
368383

369384
The method includes a functionality to create a mute timing
370385

371386
**Arguments**:
372387

373388
- `mute_time_interval` _MuteTimeInterval_ - Specify the mute time interval
389+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
374390

375391

376392
**Raises**:
@@ -388,7 +404,9 @@ The method includes a functionality to create a mute timing
388404
#### update\_mute\_timing
389405

390406
```python
391-
def update_mute_timing(name: str, mute_time_interval: MuteTimeInterval)
407+
def update_mute_timing(name: str,
408+
mute_time_interval: MuteTimeInterval,
409+
disable_provenance: bool = False)
392410
```
393411

394412
The method includes a functionality to update an existing mute timing
@@ -397,6 +415,7 @@ The method includes a functionality to update an existing mute timing
397415

398416
- `name` _str_ - Specify the mute timing name
399417
- `mute_time_interval` _MuteTimeInterval_ - Specify the mute time interval
418+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
400419

401420

402421
**Raises**:
@@ -483,7 +502,9 @@ The method includes a functionality to get a message template specified by the n
483502
#### create\_or\_update\_message\_template
484503

485504
```python
486-
def create_or_update_message_template(name: str, message_template: str)
505+
def create_or_update_message_template(name: str,
506+
message_template: str,
507+
disable_provenance: bool = False)
487508
```
488509

489510
The method includes a functionality to create or update a message template
@@ -492,6 +513,7 @@ The method includes a functionality to create or update a message template
492513

493514
- `name` _str_ - Specify the message template name
494515
- `message_template` _str_ - Specify the message template
516+
- `disable_provenance` _bool_ - Specify if the provenance header should be set or not (default False)
495517

496518

497519
**Raises**:

docs/content/grafana_api/api.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def call_the_api(api_call: str,
3636
method: RequestsMethods = RequestsMethods.GET,
3737
json_complete: str = None,
3838
org_id_header: int = None,
39+
disable_provenance_header: bool = False,
3940
response_status_code: bool = False) -> any
4041
```
4142

@@ -46,8 +47,9 @@ The method execute a defined API call against the Grafana endpoints
4647
- `api_call` _str_ - Specify the API call endpoint
4748
- `method` _RequestsMethods_ - Specify the used method (default GET)
4849
- `json_complete` _str_ - Specify the inserted JSON as string
49-
- `org_id_header` _int_ - Specify the optional organization id for the corresponding API call
50-
- `response_status_code` _bool_ - Specify if the response should include the original status code
50+
- `org_id_header` _int_ - Specify the optional organization id as header for the corresponding API call
51+
- `disable_provenance_header` _bool_ - Specify the optional disable provenance as header for the corresponding API call (default False)
52+
- `response_status_code` _bool_ - Specify if the response should include the original status code (default False)
5153

5254

5355
**Raises**:

0 commit comments

Comments
 (0)