From e57fd88644be5de48173b6c1502ba01f43c9e105 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:26:55 +0300 Subject: [PATCH] Swagger: restore missing enterprise endpoints (#54765) --- public/api-merged.json | 3207 ++++++++++++++++++++++++++++++++++-- public/api-spec.json | 3055 +++++++++++++++++++++++++++++++++- public/openapi3.json | 3521 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 9542 insertions(+), 241 deletions(-) diff --git a/public/api-merged.json b/public/api-merged.json index 199963f0e38..768130ce9c2 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -26,6 +26,551 @@ }, "basePath": "/api", "paths": { + "/access-control/roles": { + "get": { + "description": "Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in.\n\nYou need to have a permission with action `roles:list` and scope `roles:*`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get all roles.", + "operationId": "listRoles", + "parameters": [ + { + "type": "boolean", + "name": "delegatable", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/listRolesResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates a new custom role and maps given permissions to that role. Note that roles with the same prefix as Fixed Roles can’t be created.\n\nYou need to have a permission with action `roles:write` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.\nFor example, if a user does not have required permissions for creating users, they won’t be able to create a custom role which allows to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Create a new custom role.", + "operationId": "createRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRoleForm" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/createRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/roles/{roleUID}": { + "get": { + "description": "Get a role for the given UID.\n\nYou need to have a permission with action `roles:read` and scope `roles:*`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get a role.", + "operationId": "getRole", + "parameters": [ + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `roles:write` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Update a custom role.", + "operationId": "updateRoleWithPermissions", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRoleCommand" + } + }, + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Delete a role with the given UID, and it’s permissions. If the role is assigned to a built-in role, the deletion operation will fail, unless force query param is set to true, and in that case all assignments will also be deleted.\n\nYou need to have a permission with action `roles:delete` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only delete a custom role with the same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to delete a custom role which allows to do that.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Delete a custom role.", + "operationId": "deleteCustomRole", + "parameters": [ + { + "type": "boolean", + "name": "force", + "in": "query" + }, + { + "type": "boolean", + "name": "global", + "in": "query" + }, + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/status": { + "get": { + "description": "Returns an indicator to check if fine-grained access control is enabled or not.\n\nYou need to have a permission with action `status:accesscontrol` and scope `services:accesscontrol`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get status.", + "operationId": "getAccessControlStatus", + "responses": { + "200": { + "$ref": "#/responses/getAccessControlStatusResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles": { + "get": { + "description": "You need to have a permission with action `teams.roles:list` and scope `teams:id:\u003cteam ID\u003e`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get team roles.", + "operationId": "listTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:type:delegate` for each.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Update team role.", + "operationId": "setTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You need to have a permission with action `teams.roles:add` and scope `permissions:type:delegate`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Add team role.", + "operationId": "addTeamRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTeamRoleCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles/{roleUID}": { + "delete": { + "description": "You need to have a permission with action `teams.roles:remove` and scope `permissions:type:delegate`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Remove team role.", + "operationId": "removeTeamRole", + "parameters": [ + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{userId}/roles": { + "get": { + "description": "Lists the roles that have been directly assigned to a given user. The list does not include built-in roles (Viewer, Editor, Admin or Grafana Admin), and it does not include roles that have been inherited from a team.\n\nYou need to have a permission with action `users.roles:list` and scope `users:id:\u003cuser ID\u003e`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "List roles assigned to a user.", + "operationId": "listUserRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAllRolesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Update the user’s role assignments to match the provided set of UIDs. This will remove any assigned roles that aren’t in the request and add roles that are in the set but are not already assigned to the user.\nIf you want to add or remove a single role, consider using Add a user role assignment or Remove a user role assignment instead.\n\nYou need to have a permission with action `users.roles:add` and `users.roles:remove` and scope `permissions:type:delegate` for each. `permissions:type:delegate` scope ensures that users can only assign or unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign or unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Set user role assignments.", + "operationId": "setUserRoles", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SetUserRolesCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Assign a role to a specific user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:add` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only assign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Add a user role assignment.", + "operationId": "addUserRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddUserRoleCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{userId}/roles/{roleUID}": { + "delete": { + "description": "Revoke a role from a user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:remove` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Remove a user role assignment.", + "operationId": "removeUserRole", + "parameters": [ + { + "type": "boolean", + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", + "name": "global", + "in": "query" + }, + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap-sync-status": { + "get": { + "description": "You need to have a permission with action `ldap.status:read`.", + "tags": [ + "ldap_debug" + ], + "summary": "Returns the current state of the LDAP background sync integration", + "operationId": "getSyncStatus", + "responses": { + "200": { + "$ref": "#/responses/getSyncStatusResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/admin/ldap/reload": { "post": { "security": [ @@ -197,6 +742,27 @@ } } }, + "/admin/provisioning/access-control/reload": { + "post": { + "tags": [ + "access_control_provisioning", + "enterprise" + ], + "summary": "You need to have a permission with action `provisioning:reload` with scope `provisioners:accesscontrol`.", + "operationId": "adminProvisioningReloadAccessControl", + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + } + } + } + }, "/admin/provisioning/dashboards/reload": { "post": { "security": [ @@ -2115,15 +2681,15 @@ "name": "Body", "in": "body", "schema": { - "$ref": "#/definitions/AlertRuleGroupMetadata" + "$ref": "#/definitions/AlertRuleGroup" } } ], "responses": { "200": { - "description": "AlertRuleGroupMetadata", + "description": "AlertRuleGroup", "schema": { - "$ref": "#/definitions/AlertRuleGroupMetadata" + "$ref": "#/definitions/AlertRuleGroup" } }, "400": { @@ -3353,7 +3919,9 @@ }, "/datasources/correlations": { "get": { - "tags": ["correlations"], + "tags": [ + "correlations" + ], "summary": "Gets all correlations.", "operationId": "getCorrelations", "responses": { @@ -3755,7 +4323,9 @@ }, "/datasources/uid/{sourceUID}/correlations": { "get": { - "tags": ["correlations"], + "tags": [ + "correlations" + ], "summary": "Gets all correlations originating from the given data source.", "operationId": "getCorrelationsBySourceUID", "parameters": [ @@ -3827,7 +4397,9 @@ }, "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { "get": { - "tags": ["correlations"], + "tags": [ + "correlations" + ], "summary": "Gets a correlation.", "operationId": "getCorrelation", "parameters": [ @@ -4134,6 +4706,216 @@ } } }, + "/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).", + "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).", + "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).", + "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).", + "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).", + "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", @@ -4981,6 +5763,216 @@ } } }, + "/licensing/check": { + "get": { + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Check license availability.", + "operationId": "getStatus", + "responses": { + "200": { + "$ref": "#/responses/getStatusResponse" + } + } + } + }, + "/licensing/custom-permissions": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Get custom permissions report.", + "operationId": "getCustomPermissionsReport", + "responses": { + "200": { + "$ref": "#/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/custom-permissions-csv": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "produces": [ + "text/csv" + ], + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Get custom permissions report in CSV format.", + "operationId": "getCustomPermissionsCSV", + "responses": { + "200": { + "$ref": "#/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/refresh-stats": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Refresh license stats.", + "operationId": "refreshLicenseStats", + "responses": { + "200": { + "$ref": "#/responses/refreshLicenseStatsResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Get license token.", + "operationId": "getLicenseToken", + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + } + } + }, + "post": { + "description": "You need to have a permission with action `licensing:update`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Create license token.", + "operationId": "postLicenseToken", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + } + } + }, + "delete": { + "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Remove license from database.", + "operationId": "deleteLicenseToken", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token/renew": { + "post": { + "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postRenewLicenseTokenResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + } + } + } + }, + "/logout/saml": { + "get": { + "tags": [ + "saml", + "enterprise" + ], + "summary": "GetLogout initiates single logout process.", + "operationId": "getSAMLLogout", + "responses": { + "302": { + "description": "(empty)" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/org": { "get": { "description": "Get current Organization", @@ -6499,6 +7491,827 @@ } } }, + "/recording-rules": { + "get": { + "description": "Lists all rules in the database: active or deleted", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "listRecordingRules", + "responses": { + "200": { + "$ref": "#/responses/listRecordingRulesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Update the active status of a rule", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "updateRecordingRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Create a recording rule that is then registered and started", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "createRecordingRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/test": { + "post": { + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Test a recording rule.", + "operationId": "testCreateRecordingRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/writer": { + "get": { + "description": "Return the prometheus remote write target", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "getRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "It returns a 422 if there is not an existing prometheus data source configured", + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Create a remote write target.", + "operationId": "createRecordingRuleWriteTarget", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Delete the remote write target.", + "operationId": "deleteRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/{recordingRuleID}": { + "delete": { + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Delete removes the rule from the registry and stops it.", + "operationId": "deleteRecordingRule", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "recordingRuleID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "List reports.", + "operationId": "getReports", + "responses": { + "200": { + "$ref": "#/responses/getReportsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Create a report.", + "operationId": "createReport", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/email": { + "post": { + "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Send a report.", + "operationId": "sendReport", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportEmailDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/render/pdf/{dashboardID}": { + "get": { + "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", + "produces": [ + "application/pdf" + ], + "tags": [ + "reports", + "enterprise" + ], + "summary": "Render report for dashboard.", + "operationId": "renderReportPDF", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "dashboardID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "title", + "in": "query" + }, + { + "type": "string", + "name": "variables", + "in": "query" + }, + { + "type": "string", + "name": "from", + "in": "query" + }, + { + "type": "string", + "name": "to", + "in": "query" + }, + { + "type": "string", + "name": "orientation", + "in": "query" + }, + { + "type": "string", + "name": "layout", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/render/pdfs": { + "get": { + "description": "Available to all users and with a valid license.", + "produces": [ + "application/pdf" + ], + "tags": [ + "reports", + "enterprise" + ], + "summary": "Render report for multiple dashboards.", + "operationId": "renderReportPDFs", + "parameters": [ + { + "type": "string", + "name": "dashboardID", + "in": "query" + }, + { + "type": "string", + "name": "orientation", + "in": "query" + }, + { + "type": "string", + "name": "layout", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/settings": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:read`x.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Get settings.", + "operationId": "getReportSettings", + "responses": { + "200": { + "$ref": "#/responses/getReportSettingsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:write`xx.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Save settings.", + "operationId": "saveReportSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/test-email": { + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Send test report via email.", + "operationId": "sendTestEmail", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/{id}": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Get a report.", + "operationId": "getReport", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Update a report.", + "operationId": "updateReport", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + }, + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Delete a report.", + "operationId": "deleteReport", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/saml/acs": { + "post": { + "tags": [ + "saml", + "enterprise" + ], + "summary": "It performs assertion Consumer Service (ACS).", + "operationId": "postACS", + "parameters": [ + { + "type": "string", + "name": "RelayState", + "in": "query" + } + ], + "responses": { + "302": { + "description": "(empty)" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/saml/metadata": { + "get": { + "produces": [ + "application/xml;application/samlmetadata+xml" + ], + "tags": [ + "saml", + "enterprise" + ], + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "operationId": "getMetadata", + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + } + } + } + }, + "/saml/slo": { + "get": { + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "tags": [ + "saml", + "enterprise" + ], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "getSLO", + "responses": { + "302": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "tags": [ + "saml", + "enterprise" + ], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", + "parameters": [ + { + "type": "string", + "name": "SAMLRequest", + "in": "query" + }, + { + "type": "string", + "name": "SAMLResponse", + "in": "query" + } + ], + "responses": { + "302": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/search": { "get": { "tags": [ @@ -6643,7 +8456,7 @@ "tags": [ "service_accounts" ], - "summary": "Create service account", + "summary": "# Create service account", "operationId": "createServiceAccount", "parameters": [ { @@ -6679,7 +8492,7 @@ "tags": [ "service_accounts" ], - "summary": "Search service accounts with paging", + "summary": "# Search service accounts with paging", "operationId": "searchOrgServiceAccountsWithPaging", "parameters": [ { @@ -6735,7 +8548,7 @@ "tags": [ "service_accounts" ], - "summary": "Get single serviceaccount by Id", + "summary": "# Get single serviceaccount by Id", "operationId": "retrieveServiceAccount", "parameters": [ { @@ -6772,7 +8585,7 @@ "tags": [ "service_accounts" ], - "summary": "Delete service account", + "summary": "# Delete service account", "operationId": "deleteServiceAccount", "parameters": [ { @@ -6806,7 +8619,7 @@ "tags": [ "service_accounts" ], - "summary": "Update service account", + "summary": "# Update service account", "operationId": "updateServiceAccount", "parameters": [ { @@ -6852,7 +8665,7 @@ "tags": [ "service_accounts" ], - "summary": "Get service account tokens", + "summary": "# Get service account tokens", "operationId": "listTokens", "parameters": [ { @@ -6886,7 +8699,7 @@ "tags": [ "service_accounts" ], - "summary": "CreateNewToken adds a token to a service account", + "summary": "# CreateNewToken adds a token to a service account", "operationId": "createToken", "parameters": [ { @@ -6935,7 +8748,7 @@ "tags": [ "service_accounts" ], - "summary": "DeleteToken deletes service account tokens", + "summary": "# DeleteToken deletes service account tokens", "operationId": "deleteToken", "parameters": [ { @@ -7208,6 +9021,135 @@ } } }, + "/teams/{teamId}/groups": { + "get": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Get External Groups.", + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Add External Group.", + "operationId": "addTeamGroupApi", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamGroupMapping" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{teamId}/groups/{groupId}": { + "delete": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Remove External Group.", + "operationId": "removeTeamGroupApi", + "parameters": [ + { + "type": "string", + "name": "groupId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/teams/{team_id}": { "get": { "tags": [ @@ -8284,24 +10226,60 @@ "Ack": { "type": "object" }, - "AddApiKeyCommand": { - "description": "COMMANDS", + "ActiveSyncStatusDTO": { + "description": "ActiveSyncStatusDTO holds the information for LDAP background Sync", "type": "object", "properties": { - "name": { - "type": "string" + "enabled": { + "type": "boolean" }, - "role": { + "nextSync": { + "type": "string", + "format": "date-time" + }, + "prevSync": { + "$ref": "#/definitions/SyncResult" + }, + "schedule": { + "type": "string" + } + } + }, + "ActiveUserStats": { + "type": "object", + "properties": { + "active_admins_and_editors": { + "type": "integer", + "format": "int64" + }, + "active_users": { + "type": "integer", + "format": "int64" + }, + "active_viewers": { + "type": "integer", + "format": "int64" + } + } + }, + "AddBuiltInRoleCommand": { + "type": "object", + "properties": { + "builtInRole": { "type": "string", "enum": [ "Viewer", - "Editor", - "Admin" + " Editor", + " Admin", + " Grafana Admin" ] }, - "secondsToLive": { - "type": "integer", - "format": "int64" + "global": { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to create organization local assignment. Refer to the Built-in role assignments for more information.", + "type": "boolean" + }, + "roleUid": { + "type": "string" } } }, @@ -8411,6 +10389,25 @@ } } }, + "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": { @@ -8432,6 +10429,25 @@ } } }, + "AddTeamRoleCommand": { + "type": "object", + "properties": { + "roleUid": { + "type": "string" + } + } + }, + "AddUserRoleCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean" + }, + "roleUid": { + "type": "string" + } + } + }, "Address": { "type": "object", "properties": { @@ -8837,95 +10853,6 @@ } } }, - "AlertRule": { - "type": "object", - "title": "AlertRule is the model for alert rules in unified alerting.", - "properties": { - "Annotations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "Condition": { - "type": "string" - }, - "DashboardUID": { - "type": "string" - }, - "Data": { - "type": "array", - "items": { - "$ref": "#/definitions/AlertQuery" - } - }, - "ExecErrState": { - "type": "string", - "enum": [ - "Alerting", - "Error", - "OK" - ] - }, - "For": { - "$ref": "#/definitions/Duration" - }, - "ID": { - "type": "integer", - "format": "int64" - }, - "IntervalSeconds": { - "type": "integer", - "format": "int64" - }, - "Labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "NamespaceUID": { - "type": "string" - }, - "NoDataState": { - "type": "string", - "enum": [ - "Alerting", - "NoData", - "OK" - ] - }, - "OrgID": { - "type": "integer", - "format": "int64" - }, - "PanelID": { - "type": "integer", - "format": "int64" - }, - "RuleGroup": { - "type": "string" - }, - "RuleGroupIndex": { - "type": "integer", - "format": "int64" - }, - "Title": { - "type": "string" - }, - "UID": { - "type": "string" - }, - "Updated": { - "type": "string", - "format": "date-time" - }, - "Version": { - "type": "integer", - "format": "int64" - } - } - }, "AlertRuleGroup": { "type": "object", "properties": { @@ -8939,7 +10866,7 @@ "rules": { "type": "array", "items": { - "$ref": "#/definitions/AlertRule" + "$ref": "#/definitions/ProvisionedAlertRule" } }, "title": { @@ -9207,6 +11134,26 @@ } } }, + "BrandingOptionsDTO": { + "type": "object", + "properties": { + "emailFooterLink": { + "type": "string" + }, + "emailFooterMode": { + "type": "string" + }, + "emailFooterText": { + "type": "string" + }, + "emailLogoUrl": { + "type": "string" + }, + "reportLogoUrl": { + "type": "string" + } + } + }, "CalculateDiffTarget": { "type": "object", "properties": { @@ -9269,6 +11216,84 @@ } } }, + "ConfigDTO": { + "description": "ConfigDTO is model representation in transfer", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "dashboardId": { + "type": "integer", + "format": "int64" + }, + "dashboardName": { + "type": "string" + }, + "dashboardUid": { + "type": "string" + }, + "dashboards": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardDTO" + } + }, + "enableCsv": { + "type": "boolean" + }, + "enableDashboardUrl": { + "type": "boolean" + }, + "formats": { + "type": "array", + "items": { + "$ref": "#/definitions/Type" + } + }, + "id": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/ReportOptionsDTO" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "recipients": { + "type": "string" + }, + "replyTo": { + "type": "string" + }, + "schedule": { + "$ref": "#/definitions/ScheduleDTO" + }, + "state": { + "$ref": "#/definitions/State" + }, + "templateVars": { + "type": "object" + }, + "updated": { + "type": "string", + "format": "date-time" + }, + "userId": { + "type": "integer", + "format": "int64" + } + } + }, "ContactPoints": { "type": "array", "items": { @@ -9458,6 +11483,60 @@ } } }, + "CreateOrUpdateConfigCmd": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64" + }, + "dashboardUid": { + "type": "string" + }, + "dashboards": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardDTO" + } + }, + "enableCsv": { + "type": "boolean" + }, + "enableDashboardUrl": { + "type": "boolean" + }, + "formats": { + "type": "array", + "items": { + "$ref": "#/definitions/Type" + } + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/ReportOptionsDTO" + }, + "recipients": { + "type": "string" + }, + "replyTo": { + "type": "string" + }, + "schedule": { + "$ref": "#/definitions/ScheduleDTO" + }, + "state": { + "$ref": "#/definitions/State" + }, + "templateVars": { + "type": "object" + } + } + }, "CreateOrgCommand": { "type": "object", "properties": { @@ -9500,6 +11579,42 @@ } } }, + "CreateRoleForm": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "uid": { + "type": "string" + }, + "version": { + "type": "integer", + "format": "int64" + } + } + }, "CreateServiceAccountForm": { "type": "object", "properties": { @@ -9533,6 +11648,53 @@ } } }, + "CustomPermissionsRecordDTO": { + "type": "object", + "properties": { + "customPermissions": { + "type": "string" + }, + "granteeName": { + "type": "string" + }, + "granteeType": { + "type": "string" + }, + "granteeUrl": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "isFolder": { + "type": "boolean" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "orgRole": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "title": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "usersCount": { + "type": "integer", + "format": "int64" + } + } + }, "DashboardACLInfoDTO": { "type": "object", "properties": { @@ -9636,6 +11798,20 @@ } } }, + "DashboardDTO": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/DashboardReportDTO" + }, + "reportVariables": { + "type": "object" + }, + "timeRange": { + "$ref": "#/definitions/TimeRangeDTO" + } + } + }, "DashboardFullWithMeta": { "type": "object", "properties": { @@ -9719,6 +11895,9 @@ "publicDashboardEnabled": { "type": "boolean" }, + "publicDashboardUid": { + "type": "string" + }, "slug": { "type": "string" }, @@ -9749,6 +11928,21 @@ } } }, + "DashboardReportDTO": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, "DashboardSnapshot": { "description": "DashboardSnapshot model", "type": "object", @@ -9869,6 +12063,7 @@ "format": "date-time" }, "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" }, "dashboardId": { @@ -10096,6 +12291,83 @@ } } }, + "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" + } + } + } + }, "DataTopic": { "type": "string", "title": "DataTopic is used to identify which topic the frame should be assigned to." @@ -10128,6 +12400,14 @@ } } }, + "DeleteTokenCommand": { + "type": "object", + "properties": { + "instance": { + "type": "string" + } + } + }, "DiscoveryBase": { "type": "object", "required": [ @@ -10373,6 +12653,18 @@ } } }, + "FailedUser": { + "description": "FailedUser holds the information of an user that failed", + "type": "object", + "properties": { + "Error": { + "type": "string" + }, + "Login": { + "type": "string" + } + } + }, "Failure": { "$ref": "#/definitions/ResponseDetails" }, @@ -10800,6 +13092,12 @@ "$ref": "#/definitions/SNSConfig" } }, + "telegram_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/TelegramConfig" + } + }, "victorops_configs": { "type": "array", "items": { @@ -11100,6 +13398,9 @@ "smtp_smarthost": { "$ref": "#/definitions/HostPort" }, + "telegram_api_url": { + "$ref": "#/definitions/URL" + }, "victorops_api_key": { "$ref": "#/definitions/Secret" }, @@ -12219,6 +14520,9 @@ "email": { "type": "string" }, + "isDisabled": { + "type": "boolean" + }, "lastSeenAt": { "type": "string", "format": "date-time" @@ -12468,6 +14772,26 @@ } } }, + "Permission": { + "type": "object", + "title": "Permission is the model for access control permissions.", + "properties": { + "action": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "scope": { + "type": "string" + }, + "updated": { + "type": "string", + "format": "date-time" + } + } + }, "PermissionDenied": { "type": "object" }, @@ -12737,6 +15061,12 @@ "$ref": "#/definitions/SNSConfig" } }, + "telegram_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/TelegramConfig" + } + }, "victorops_configs": { "type": "array", "items": { @@ -12942,6 +15272,20 @@ } } }, + "PrometheusRemoteWriteTargetJSON": { + "type": "object", + "properties": { + "data_source_uid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "remote_write_path": { + "type": "string" + } + } + }, "Provenance": { "type": "string" }, @@ -13397,6 +15741,12 @@ "$ref": "#/definitions/SNSConfig" } }, + "telegram_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/TelegramConfig" + } + }, "victorops_configs": { "type": "array", "items": { @@ -13417,6 +15767,53 @@ } } }, + "RecordingRuleJSON": { + "description": "RecordingRuleJSON is the external representation of a recording rule", + "type": "object", + "properties": { + "active": { + "type": "boolean" + }, + "count": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "dest_data_source_uid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "interval": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "prom_name": { + "type": "string" + }, + "queries": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "range": { + "type": "integer", + "format": "int64" + }, + "target_ref_id": { + "type": "string" + } + } + }, "Regexp": { "description": "A Regexp is safe for concurrent use by multiple goroutines,\nexcept for configuration methods, such as Longest.", "type": "object", @@ -13434,6 +15831,41 @@ } } }, + "ReportEmailDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "emails": { + "description": "Comma-separated list of emails to which to send the report to.", + "type": "string" + }, + "id": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "string", + "format": "int64" + }, + "useEmailsFromReport": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "boolean" + } + } + }, + "ReportOptionsDTO": { + "type": "object", + "properties": { + "layout": { + "type": "string" + }, + "orientation": { + "type": "string" + }, + "timeRange": { + "$ref": "#/definitions/TimeRangeDTO" + } + } + }, "ResponseDetails": { "type": "object", "properties": { @@ -13468,6 +15900,50 @@ } } }, + "RoleDTO": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "delegatable": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "uid": { + "type": "string" + }, + "updated": { + "type": "string", + "format": "date-time" + }, + "version": { + "type": "integer", + "format": "int64" + } + } + }, "Route": { "description": "A Route is a node that contains definitions of how to handle alerts. This is modified\nfrom the upstream alertmanager in that it adds the ObjectMatchers property.", "type": "object", @@ -13748,6 +16224,49 @@ } } }, + "ScheduleDTO": { + "type": "object", + "properties": { + "day": { + "type": "string" + }, + "dayOfMonth": { + "type": "string" + }, + "endDate": { + "type": "string", + "format": "date-time" + }, + "frequency": { + "type": "string" + }, + "hour": { + "type": "integer", + "format": "int64" + }, + "intervalAmount": { + "type": "integer", + "format": "int64" + }, + "intervalFrequency": { + "type": "string" + }, + "minute": { + "type": "integer", + "format": "int64" + }, + "startDate": { + "type": "string", + "format": "date-time" + }, + "timeZone": { + "type": "string" + }, + "workdaysOnly": { + "type": "boolean" + } + } + }, "SearchServiceAccountsResult": { "description": "swagger: model", "type": "object", @@ -13940,6 +16459,23 @@ } } }, + "SetUserRolesCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean" + }, + "includeHidden": { + "type": "boolean" + }, + "roleUids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "SettingsBag": { "type": "object", "additionalProperties": { @@ -13949,6 +16485,26 @@ } } }, + "SettingsDTO": { + "type": "object", + "properties": { + "branding": { + "$ref": "#/definitions/BrandingOptionsDTO" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "userId": { + "type": "integer", + "format": "int64" + } + } + }, "SigV4Config": { "description": "SigV4Config is the configuration for signing remote write requests with\nAWS's SigV4 verification process. Empty values will be retrieved using the\nAWS default credentials chain.", "type": "object", @@ -14120,6 +16676,17 @@ "SmtpNotEnabled": { "$ref": "#/definitions/ResponseDetails" }, + "State": { + "type": "string" + }, + "Status": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, "Success": { "$ref": "#/definitions/ResponseDetails" }, @@ -14131,6 +16698,39 @@ } } }, + "SyncResult": { + "type": "object", + "title": "SyncResult holds the result of a sync with LDAP. This gives us information on which users were updated and how.", + "properties": { + "Elapsed": { + "$ref": "#/definitions/Duration" + }, + "FailedUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/FailedUser" + } + }, + "MissingUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "Started": { + "type": "string", + "format": "date-time" + }, + "UpdatedUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + } + }, "TLSConfig": { "type": "object", "title": "TLSConfig configures the options for TLS connections.", @@ -14205,6 +16805,30 @@ } } }, + "TeamGroupDTO": { + "type": "object", + "properties": { + "groupId": { + "type": "string" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "teamId": { + "type": "integer", + "format": "int64" + } + } + }, + "TeamGroupMapping": { + "type": "object", + "properties": { + "groupId": { + "type": "string" + } + } + }, "TeamMemberDTO": { "type": "object", "properties": { @@ -14246,6 +16870,37 @@ } } }, + "TelegramConfig": { + "type": "object", + "title": "TelegramConfig configures notifications via Telegram.", + "properties": { + "api_url": { + "$ref": "#/definitions/URL" + }, + "chat": { + "type": "integer", + "format": "int64" + }, + "disable_notifications": { + "type": "boolean" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "message": { + "type": "string" + }, + "parse_mode": { + "type": "string" + }, + "send_resolved": { + "type": "boolean" + }, + "token": { + "$ref": "#/definitions/Secret" + } + } + }, "TempUserDTO": { "type": "object", "properties": { @@ -14488,6 +17143,104 @@ } } }, + "TimeRangeDTO": { + "type": "object", + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + } + }, + "Token": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "company": { + "type": "string" + }, + "details_url": { + "type": "string" + }, + "exp": { + "type": "integer", + "format": "int64" + }, + "iat": { + "type": "integer", + "format": "int64" + }, + "included_users": { + "type": "integer", + "format": "int64" + }, + "iss": { + "type": "string" + }, + "jti": { + "type": "string" + }, + "lexp": { + "type": "integer", + "format": "int64" + }, + "lic_exp_warn_days": { + "type": "integer", + "format": "int64" + }, + "lid": { + "type": "string" + }, + "limit_by": { + "type": "string" + }, + "max_concurrent_user_sessions": { + "type": "integer", + "format": "int64" + }, + "nbf": { + "type": "integer", + "format": "int64" + }, + "prod": { + "type": "array", + "items": { + "type": "string" + } + }, + "slug": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/TokenStatus" + }, + "sub": { + "type": "string" + }, + "tok_exp_warn_days": { + "type": "integer", + "format": "int64" + }, + "trial": { + "type": "boolean" + }, + "trial_exp": { + "type": "integer", + "format": "int64" + }, + "update_days": { + "type": "integer", + "format": "int64" + }, + "usage_billing": { + "type": "boolean" + } + } + }, "TokenDTO": { "type": "object", "properties": { @@ -14510,6 +17263,10 @@ "format": "int64", "example": 1 }, + "isRevoked": { + "type": "boolean", + "example": false + }, "lastUsedAt": { "type": "string", "format": "date-time", @@ -14526,6 +17283,10 @@ } } }, + "TokenStatus": { + "type": "integer", + "format": "int64" + }, "TrimDashboardCommand": { "type": "object", "properties": { @@ -14548,6 +17309,9 @@ } } }, + "Type": { + "type": "string" + }, "URL": { "description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use RawPath, an optional field which only gets\nset if the default encoding is different from Path.\n\nURL's String method uses the EscapedPath method to obtain the path. See the\nEscapedPath method for more details.", "type": "object", @@ -14910,6 +17674,39 @@ } } }, + "UpdateRoleCommand": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "version": { + "type": "integer", + "format": "int64" + } + } + }, "UpdateServiceAccountForm": { "type": "object", "properties": { @@ -15509,7 +18306,6 @@ "$ref": "#/definitions/Duration" }, "gettableAlert": { - "description": "GettableAlert gettable alert", "type": "object", "required": [ "labels", @@ -15620,7 +18416,6 @@ } }, "gettableSilences": { - "description": "GettableSilences gettable silences", "type": "array", "items": { "$ref": "#/definitions/gettableSilence" @@ -15731,7 +18526,6 @@ } }, "postableSilence": { - "description": "PostableSilence postable silence", "type": "object", "required": [ "comment", @@ -15769,6 +18563,7 @@ } }, "receiver": { + "description": "Receiver receiver", "type": "object", "required": [ "name" @@ -15879,6 +18674,21 @@ "$ref": "#/definitions/ErrorResponseBody" } }, + "addPermissionResponse": { + "description": "(empty)", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "permissionId": { + "type": "integer", + "format": "int64" + } + } + } + }, "adminCreateUserResponse": { "description": "(empty)", "schema": { @@ -15928,6 +18738,16 @@ "$ref": "#/definitions/ErrorResponseBody" } }, + "contentResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, "createCorrelationResponse": { "description": "(empty)", "schema": { @@ -16023,6 +18843,27 @@ "$ref": "#/definitions/Playlist" } }, + "createReportResponse": { + "description": "(empty)", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + } + } + } + }, + "createRoleResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/RoleDTO" + } + }, "createServiceAccountResponse": { "description": "(empty)", "schema": { @@ -16207,6 +19048,12 @@ } } }, + "getAccessControlStatusResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/Status" + } + }, "getAlertNotificationChannelResponse": { "description": "(empty)", "schema": { @@ -16246,6 +19093,21 @@ } } }, + "getAllPermissionseResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/DataSourcePermissionsDTO" + } + }, + "getAllRolesResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + }, "getAnnotationByIDResponse": { "description": "(empty)", "schema": { @@ -16297,6 +19159,15 @@ "$ref": "#/definitions/OrgDetailsDTO" } }, + "getCustomPermissionsReportResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomPermissionsRecordDTO" + } + } + }, "getDashboardPermissionsListResponse": { "description": "(empty)", "schema": { @@ -16398,6 +19269,12 @@ "$ref": "#/definitions/LibraryElementSearchResponse" } }, + "getLicenseTokenResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/Token" + } + }, "getOrgByIDResponse": { "description": "(empty)", "schema": { @@ -16506,6 +19383,33 @@ } } }, + "getReportResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/ConfigDTO" + } + }, + "getReportSettingsResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + }, + "getReportsResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigDTO" + } + } + }, + "getRoleResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/RoleDTO" + } + }, "getSharingOptionsResponse": { "description": "(empty)", "schema": { @@ -16541,12 +19445,30 @@ } } }, + "getStatusResponse": { + "description": "(empty)" + }, + "getSyncStatusResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/ActiveSyncStatusDTO" + } + }, "getTeamByIDResponse": { "description": "(empty)", "schema": { "$ref": "#/definitions/TeamDTO" } }, + "getTeamGroupsApiResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamGroupDTO" + } + } + }, "getTeamMembersResponse": { "description": "(empty)", "schema": { @@ -16610,6 +19532,36 @@ "$ref": "#/definitions/ErrorResponseBody" } }, + "listBuiltinRolesResponse": { + "description": "(empty)", + "schema": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + } + }, + "listRecordingRulesResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + }, + "listRolesResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + }, "listSortOptionsResponse": { "description": "(empty)", "schema": { @@ -16770,6 +19722,9 @@ } } }, + "postRenewLicenseTokenResponse": { + "description": "(empty)" + }, "preconditionFailedError": { "description": "PreconditionFailedError", "schema": { @@ -16782,6 +19737,24 @@ "$ref": "#/definitions/QueryDataResponse" } }, + "recordingRuleResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + }, + "recordingRuleWriteTargetResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + }, + "refreshLicenseStatsResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/ActiveUserStats" + } + }, "retrieveServiceAccountResponse": { "description": "(empty)", "schema": { diff --git a/public/api-spec.json b/public/api-spec.json index 1dfb3a3c5b8..bb7237d83a8 100644 --- a/public/api-spec.json +++ b/public/api-spec.json @@ -26,6 +26,551 @@ }, "basePath": "/api", "paths": { + "/access-control/roles": { + "get": { + "description": "Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in.\n\nYou need to have a permission with action `roles:list` and scope `roles:*`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get all roles.", + "operationId": "listRoles", + "parameters": [ + { + "type": "boolean", + "name": "delegatable", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/listRolesResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates a new custom role and maps given permissions to that role. Note that roles with the same prefix as Fixed Roles can’t be created.\n\nYou need to have a permission with action `roles:write` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.\nFor example, if a user does not have required permissions for creating users, they won’t be able to create a custom role which allows to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Create a new custom role.", + "operationId": "createRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRoleForm" + } + } + ], + "responses": { + "201": { + "$ref": "#/responses/createRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/roles/{roleUID}": { + "get": { + "description": "Get a role for the given UID.\n\nYou need to have a permission with action `roles:read` and scope `roles:*`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get a role.", + "operationId": "getRole", + "parameters": [ + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `roles:write` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Update a custom role.", + "operationId": "updateRoleWithPermissions", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRoleCommand" + } + }, + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Delete a role with the given UID, and it’s permissions. If the role is assigned to a built-in role, the deletion operation will fail, unless force query param is set to true, and in that case all assignments will also be deleted.\n\nYou need to have a permission with action `roles:delete` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only delete a custom role with the same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to delete a custom role which allows to do that.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Delete a custom role.", + "operationId": "deleteCustomRole", + "parameters": [ + { + "type": "boolean", + "name": "force", + "in": "query" + }, + { + "type": "boolean", + "name": "global", + "in": "query" + }, + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/status": { + "get": { + "description": "Returns an indicator to check if fine-grained access control is enabled or not.\n\nYou need to have a permission with action `status:accesscontrol` and scope `services:accesscontrol`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get status.", + "operationId": "getAccessControlStatus", + "responses": { + "200": { + "$ref": "#/responses/getAccessControlStatusResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles": { + "get": { + "description": "You need to have a permission with action `teams.roles:list` and scope `teams:id:\u003cteam ID\u003e`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Get team roles.", + "operationId": "listTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:type:delegate` for each.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Update team role.", + "operationId": "setTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You need to have a permission with action `teams.roles:add` and scope `permissions:type:delegate`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Add team role.", + "operationId": "addTeamRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTeamRoleCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles/{roleUID}": { + "delete": { + "description": "You need to have a permission with action `teams.roles:remove` and scope `permissions:type:delegate`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Remove team role.", + "operationId": "removeTeamRole", + "parameters": [ + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{userId}/roles": { + "get": { + "description": "Lists the roles that have been directly assigned to a given user. The list does not include built-in roles (Viewer, Editor, Admin or Grafana Admin), and it does not include roles that have been inherited from a team.\n\nYou need to have a permission with action `users.roles:list` and scope `users:id:\u003cuser ID\u003e`.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "List roles assigned to a user.", + "operationId": "listUserRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAllRolesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Update the user’s role assignments to match the provided set of UIDs. This will remove any assigned roles that aren’t in the request and add roles that are in the set but are not already assigned to the user.\nIf you want to add or remove a single role, consider using Add a user role assignment or Remove a user role assignment instead.\n\nYou need to have a permission with action `users.roles:add` and `users.roles:remove` and scope `permissions:type:delegate` for each. `permissions:type:delegate` scope ensures that users can only assign or unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign or unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Set user role assignments.", + "operationId": "setUserRoles", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SetUserRolesCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Assign a role to a specific user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:add` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only assign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Add a user role assignment.", + "operationId": "addUserRole", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddUserRoleCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{userId}/roles/{roleUID}": { + "delete": { + "description": "Revoke a role from a user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:remove` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": [ + "access_control", + "enterprise" + ], + "summary": "Remove a user role assignment.", + "operationId": "removeUserRole", + "parameters": [ + { + "type": "boolean", + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", + "name": "global", + "in": "query" + }, + { + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap-sync-status": { + "get": { + "description": "You need to have a permission with action `ldap.status:read`.", + "tags": [ + "ldap_debug" + ], + "summary": "Returns the current state of the LDAP background sync integration", + "operationId": "getSyncStatus", + "responses": { + "200": { + "$ref": "#/responses/getSyncStatusResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/admin/ldap/reload": { "post": { "security": [ @@ -197,6 +742,27 @@ } } }, + "/admin/provisioning/access-control/reload": { + "post": { + "tags": [ + "access_control_provisioning", + "enterprise" + ], + "summary": "You need to have a permission with action `provisioning:reload` with scope `provisioners:accesscontrol`.", + "operationId": "adminProvisioningReloadAccessControl", + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + } + } + } + }, "/admin/provisioning/dashboards/reload": { "post": { "security": [ @@ -2706,7 +3272,9 @@ }, "/datasources/correlations": { "get": { - "tags": ["correlations"], + "tags": [ + "correlations" + ], "summary": "Gets all correlations.", "operationId": "getCorrelations", "responses": { @@ -3108,7 +3676,9 @@ }, "/datasources/uid/{sourceUID}/correlations": { "get": { - "tags": ["correlations"], + "tags": [ + "correlations" + ], "summary": "Gets all correlations originating from the given data source.", "operationId": "getCorrelationsBySourceUID", "parameters": [ @@ -3180,7 +3750,9 @@ }, "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { "get": { - "tags": ["correlations"], + "tags": [ + "correlations" + ], "summary": "Gets a correlation.", "operationId": "getCorrelation", "parameters": [ @@ -3487,6 +4059,216 @@ } } }, + "/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).", + "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).", + "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).", + "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).", + "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).", + "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", @@ -4334,6 +5116,216 @@ } } }, + "/licensing/check": { + "get": { + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Check license availability.", + "operationId": "getStatus", + "responses": { + "200": { + "$ref": "#/responses/getStatusResponse" + } + } + } + }, + "/licensing/custom-permissions": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Get custom permissions report.", + "operationId": "getCustomPermissionsReport", + "responses": { + "200": { + "$ref": "#/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/custom-permissions-csv": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "produces": [ + "text/csv" + ], + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Get custom permissions report in CSV format.", + "operationId": "getCustomPermissionsCSV", + "responses": { + "200": { + "$ref": "#/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/refresh-stats": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Refresh license stats.", + "operationId": "refreshLicenseStats", + "responses": { + "200": { + "$ref": "#/responses/refreshLicenseStatsResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Get license token.", + "operationId": "getLicenseToken", + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + } + } + }, + "post": { + "description": "You need to have a permission with action `licensing:update`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Create license token.", + "operationId": "postLicenseToken", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + } + } + }, + "delete": { + "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Remove license from database.", + "operationId": "deleteLicenseToken", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token/renew": { + "post": { + "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postRenewLicenseTokenResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + } + } + } + }, + "/logout/saml": { + "get": { + "tags": [ + "saml", + "enterprise" + ], + "summary": "GetLogout initiates single logout process.", + "operationId": "getSAMLLogout", + "responses": { + "302": { + "description": "" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/org": { "get": { "description": "Get current Organization", @@ -5852,6 +6844,827 @@ } } }, + "/recording-rules": { + "get": { + "description": "Lists all rules in the database: active or deleted", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "listRecordingRules", + "responses": { + "200": { + "$ref": "#/responses/listRecordingRulesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Update the active status of a rule", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "updateRecordingRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Create a recording rule that is then registered and started", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "createRecordingRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/test": { + "post": { + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Test a recording rule.", + "operationId": "testCreateRecordingRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/writer": { + "get": { + "description": "Return the prometheus remote write target", + "tags": [ + "recording_rules", + "enterprise" + ], + "operationId": "getRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "It returns a 422 if there is not an existing prometheus data source configured", + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Create a remote write target.", + "operationId": "createRecordingRuleWriteTarget", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Delete the remote write target.", + "operationId": "deleteRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/{recordingRuleID}": { + "delete": { + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Delete removes the rule from the registry and stops it.", + "operationId": "deleteRecordingRule", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "recordingRuleID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "List reports.", + "operationId": "getReports", + "responses": { + "200": { + "$ref": "#/responses/getReportsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Create a report.", + "operationId": "createReport", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/email": { + "post": { + "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Send a report.", + "operationId": "sendReport", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportEmailDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/render/pdf/{dashboardID}": { + "get": { + "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", + "produces": [ + "application/pdf" + ], + "tags": [ + "reports", + "enterprise" + ], + "summary": "Render report for dashboard.", + "operationId": "renderReportPDF", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "dashboardID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "title", + "in": "query" + }, + { + "type": "string", + "name": "variables", + "in": "query" + }, + { + "type": "string", + "name": "from", + "in": "query" + }, + { + "type": "string", + "name": "to", + "in": "query" + }, + { + "type": "string", + "name": "orientation", + "in": "query" + }, + { + "type": "string", + "name": "layout", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/render/pdfs": { + "get": { + "description": "Available to all users and with a valid license.", + "produces": [ + "application/pdf" + ], + "tags": [ + "reports", + "enterprise" + ], + "summary": "Render report for multiple dashboards.", + "operationId": "renderReportPDFs", + "parameters": [ + { + "type": "string", + "name": "dashboardID", + "in": "query" + }, + { + "type": "string", + "name": "orientation", + "in": "query" + }, + { + "type": "string", + "name": "layout", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/settings": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:read`x.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Get settings.", + "operationId": "getReportSettings", + "responses": { + "200": { + "$ref": "#/responses/getReportSettingsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:write`xx.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Save settings.", + "operationId": "saveReportSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/test-email": { + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Send test report via email.", + "operationId": "sendTestEmail", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/{id}": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Get a report.", + "operationId": "getReport", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Update a report.", + "operationId": "updateReport", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + }, + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", + "tags": [ + "reports", + "enterprise" + ], + "summary": "Delete a report.", + "operationId": "deleteReport", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/saml/acs": { + "post": { + "tags": [ + "saml", + "enterprise" + ], + "summary": "It performs assertion Consumer Service (ACS).", + "operationId": "postACS", + "parameters": [ + { + "type": "string", + "name": "RelayState", + "in": "query" + } + ], + "responses": { + "302": { + "description": "" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/saml/metadata": { + "get": { + "produces": [ + "application/xml;application/samlmetadata+xml" + ], + "tags": [ + "saml", + "enterprise" + ], + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "operationId": "getMetadata", + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + } + } + } + }, + "/saml/slo": { + "get": { + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "tags": [ + "saml", + "enterprise" + ], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "getSLO", + "responses": { + "302": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "tags": [ + "saml", + "enterprise" + ], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", + "parameters": [ + { + "type": "string", + "name": "SAMLRequest", + "in": "query" + }, + { + "type": "string", + "name": "SAMLResponse", + "in": "query" + } + ], + "responses": { + "302": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/search": { "get": { "tags": [ @@ -5996,7 +7809,7 @@ "tags": [ "service_accounts" ], - "summary": "Create service account", + "summary": "# Create service account", "operationId": "createServiceAccount", "parameters": [ { @@ -6032,7 +7845,7 @@ "tags": [ "service_accounts" ], - "summary": "Search service accounts with paging", + "summary": "# Search service accounts with paging", "operationId": "searchOrgServiceAccountsWithPaging", "parameters": [ { @@ -6088,7 +7901,7 @@ "tags": [ "service_accounts" ], - "summary": "Get single serviceaccount by Id", + "summary": "# Get single serviceaccount by Id", "operationId": "retrieveServiceAccount", "parameters": [ { @@ -6125,7 +7938,7 @@ "tags": [ "service_accounts" ], - "summary": "Delete service account", + "summary": "# Delete service account", "operationId": "deleteServiceAccount", "parameters": [ { @@ -6159,7 +7972,7 @@ "tags": [ "service_accounts" ], - "summary": "Update service account", + "summary": "# Update service account", "operationId": "updateServiceAccount", "parameters": [ { @@ -6205,7 +8018,7 @@ "tags": [ "service_accounts" ], - "summary": "Get service account tokens", + "summary": "# Get service account tokens", "operationId": "listTokens", "parameters": [ { @@ -6239,7 +8052,7 @@ "tags": [ "service_accounts" ], - "summary": "CreateNewToken adds a token to a service account", + "summary": "# CreateNewToken adds a token to a service account", "operationId": "createToken", "parameters": [ { @@ -6288,7 +8101,7 @@ "tags": [ "service_accounts" ], - "summary": "DeleteToken deletes service account tokens", + "summary": "# DeleteToken deletes service account tokens", "operationId": "deleteToken", "parameters": [ { @@ -6561,6 +8374,135 @@ } } }, + "/teams/{teamId}/groups": { + "get": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Get External Groups.", + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Add External Group.", + "operationId": "addTeamGroupApi", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamGroupMapping" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{teamId}/groups/{groupId}": { + "delete": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Remove External Group.", + "operationId": "removeTeamGroupApi", + "parameters": [ + { + "type": "string", + "name": "groupId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/teams/{team_id}": { "get": { "tags": [ @@ -7634,6 +9576,63 @@ } }, "definitions": { + "ActiveSyncStatusDTO": { + "description": "ActiveSyncStatusDTO holds the information for LDAP background Sync", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "nextSync": { + "type": "string", + "format": "date-time" + }, + "prevSync": { + "$ref": "#/definitions/SyncResult" + }, + "schedule": { + "type": "string" + } + } + }, + "ActiveUserStats": { + "type": "object", + "properties": { + "active_admins_and_editors": { + "type": "integer", + "format": "int64" + }, + "active_users": { + "type": "integer", + "format": "int64" + }, + "active_viewers": { + "type": "integer", + "format": "int64" + } + } + }, + "AddBuiltInRoleCommand": { + "type": "object", + "properties": { + "builtInRole": { + "type": "string", + "enum": [ + "Viewer", + " Editor", + " Admin", + " Grafana Admin" + ] + }, + "global": { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to create organization local assignment. Refer to the Built-in role assignments for more information.", + "type": "boolean" + }, + "roleUid": { + "type": "string" + } + } + }, "AddCommand": { "type": "object", "properties": { @@ -7740,6 +9739,25 @@ } } }, + "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": { @@ -7761,6 +9779,25 @@ } } }, + "AddTeamRoleCommand": { + "type": "object", + "properties": { + "roleUid": { + "type": "string" + } + } + }, + "AddUserRoleCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean" + }, + "roleUid": { + "type": "string" + } + } + }, "Address": { "type": "object", "properties": { @@ -8166,6 +10203,26 @@ } } }, + "BrandingOptionsDTO": { + "type": "object", + "properties": { + "emailFooterLink": { + "type": "string" + }, + "emailFooterMode": { + "type": "string" + }, + "emailFooterText": { + "type": "string" + }, + "emailLogoUrl": { + "type": "string" + }, + "reportLogoUrl": { + "type": "string" + } + } + }, "CalculateDiffTarget": { "type": "object", "properties": { @@ -8198,6 +10255,84 @@ "type": "number", "format": "double" }, + "ConfigDTO": { + "description": "ConfigDTO is model representation in transfer", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "dashboardId": { + "type": "integer", + "format": "int64" + }, + "dashboardName": { + "type": "string" + }, + "dashboardUid": { + "type": "string" + }, + "dashboards": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardDTO" + } + }, + "enableCsv": { + "type": "boolean" + }, + "enableDashboardUrl": { + "type": "boolean" + }, + "formats": { + "type": "array", + "items": { + "$ref": "#/definitions/Type" + } + }, + "id": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/ReportOptionsDTO" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "recipients": { + "type": "string" + }, + "replyTo": { + "type": "string" + }, + "schedule": { + "$ref": "#/definitions/ScheduleDTO" + }, + "state": { + "$ref": "#/definitions/State" + }, + "templateVars": { + "type": "object" + }, + "updated": { + "type": "string", + "format": "date-time" + }, + "userId": { + "type": "integer", + "format": "int64" + } + } + }, "Correlation": { "description": "Correlation is the model for correlations definitions", "type": "object", @@ -8381,6 +10516,60 @@ } } }, + "CreateOrUpdateConfigCmd": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64" + }, + "dashboardUid": { + "type": "string" + }, + "dashboards": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardDTO" + } + }, + "enableCsv": { + "type": "boolean" + }, + "enableDashboardUrl": { + "type": "boolean" + }, + "formats": { + "type": "array", + "items": { + "$ref": "#/definitions/Type" + } + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/ReportOptionsDTO" + }, + "recipients": { + "type": "string" + }, + "replyTo": { + "type": "string" + }, + "schedule": { + "$ref": "#/definitions/ScheduleDTO" + }, + "state": { + "$ref": "#/definitions/State" + }, + "templateVars": { + "type": "object" + } + } + }, "CreateOrgCommand": { "type": "object", "properties": { @@ -8423,6 +10612,42 @@ } } }, + "CreateRoleForm": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "uid": { + "type": "string" + }, + "version": { + "type": "integer", + "format": "int64" + } + } + }, "CreateServiceAccountForm": { "type": "object", "properties": { @@ -8456,6 +10681,53 @@ } } }, + "CustomPermissionsRecordDTO": { + "type": "object", + "properties": { + "customPermissions": { + "type": "string" + }, + "granteeName": { + "type": "string" + }, + "granteeType": { + "type": "string" + }, + "granteeUrl": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "isFolder": { + "type": "boolean" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "orgRole": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "title": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "usersCount": { + "type": "integer", + "format": "int64" + } + } + }, "DashboardACLInfoDTO": { "type": "object", "properties": { @@ -8559,6 +10831,20 @@ } } }, + "DashboardDTO": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/DashboardReportDTO" + }, + "reportVariables": { + "type": "object" + }, + "timeRange": { + "$ref": "#/definitions/TimeRangeDTO" + } + } + }, "DashboardFullWithMeta": { "type": "object", "properties": { @@ -8642,6 +10928,9 @@ "publicDashboardEnabled": { "type": "boolean" }, + "publicDashboardUid": { + "type": "string" + }, "slug": { "type": "string" }, @@ -8672,6 +10961,21 @@ } } }, + "DashboardReportDTO": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, "DashboardSnapshot": { "description": "DashboardSnapshot model", "type": "object", @@ -8792,6 +11096,7 @@ "format": "date-time" }, "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" }, "dashboardId": { @@ -9019,6 +11324,83 @@ } } }, + "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" + } + } + } + }, "DataTopic": { "type": "string", "title": "DataTopic is used to identify which topic the frame should be assigned to." @@ -9032,6 +11414,14 @@ } } }, + "DeleteTokenCommand": { + "type": "object", + "properties": { + "instance": { + "type": "string" + } + } + }, "DsAccess": { "type": "string" }, @@ -9082,6 +11472,18 @@ } } }, + "FailedUser": { + "description": "FailedUser holds the information of an user that failed", + "type": "object", + "properties": { + "Error": { + "type": "string" + }, + "Login": { + "type": "string" + } + } + }, "Field": { "description": "A Field is essentially a slice of various types with extra properties and methods.\nSee NewField() for supported types.\n\nThe slice data in the Field is a not exported, so methods on the Field are used to to manipulate its data.", "type": "object", @@ -10138,6 +12540,9 @@ "email": { "type": "string" }, + "isDisabled": { + "type": "boolean" + }, "lastSeenAt": { "type": "string", "format": "date-time" @@ -10300,6 +12705,26 @@ } } }, + "Permission": { + "type": "object", + "title": "Permission is the model for access control permissions.", + "properties": { + "action": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "scope": { + "type": "string" + }, + "updated": { + "type": "string", + "format": "date-time" + } + } + }, "PermissionType": { "type": "integer", "format": "int64" @@ -10497,6 +12922,20 @@ } } }, + "PrometheusRemoteWriteTargetJSON": { + "type": "object", + "properties": { + "data_source_uid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "remote_write_path": { + "type": "string" + } + } + }, "QueryDataResponse": { "description": "It is the return type of a QueryData call.", "type": "object", @@ -10718,6 +13157,88 @@ } } }, + "RecordingRuleJSON": { + "description": "RecordingRuleJSON is the external representation of a recording rule", + "type": "object", + "properties": { + "active": { + "type": "boolean" + }, + "count": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "dest_data_source_uid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "interval": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "prom_name": { + "type": "string" + }, + "queries": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "range": { + "type": "integer", + "format": "int64" + }, + "target_ref_id": { + "type": "string" + } + } + }, + "ReportEmailDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "emails": { + "description": "Comma-separated list of emails to which to send the report to.", + "type": "string" + }, + "id": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "string", + "format": "int64" + }, + "useEmailsFromReport": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "boolean" + } + } + }, + "ReportOptionsDTO": { + "type": "object", + "properties": { + "layout": { + "type": "string" + }, + "orientation": { + "type": "string" + }, + "timeRange": { + "$ref": "#/definitions/TimeRangeDTO" + } + } + }, "Responses": { "description": "The QueryData method the QueryDataHandler method will set the RefId\nproperty on the DataResponses' frames based on these RefIDs.", "type": "object", @@ -10744,6 +13265,50 @@ } } }, + "RoleDTO": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "delegatable": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "uid": { + "type": "string" + }, + "updated": { + "type": "string", + "format": "date-time" + }, + "version": { + "type": "integer", + "format": "int64" + } + } + }, "SaveDashboardCommand": { "type": "object", "properties": { @@ -10776,6 +13341,49 @@ } } }, + "ScheduleDTO": { + "type": "object", + "properties": { + "day": { + "type": "string" + }, + "dayOfMonth": { + "type": "string" + }, + "endDate": { + "type": "string", + "format": "date-time" + }, + "frequency": { + "type": "string" + }, + "hour": { + "type": "integer", + "format": "int64" + }, + "intervalAmount": { + "type": "integer", + "format": "int64" + }, + "intervalFrequency": { + "type": "string" + }, + "minute": { + "type": "integer", + "format": "int64" + }, + "startDate": { + "type": "string", + "format": "date-time" + }, + "timeZone": { + "type": "string" + }, + "workdaysOnly": { + "type": "boolean" + } + } + }, "SearchServiceAccountsResult": { "description": "swagger: model", "type": "object", @@ -10960,6 +13568,23 @@ } } }, + "SetUserRolesCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean" + }, + "includeHidden": { + "type": "boolean" + }, + "roleUids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "SettingsBag": { "type": "object", "additionalProperties": { @@ -10969,6 +13594,37 @@ } } }, + "SettingsDTO": { + "type": "object", + "properties": { + "branding": { + "$ref": "#/definitions/BrandingOptionsDTO" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "userId": { + "type": "integer", + "format": "int64" + } + } + }, + "State": { + "type": "string" + }, + "Status": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, "SuccessResponseBody": { "type": "object", "properties": { @@ -10977,6 +13633,39 @@ } } }, + "SyncResult": { + "type": "object", + "title": "SyncResult holds the result of a sync with LDAP. This gives us information on which users were updated and how.", + "properties": { + "Elapsed": { + "$ref": "#/definitions/Duration" + }, + "FailedUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/FailedUser" + } + }, + "MissingUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "Started": { + "type": "string", + "format": "date-time" + }, + "UpdatedUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + } + }, "TagsDTO": { "type": "object", "title": "TagsDTO is the frontend DTO for Tag.", @@ -11025,6 +13714,30 @@ } } }, + "TeamGroupDTO": { + "type": "object", + "properties": { + "groupId": { + "type": "string" + }, + "orgId": { + "type": "integer", + "format": "int64" + }, + "teamId": { + "type": "integer", + "format": "int64" + } + } + }, + "TeamGroupMapping": { + "type": "object", + "properties": { + "groupId": { + "type": "string" + } + } + }, "TeamMemberDTO": { "type": "object", "properties": { @@ -11160,6 +13873,104 @@ "description": "ThresholdsMode absolute or percentage", "type": "string" }, + "TimeRangeDTO": { + "type": "object", + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + } + }, + "Token": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "company": { + "type": "string" + }, + "details_url": { + "type": "string" + }, + "exp": { + "type": "integer", + "format": "int64" + }, + "iat": { + "type": "integer", + "format": "int64" + }, + "included_users": { + "type": "integer", + "format": "int64" + }, + "iss": { + "type": "string" + }, + "jti": { + "type": "string" + }, + "lexp": { + "type": "integer", + "format": "int64" + }, + "lic_exp_warn_days": { + "type": "integer", + "format": "int64" + }, + "lid": { + "type": "string" + }, + "limit_by": { + "type": "string" + }, + "max_concurrent_user_sessions": { + "type": "integer", + "format": "int64" + }, + "nbf": { + "type": "integer", + "format": "int64" + }, + "prod": { + "type": "array", + "items": { + "type": "string" + } + }, + "slug": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/TokenStatus" + }, + "sub": { + "type": "string" + }, + "tok_exp_warn_days": { + "type": "integer", + "format": "int64" + }, + "trial": { + "type": "boolean" + }, + "trial_exp": { + "type": "integer", + "format": "int64" + }, + "update_days": { + "type": "integer", + "format": "int64" + }, + "usage_billing": { + "type": "boolean" + } + } + }, "TokenDTO": { "type": "object", "properties": { @@ -11182,6 +13993,10 @@ "format": "int64", "example": 1 }, + "isRevoked": { + "type": "boolean", + "example": false + }, "lastUsedAt": { "type": "string", "format": "date-time", @@ -11198,6 +14013,10 @@ } } }, + "TokenStatus": { + "type": "integer", + "format": "int64" + }, "TrimDashboardCommand": { "type": "object", "properties": { @@ -11220,6 +14039,9 @@ } } }, + "Type": { + "type": "string" + }, "UpdateAlertNotificationCommand": { "type": "object", "properties": { @@ -11545,6 +14367,39 @@ } } }, + "UpdateRoleCommand": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + }, + "version": { + "type": "integer", + "format": "int64" + } + } + }, "UpdateServiceAccountForm": { "type": "object", "properties": { @@ -11857,6 +14712,21 @@ "$ref": "#/definitions/ErrorResponseBody" } }, + "addPermissionResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "permissionId": { + "type": "integer", + "format": "int64" + } + } + } + }, "adminCreateUserResponse": { "description": "", "schema": { @@ -11906,6 +14776,16 @@ "$ref": "#/definitions/ErrorResponseBody" } }, + "contentResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, "createCorrelationResponse": { "description": "", "schema": { @@ -12001,6 +14881,27 @@ "$ref": "#/definitions/Playlist" } }, + "createReportResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + } + } + } + }, + "createRoleResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RoleDTO" + } + }, "createServiceAccountResponse": { "description": "", "schema": { @@ -12185,6 +15086,12 @@ } } }, + "getAccessControlStatusResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Status" + } + }, "getAlertNotificationChannelResponse": { "description": "", "schema": { @@ -12224,6 +15131,21 @@ } } }, + "getAllPermissionseResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DataSourcePermissionsDTO" + } + }, + "getAllRolesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + }, "getAnnotationByIDResponse": { "description": "", "schema": { @@ -12275,6 +15197,15 @@ "$ref": "#/definitions/OrgDetailsDTO" } }, + "getCustomPermissionsReportResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomPermissionsRecordDTO" + } + } + }, "getDashboardPermissionsListResponse": { "description": "", "schema": { @@ -12376,6 +15307,12 @@ "$ref": "#/definitions/LibraryElementSearchResponse" } }, + "getLicenseTokenResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Token" + } + }, "getOrgByIDResponse": { "description": "", "schema": { @@ -12484,6 +15421,33 @@ } } }, + "getReportResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ConfigDTO" + } + }, + "getReportSettingsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + }, + "getReportsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigDTO" + } + } + }, + "getRoleResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RoleDTO" + } + }, "getSharingOptionsResponse": { "description": "", "schema": { @@ -12519,12 +15483,30 @@ } } }, + "getStatusResponse": { + "description": "" + }, + "getSyncStatusResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ActiveSyncStatusDTO" + } + }, "getTeamByIDResponse": { "description": "", "schema": { "$ref": "#/definitions/TeamDTO" } }, + "getTeamGroupsApiResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamGroupDTO" + } + } + }, "getTeamMembersResponse": { "description": "", "schema": { @@ -12588,6 +15570,36 @@ "$ref": "#/definitions/ErrorResponseBody" } }, + "listBuiltinRolesResponse": { + "description": "", + "schema": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + } + }, + "listRecordingRulesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + }, + "listRolesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + }, "listSortOptionsResponse": { "description": "", "schema": { @@ -12748,6 +15760,9 @@ } } }, + "postRenewLicenseTokenResponse": { + "description": "" + }, "preconditionFailedError": { "description": "PreconditionFailedError", "schema": { @@ -12760,6 +15775,24 @@ "$ref": "#/definitions/QueryDataResponse" } }, + "recordingRuleResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + }, + "recordingRuleWriteTargetResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + }, + "refreshLicenseStatsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ActiveUserStats" + } + }, "retrieveServiceAccountResponse": { "description": "", "schema": { diff --git a/public/openapi3.json b/public/openapi3.json index 53fd3d256c1..e5652e201ad 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -14,6 +14,25 @@ }, "description": "AcceptedResponse" }, + "addPermissionResponse": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + }, + "permissionId": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + } + } + }, + "description": "(empty)" + }, "adminCreateUserResponse": { "content": { "application/json": { @@ -91,6 +110,20 @@ }, "description": "ConflictError" }, + "contentResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "format": "uint8", + "type": "integer" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, "createCorrelationResponse": { "content": { "application/json": { @@ -206,6 +239,35 @@ }, "description": "(empty)" }, + "createReportResponse": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "(empty)" + }, + "createRoleResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleDTO" + } + } + }, + "description": "(empty)" + }, "createServiceAccountResponse": { "content": { "application/json": { @@ -450,6 +512,16 @@ }, "description": "(empty)" }, + "getAccessControlStatusResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Status" + } + } + }, + "description": "(empty)" + }, "getAlertNotificationChannelResponse": { "content": { "application/json": { @@ -509,6 +581,29 @@ }, "description": "(empty)" }, + "getAllPermissionseResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourcePermissionsDTO" + } + } + }, + "description": "(empty)" + }, + "getAllRolesResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/RoleDTO" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, "getAnnotationByIDResponse": { "content": { "application/json": { @@ -542,6 +637,42 @@ }, "description": "(empty)" }, + "getCorrelationResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Correlation" + } + } + }, + "description": "(empty)" + }, + "getCorrelationsBySourceUIDResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Correlation" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, + "getCorrelationsResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Correlation" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, "getCurrentOrgResponse": { "content": { "application/json": { @@ -552,6 +683,19 @@ }, "description": "(empty)" }, + "getCustomPermissionsReportResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/CustomPermissionsRecordDTO" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, "getDashboardPermissionsListResponse": { "content": { "application/json": { @@ -701,6 +845,16 @@ }, "description": "(empty)" }, + "getLicenseTokenResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Token" + } + } + }, + "description": "(empty)" + }, "getOrgByIDResponse": { "content": { "application/json": { @@ -869,6 +1023,49 @@ }, "description": "(empty)" }, + "getReportResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigDTO" + } + } + }, + "description": "(empty)" + }, + "getReportSettingsResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingsDTO" + } + } + }, + "description": "(empty)" + }, + "getReportsResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/ConfigDTO" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, + "getRoleResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleDTO" + } + } + }, + "description": "(empty)" + }, "getSharingOptionsResponse": { "content": { "application/json": { @@ -916,6 +1113,19 @@ }, "description": "(empty)" }, + "getStatusResponse": { + "description": "(empty)" + }, + "getSyncStatusResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActiveSyncStatusDTO" + } + } + }, + "description": "(empty)" + }, "getTeamByIDResponse": { "content": { "application/json": { @@ -926,6 +1136,19 @@ }, "description": "(empty)" }, + "getTeamGroupsApiResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/TeamGroupDTO" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, "getTeamMembersResponse": { "content": { "application/json": { @@ -1017,6 +1240,48 @@ }, "description": "InternalServerError is a general error indicating something went wrong internally." }, + "listBuiltinRolesResponse": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/RoleDTO" + }, + "type": "array" + }, + "type": "object" + } + } + }, + "description": "(empty)" + }, + "listRecordingRulesResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/RecordingRuleJSON" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, + "listRolesResponse": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/RoleDTO" + }, + "type": "array" + } + } + }, + "description": "(empty)" + }, "listSortOptionsResponse": { "content": { "application/json": { @@ -1213,6 +1478,9 @@ }, "description": "(empty)" }, + "postRenewLicenseTokenResponse": { + "description": "(empty)" + }, "preconditionFailedError": { "content": { "application/json": { @@ -1233,6 +1501,36 @@ }, "description": "(empty)" }, + "recordingRuleResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordingRuleJSON" + } + } + }, + "description": "(empty)" + }, + "recordingRuleWriteTargetResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrometheusRemoteWriteTargetJSON" + } + } + }, + "description": "(empty)" + }, + "refreshLicenseStatsResponse": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActiveUserStats" + } + } + }, + "description": "(empty)" + }, "retrieveServiceAccountResponse": { "content": { "application/json": { @@ -1419,23 +1717,59 @@ "Ack": { "type": "object" }, - "AddApiKeyCommand": { - "description": "COMMANDS", + "ActiveSyncStatusDTO": { + "description": "ActiveSyncStatusDTO holds the information for LDAP background Sync", "properties": { - "name": { + "enabled": { + "type": "boolean" + }, + "nextSync": { + "format": "date-time", "type": "string" }, - "role": { + "prevSync": { + "$ref": "#/components/schemas/SyncResult" + }, + "schedule": { + "type": "string" + } + }, + "type": "object" + }, + "ActiveUserStats": { + "properties": { + "active_admins_and_editors": { + "format": "int64", + "type": "integer" + }, + "active_users": { + "format": "int64", + "type": "integer" + }, + "active_viewers": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, + "AddBuiltInRoleCommand": { + "properties": { + "builtInRole": { "enum": [ "Viewer", - "Editor", - "Admin" + " Editor", + " Admin", + " Grafana Admin" ], "type": "string" }, - "secondsToLive": { - "format": "int64", - "type": "integer" + "global": { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to create organization local assignment. Refer to the Built-in role assignments for more information.", + "type": "boolean" + }, + "roleUid": { + "type": "string" } }, "type": "object" @@ -1546,6 +1880,25 @@ }, "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": { @@ -1567,6 +1920,25 @@ }, "type": "object" }, + "AddTeamRoleCommand": { + "properties": { + "roleUid": { + "type": "string" + } + }, + "type": "object" + }, + "AddUserRoleCommand": { + "properties": { + "global": { + "type": "boolean" + }, + "roleUid": { + "type": "string" + } + }, + "type": "object" + }, "Address": { "properties": { "address1": { @@ -1972,95 +2344,6 @@ ], "type": "object" }, - "AlertRule": { - "properties": { - "Annotations": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "Condition": { - "type": "string" - }, - "DashboardUID": { - "type": "string" - }, - "Data": { - "items": { - "$ref": "#/components/schemas/AlertQuery" - }, - "type": "array" - }, - "ExecErrState": { - "enum": [ - "Alerting", - "Error", - "OK" - ], - "type": "string" - }, - "For": { - "$ref": "#/components/schemas/Duration" - }, - "ID": { - "format": "int64", - "type": "integer" - }, - "IntervalSeconds": { - "format": "int64", - "type": "integer" - }, - "Labels": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "NamespaceUID": { - "type": "string" - }, - "NoDataState": { - "enum": [ - "Alerting", - "NoData", - "OK" - ], - "type": "string" - }, - "OrgID": { - "format": "int64", - "type": "integer" - }, - "PanelID": { - "format": "int64", - "type": "integer" - }, - "RuleGroup": { - "type": "string" - }, - "RuleGroupIndex": { - "format": "int64", - "type": "integer" - }, - "Title": { - "type": "string" - }, - "UID": { - "type": "string" - }, - "Updated": { - "format": "date-time", - "type": "string" - }, - "Version": { - "format": "int64", - "type": "integer" - } - }, - "title": "AlertRule is the model for alert rules in unified alerting.", - "type": "object" - }, "AlertRuleGroup": { "properties": { "folderUid": { @@ -2072,7 +2355,7 @@ }, "rules": { "items": { - "$ref": "#/components/schemas/AlertRule" + "$ref": "#/components/schemas/ProvisionedAlertRule" }, "type": "array" }, @@ -2342,6 +2625,26 @@ "title": "BasicAuth contains basic HTTP authentication credentials.", "type": "object" }, + "BrandingOptionsDTO": { + "properties": { + "emailFooterLink": { + "type": "string" + }, + "emailFooterMode": { + "type": "string" + }, + "emailFooterText": { + "type": "string" + }, + "emailLogoUrl": { + "type": "string" + }, + "reportLogoUrl": { + "type": "string" + } + }, + "type": "object" + }, "CalculateDiffTarget": { "properties": { "dashboardId": { @@ -2404,6 +2707,84 @@ "title": "Config is the top-level configuration for Alertmanager's config files.", "type": "object" }, + "ConfigDTO": { + "description": "ConfigDTO is model representation in transfer", + "properties": { + "created": { + "format": "date-time", + "type": "string" + }, + "dashboardId": { + "format": "int64", + "type": "integer" + }, + "dashboardName": { + "type": "string" + }, + "dashboardUid": { + "type": "string" + }, + "dashboards": { + "items": { + "$ref": "#/components/schemas/DashboardDTO" + }, + "type": "array" + }, + "enableCsv": { + "type": "boolean" + }, + "enableDashboardUrl": { + "type": "boolean" + }, + "formats": { + "items": { + "$ref": "#/components/schemas/Type" + }, + "type": "array" + }, + "id": { + "format": "int64", + "type": "integer" + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "$ref": "#/components/schemas/ReportOptionsDTO" + }, + "orgId": { + "format": "int64", + "type": "integer" + }, + "recipients": { + "type": "string" + }, + "replyTo": { + "type": "string" + }, + "schedule": { + "$ref": "#/components/schemas/ScheduleDTO" + }, + "state": { + "$ref": "#/components/schemas/State" + }, + "templateVars": { + "type": "object" + }, + "updated": { + "format": "date-time", + "type": "string" + }, + "userId": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, "ContactPoints": { "items": { "$ref": "#/components/schemas/EmbeddedContactPoint" @@ -2593,6 +2974,60 @@ }, "type": "object" }, + "CreateOrUpdateConfigCmd": { + "properties": { + "dashboardId": { + "format": "int64", + "type": "integer" + }, + "dashboardUid": { + "type": "string" + }, + "dashboards": { + "items": { + "$ref": "#/components/schemas/DashboardDTO" + }, + "type": "array" + }, + "enableCsv": { + "type": "boolean" + }, + "enableDashboardUrl": { + "type": "boolean" + }, + "formats": { + "items": { + "$ref": "#/components/schemas/Type" + }, + "type": "array" + }, + "message": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "$ref": "#/components/schemas/ReportOptionsDTO" + }, + "recipients": { + "type": "string" + }, + "replyTo": { + "type": "string" + }, + "schedule": { + "$ref": "#/components/schemas/ScheduleDTO" + }, + "state": { + "$ref": "#/components/schemas/State" + }, + "templateVars": { + "type": "object" + } + }, + "type": "object" + }, "CreateOrgCommand": { "properties": { "name": { @@ -2635,6 +3070,42 @@ ], "type": "object" }, + "CreateRoleForm": { + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "items": { + "$ref": "#/components/schemas/Permission" + }, + "type": "array" + }, + "uid": { + "type": "string" + }, + "version": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, "CreateServiceAccountForm": { "properties": { "isDisabled": { @@ -2668,6 +3139,53 @@ }, "type": "object" }, + "CustomPermissionsRecordDTO": { + "properties": { + "customPermissions": { + "type": "string" + }, + "granteeName": { + "type": "string" + }, + "granteeType": { + "type": "string" + }, + "granteeUrl": { + "type": "string" + }, + "id": { + "format": "int64", + "type": "integer" + }, + "isFolder": { + "type": "boolean" + }, + "orgId": { + "format": "int64", + "type": "integer" + }, + "orgRole": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "title": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "usersCount": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, "DashboardACLInfoDTO": { "properties": { "created": { @@ -2771,6 +3289,20 @@ }, "type": "object" }, + "DashboardDTO": { + "properties": { + "dashboard": { + "$ref": "#/components/schemas/DashboardReportDTO" + }, + "reportVariables": { + "type": "object" + }, + "timeRange": { + "$ref": "#/components/schemas/TimeRangeDTO" + } + }, + "type": "object" + }, "DashboardFullWithMeta": { "properties": { "dashboard": { @@ -2853,6 +3385,9 @@ "publicDashboardEnabled": { "type": "boolean" }, + "publicDashboardUid": { + "type": "string" + }, "slug": { "type": "string" }, @@ -2884,6 +3419,21 @@ }, "type": "object" }, + "DashboardReportDTO": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + }, + "type": "object" + }, "DashboardSnapshot": { "description": "DashboardSnapshot model", "properties": { @@ -3003,6 +3553,7 @@ "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" }, "dashboardId": { @@ -3231,6 +3782,83 @@ }, "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" + }, "DataTopic": { "title": "DataTopic is used to identify which topic the frame should be assigned to.", "type": "string" @@ -3263,6 +3891,14 @@ }, "type": "object" }, + "DeleteTokenCommand": { + "properties": { + "instance": { + "type": "string" + } + }, + "type": "object" + }, "DiscoveryBase": { "properties": { "error": { @@ -3508,6 +4144,18 @@ }, "type": "object" }, + "FailedUser": { + "description": "FailedUser holds the information of an user that failed", + "properties": { + "Error": { + "type": "string" + }, + "Login": { + "type": "string" + } + }, + "type": "object" + }, "Failure": { "$ref": "#/components/schemas/ResponseDetails" }, @@ -3934,6 +4582,12 @@ }, "type": "array" }, + "telegram_configs": { + "items": { + "$ref": "#/components/schemas/TelegramConfig" + }, + "type": "array" + }, "victorops_configs": { "items": { "$ref": "#/components/schemas/VictorOpsConfig" @@ -4234,6 +4888,9 @@ "smtp_smarthost": { "$ref": "#/components/schemas/HostPort" }, + "telegram_api_url": { + "$ref": "#/components/schemas/URL" + }, "victorops_api_key": { "$ref": "#/components/schemas/Secret" }, @@ -5352,6 +6009,9 @@ "email": { "type": "string" }, + "isDisabled": { + "type": "boolean" + }, "lastSeenAt": { "format": "date-time", "type": "string" @@ -5602,6 +6262,26 @@ }, "type": "object" }, + "Permission": { + "properties": { + "action": { + "type": "string" + }, + "created": { + "format": "date-time", + "type": "string" + }, + "scope": { + "type": "string" + }, + "updated": { + "format": "date-time", + "type": "string" + } + }, + "title": "Permission is the model for access control permissions.", + "type": "object" + }, "PermissionDenied": { "type": "object" }, @@ -5870,6 +6550,12 @@ }, "type": "array" }, + "telegram_configs": { + "items": { + "$ref": "#/components/schemas/TelegramConfig" + }, + "type": "array" + }, "victorops_configs": { "items": { "$ref": "#/components/schemas/VictorOpsConfig" @@ -6076,6 +6762,20 @@ }, "type": "object" }, + "PrometheusRemoteWriteTargetJSON": { + "properties": { + "data_source_uid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "remote_write_path": { + "type": "string" + } + }, + "type": "object" + }, "Provenance": { "type": "string" }, @@ -6529,6 +7229,12 @@ }, "type": "array" }, + "telegram_configs": { + "items": { + "$ref": "#/components/schemas/TelegramConfig" + }, + "type": "array" + }, "victorops_configs": { "items": { "$ref": "#/components/schemas/VictorOpsConfig" @@ -6551,6 +7257,53 @@ "title": "Receiver configuration provides configuration on how to contact a receiver.", "type": "object" }, + "RecordingRuleJSON": { + "description": "RecordingRuleJSON is the external representation of a recording rule", + "properties": { + "active": { + "type": "boolean" + }, + "count": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "dest_data_source_uid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "interval": { + "format": "int64", + "type": "integer" + }, + "name": { + "type": "string" + }, + "prom_name": { + "type": "string" + }, + "queries": { + "items": { + "additionalProperties": { + "type": "object" + }, + "type": "object" + }, + "type": "array" + }, + "range": { + "format": "int64", + "type": "integer" + }, + "target_ref_id": { + "type": "string" + } + }, + "type": "object" + }, "Regexp": { "description": "A Regexp is safe for concurrent use by multiple goroutines,\nexcept for configuration methods, such as Longest.", "title": "Regexp is the representation of a compiled regular expression.", @@ -6568,6 +7321,41 @@ }, "type": "object" }, + "ReportEmailDTO": { + "properties": { + "email": { + "type": "string" + }, + "emails": { + "description": "Comma-separated list of emails to which to send the report to.", + "type": "string" + }, + "id": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "format": "int64", + "type": "string" + }, + "useEmailsFromReport": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "boolean" + } + }, + "type": "object" + }, + "ReportOptionsDTO": { + "properties": { + "layout": { + "type": "string" + }, + "orientation": { + "type": "string" + }, + "timeRange": { + "$ref": "#/components/schemas/TimeRangeDTO" + } + }, + "type": "object" + }, "ResponseDetails": { "properties": { "msg": { @@ -6602,6 +7390,50 @@ }, "type": "object" }, + "RoleDTO": { + "properties": { + "created": { + "format": "date-time", + "type": "string" + }, + "delegatable": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "items": { + "$ref": "#/components/schemas/Permission" + }, + "type": "array" + }, + "uid": { + "type": "string" + }, + "updated": { + "format": "date-time", + "type": "string" + }, + "version": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, "Route": { "description": "A Route is a node that contains definitions of how to handle alerts. This is modified\nfrom the upstream alertmanager in that it adds the ObjectMatchers property.", "properties": { @@ -6882,6 +7714,49 @@ }, "type": "object" }, + "ScheduleDTO": { + "properties": { + "day": { + "type": "string" + }, + "dayOfMonth": { + "type": "string" + }, + "endDate": { + "format": "date-time", + "type": "string" + }, + "frequency": { + "type": "string" + }, + "hour": { + "format": "int64", + "type": "integer" + }, + "intervalAmount": { + "format": "int64", + "type": "integer" + }, + "intervalFrequency": { + "type": "string" + }, + "minute": { + "format": "int64", + "type": "integer" + }, + "startDate": { + "format": "date-time", + "type": "string" + }, + "timeZone": { + "type": "string" + }, + "workdaysOnly": { + "type": "boolean" + } + }, + "type": "object" + }, "SearchServiceAccountsResult": { "description": "swagger: model", "properties": { @@ -7073,6 +7948,23 @@ }, "type": "object" }, + "SetUserRolesCommand": { + "properties": { + "global": { + "type": "boolean" + }, + "includeHidden": { + "type": "boolean" + }, + "roleUids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "SettingsBag": { "additionalProperties": { "additionalProperties": { @@ -7082,6 +7974,26 @@ }, "type": "object" }, + "SettingsDTO": { + "properties": { + "branding": { + "$ref": "#/components/schemas/BrandingOptionsDTO" + }, + "id": { + "format": "int64", + "type": "integer" + }, + "orgId": { + "format": "int64", + "type": "integer" + }, + "userId": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, "SigV4Config": { "description": "SigV4Config is the configuration for signing remote write requests with\nAWS's SigV4 verification process. Empty values will be retrieved using the\nAWS default credentials chain.", "properties": { @@ -7253,6 +8165,17 @@ "SmtpNotEnabled": { "$ref": "#/components/schemas/ResponseDetails" }, + "State": { + "type": "string" + }, + "Status": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, "Success": { "$ref": "#/components/schemas/ResponseDetails" }, @@ -7264,6 +8187,39 @@ }, "type": "object" }, + "SyncResult": { + "properties": { + "Elapsed": { + "$ref": "#/components/schemas/Duration" + }, + "FailedUsers": { + "items": { + "$ref": "#/components/schemas/FailedUser" + }, + "type": "array" + }, + "MissingUserIds": { + "items": { + "format": "int64", + "type": "integer" + }, + "type": "array" + }, + "Started": { + "format": "date-time", + "type": "string" + }, + "UpdatedUserIds": { + "items": { + "format": "int64", + "type": "integer" + }, + "type": "array" + } + }, + "title": "SyncResult holds the result of a sync with LDAP. This gives us information on which users were updated and how.", + "type": "object" + }, "TLSConfig": { "properties": { "ca_file": { @@ -7338,6 +8294,30 @@ }, "type": "object" }, + "TeamGroupDTO": { + "properties": { + "groupId": { + "type": "string" + }, + "orgId": { + "format": "int64", + "type": "integer" + }, + "teamId": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, + "TeamGroupMapping": { + "properties": { + "groupId": { + "type": "string" + } + }, + "type": "object" + }, "TeamMemberDTO": { "properties": { "auth_module": { @@ -7379,6 +8359,37 @@ }, "type": "object" }, + "TelegramConfig": { + "properties": { + "api_url": { + "$ref": "#/components/schemas/URL" + }, + "chat": { + "format": "int64", + "type": "integer" + }, + "disable_notifications": { + "type": "boolean" + }, + "http_config": { + "$ref": "#/components/schemas/HTTPClientConfig" + }, + "message": { + "type": "string" + }, + "parse_mode": { + "type": "string" + }, + "send_resolved": { + "type": "boolean" + }, + "token": { + "$ref": "#/components/schemas/Secret" + } + }, + "title": "TelegramConfig configures notifications via Telegram.", + "type": "object" + }, "TempUserDTO": { "properties": { "code": { @@ -7621,6 +8632,104 @@ "title": "TimeRange represents a range of minutes within a 1440 minute day, exclusive of the End minute. A day consists of 1440 minutes.", "type": "object" }, + "TimeRangeDTO": { + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + }, + "type": "object" + }, + "Token": { + "properties": { + "account": { + "type": "string" + }, + "company": { + "type": "string" + }, + "details_url": { + "type": "string" + }, + "exp": { + "format": "int64", + "type": "integer" + }, + "iat": { + "format": "int64", + "type": "integer" + }, + "included_users": { + "format": "int64", + "type": "integer" + }, + "iss": { + "type": "string" + }, + "jti": { + "type": "string" + }, + "lexp": { + "format": "int64", + "type": "integer" + }, + "lic_exp_warn_days": { + "format": "int64", + "type": "integer" + }, + "lid": { + "type": "string" + }, + "limit_by": { + "type": "string" + }, + "max_concurrent_user_sessions": { + "format": "int64", + "type": "integer" + }, + "nbf": { + "format": "int64", + "type": "integer" + }, + "prod": { + "items": { + "type": "string" + }, + "type": "array" + }, + "slug": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/TokenStatus" + }, + "sub": { + "type": "string" + }, + "tok_exp_warn_days": { + "format": "int64", + "type": "integer" + }, + "trial": { + "type": "boolean" + }, + "trial_exp": { + "format": "int64", + "type": "integer" + }, + "update_days": { + "format": "int64", + "type": "integer" + }, + "usage_billing": { + "type": "boolean" + } + }, + "type": "object" + }, "TokenDTO": { "properties": { "created": { @@ -7642,6 +8751,10 @@ "format": "int64", "type": "integer" }, + "isRevoked": { + "example": false, + "type": "boolean" + }, "lastUsedAt": { "example": "2022-03-23T10:31:02Z", "format": "date-time", @@ -7659,6 +8772,10 @@ }, "type": "object" }, + "TokenStatus": { + "format": "int64", + "type": "integer" + }, "TrimDashboardCommand": { "properties": { "dashboard": { @@ -7681,6 +8798,9 @@ }, "type": "object" }, + "Type": { + "type": "string" + }, "URL": { "description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use RawPath, an optional field which only gets\nset if the default encoding is different from Path.\n\nURL's String method uses the EscapedPath method to obtain the path. See the\nEscapedPath method for more details.", "properties": { @@ -8043,6 +9163,39 @@ }, "type": "object" }, + "UpdateRoleCommand": { + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "global": { + "type": "boolean" + }, + "group": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "items": { + "$ref": "#/components/schemas/Permission" + }, + "type": "array" + }, + "version": { + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, "UpdateServiceAccountForm": { "properties": { "isDisabled": { @@ -8642,7 +9795,6 @@ "$ref": "#/components/schemas/Duration" }, "gettableAlert": { - "description": "GettableAlert gettable alert", "properties": { "annotations": { "$ref": "#/components/schemas/labelSet" @@ -8753,7 +9905,6 @@ "type": "object" }, "gettableSilences": { - "description": "GettableSilences gettable silences", "items": { "$ref": "#/components/schemas/gettableSilence" }, @@ -8864,7 +10015,6 @@ "type": "array" }, "postableSilence": { - "description": "PostableSilence postable silence", "properties": { "comment": { "description": "comment", @@ -8902,6 +10052,7 @@ "type": "object" }, "receiver": { + "description": "Receiver receiver", "properties": { "name": { "description": "name", @@ -9030,6 +10181,598 @@ }, "openapi": "3.0.3", "paths": { + "/access-control/roles": { + "get": { + "description": "Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in.\n\nYou need to have a permission with action `roles:list` and scope `roles:*`.", + "operationId": "listRoles", + "parameters": [ + { + "in": "query", + "name": "delegatable", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/listRolesResponse" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get all roles.", + "tags": [ + "access_control", + "enterprise" + ] + }, + "post": { + "description": "Creates a new custom role and maps given permissions to that role. Note that roles with the same prefix as Fixed Roles can’t be created.\n\nYou need to have a permission with action `roles:write` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.\nFor example, if a user does not have required permissions for creating users, they won’t be able to create a custom role which allows to do that. This is done to prevent escalation of privileges.", + "operationId": "createRole", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateRoleForm" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/createRoleResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Create a new custom role.", + "tags": [ + "access_control", + "enterprise" + ] + } + }, + "/access-control/roles/{roleUID}": { + "delete": { + "description": "Delete a role with the given UID, and it’s permissions. If the role is assigned to a built-in role, the deletion operation will fail, unless force query param is set to true, and in that case all assignments will also be deleted.\n\nYou need to have a permission with action `roles:delete` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only delete a custom role with the same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to delete a custom role which allows to do that.", + "operationId": "deleteCustomRole", + "parameters": [ + { + "in": "query", + "name": "force", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "global", + "schema": { + "type": "boolean" + } + }, + { + "in": "path", + "name": "roleUID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Delete a custom role.", + "tags": [ + "access_control", + "enterprise" + ] + }, + "get": { + "description": "Get a role for the given UID.\n\nYou need to have a permission with action `roles:read` and scope `roles:*`.", + "operationId": "getRole", + "parameters": [ + { + "in": "path", + "name": "roleUID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getRoleResponse" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get a role.", + "tags": [ + "access_control", + "enterprise" + ] + }, + "put": { + "description": "You need to have a permission with action `roles:write` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.", + "operationId": "updateRoleWithPermissions", + "parameters": [ + { + "in": "path", + "name": "roleUID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateRoleCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/getRoleResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Update a custom role.", + "tags": [ + "access_control", + "enterprise" + ] + } + }, + "/access-control/status": { + "get": { + "description": "Returns an indicator to check if fine-grained access control is enabled or not.\n\nYou need to have a permission with action `status:accesscontrol` and scope `services:accesscontrol`.", + "operationId": "getAccessControlStatus", + "responses": { + "200": { + "$ref": "#/components/responses/getAccessControlStatusResponse" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get status.", + "tags": [ + "access_control", + "enterprise" + ] + } + }, + "/access-control/teams/{teamId}/roles": { + "get": { + "description": "You need to have a permission with action `teams.roles:list` and scope `teams:id:\u003cteam ID\u003e`.", + "operationId": "listTeamRoles", + "parameters": [ + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get team roles.", + "tags": [ + "access_control", + "enterprise" + ] + }, + "post": { + "description": "You need to have a permission with action `teams.roles:add` and scope `permissions:type:delegate`.", + "operationId": "addTeamRole", + "parameters": [ + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddTeamRoleCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Add team role.", + "tags": [ + "access_control", + "enterprise" + ] + }, + "put": { + "description": "You need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:type:delegate` for each.", + "operationId": "setTeamRoles", + "parameters": [ + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Update team role.", + "tags": [ + "access_control", + "enterprise" + ] + } + }, + "/access-control/teams/{teamId}/roles/{roleUID}": { + "delete": { + "description": "You need to have a permission with action `teams.roles:remove` and scope `permissions:type:delegate`.", + "operationId": "removeTeamRole", + "parameters": [ + { + "in": "path", + "name": "roleUID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Remove team role.", + "tags": [ + "access_control", + "enterprise" + ] + } + }, + "/access-control/users/{userId}/roles": { + "get": { + "description": "Lists the roles that have been directly assigned to a given user. The list does not include built-in roles (Viewer, Editor, Admin or Grafana Admin), and it does not include roles that have been inherited from a team.\n\nYou need to have a permission with action `users.roles:list` and scope `users:id:\u003cuser ID\u003e`.", + "operationId": "listUserRoles", + "parameters": [ + { + "in": "path", + "name": "userId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getAllRolesResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "List roles assigned to a user.", + "tags": [ + "access_control", + "enterprise" + ] + }, + "post": { + "description": "Assign a role to a specific user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:add` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only assign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign a role which will allow to do that. This is done to prevent escalation of privileges.", + "operationId": "addUserRole", + "parameters": [ + { + "in": "path", + "name": "userId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddUserRoleCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Add a user role assignment.", + "tags": [ + "access_control", + "enterprise" + ] + }, + "put": { + "description": "Update the user’s role assignments to match the provided set of UIDs. This will remove any assigned roles that aren’t in the request and add roles that are in the set but are not already assigned to the user.\nIf you want to add or remove a single role, consider using Add a user role assignment or Remove a user role assignment instead.\n\nYou need to have a permission with action `users.roles:add` and `users.roles:remove` and scope `permissions:type:delegate` for each. `permissions:type:delegate` scope ensures that users can only assign or unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign or unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "operationId": "setUserRoles", + "parameters": [ + { + "in": "path", + "name": "userId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetUserRolesCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Set user role assignments.", + "tags": [ + "access_control", + "enterprise" + ] + } + }, + "/access-control/users/{userId}/roles/{roleUID}": { + "delete": { + "description": "Revoke a role from a user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:remove` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "operationId": "removeUserRole", + "parameters": [ + { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", + "in": "query", + "name": "global", + "schema": { + "type": "boolean" + } + }, + { + "in": "path", + "name": "roleUID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "userId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Remove a user role assignment.", + "tags": [ + "access_control", + "enterprise" + ] + } + }, + "/admin/ldap-sync-status": { + "get": { + "description": "You need to have a permission with action `ldap.status:read`.", + "operationId": "getSyncStatus", + "responses": { + "200": { + "$ref": "#/components/responses/getSyncStatusResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Returns the current state of the LDAP background sync integration", + "tags": [ + "ldap_debug" + ] + } + }, "/admin/ldap/reload": { "post": { "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.", @@ -9206,6 +10949,27 @@ ] } }, + "/admin/provisioning/access-control/reload": { + "post": { + "operationId": "adminProvisioningReloadAccessControl", + "responses": { + "202": { + "$ref": "#/components/responses/acceptedResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + } + }, + "summary": "You need to have a permission with action `provisioning:reload` with scope `provisioners:accesscontrol`.", + "tags": [ + "access_control_provisioning", + "enterprise" + ] + } + }, "/admin/provisioning/dashboards/reload": { "post": { "description": "Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`.", @@ -11296,7 +13060,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertRuleGroupMetadata" + "$ref": "#/components/schemas/AlertRuleGroup" } } }, @@ -11307,11 +13071,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertRuleGroupMetadata" + "$ref": "#/components/schemas/AlertRuleGroup" } } }, - "description": "AlertRuleGroupMetadata" + "description": "AlertRuleGroup" }, "400": { "content": { @@ -12656,6 +14420,29 @@ ] } }, + "/datasources/correlations": { + "get": { + "operationId": "getCorrelations", + "responses": { + "200": { + "$ref": "#/components/responses/getCorrelationsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Gets all correlations.", + "tags": [ + "correlations" + ] + } + }, "/datasources/id/{name}": { "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:name:*` and `datasources:name:test_datasource` (single data source).", @@ -13071,6 +14858,37 @@ } }, "/datasources/uid/{sourceUID}/correlations": { + "get": { + "operationId": "getCorrelationsBySourceUID", + "parameters": [ + { + "in": "path", + "name": "sourceUID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getCorrelationsBySourceUIDResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Gets all correlations originating from the given data source.", + "tags": [ + "correlations" + ] + }, "post": { "operationId": "createCorrelation", "parameters": [ @@ -13121,6 +14939,45 @@ } }, "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "get": { + "operationId": "getCorrelation", + "parameters": [ + { + "in": "path", + "name": "sourceUID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "correlationUID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getCorrelationResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Gets a correlation.", + "tags": [ + "correlations" + ] + }, "patch": { "operationId": "updateCorrelation", "parameters": [ @@ -13422,6 +15279,236 @@ ] } }, + "/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).", + "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).", + "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).", + "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).", + "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).", + "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": { "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/deleteDataSourceByUID) instead", @@ -14335,6 +16422,216 @@ ] } }, + "/licensing/check": { + "get": { + "operationId": "getStatus", + "responses": { + "200": { + "$ref": "#/components/responses/getStatusResponse" + } + }, + "summary": "Check license availability.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/custom-permissions": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "operationId": "getCustomPermissionsReport", + "responses": { + "200": { + "$ref": "#/components/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get custom permissions report.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/custom-permissions-csv": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "operationId": "getCustomPermissionsCSV", + "responses": { + "200": { + "$ref": "#/components/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get custom permissions report in CSV format.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/refresh-stats": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "operationId": "refreshLicenseStats", + "responses": { + "200": { + "$ref": "#/components/responses/refreshLicenseStatsResponse" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Refresh license stats.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/token": { + "delete": { + "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", + "operationId": "deleteLicenseToken", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTokenCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "202": { + "$ref": "#/components/responses/acceptedResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Remove license from database.", + "tags": [ + "licensing", + "enterprise" + ] + }, + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "operationId": "getLicenseToken", + "responses": { + "200": { + "$ref": "#/components/responses/getLicenseTokenResponse" + } + }, + "summary": "Get license token.", + "tags": [ + "licensing", + "enterprise" + ] + }, + "post": { + "description": "You need to have a permission with action `licensing:update`.", + "operationId": "postLicenseToken", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTokenCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/getLicenseTokenResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + } + }, + "summary": "Create license token.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/token/renew": { + "post": { + "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + "operationId": "postRenewLicenseToken", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/postRenewLicenseTokenResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + } + }, + "summary": "Manually force license refresh.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/logout/saml": { + "get": { + "operationId": "getSAMLLogout", + "responses": { + "302": { + "description": "(empty)" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "GetLogout initiates single logout process.", + "tags": [ + "saml", + "enterprise" + ] + } + }, "/org": { "get": { "description": "Get current Organization", @@ -15970,6 +18267,864 @@ ] } }, + "/recording-rules": { + "get": { + "description": "Lists all rules in the database: active or deleted", + "operationId": "listRecordingRules", + "responses": { + "200": { + "$ref": "#/components/responses/listRecordingRulesResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "tags": [ + "recording_rules", + "enterprise" + ] + }, + "post": { + "description": "Create a recording rule that is then registered and started", + "operationId": "createRecordingRule", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordingRuleJSON" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "tags": [ + "recording_rules", + "enterprise" + ] + }, + "put": { + "description": "Update the active status of a rule", + "operationId": "updateRecordingRule", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordingRuleJSON" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "tags": [ + "recording_rules", + "enterprise" + ] + } + }, + "/recording-rules/test": { + "post": { + "operationId": "testCreateRecordingRule", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordingRuleJSON" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Test a recording rule.", + "tags": [ + "recording_rules", + "enterprise" + ] + } + }, + "/recording-rules/writer": { + "delete": { + "operationId": "deleteRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Delete the remote write target.", + "tags": [ + "recording_rules", + "enterprise" + ] + }, + "get": { + "description": "Return the prometheus remote write target", + "operationId": "getRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/components/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "tags": [ + "recording_rules", + "enterprise" + ] + }, + "post": { + "description": "It returns a 422 if there is not an existing prometheus data source configured", + "operationId": "createRecordingRuleWriteTarget", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrometheusRemoteWriteTargetJSON" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Create a remote write target.", + "tags": [ + "recording_rules", + "enterprise" + ] + } + }, + "/recording-rules/{recordingRuleID}": { + "delete": { + "operationId": "deleteRecordingRule", + "parameters": [ + { + "in": "path", + "name": "recordingRuleID", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Delete removes the rule from the registry and stops it.", + "tags": [ + "recording_rules", + "enterprise" + ] + } + }, + "/reports": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", + "operationId": "getReports", + "responses": { + "200": { + "$ref": "#/components/responses/getReportsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "List reports.", + "tags": [ + "reports", + "enterprise" + ] + }, + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "operationId": "createReport", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrUpdateConfigCmd" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/createReportResponse" + }, + "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": "Create a report.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/reports/email": { + "post": { + "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", + "operationId": "sendReport", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportEmailDTO" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "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": "Send a report.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/reports/render/pdf/{dashboardID}": { + "get": { + "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", + "operationId": "renderReportPDF", + "parameters": [ + { + "in": "path", + "name": "DashboardID", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "in": "path", + "name": "dashboardID", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "in": "query", + "name": "title", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "variables", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "from", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "orientation", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "layout", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/contentResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Render report for dashboard.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/reports/render/pdfs": { + "get": { + "description": "Available to all users and with a valid license.", + "operationId": "renderReportPDFs", + "parameters": [ + { + "in": "query", + "name": "dashboardID", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "orientation", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "layout", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/contentResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Render report for multiple dashboards.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/reports/settings": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:read`x.", + "operationId": "getReportSettings", + "responses": { + "200": { + "$ref": "#/components/responses/getReportSettingsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get settings.", + "tags": [ + "reports", + "enterprise" + ] + }, + "post": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:write`xx.", + "operationId": "saveReportSettings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SettingsDTO" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Save settings.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/reports/test-email": { + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", + "operationId": "sendTestEmail", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrUpdateConfigCmd" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "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": "Send test report via email.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/reports/{id}": { + "delete": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", + "operationId": "deleteReport", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "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": "Delete a report.", + "tags": [ + "reports", + "enterprise" + ] + }, + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", + "operationId": "getReport", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getReportResponse" + }, + "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": "Get a report.", + "tags": [ + "reports", + "enterprise" + ] + }, + "put": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", + "operationId": "updateReport", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrUpdateConfigCmd" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "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": "Update a report.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/saml/acs": { + "post": { + "operationId": "postACS", + "parameters": [ + { + "in": "query", + "name": "RelayState", + "schema": { + "type": "string" + } + } + ], + "responses": { + "302": { + "description": "(empty)" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "It performs assertion Consumer Service (ACS).", + "tags": [ + "saml", + "enterprise" + ] + } + }, + "/saml/metadata": { + "get": { + "operationId": "getMetadata", + "responses": { + "200": { + "$ref": "#/components/responses/contentResponse" + } + }, + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "tags": [ + "saml", + "enterprise" + ] + } + }, + "/saml/slo": { + "get": { + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "operationId": "getSLO", + "responses": { + "302": { + "description": "(empty)" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "It performs Single Logout (SLO) callback.", + "tags": [ + "saml", + "enterprise" + ] + }, + "post": { + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "operationId": "postSLO", + "parameters": [ + { + "in": "query", + "name": "SAMLRequest", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "SAMLResponse", + "schema": { + "type": "string" + } + } + ], + "responses": { + "302": { + "description": "(empty)" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "It performs Single Logout (SLO) callback.", + "tags": [ + "saml", + "enterprise" + ] + } + }, "/search": { "get": { "operationId": "search", @@ -16160,7 +19315,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create service account", + "summary": "# Create service account", "tags": [ "service_accounts" ] @@ -16226,7 +19381,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Search service accounts with paging", + "summary": "# Search service accounts with paging", "tags": [ "service_accounts" ] @@ -16264,7 +19419,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete service account", + "summary": "# Delete service account", "tags": [ "service_accounts" ] @@ -16303,7 +19458,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get single serviceaccount by Id", + "summary": "# Get single serviceaccount by Id", "tags": [ "service_accounts" ] @@ -16352,7 +19507,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update service account", + "summary": "# Update service account", "tags": [ "service_accounts" ] @@ -16390,7 +19545,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get service account tokens", + "summary": "# Get service account tokens", "tags": [ "service_accounts" ] @@ -16442,7 +19597,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "CreateNewToken adds a token to a service account", + "summary": "# CreateNewToken adds a token to a service account", "tags": [ "service_accounts" ] @@ -16492,7 +19647,7 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "DeleteToken deletes service account tokens", + "summary": "# DeleteToken deletes service account tokens", "tags": [ "service_accounts" ] @@ -16747,6 +19902,146 @@ ] } }, + "/teams/{teamId}/groups": { + "get": { + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getTeamGroupsApiResponse" + }, + "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": "Get External Groups.", + "tags": [ + "sync_team_groups", + "enterprise" + ] + }, + "post": { + "operationId": "addTeamGroupApi", + "parameters": [ + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeamGroupMapping" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "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": "Add External Group.", + "tags": [ + "sync_team_groups", + "enterprise" + ] + } + }, + "/teams/{teamId}/groups/{groupId}": { + "delete": { + "operationId": "removeTeamGroupApi", + "parameters": [ + { + "in": "path", + "name": "groupId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "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": "Remove External Group.", + "tags": [ + "sync_team_groups", + "enterprise" + ] + } + }, "/teams/{team_id}": { "delete": { "operationId": "deleteTeamByID",