mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 08:52:07 +08:00
Alerting: Pass yaml as a query param in export request (#62751)
* Set YAML as default value for exporting alert rules * use YAML format for rule list export Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> * lint * Add new format query param to swagger+docs * Fix broken test --------- Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com> Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
This commit is contained in:
@ -244,10 +244,11 @@ GET /api/v1/provisioning/alert-rules/{UID}/export
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------- | ------- | ------- | -------- | --------- | :------: | ------- | -------------------------------------------------- |
|
||||
| UID | `path` | string | `string` | | ✓ | | Alert rule UID |
|
||||
| download | `query` | boolean | `bool` | | | | Whether to initiate a download of the file or not. |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------- | ------- | -------- | -------- | --------- | :------: | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| UID | `path` | string | `string` | | ✓ | | Alert rule UID |
|
||||
| download | `query` | boolean | `bool` | | | | Whether to initiate a download of the file or not. |
|
||||
| format | `query` | `string` | string | | | `"yaml"` | Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence. |
|
||||
|
||||
#### All responses
|
||||
|
||||
@ -322,11 +323,12 @@ GET /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| --------- | ------- | ------- | -------- | --------- | :------: | ------- | -------------------------------------------------- |
|
||||
| FolderUID | `path` | string | `string` | | ✓ | | |
|
||||
| Group | `path` | string | `string` | | ✓ | | |
|
||||
| download | `query` | boolean | `bool` | | | | Whether to initiate a download of the file or not. |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| --------- | ------- | -------- | -------- | --------- | :------: | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| FolderUID | `path` | string | `string` | | ✓ | | |
|
||||
| Group | `path` | string | `string` | | ✓ | | |
|
||||
| download | `query` | boolean | `bool` | | | | Whether to initiate a download of the file or not. |
|
||||
| format | `query` | `string` | string | | | `"yaml"` | Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence. |
|
||||
|
||||
#### All responses
|
||||
|
||||
@ -381,9 +383,10 @@ GET /api/v1/provisioning/alert-rules/export
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------- | ------- | ------- | ------- | --------- | :------: | ------- | -------------------------------------------------- |
|
||||
| download | `query` | boolean | `bool` | | | | Whether to initiate a download of the file or not. |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------- | ------- | -------- | ------- | --------- | :------: | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| download | `query` | boolean | `bool` | | | | Whether to initiate a download of the file or not. |
|
||||
| format | `query` | `string` | string | | | `"yaml"` | Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence. |
|
||||
|
||||
#### All responses
|
||||
|
||||
|
Reference in New Issue
Block a user