ngalert openapi: Use same basePath as rest of Grafana (#79025)

* ngalert openapi: Use same `basePath` as rest of Grafana
Currently, there are two issues that prevent easily merging `ngalert` and grafana openapi specs:
- The basePath is different. `grafana` has `/api` and `ngalert` has `/api/v1`. I changed `ngalert` to use `/api`
- The `ngalert` endpoints have their basePath in the each operation path. The basePath should actually be omitted
---------

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
Julien Duchesne
2024-01-17 11:53:16 -05:00
committed by GitHub
co-authored by Yuriy Tseretyan
parent dce9d1e87c
commit c9211fbd69
22 changed files with 2639 additions and 2586 deletions
+22 -21
View File
@@ -1,5 +1,5 @@
{
"basePath": "/api/v1",
"basePath": "/api",
"consumes": [
"application/json"
],
@@ -4414,7 +4414,6 @@
"type": "object"
},
"alertGroup": {
"description": "AlertGroup alert group",
"properties": {
"alerts": {
"description": "alerts",
@@ -4438,6 +4437,7 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
},
@@ -4542,6 +4542,7 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"
@@ -4597,7 +4598,6 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
},
@@ -4652,13 +4652,13 @@
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},
"type": "array"
},
"integration": {
"description": "Integration integration",
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
@@ -4840,6 +4840,7 @@
"type": "object"
},
"receiver": {
"description": "Receiver receiver",
"properties": {
"active": {
"description": "active",
@@ -4959,7 +4960,7 @@
"version": "1.1.0"
},
"paths": {
"/api/v1/provisioning/alert-rules": {
"/v1/provisioning/alert-rules": {
"get": {
"operationId": "RouteGetAlertRules",
"responses": {
@@ -5014,7 +5015,7 @@
]
}
},
"/api/v1/provisioning/alert-rules/export": {
"/v1/provisioning/alert-rules/export": {
"get": {
"operationId": "RouteGetAlertRulesExport",
"parameters": [
@@ -5071,7 +5072,7 @@
]
}
},
"/api/v1/provisioning/alert-rules/{UID}": {
"/v1/provisioning/alert-rules/{UID}": {
"delete": {
"operationId": "RouteDeleteAlertRule",
"parameters": [
@@ -5171,7 +5172,7 @@
]
}
},
"/api/v1/provisioning/alert-rules/{UID}/export": {
"/v1/provisioning/alert-rules/{UID}/export": {
"get": {
"operationId": "RouteGetAlertRuleExport",
"parameters": [
@@ -5219,7 +5220,7 @@
]
}
},
"/api/v1/provisioning/contact-points": {
"/v1/provisioning/contact-points": {
"get": {
"operationId": "RouteGetContactpoints",
"parameters": [
@@ -5282,7 +5283,7 @@
]
}
},
"/api/v1/provisioning/contact-points/export": {
"/v1/provisioning/contact-points/export": {
"get": {
"operationId": "RouteGetContactpointsExport",
"parameters": [
@@ -5334,7 +5335,7 @@
]
}
},
"/api/v1/provisioning/contact-points/{UID}": {
"/v1/provisioning/contact-points/{UID}": {
"delete": {
"consumes": [
"application/json"
@@ -5405,7 +5406,7 @@
]
}
},
"/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": {
"/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": {
"get": {
"operationId": "RouteGetAlertRuleGroup",
"parameters": [
@@ -5489,7 +5490,7 @@
]
}
},
"/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": {
"/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": {
"get": {
"operationId": "RouteGetAlertRuleGroupExport",
"parameters": [
@@ -5542,7 +5543,7 @@
]
}
},
"/api/v1/provisioning/mute-timings": {
"/v1/provisioning/mute-timings": {
"get": {
"operationId": "RouteGetMuteTimings",
"responses": {
@@ -5597,7 +5598,7 @@
]
}
},
"/api/v1/provisioning/mute-timings/export": {
"/v1/provisioning/mute-timings/export": {
"get": {
"operationId": "RouteExportMuteTimings",
"parameters": [
@@ -5636,7 +5637,7 @@
]
}
},
"/api/v1/provisioning/mute-timings/{name}": {
"/v1/provisioning/mute-timings/{name}": {
"delete": {
"operationId": "RouteDeleteMuteTiming",
"parameters": [
@@ -5737,7 +5738,7 @@
]
}
},
"/api/v1/provisioning/mute-timings/{name}/export": {
"/v1/provisioning/mute-timings/{name}/export": {
"get": {
"operationId": "RouteExportMuteTiming",
"parameters": [
@@ -5783,7 +5784,7 @@
]
}
},
"/api/v1/provisioning/policies": {
"/v1/provisioning/policies": {
"delete": {
"consumes": [
"application/json"
@@ -5857,7 +5858,7 @@
]
}
},
"/api/v1/provisioning/policies/export": {
"/v1/provisioning/policies/export": {
"get": {
"operationId": "RouteGetPolicyTreeExport",
"responses": {
@@ -5880,7 +5881,7 @@
]
}
},
"/api/v1/provisioning/templates": {
"/v1/provisioning/templates": {
"get": {
"operationId": "RouteGetTemplates",
"responses": {
@@ -5900,7 +5901,7 @@
]
}
},
"/api/v1/provisioning/templates/{name}": {
"/v1/provisioning/templates/{name}": {
"delete": {
"operationId": "RouteDeleteTemplate",
"parameters": [