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>
This commit is contained in:
Yuri Tseretyan
2024-08-09 11:40:07 -04:00
committed by GitHub
co-authored by brendamuir
parent d20510a1db
commit 1108a00668
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.",