* 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>
| 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 |
| 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. |
| 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. |
"description":"The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use RawPath, an optional field which only gets\nset if the default encoding is different from Path.\n\nURL's String method uses the EscapedPath method to obtain the path. See the\nEscapedPath method for more details.",
"properties":{
"ForceQuery":{
"type":"boolean"
@ -3325,7 +3330,7 @@
"$ref":"#/definitions/Userinfo"
}
},
"title":"URL is a custom URL type that allows validation at configuration load time.",
"title":"A URL represents a parsed URL (technically, a URI reference).",
"description":"The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use RawPath, an optional field which only gets\nset if the default encoding is different from Path.\n\nURL's String method uses the EscapedPath method to obtain the path. See the\nEscapedPath method for more details.",
"properties":{
"ForceQuery":{
"type":"boolean"
@ -3325,7 +3330,7 @@
"$ref":"#/definitions/Userinfo"
}
},
"title":"URL is a custom URL type that allows validation at configuration load time.",
"title":"A URL represents a parsed URL (technically, a URI reference).",
"type":"object"
},
"Userinfo":{
@ -3502,6 +3507,7 @@
"type":"object"
},
"alertGroup":{
"description":"AlertGroup alert group",
"properties":{
"alerts":{
"description":"alerts",
@ -3525,7 +3531,6 @@
"type":"object"
},
"alertGroups":{
"description":"AlertGroups alert groups",
"items":{
"$ref":"#/definitions/alertGroup"
},
@ -3630,6 +3635,7 @@
"type":"object"
},
"gettableAlert":{
"description":"GettableAlert gettable alert",
"properties":{
"annotations":{
"$ref":"#/definitions/labelSet"
@ -3691,6 +3697,7 @@
"type":"array"
},
"gettableSilence":{
"description":"GettableSilence gettable silence",
"properties":{
"comment":{
"description":"comment",
@ -3927,7 +3934,6 @@
"type":"object"
},
"receiver":{
"description":"Receiver receiver",
"properties":{
"active":{
"description":"active",
@ -5784,6 +5790,13 @@
"in":"query",
"name":"download",
"type":"boolean"
},
{
"default":"yaml",
"description":"Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.",
"in":"query",
"name":"format",
"type":"string"
}
],
"responses":{
@ -5915,6 +5928,13 @@
"in":"query",
"name":"download",
"type":"boolean"
},
{
"default":"yaml",
"description":"Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.",
"in":"query",
"name":"format",
"type":"string"
}
],
"produces":[
@ -6164,6 +6184,13 @@
"in":"query",
"name":"download",
"type":"boolean"
},
{
"default":"yaml",
"description":"Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.",
"description":"Whether to initiate a download of the file or not.",
"name":"download",
"in":"query"
},
{
"type":"string",
"default":"yaml",
"description":"Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.",
"name":"format",
"in":"query"
}
],
"responses":{
@ -1901,6 +1908,13 @@
"description":"Whether to initiate a download of the file or not.",
"name":"download",
"in":"query"
},
{
"type":"string",
"default":"yaml",
"description":"Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.",
"name":"format",
"in":"query"
}
],
"responses":{
@ -2157,6 +2171,13 @@
"description":"Whether to initiate a download of the file or not.",
"name":"download",
"in":"query"
},
{
"type":"string",
"default":"yaml",
"description":"Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.",
"name":"format",
"in":"query"
}
],
"responses":{
@ -2975,6 +2996,10 @@
"internal",
"external"
]
},
"numExternalAlertmanagers":{
"type":"integer",
"format":"int64"
}
}
},
@ -5905,8 +5930,9 @@
}
},
"URL":{
"description":"The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use RawPath, an optional field which only gets\nset if the default encoding is different from Path.\n\nURL's String method uses the EscapedPath method to obtain the path. See the\nEscapedPath method for more details.",
"type":"object",
"title":"URL is a custom URL type that allows validation at configuration load time.",
"title":"A URL represents a parsed URL (technically, a URI reference).",