[v11.2.x] Alerting: Support for optimistic concurrency in priovisioning Tempate API (#92251)

Alerting: Support for optimistic concurrency in priovisioning Tempate API (#91195)

* support optimistic concurrency in template service

* update request handler to get version from query parameter

* return not found if a new template is set with version

* update PUT api to set version

* update documentation + for mute timings

---------

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
(cherry picked from commit 1108a00668)

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-08-21 17:54:28 -04:00
committed by GitHub
co-authored by Yuri Tseretyan
parent 0c1d03e21a
commit 25c9b9d58e
12 changed files with 371 additions and 53 deletions
+25 -1
View File
@@ -2264,6 +2264,9 @@
},
"template": {
"type": "string"
},
"version": {
"type": "string"
}
},
"type": "object"
@@ -2272,6 +2275,9 @@
"properties": {
"template": {
"type": "string"
},
"version": {
"type": "string"
}
},
"type": "object"
@@ -6183,16 +6189,28 @@
"operationId": "RouteDeleteTemplate",
"parameters": [
{
"description": "Template Name",
"description": "Template name",
"in": "path",
"name": "name",
"required": true,
"type": "string"
},
{
"description": "Version of template to use for optimistic concurrency. Leave empty to disable validation",
"in": "query",
"name": "version",
"type": "string"
}
],
"responses": {
"204": {
"description": " The template was deleted successfully."
},
"409": {
"description": "GenericPublicError",
"schema": {
"$ref": "#/definitions/GenericPublicError"
}
}
},
"summary": "Delete a template.",
@@ -6265,6 +6283,12 @@
"schema": {
"$ref": "#/definitions/ValidationError"
}
},
"409": {
"description": "GenericPublicError",
"schema": {
"$ref": "#/definitions/GenericPublicError"
}
}
},
"summary": "Updates an existing notification template.",