Chore: Fix Swagger and OpenAPI specifications (#61669)

* Add go-swagger annotations for route

* Re-generate Swagger and OpenAPI specs
This commit is contained in:
Sofia Papagiannaki
2023-01-18 17:49:07 +02:00
committed by GitHub
parent b80c9bb974
commit 4b634fadcf
4 changed files with 6656 additions and 1535 deletions

View File

@@ -548,6 +548,13 @@ type RemoveOrgUserParams struct {
UserID int64 `json:"user_id"`
}
// swagger:parameters searchOrgUsers
type SearchOrgUsersParams struct {
// in:path
// required:true
OrgID int64 `json:"org_id"`
}
// swagger:response getOrgUsersForCurrentOrgLookupResponse
type GetOrgUsersForCurrentOrgLookupResponse struct {
// The response message
@@ -564,7 +571,14 @@ type GetOrgUsersForCurrentOrgResponse struct {
// swagger:response getOrgUsersResponse
type GetOrgUsersResponse struct {
// The response message
// The response message/
// in: body
Body []*org.OrgUserDTO `json:"body"`
}
// swagger:response searchOrgUsersResponse
type SearchOrgUsersResponse struct {
// The response message
// in: body
Body *org.SearchOrgUsersQueryResult `json:"body"`
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -942,7 +942,7 @@
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/PlaylistItem"
"$ref": "#/components/schemas/Item"
},
"type": "array"
}
@@ -1587,6 +1587,16 @@
},
"description": "(empty)"
},
"searchOrgUsersResponse": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchOrgUsersQueryResult"
}
}
},
"description": "(empty)"
},
"searchOrgsResponse": {
"content": {
"application/json": {
@@ -2648,6 +2658,60 @@
"title": "Authorization contains HTTP authorization credentials.",
"type": "object"
},
"BacktestConfig": {
"properties": {
"annotations": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"condition": {
"type": "string"
},
"data": {
"items": {
"$ref": "#/components/schemas/AlertQuery"
},
"type": "array"
},
"for": {
"$ref": "#/components/schemas/Duration"
},
"from": {
"format": "date-time",
"type": "string"
},
"interval": {
"$ref": "#/components/schemas/Duration"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"no_data_state": {
"enum": [
"Alerting",
"NoData",
"OK"
],
"type": "string"
},
"title": {
"type": "string"
},
"to": {
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"BacktestResult": {
"$ref": "#/components/schemas/Frame"
},
"BasicAuth": {
"properties": {
"password": {
@@ -3662,8 +3726,8 @@
"type": "string"
},
"createdBy": {
"description": "Since we get created by with left join user table, this can be null technically,\nbut in reality it will always be set, when database is not corrupted.",
"type": "string"
"format": "int64",
"type": "integer"
},
"dashboardId": {
"format": "int64",
@@ -3672,6 +3736,9 @@
"dashboardUid": {
"type": "string"
},
"data": {
"$ref": "#/components/schemas/Json"
},
"id": {
"format": "int64",
"type": "integer"
@@ -3695,7 +3762,7 @@
"type": "object"
},
"DashboardVersionMeta": {
"description": "DashboardVersionMeta extends the dashboard version model with the names\nassociated with the UserIds, overriding the field with the same name from\nthe DashboardVersion model.",
"description": "DashboardVersionMeta extends the DashboardVersionDTO with the names\nassociated with the UserIds, overriding the field with the same name from\nthe DashboardVersionDTO model.",
"properties": {
"created": {
"format": "date-time",
@@ -3972,6 +4039,7 @@
"type": "object"
},
"DataTopic": {
"description": "nolint:revive",
"title": "DataTopic is used to identify which topic the frame should be assigned to.",
"type": "string"
},
@@ -5247,6 +5315,23 @@
"title": "InspectType is a type for the Inspect property of a Notice.",
"type": "integer"
},
"Item": {
"properties": {
"title": {
"description": "Title is an unused property -- it will be removed in the future",
"type": "string"
},
"type": {
"$ref": "#/components/schemas/ItemType"
},
"value": {
"description": "Value depends on type and describes the playlist item.\n\ndashboard_by_id: The value is an internal numerical identifier set by Grafana. This\nis not portable as the numerical identifier is non-deterministic between different instances.\nWill be replaced by dashboard_by_uid in the future. (deprecated)\ndashboard_by_tag: The value is a tag which is set on any number of dashboards. All\ndashboards behind the tag will be added to the playlist.\ndashboard_by_uid: The value is the dashboard UID",
"type": "string"
}
},
"title": "Item defines model for Item.",
"type": "object"
},
"ItemDTO": {
"properties": {
"alertId": {
@@ -5321,6 +5406,10 @@
},
"type": "object"
},
"ItemType": {
"title": "Type of the item.",
"type": "string"
},
"Json": {
"type": "object"
},
@@ -6070,6 +6159,12 @@
},
"type": "object"
},
"authLabels": {
"items": {
"type": "string"
},
"type": "array"
},
"avatarUrl": {
"type": "string"
},
@@ -6195,6 +6290,9 @@
},
"PatchAnnotationsCmd": {
"properties": {
"data": {
"$ref": "#/components/schemas/Json"
},
"id": {
"format": "int64",
"type": "integer"
@@ -6411,25 +6509,30 @@
},
"PlaylistItem": {
"properties": {
"Id": {
"format": "int64",
"type": "integer"
},
"PlaylistId": {
"format": "int64",
"type": "integer"
},
"order": {
"format": "int64",
"type": "integer"
},
"title": {
"description": "Title is an unused property -- it will be removed in the future",
"type": "string"
},
"type": {
"$ref": "#/components/schemas/PlaylistItemType"
"type": "string"
},
"value": {
"description": "Value depends on type and describes the playlist item.\n\ndashboard_by_id: The value is an internal numerical identifier set by Grafana. This\nis not portable as the numerical identifier is non-deterministic between different instances.\nWill be replaced by dashboard_by_uid in the future. (deprecated)\ndashboard_by_tag: The value is a tag which is set on any number of dashboards. All\ndashboards behind the tag will be added to the playlist.\ndashboard_by_uid: The value is the dashboard UID",
"type": "string"
}
},
"title": "PlaylistItem defines model for playlist.Item.",
"type": "object"
},
"PlaylistItemType": {
"title": "Type of the item.",
"type": "string"
},
"Playlists": {
"items": {
"$ref": "#/components/schemas/Playlist"
@@ -7868,6 +7971,29 @@
},
"type": "object"
},
"SearchOrgUsersQueryResult": {
"properties": {
"orgUsers": {
"items": {
"$ref": "#/components/schemas/OrgUserDTO"
},
"type": "array"
},
"page": {
"format": "int64",
"type": "integer"
},
"perPage": {
"format": "int64",
"type": "integer"
},
"totalCount": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"SearchTeamQueryResult": {
"properties": {
"page": {
@@ -9034,6 +9160,9 @@
},
"UpdateAnnotationsCmd": {
"properties": {
"data": {
"$ref": "#/components/schemas/Json"
},
"id": {
"format": "int64",
"type": "integer"
@@ -9356,7 +9485,7 @@
"Email": {
"type": "string"
},
"Id": {
"ID": {
"format": "int64",
"type": "integer"
},
@@ -17890,6 +18019,46 @@
]
}
},
"/orgs/{org_id}/users/search": {
"get": {
"description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.",
"operationId": "searchOrgUsers",
"parameters": [
{
"in": "path",
"name": "org_id",
"required": true,
"schema": {
"format": "int64",
"type": "integer"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/searchOrgUsersResponse"
},
"401": {
"$ref": "#/components/responses/unauthorisedError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"500": {
"$ref": "#/components/responses/internalServerError"
}
},
"security": [
{
"basic": []
}
],
"summary": "Search Users in Organization.",
"tags": [
"orgs"
]
}
},
"/orgs/{org_id}/users/{user_id}": {
"delete": {
"description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.",