Swagger: Fix listTokensResponse (#78155)

* Swagger: Fix listTokensResponse
It should return a list of Tokens, not a single one
Also regenerated the API spec from the latest changes + this branch

* Remove pointer
This commit is contained in:
Julien Duchesne 2023-11-15 08:59:54 -05:00 committed by GitHub
parent 8057b9298d
commit c551c9e71f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 1021 deletions

View File

@ -246,7 +246,7 @@ type DeleteTokenParams struct {
// swagger:response listTokensResponse
type ListTokensResponse struct {
// in:body
Body *TokenDTO
Body []TokenDTO
}
// swagger:response createTokenResponse

View File

@ -685,216 +685,6 @@
}
}
},
"/datasources/{datasourceId}/disable-permissions": {
"post": {
"description": "Disables permissions for the data source with the given id. All existing permissions will be removed and anyone will be able to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Disable permissions for a data source.",
"operationId": "disablePermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/createOrUpdateDatasourceResponse"
},
"400": {
"$ref": "#/responses/badRequestError"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/datasources/{datasourceId}/enable-permissions": {
"post": {
"description": "Enables permissions for the data source with the given id.\nNo one except Org Admins will be able to query the data source until permissions have been added\nwhich permit certain users or teams to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Enable permissions for a data source.",
"operationId": "enablePermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/createOrUpdateDatasourceResponse"
},
"400": {
"$ref": "#/responses/badRequestError"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/datasources/{datasourceId}/permissions": {
"get": {
"description": "Gets all existing permissions for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use GET /api/access-control/datasources/:uid",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Get permissions for a data source.",
"operationId": "getAllPermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/getAllPermissionseResponse"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
},
"post": {
"description": "You need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use POST /api/access-control/datasources/:uid/users/:id, /api/access-control/datasources/:uid/teams/:id or /api/access-control/datasources/:uid/buildInRoles/:id",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Add permissions for a data source.",
"operationId": "addPermission",
"parameters": [
{
"type": "integer",
"format": "int64",
"name": "userId",
"in": "query"
},
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "query"
},
{
"type": "string",
"name": "builtinRole",
"in": "query"
},
{
"type": "integer",
"format": "int64",
"name": "permission",
"in": "query"
},
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/addPermissionResponse"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/datasources/{datasourceId}/permissions/{permissionId}": {
"delete": {
"description": "Removes the permission with the given permissionId for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:delete` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use POST /api/access-control/datasources/:uid/users/:id, /api/access-control/datasources/:uid/teams/:id or /api/access-control/datasources/:uid/buildInRoles/:id",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Remove permission for a data source.",
"operationId": "deletePermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
},
{
"type": "string",
"name": "permissionId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/okResponse"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
}
}
}
},
"/licensing/check": {
"get": {
"tags": [
@ -1572,6 +1362,21 @@
"type": "string",
"name": "layout",
"in": "query"
},
{
"type": "string",
"name": "title",
"in": "query"
},
{
"type": "string",
"name": "scaleFactor",
"in": "query"
},
{
"type": "string",
"name": "includeTables",
"in": "query"
}
],
"responses": {
@ -2195,25 +2000,6 @@
}
}
},
"AddPermissionDTO": {
"type": "object",
"properties": {
"builtinRole": {
"type": "string"
},
"permission": {
"$ref": "#/definitions/DsPermissionType"
},
"teamId": {
"type": "integer",
"format": "int64"
},
"userId": {
"type": "integer",
"format": "int64"
}
}
},
"AddServiceAccountTokenCommand": {
"type": "object",
"properties": {
@ -4226,83 +4012,6 @@
}
}
},
"DataSourcePermissionRuleDTO": {
"type": "object",
"properties": {
"builtInRole": {
"type": "string"
},
"created": {
"type": "string",
"format": "date-time"
},
"datasourceId": {
"type": "integer",
"format": "int64"
},
"id": {
"type": "integer",
"format": "int64"
},
"isManaged": {
"type": "boolean"
},
"permission": {
"$ref": "#/definitions/DsPermissionType"
},
"permissionName": {
"type": "string"
},
"team": {
"type": "string"
},
"teamAvatarUrl": {
"type": "string"
},
"teamEmail": {
"type": "string"
},
"teamId": {
"type": "integer",
"format": "int64"
},
"updated": {
"type": "string",
"format": "date-time"
},
"userAvatarUrl": {
"type": "string"
},
"userEmail": {
"type": "string"
},
"userId": {
"type": "integer",
"format": "int64"
},
"userLogin": {
"type": "string"
}
}
},
"DataSourcePermissionsDTO": {
"type": "object",
"properties": {
"datasourceId": {
"type": "integer",
"format": "int64"
},
"enabled": {
"type": "boolean"
},
"permissions": {
"type": "array",
"items": {
"$ref": "#/definitions/DataSourcePermissionRuleDTO"
}
}
}
},
"DataSourceRef": {
"description": "Ref to a DataSource instance",
"type": "object",
@ -6771,10 +6480,6 @@
"type": "boolean",
"example": false
},
"requiredBy": {
"type": "string",
"example": "grafana-app"
},
"login": {
"type": "string",
"example": "sa-grafana"
@ -6830,10 +6535,6 @@
"type": "boolean",
"example": false
},
"requiredBy": {
"type": "string",
"example": "grafana-app"
},
"login": {
"type": "string",
"example": "sa-grafana"
@ -6847,6 +6548,10 @@
"format": "int64",
"example": 1
},
"requiredBy": {
"type": "string",
"example": "grafana-app"
},
"role": {
"type": "string",
"example": "Editor"
@ -8159,21 +7864,6 @@
"$ref": "#/definitions/ErrorResponseBody"
}
},
"addPermissionResponse": {
"description": "",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"permissionId": {
"type": "integer",
"format": "int64"
}
}
}
},
"adminCreateUserResponse": {
"description": "",
"schema": {
@ -8596,12 +8286,6 @@
}
}
},
"getAllPermissionseResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/DataSourcePermissionsDTO"
}
},
"getAllRolesResponse": {
"description": "",
"schema": {
@ -9126,7 +8810,10 @@
"listTokensResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/TokenDTO"
"type": "array",
"items": {
"$ref": "#/definitions/TokenDTO"
}
}
},
"notFoundError": {

View File

@ -5247,216 +5247,6 @@
}
}
},
"/datasources/{datasourceId}/disable-permissions": {
"post": {
"description": "Disables permissions for the data source with the given id. All existing permissions will be removed and anyone will be able to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Disable permissions for a data source.",
"operationId": "disablePermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/createOrUpdateDatasourceResponse"
},
"400": {
"$ref": "#/responses/badRequestError"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/datasources/{datasourceId}/enable-permissions": {
"post": {
"description": "Enables permissions for the data source with the given id.\nNo one except Org Admins will be able to query the data source until permissions have been added\nwhich permit certain users or teams to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Enable permissions for a data source.",
"operationId": "enablePermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/createOrUpdateDatasourceResponse"
},
"400": {
"$ref": "#/responses/badRequestError"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/datasources/{datasourceId}/permissions": {
"get": {
"description": "Gets all existing permissions for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use GET /api/access-control/datasources/:uid",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Get permissions for a data source.",
"operationId": "getAllPermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/getAllPermissionseResponse"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
},
"post": {
"description": "You need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use POST /api/access-control/datasources/:uid/users/:id, /api/access-control/datasources/:uid/teams/:id or /api/access-control/datasources/:uid/buildInRoles/:id",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Add permissions for a data source.",
"operationId": "addPermission",
"parameters": [
{
"type": "integer",
"format": "int64",
"name": "userId",
"in": "query"
},
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "query"
},
{
"type": "string",
"name": "builtinRole",
"in": "query"
},
{
"type": "integer",
"format": "int64",
"name": "permission",
"in": "query"
},
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/addPermissionResponse"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/datasources/{datasourceId}/permissions/{permissionId}": {
"delete": {
"description": "Removes the permission with the given permissionId for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:delete` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use POST /api/access-control/datasources/:uid/users/:id, /api/access-control/datasources/:uid/teams/:id or /api/access-control/datasources/:uid/buildInRoles/:id",
"tags": [
"datasource_permissions",
"enterprise"
],
"summary": "Remove permission for a data source.",
"operationId": "deletePermissions",
"parameters": [
{
"type": "string",
"name": "datasourceId",
"in": "path",
"required": true
},
{
"type": "string",
"name": "permissionId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/okResponse"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"404": {
"$ref": "#/responses/notFoundError"
}
}
}
},
"/datasources/{id}": {
"get": {
"description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/getDataSourceByUID) instead",
@ -8704,6 +8494,21 @@
"type": "string",
"name": "layout",
"in": "query"
},
{
"type": "string",
"name": "title",
"in": "query"
},
{
"type": "string",
"name": "scaleFactor",
"in": "query"
},
{
"type": "string",
"name": "includeTables",
"in": "query"
}
],
"responses": {
@ -11207,25 +11012,6 @@
}
}
},
"AddPermissionDTO": {
"type": "object",
"properties": {
"builtinRole": {
"type": "string"
},
"permission": {
"$ref": "#/definitions/DsPermissionType"
},
"teamId": {
"type": "integer",
"format": "int64"
},
"userId": {
"type": "integer",
"format": "int64"
}
}
},
"AddServiceAccountTokenCommand": {
"type": "object",
"properties": {
@ -13809,83 +13595,6 @@
}
}
},
"DataSourcePermissionRuleDTO": {
"type": "object",
"properties": {
"builtInRole": {
"type": "string"
},
"created": {
"type": "string",
"format": "date-time"
},
"datasourceId": {
"type": "integer",
"format": "int64"
},
"id": {
"type": "integer",
"format": "int64"
},
"isManaged": {
"type": "boolean"
},
"permission": {
"$ref": "#/definitions/DsPermissionType"
},
"permissionName": {
"type": "string"
},
"team": {
"type": "string"
},
"teamAvatarUrl": {
"type": "string"
},
"teamEmail": {
"type": "string"
},
"teamId": {
"type": "integer",
"format": "int64"
},
"updated": {
"type": "string",
"format": "date-time"
},
"userAvatarUrl": {
"type": "string"
},
"userEmail": {
"type": "string"
},
"userId": {
"type": "integer",
"format": "int64"
},
"userLogin": {
"type": "string"
}
}
},
"DataSourcePermissionsDTO": {
"type": "object",
"properties": {
"datasourceId": {
"type": "integer",
"format": "int64"
},
"enabled": {
"type": "boolean"
},
"permissions": {
"type": "array",
"items": {
"$ref": "#/definitions/DataSourcePermissionRuleDTO"
}
}
}
},
"DataSourceRef": {
"description": "Ref to a DataSource instance",
"type": "object",
@ -21265,21 +20974,6 @@
"$ref": "#/definitions/ErrorResponseBody"
}
},
"addPermissionResponse": {
"description": "(empty)",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"permissionId": {
"type": "integer",
"format": "int64"
}
}
}
},
"adminCreateUserResponse": {
"description": "(empty)",
"schema": {
@ -21702,12 +21396,6 @@
}
}
},
"getAllPermissionseResponse": {
"description": "(empty)",
"schema": {
"$ref": "#/definitions/DataSourcePermissionsDTO"
}
},
"getAllRolesResponse": {
"description": "(empty)",
"schema": {
@ -22232,7 +21920,10 @@
"listTokensResponse": {
"description": "(empty)",
"schema": {
"$ref": "#/definitions/TokenDTO"
"type": "array",
"items": {
"$ref": "#/definitions/TokenDTO"
}
}
},
"notFoundError": {

View File

@ -50,25 +50,6 @@
},
"description": "AcceptedResponse"
},
"addPermissionResponse": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
},
"permissionId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
}
}
},
"description": "(empty)"
},
"adminCreateUserResponse": {
"content": {
"application/json": {
@ -647,16 +628,6 @@
},
"description": "(empty)"
},
"getAllPermissionseResponse": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DataSourcePermissionsDTO"
}
}
},
"description": "(empty)"
},
"getAllRolesResponse": {
"content": {
"application/json": {
@ -1434,7 +1405,10 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenDTO"
"items": {
"$ref": "#/components/schemas/TokenDTO"
},
"type": "array"
}
}
},
@ -2112,25 +2086,6 @@
},
"type": "object"
},
"AddPermissionDTO": {
"properties": {
"builtinRole": {
"type": "string"
},
"permission": {
"$ref": "#/components/schemas/DsPermissionType"
},
"teamId": {
"format": "int64",
"type": "integer"
},
"userId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"AddServiceAccountTokenCommand": {
"properties": {
"name": {
@ -4714,83 +4669,6 @@
},
"type": "object"
},
"DataSourcePermissionRuleDTO": {
"properties": {
"builtInRole": {
"type": "string"
},
"created": {
"format": "date-time",
"type": "string"
},
"datasourceId": {
"format": "int64",
"type": "integer"
},
"id": {
"format": "int64",
"type": "integer"
},
"isManaged": {
"type": "boolean"
},
"permission": {
"$ref": "#/components/schemas/DsPermissionType"
},
"permissionName": {
"type": "string"
},
"team": {
"type": "string"
},
"teamAvatarUrl": {
"type": "string"
},
"teamEmail": {
"type": "string"
},
"teamId": {
"format": "int64",
"type": "integer"
},
"updated": {
"format": "date-time",
"type": "string"
},
"userAvatarUrl": {
"type": "string"
},
"userEmail": {
"type": "string"
},
"userId": {
"format": "int64",
"type": "integer"
},
"userLogin": {
"type": "string"
}
},
"type": "object"
},
"DataSourcePermissionsDTO": {
"properties": {
"datasourceId": {
"format": "int64",
"type": "integer"
},
"enabled": {
"type": "boolean"
},
"permissions": {
"items": {
"$ref": "#/components/schemas/DataSourcePermissionRuleDTO"
},
"type": "array"
}
},
"type": "object"
},
"DataSourceRef": {
"description": "Ref to a DataSource instance",
"properties": {
@ -17912,236 +17790,6 @@
]
}
},
"/datasources/{datasourceId}/disable-permissions": {
"post": {
"description": "Disables permissions for the data source with the given id. All existing permissions will be removed and anyone will be able to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.",
"operationId": "disablePermissions",
"parameters": [
{
"in": "path",
"name": "datasourceId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/createOrUpdateDatasourceResponse"
},
"400": {
"$ref": "#/components/responses/badRequestError"
},
"401": {
"$ref": "#/components/responses/unauthorisedError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"404": {
"$ref": "#/components/responses/notFoundError"
},
"500": {
"$ref": "#/components/responses/internalServerError"
}
},
"summary": "Disable permissions for a data source.",
"tags": [
"datasource_permissions",
"enterprise"
]
}
},
"/datasources/{datasourceId}/enable-permissions": {
"post": {
"description": "Enables permissions for the data source with the given id.\nNo one except Org Admins will be able to query the data source until permissions have been added\nwhich permit certain users or teams to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.",
"operationId": "enablePermissions",
"parameters": [
{
"in": "path",
"name": "datasourceId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/createOrUpdateDatasourceResponse"
},
"400": {
"$ref": "#/components/responses/badRequestError"
},
"401": {
"$ref": "#/components/responses/unauthorisedError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"404": {
"$ref": "#/components/responses/notFoundError"
},
"500": {
"$ref": "#/components/responses/internalServerError"
}
},
"summary": "Enable permissions for a data source.",
"tags": [
"datasource_permissions",
"enterprise"
]
}
},
"/datasources/{datasourceId}/permissions": {
"get": {
"description": "Gets all existing permissions for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use GET /api/access-control/datasources/:uid",
"operationId": "getAllPermissions",
"parameters": [
{
"in": "path",
"name": "datasourceId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/getAllPermissionseResponse"
},
"401": {
"$ref": "#/components/responses/unauthorisedError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"404": {
"$ref": "#/components/responses/notFoundError"
},
"500": {
"$ref": "#/components/responses/internalServerError"
}
},
"summary": "Get permissions for a data source.",
"tags": [
"datasource_permissions",
"enterprise"
]
},
"post": {
"description": "You need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use POST /api/access-control/datasources/:uid/users/:id, /api/access-control/datasources/:uid/teams/:id or /api/access-control/datasources/:uid/buildInRoles/:id",
"operationId": "addPermission",
"parameters": [
{
"in": "query",
"name": "userId",
"schema": {
"format": "int64",
"type": "integer"
}
},
{
"in": "query",
"name": "teamId",
"schema": {
"format": "int64",
"type": "integer"
}
},
{
"in": "query",
"name": "builtinRole",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "permission",
"schema": {
"format": "int64",
"type": "integer"
}
},
{
"in": "path",
"name": "datasourceId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/addPermissionResponse"
},
"401": {
"$ref": "#/components/responses/unauthorisedError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"404": {
"$ref": "#/components/responses/notFoundError"
},
"500": {
"$ref": "#/components/responses/internalServerError"
}
},
"summary": "Add permissions for a data source.",
"tags": [
"datasource_permissions",
"enterprise"
]
}
},
"/datasources/{datasourceId}/permissions/{permissionId}": {
"delete": {
"description": "Removes the permission with the given permissionId for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:delete` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).\n\nDeprecated: true.\nDeprecated. Please use POST /api/access-control/datasources/:uid/users/:id, /api/access-control/datasources/:uid/teams/:id or /api/access-control/datasources/:uid/buildInRoles/:id",
"operationId": "deletePermissions",
"parameters": [
{
"in": "path",
"name": "datasourceId",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "permissionId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/okResponse"
},
"401": {
"$ref": "#/components/responses/unauthorisedError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"404": {
"$ref": "#/components/responses/notFoundError"
}
},
"summary": "Remove permission for a data source.",
"tags": [
"datasource_permissions",
"enterprise"
]
}
},
"/datasources/{id}": {
"delete": {
"deprecated": true,
@ -21612,6 +21260,27 @@
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "title",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "scaleFactor",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "includeTables",
"schema": {
"type": "string"
}
}
],
"responses": {