From 3f1908464d9ca10c461d00d13bdf5b5e4f2cd085 Mon Sep 17 00:00:00 2001 From: Polina Boneva <13227501+polibb@users.noreply.github.com> Date: Thu, 5 Jan 2023 11:48:11 +0200 Subject: [PATCH] PanelChrome: Implement Panel header with error, loading, and streaming data status (#60147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * dashboards squad mob! :trident: lastFile:packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx * dashboards squad mob! :trident: * dashboards squad mob! :trident: lastFile:packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx * user essentials mob! :trident: * create grafana/ui LoadingBar and set it up in Storybook * Remove test changes on PanelChrome * Fix mdx page reference * dashboards squad mob! :trident: lastFile:public/api-merged.json * dashboards squad mob! :trident: * dashboards squad mob! :trident: * dashboards squad mob! :trident: * dashboards squad mob! :trident: lastFile:public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderState.tsx * Implemented basic draft of panel header states. Using ToolbarButton instead of IconButton. * use 'warning' styled Button in ToolbarButton * make LoadingBar a simple JSX Element; do not use containerWidth; have a wrapper around the loading bar itself; * fix wrapper around LoadingBar: willChange css prop makes performance of rerendering better * States: Render general panel query error states and render notices next to the title * add streaming to PanelChrome if data is streaming instead of loading * PanelHeaderState with its own state 'mode' * clean up useEffect * notices have their own square space in the size of the panel header * clean up * minor fixes * moving the LoadingBar to core * LoadingBar is not in grafana/ui * always have a place for the loading bar in the PanelChrome, otherwise it moves everything when appearing; remove titleItemsNodes for now - in later development make no changes to Notice component, not part of this PR * Revert "moving the LoadingBar to core" This reverts commit 11f0f4ff2fe81d6755b6587c368284f0ea8f7b68. * do not use internal comment as it doesn't do anything * integrate LoadingBar in PanelChrome from grafana/ui directly * fix deprecated leftItems comment * Modify annimation to 1 second * remove comments * remove streaming stopped UI because we cannot know when the streaming has stopped * skip unnecessary test for now * no point in removing hoverHeader now, even though it's not yet implemented * small fixes * error state of the data in a panel is positioned in PanelChrome itself, not in PanelHeaderState * Fixed loading state jitter * remove warning state as we have none of it * streaming cannot be stopped from the icon * explicit content container width and height * explicit content container width and height * edit deprecated comment * fix LoadingBar to be relative to width of panel; remove explicit width and height on content strict * no warning state of the data * status of the panel data given directly to PanelChrome, not a node * clean up * clean up console log Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> * panel title design fits typography h6 styles; render error status only if error or error message are passed to PanelChrome * add storybook examples; prepare PanelChrome for hoverHeader because this will be a breaking change and it will affect how the storybook example shows up * show storybook example for streaming panel with title because that's the condition for having a header * override margin-bottom: 0.45em of h6 Co-authored-by: Alexandra Vargas Co-authored-by: Torkel Ödegaard Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> --- .../src/components/IconButton/IconButton.tsx | 2 +- .../src/components/LoadingBar/LoadingBar.tsx | 2 +- .../PanelChrome/PanelChrome.story.tsx | 54 +- .../PanelChrome/PanelChrome.test.tsx | 13 +- .../components/PanelChrome/PanelChrome.tsx | 198 +- .../components/PanelChrome/PanelStatus.tsx | 43 + public/api-merged.json | 4576 ++++++----------- public/api-spec.json | 3134 +---------- .../dashboard/dashgrid/PanelStateWrapper.tsx | 26 +- 9 files changed, 1715 insertions(+), 6333 deletions(-) create mode 100644 packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx diff --git a/packages/grafana-ui/src/components/IconButton/IconButton.tsx b/packages/grafana-ui/src/components/IconButton/IconButton.tsx index 53d727d6963..2eeb1e604d3 100644 --- a/packages/grafana-ui/src/components/IconButton/IconButton.tsx +++ b/packages/grafana-ui/src/components/IconButton/IconButton.tsx @@ -18,7 +18,7 @@ export interface Props extends React.ButtonHTMLAttributes { name: IconName; /** Icon size */ size?: IconSize; - /** Type od the icon - mono or default */ + /** Type of the icon - mono or default */ iconType?: IconType; /** Tooltip content to display on hover */ tooltip?: PopoverContent; diff --git a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx index dd3fbcd272c..b576d22d728 100644 --- a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx +++ b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx @@ -30,7 +30,7 @@ const getStyles = (width?: string, height?: string) => (_: GrafanaTheme2) => { transform: 'translateX(0)', }, '100%': { - transform: `translateX(calc(100% - ${barWidth}))`, + transform: `translateX(100%)`, }, }); diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx index 7e5247cb66d..ac658843e90 100644 --- a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx +++ b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx @@ -4,6 +4,7 @@ import { merge } from 'lodash'; import React, { CSSProperties, useState, ReactNode } from 'react'; import { useInterval } from 'react-use'; +import { LoadingState } from '@grafana/data'; import { PanelChrome, PanelChromeProps } from '@grafana/ui'; import { DashboardStoryCanvas } from '../../utils/storybook/DashboardStoryCanvas'; @@ -64,26 +65,21 @@ export const Examples = () => { - {renderPanel('Default panel with error state indicator', { + {renderPanel('Default panel with error status', { title: 'Default title', - leftItems: [ - , - ], + status: { + message: 'Error text', + onClick: action('ErrorIndicator: onClick fired'), + }, })} - {renderPanel('No padding with error state indicator', { + {renderPanel('No padding with error state', { padding: 'none', title: 'Default title', - leftItems: [ - , - ], + loadingState: LoadingState.Error, + })} + {renderPanel('Default panel with streaming state', { + title: 'Default title', + loadingState: LoadingState.Streaming, })} @@ -93,22 +89,21 @@ export const Examples = () => { })} - + - {renderPanel('No title and loading indicator', { - title: '', + {renderPanel('Default panel with deprecated error indicator', { + title: 'Default title', leftItems: [ - setLoading(false)} - key="loading-indicator" + , ], })} - - - {renderPanel('Very long title', { - title: 'Very long title that should get ellipsis when there is no more space', + {renderPanel('No padding with deprecated loading indicator', { + padding: 'none', + title: 'Default title', leftItems: [ = (args: PanelChromeProps return ( - {(width: number, height: number) =>
Description text
} + {(width: number, height: number) => ( +
Panel in a loading state
+ )}
); }; @@ -221,6 +218,7 @@ Basic.args = { title: 'Very long title that should get ellipsis when there is no more space', titleItems, menu, + loadingState: LoadingState.Loading, }; export default meta; diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.test.tsx b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.test.tsx index 35508f8e3c7..9109497b461 100644 --- a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.test.tsx +++ b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.test.tsx @@ -35,12 +35,6 @@ it('renders an empty panel with padding', () => { expect(screen.getByText("Panel's Content").parentElement).not.toHaveStyle({ padding: '0px' }); }); -it('renders an empty panel without a header if no title or titleItems', () => { - setup(); - - expect(screen.queryByTestId('header-container')).not.toBeInTheDocument(); -}); - it('renders panel with a header if prop title', () => { setup({ title: 'Test Panel Header' }); @@ -81,10 +75,9 @@ it('renders panel with a header with icons in place if prop titleItems', () => { expect(screen.getByTestId('title-items-container')).toBeInTheDocument(); }); -it('renders panel with a fixed header if prop hoverHeader is false', () => { - setup({ title: 'Test Panel Header', hoverHeader: false }); - - expect(screen.getByTestId('header-container')).toBeInTheDocument(); +it.skip('renders panel with a fixed header if prop hoverHeader is false', () => { + // setup({ title: 'Test Panel Header', hoverHeader: false }); + // expect(screen.getByTestId('header-container')).toBeInTheDocument(); }); it('renders panel with a header if prop menu', () => { diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx index 685261d1870..332c9ab98a7 100644 --- a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx +++ b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx @@ -1,15 +1,24 @@ import { css, cx } from '@emotion/css'; -import React, { CSSProperties, ReactNode } from 'react'; +import { isEmpty } from 'lodash'; +import React, { CSSProperties, ReactElement, ReactNode } from 'react'; -import { GrafanaTheme2, isIconName } from '@grafana/data'; +import { GrafanaTheme2, isIconName, LoadingState } from '@grafana/data'; import { useStyles2, useTheme2 } from '../../themes'; import { IconName } from '../../types/icon'; import { Dropdown } from '../Dropdown/Dropdown'; import { Icon } from '../Icon/Icon'; import { IconButton, IconButtonVariant } from '../IconButton/IconButton'; +import { LoadingBar } from '../LoadingBar/LoadingBar'; import { PopoverContent, Tooltip } from '../Tooltip'; +import { PanelStatus } from './PanelStatus'; + +interface Status { + message?: string; + onClick?: (e: React.SyntheticEvent) => void; +} + /** * @internal */ @@ -31,16 +40,16 @@ export interface PanelChromeProps { padding?: PanelPadding; title?: string; titleItems?: PanelChromeInfoState[]; - menu?: React.ReactElement; - /** dragClass, hoverHeader, loadingState, and states not yet implemented */ + menu?: ReactElement; + /** dragClass, hoverHeader not yet implemented */ // dragClass?: string; hoverHeader?: boolean; - // loadingState?: LoadingState; - // states?: ReactNode[]; - /** @deprecated in favor of prop states + loadingState?: LoadingState; + status?: Status; + /** @deprecated in favor of props + * status for errors and loadingState for loading and streaming * which will serve the same purpose - * of showing the panel state in the top right corner - * of itself or its header + * of showing/interacting with the panel's data state * */ leftItems?: ReactNode[]; } @@ -53,7 +62,7 @@ export type PanelPadding = 'none' | 'md'; /** * @internal */ -export const PanelChrome: React.FC = ({ +export function PanelChrome({ width, height, children, @@ -63,14 +72,18 @@ export const PanelChrome: React.FC = ({ menu, // dragClass, hoverHeader = false, - // loadingState, - // states = [], + loadingState, + status, leftItems = [], -}) => { +}: PanelChromeProps) { const theme = useTheme2(); const styles = useStyles2(getStyles); - const headerHeight = !hoverHeader ? getHeaderHeight(theme, title, leftItems) : 0; + // To Do rely on hoverHeader prop for header, not separate props + // once hoverHeader is implemented + const hasHeader = title.length > 0 || leftItems.length > 0; + + const headerHeight = getHeaderHeight(theme, hasHeader); const { contentStyle, innerWidth, innerHeight } = getContentStyle(padding, theme, width, headerHeight, height); const headerStyles: CSSProperties = { @@ -82,72 +95,91 @@ export const PanelChrome: React.FC = ({ }; const containerStyles: CSSProperties = { width, height }; - const handleMenuOpen = () => {}; - - const hasHeader = title || titleItems.length > 0 || menu; + const isUsingDeprecatedLeftItems = isEmpty(status) && !loadingState; + const showLoading = loadingState === LoadingState.Loading && !isUsingDeprecatedLeftItems; + const showStreaming = loadingState === LoadingState.Streaming && !isUsingDeprecatedLeftItems; + const renderStatus = () => { + if (isUsingDeprecatedLeftItems) { + return
{itemsRenderer(leftItems, (item) => item)}
; + } else { + const showError = loadingState === LoadingState.Error || status?.message; + return showError ? ( +
+ +
+ ) : null; + } + }; return (
- {hasHeader && !hoverHeader && ( -
- {title && ( -
- {title} +
+ {showLoading ? : null} +
+ +
+ {title && ( +
+ {title} +
+ )} + + {showStreaming && ( +
+ + + +
+ )} + + {titleItems.length > 0 && ( +
+ {titleItems + .filter((item) => isIconName(item.icon)) + .map((item, i) => ( +
+ {item.onClick ? ( + + ) : ( + + + + )} +
+ ))} +
+ )} + + {menu && ( + +
+
- )} +
+ )} - {titleItems.length > 0 && ( -
- {titleItems - .filter((item) => isIconName(item.icon)) - .map((item, i) => ( -
- {item.onClick ? ( - - ) : ( - - - - )} -
- ))} -
- )} - - {menu && ( - -
- -
-
- )} - - {leftItems.length > 0 && ( -
{itemsRenderer(leftItems, (item) => item)}
- )} -
- )} + {renderStatus()} +
{children(innerWidth, innerHeight)}
); -}; +} const itemsRenderer = (items: ReactNode[], renderer: (items: ReactNode[]) => ReactNode): ReactNode => { const toRender = React.Children.toArray(items).filter(Boolean); return toRender.length > 0 ? renderer(toRender) : null; }; -const getHeaderHeight = (theme: GrafanaTheme2, title: string, items: ReactNode[]) => { - if (title.length > 0 || items.length > 0) { +const getHeaderHeight = (theme: GrafanaTheme2, hasHeader: boolean) => { + if (hasHeader) { return theme.spacing.gridSize * theme.components.panel.headerHeight; } return 0; @@ -161,9 +193,12 @@ const getContentStyle = ( height: number ) => { const chromePadding = (padding === 'md' ? theme.components.panel.padding : 0) * theme.spacing.gridSize; + + const panelPadding = chromePadding * 2; const panelBorder = 1 * 2; - const innerWidth = width - chromePadding * 2 - panelBorder; - const innerHeight = height - headerHeight - chromePadding * 2 - panelBorder; + + const innerWidth = width - panelPadding - panelBorder; + const innerHeight = height - headerHeight - panelPadding - panelBorder; const contentStyle: CSSProperties = { padding: chromePadding, @@ -185,7 +220,7 @@ const getStyles = (theme: GrafanaTheme2) => { height: '100%', display: 'flex', flexDirection: 'column', - flex: '0 0 0', + flex: '1 1 0', '&:focus-visible, &:hover': { // only show menu icon on hover or focused panel @@ -198,11 +233,16 @@ const getStyles = (theme: GrafanaTheme2) => { outline: `1px solid ${theme.colors.action.focus}`, }, }), + loadingBarContainer: css({ + position: 'absolute', + top: 0, + width: '100%', + overflow: 'hidden', + }), content: css({ label: 'panel-content', - width: '100%', - contain: 'strict', flexGrow: 1, + contain: 'strict', }), headerContainer: css({ label: 'panel-header', @@ -210,23 +250,41 @@ const getStyles = (theme: GrafanaTheme2) => { alignItems: 'center', padding: `0 ${theme.spacing(padding)}`, }), + streaming: css({ + marginRight: 0, + color: theme.colors.success.text, + + '&:hover': { + color: theme.colors.success.text, + }, + }), title: css({ + marginBottom: 0, // override default h6 margin-bottom textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', - fontWeight: theme.typography.fontWeightMedium, + fontSize: theme.typography.h6.fontSize, + fontWeight: theme.typography.h6.fontWeight, }), items: css({ display: 'flex', }), item: css({ display: 'flex', - justifyContent: 'space-around', + justifyContent: 'center', alignItems: 'center', }), menuItem: css({ visibility: 'hidden', }), + errorContainer: css({ + label: 'error-container', + position: 'absolute', + width: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + }), rightAligned: css({ marginLeft: 'auto', }), diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx b/packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx new file mode 100644 index 00000000000..765701e2355 --- /dev/null +++ b/packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx @@ -0,0 +1,43 @@ +import { css } from '@emotion/css'; +import React from 'react'; + +import { GrafanaTheme2 } from '@grafana/data'; + +import { useStyles2 } from '../../themes'; +import { ToolbarButton } from '../ToolbarButton/ToolbarButton'; + +export interface Props { + message?: string; + onClick?: (e: React.SyntheticEvent) => void; +} + +export function PanelStatus({ message, onClick }: Props) { + const styles = useStyles2(getStyles); + + return ( + + ); +} + +const getStyles = (theme: GrafanaTheme2) => { + const { headerHeight, padding } = theme.components.panel; + + return { + buttonStyles: css({ + label: 'panel-header-state-button', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + padding: theme.spacing(padding), + width: theme.spacing(headerHeight), + height: theme.spacing(headerHeight), + borderRadius: 0, + }), + }; +}; diff --git a/public/api-merged.json b/public/api-merged.json index b0f5e2826a3..3d0d0e26e12 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -22,623 +22,6 @@ }, "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:read` 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": "updateRole", - "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": "deleteRole", - "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/roles/{roleUID}/assignments": { - "get": { - "description": "Get role assignments for the role with the given UID.\n\nYou need to have a permission with action `teams.roles:list` and scope `teams:id:*` and `users.roles:list` and scope `users:id:*`.", - "tags": [ - "access_control", - "enterprise" - ], - "summary": "Get role assignments.", - "operationId": "getRoleAssignments", - "parameters": [ - { - "type": "string", - "name": "roleUID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/getRoleAssignmentsResponse" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "put": { - "description": "Set role assignments for the role with the given UID.\n\nYou need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:type:delegate`, and `users.roles:add` and `users.roles:remove` and scope `permissions:type:delegate`.", - "tags": [ - "access_control", - "enterprise" - ], - "summary": "Set role assignments.", - "operationId": "setRoleAssignments", - "parameters": [ - { - "type": "string", - "name": "roleUID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SetRoleAssignmentsCommand" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/setRoleAssignmentsResponse" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "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:read` 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:read` 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": [ @@ -810,27 +193,6 @@ } } }, - "/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": [ @@ -2441,6 +1803,522 @@ } } }, + "/api/v1/provisioning/alert-rules": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Create a new alert rule.", + "operationId": "RoutePostAlertRule", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" + } + ], + "responses": { + "201": { + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/api/v1/provisioning/alert-rules/{UID}": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Get a specific alert rule by UID.", + "operationId": "RouteGetAlertRule", + "parameters": [ + { + "type": "string", + "description": "Alert rule UID", + "name": "UID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + }, + "404": { + "description": " Not found." + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Update an existing alert rule.", + "operationId": "RoutePutAlertRule", + "parameters": [ + { + "type": "string", + "description": "Alert rule UID", + "name": "UID", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" + } + ], + "responses": { + "200": { + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "tags": [ + "provisioning" + ], + "summary": "Delete a specific alert rule by UID.", + "operationId": "RouteDeleteAlertRule", + "parameters": [ + { + "type": "string", + "description": "Alert rule UID", + "name": "UID", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": " The alert rule was deleted successfully." + } + } + } + }, + "/api/v1/provisioning/contact-points": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Find Annotations.", + "operationId": "getAnnotations", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Find annotations created after specific epoch datetime in milliseconds.", + "name": "from", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Find annotations created before specific epoch datetime in milliseconds.", + "name": "to", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Limit response to annotations created by specific user.", + "name": "userId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Find annotations for a specified alert.", + "name": "alertId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Find annotations that are scoped to a specific dashboard", + "name": "dashboardId", + "in": "query" + }, + { + "type": "string", + "description": "Find annotations that are scoped to a specific dashboard", + "name": "dashboardUID", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Find annotations that are scoped to a specific panel", + "name": "panelId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Max limit for results returned.", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Use this to filter organization annotations. Organization annotations are annotations from an annotation data source that are not connected specifically to a dashboard or panel. You can filter by multiple tags.", + "name": "tags", + "in": "query" + }, + { + "enum": [ + "alert", + "annotation" + ], + "type": "string", + "description": "Return alerts or user created annotations", + "name": "type", + "in": "query" + }, + { + "type": "boolean", + "description": "Match any or all tags", + "name": "matchAny", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAnnotationsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates an annotation in the Grafana database. The dashboardId and panelId fields are optional. If they are not specified then an organization annotation is created and can be queried in any dashboard that adds the Grafana annotations data source. When creating a region annotation include the timeEnd property.\nThe format for `time` and `timeEnd` should be epoch numbers in millisecond resolution.\nThe response for this HTTP request is slightly different in versions prior to v6.4. In prior versions you would also get an endId if you where creating a region. But in 6.4 regions are represented using a single event with time and timeEnd properties.", + "tags": [ + "annotations" + ], + "summary": "Create Annotation.", + "operationId": "postAnnotation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postAnnotationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/graphite": { + "post": { + "description": "Creates an annotation by using Graphite-compatible event format. The `when` and `data` fields are optional. If `when` is not specified then the current time will be used as annotation’s timestamp. The `tags` field can also be in prior to Graphite `0.10.0` format (string with multiple tags being separated by a space).", + "tags": [ + "annotations" + ], + "summary": "Create Annotation in Graphite format.", + "operationId": "postGraphiteAnnotation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostGraphiteAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postAnnotationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/mass-delete": { + "post": { + "tags": [ + "annotations" + ], + "summary": "Delete multiple annotations.", + "operationId": "massDeleteAnnotations", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MassDeleteAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/tags": { + "get": { + "description": "Find all the event tags created in the annotations.", + "tags": [ + "annotations" + ], + "summary": "Find Annotations Tags.", + "operationId": "getAnnotationTags", + "parameters": [ + { + "type": "string", + "description": "Tag is a string that you can use to filter tags.", + "name": "tag", + "in": "query" + }, + { + "type": "string", + "default": "100", + "description": "Max limit for results returned.", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAnnotationTagsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/{annotation_id}": { + "get": { + "tags": [ + "annotations" + ], + "summary": "Get Annotation by ID.", + "operationId": "getAnnotationByID", + "parameters": [ + { + "type": "string", + "name": "annotation_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAnnotationByIDResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Updates all properties of an annotation that matches the specified id. To only update certain property, consider using the Patch Annotation operation.", + "tags": [ + "annotations" + ], + "summary": "Update Annotation.", + "operationId": "updateAnnotation", + "parameters": [ + { + "type": "string", + "name": "annotation_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes the annotation that matches the specified ID.", + "tags": [ + "annotations" + ], + "summary": "Delete Annotation By ID.", + "operationId": "deleteAnnotationByID", + "parameters": [ + { + "type": "string", + "name": "annotation_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "patch": { + "description": "Updates one or more properties of an annotation that matches the specified ID.\nThis operation currently supports updating of the `text`, `tags`, `time` and `timeEnd` properties.\nThis is available in Grafana 6.0.0-beta2 and above.", + "tags": [ + "annotations" + ], + "summary": "Patch Annotation.", + "operationId": "patchAnnotation", + "parameters": [ + { + "type": "string", + "name": "annotation_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/api/v1/provisioning/alert-rules": { "get": { "tags": [ @@ -3539,6 +3417,956 @@ } } }, + "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + "get": { + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", + "tags": [ + "dashboard_versions" + ], + "summary": "Get a specific dashboard version.", + "operationId": "getDashboardVersionByID", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Filter by name", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ContactPoints", + "schema": { + "$ref": "#/definitions/ContactPoints" + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Create a contact point.", + "operationId": "RoutePostContactpoints", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/EmbeddedContactPoint" + } + } + ], + "responses": { + "202": { + "description": "EmbeddedContactPoint", + "schema": { + "$ref": "#/definitions/EmbeddedContactPoint" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/api/v1/provisioning/contact-points/{UID}": { + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Update an existing contact point.", + "operationId": "RoutePutContactpoint", + "parameters": [ + { + "type": "string", + "description": "UID is the contact point unique identifier", + "name": "UID", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/EmbeddedContactPoint" + } + } + ], + "responses": { + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Delete a contact point.", + "operationId": "RouteDeleteContactpoints", + "parameters": [ + { + "type": "string", + "description": "UID is the contact point unique identifier", + "name": "UID", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": " The contact point was deleted successfully." + } + } + } + }, + "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Get a rule group.", + "operationId": "RouteGetAlertRuleGroup", + "parameters": [ + { + "type": "string", + "name": "FolderUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Group", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "AlertRuleGroup", + "schema": { + "$ref": "#/definitions/AlertRuleGroup" + } + }, + "404": { + "description": " Not found." + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Update the interval of a rule group.", + "operationId": "RoutePutAlertRuleGroup", + "parameters": [ + { + "type": "string", + "name": "FolderUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Group", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/AlertRuleGroup" + } + } + ], + "responses": { + "200": { + "description": "AlertRuleGroup", + "schema": { + "$ref": "#/definitions/AlertRuleGroup" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/api/v1/provisioning/mute-timings": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Get all the mute timings.", + "operationId": "RouteGetMuteTimings", + "responses": { + "200": { + "description": "MuteTimings", + "schema": { + "$ref": "#/definitions/MuteTimings" + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Create a new mute timing.", + "operationId": "RoutePostMuteTiming", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } + } + ], + "responses": { + "201": { + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/api/v1/provisioning/mute-timings/{name}": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Get a mute timing.", + "operationId": "RouteGetMuteTiming", + "parameters": [ + { + "type": "string", + "description": "Mute timing name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } + }, + "404": { + "description": " Not found." + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Replace an existing mute timing.", + "operationId": "RoutePutMuteTiming", + "parameters": [ + { + "type": "string", + "description": "Mute timing name", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } + } + ], + "responses": { + "200": { + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "tags": [ + "provisioning" + ], + "summary": "Delete a mute timing.", + "operationId": "RouteDeleteMuteTiming", + "parameters": [ + { + "type": "string", + "description": "Mute timing name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": " The mute timing was deleted successfully." + } + } + } + }, + "/api/v1/provisioning/policies": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Get the notification policy tree.", + "operationId": "RouteGetPolicyTree", + "responses": { + "200": { + "description": "Route", + "schema": { + "$ref": "#/definitions/Route" + } + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Sets the notification policy tree.", + "operationId": "RoutePutPolicyTree", + "parameters": [ + { + "description": "The new notification routing tree to use", + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/Route" + } + } + ], + "responses": { + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Clears the notification policy tree.", + "operationId": "RouteResetPolicyTree", + "responses": { + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + } + } + } + }, + "/api/v1/provisioning/templates": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Get all message templates.", + "operationId": "RouteGetTemplates", + "responses": { + "200": { + "description": "MessageTemplates", + "schema": { + "$ref": "#/definitions/MessageTemplates" + } + }, + "404": { + "description": " Not found." + } + } + } + }, + "/api/v1/provisioning/templates/{name}": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Get a message template.", + "operationId": "RouteGetTemplate", + "parameters": [ + { + "type": "string", + "description": "Template Name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "MessageTemplate", + "schema": { + "$ref": "#/definitions/MessageTemplate" + } + }, + "404": { + "description": " Not found." + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Updates an existing template.", + "operationId": "RoutePutTemplate", + "parameters": [ + { + "type": "string", + "description": "Template Name", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/MessageTemplateContent" + } + } + ], + "responses": { + "202": { + "description": "MessageTemplate", + "schema": { + "$ref": "#/definitions/MessageTemplate" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "tags": [ + "provisioning" + ], + "summary": "Delete a template.", + "operationId": "RouteDeleteTemplate", + "parameters": [ + { + "type": "string", + "description": "Template Name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": " The template was deleted successfully." + } + } + } + }, + "/auth/keys": { + "get": { + "description": "Will return auth keys.", + "tags": [ + "api_keys" + ], + "summary": "Get auth keys.", + "operationId": "getAPIkeys", + "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Show expired keys", + "name": "includeExpired", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAPIkeyResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Will return details of the created API key.", + "tags": [ + "api_keys" + ], + "summary": "Creates an API key.", + "operationId": "addAPIkey", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postAPIkeyResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/auth/keys/{id}": { + "delete": { + "tags": [ + "api_keys" + ], + "summary": "Delete API key.", + "operationId": "deleteAPIkey", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "id", + "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" + } + } + } + }, + "/dashboard/snapshots": { + "get": { + "tags": [ + "snapshots" + ], + "summary": "List snapshots.", + "operationId": "searchDashboardSnapshots", + "parameters": [ + { + "type": "string", + "description": "Search Query", + "name": "query", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "description": "Limit the number of returned results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/searchDashboardSnapshotsResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/calculate-diff": { + "post": { + "produces": [ + "application/json", + "text/html" + ], + "tags": [ + "dashboards" + ], + "summary": "Perform diff on two dashboards.", + "operationId": "calculateDashboardDiff", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "base": { + "$ref": "#/definitions/CalculateDiffTarget" + }, + "diffType": { + "description": "The type of diff to return\nDescription:\n`basic`\n`json`", + "type": "string", + "enum": [ + "basic", + "json" + ] + }, + "new": { + "$ref": "#/definitions/CalculateDiffTarget" + } + } + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/calculateDashboardDiffResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/db": { + "post": { + "description": "Creates a new dashboard or updates an existing dashboard.", + "tags": [ + "dashboards" + ], + "summary": "Create / Update dashboard", + "operationId": "postDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SaveDashboardCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/home": { + "get": { + "tags": [ + "dashboards" + ], + "summary": "Get home dashboard.", + "operationId": "getHomeDashboard", + "responses": { + "200": { + "$ref": "#/responses/getHomeDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/permissions": { + "get": { + "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsListByUID) instead", + "tags": [ + "dashboard_permissions" + ], + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissionsListByID", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardPermissionsListResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Please refer to [updated API](#/dashboard_permissions/updateDashboardPermissionsByUID) instead\n\nThis operation will remove existing permissions if they’re not included in the request.", + "tags": [ + "dashboard_permissions" + ], + "summary": "Updates permissions for a dashboard.", + "operationId": "updateDashboardPermissionsByID", + "deprecated": true, + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardACLCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "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" + } + } + } + }, + "/dashboards/id/{DashboardID}/restore": { + "post": { + "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", + "tags": [ + "dashboard_versions" + ], + "summary": "Restore a dashboard to a given dashboard version.", + "operationId": "restoreDashboardVersionByID", + "deprecated": true, + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RestoreDashboardVersionCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/postDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/versions": { + "get": { + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", + "tags": [ + "dashboard_versions" + ], + "summary": "Gets all existing versions for the dashboard.", + "operationId": "getDashboardVersionsByID", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { "get": { "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", @@ -4795,216 +5623,6 @@ } } }, - "/datasources/{datasourceId}/disable-permissions": { - "post": { - "description": "Disables permissions for the data source with the given id. All existing permissions will be removed and anyone will be able to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", - "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", @@ -5860,216 +6478,6 @@ } } }, - "/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": { "tags": [ @@ -7615,827 +8023,6 @@ } } }, - "/recording-rules": { - "get": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Lists all rules in the database: active or deleted.", - "operationId": "listRecordingRules", - "responses": { - "200": { - "$ref": "#/responses/listRecordingRulesResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "put": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Update the active status of a rule.", - "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": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Create a recording rule that is then registered and started.", - "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": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Return the prometheus remote write target.", - "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": [ @@ -8580,7 +8167,7 @@ "tags": [ "service_accounts" ], - "summary": "Create service account", + "summary": "# Create service account", "operationId": "createServiceAccount", "parameters": [ { @@ -8616,7 +8203,7 @@ "tags": [ "service_accounts" ], - "summary": "Search service accounts with paging", + "summary": "# Search service accounts with paging", "operationId": "searchOrgServiceAccountsWithPaging", "parameters": [ { @@ -8672,7 +8259,7 @@ "tags": [ "service_accounts" ], - "summary": "Get single serviceaccount by Id", + "summary": "# Get single serviceaccount by Id", "operationId": "retrieveServiceAccount", "parameters": [ { @@ -8709,7 +8296,7 @@ "tags": [ "service_accounts" ], - "summary": "Delete service account", + "summary": "# Delete service account", "operationId": "deleteServiceAccount", "parameters": [ { @@ -8743,7 +8330,7 @@ "tags": [ "service_accounts" ], - "summary": "Update service account", + "summary": "# Update service account", "operationId": "updateServiceAccount", "parameters": [ { @@ -8789,7 +8376,7 @@ "tags": [ "service_accounts" ], - "summary": "Get service account tokens", + "summary": "# Get service account tokens", "operationId": "listTokens", "parameters": [ { @@ -8823,7 +8410,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": [ { @@ -8872,7 +8459,7 @@ "tags": [ "service_accounts" ], - "summary": "DeleteToken deletes service account tokens", + "summary": "# DeleteToken deletes service account tokens", "operationId": "deleteToken", "parameters": [ { @@ -9145,135 +8732,6 @@ } } }, - "/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": [ @@ -10420,42 +9878,6 @@ "Ack": { "type": "object" }, - "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" - } - } - }, "AddCommand": { "type": "object", "properties": { @@ -10562,25 +9984,6 @@ } } }, - "AddPermissionDTO": { - "type": "object", - "properties": { - "builtinRole": { - "type": "string" - }, - "permission": { - "$ref": "#/definitions/DsPermissionType" - }, - "teamId": { - "type": "integer", - "format": "int64" - }, - "userId": { - "type": "integer", - "format": "int64" - } - } - }, "AddServiceAccountTokenCommand": { "type": "object", "properties": { @@ -10602,25 +10005,6 @@ } } }, - "AddTeamRoleCommand": { - "type": "object", - "properties": { - "roleUid": { - "type": "string" - } - } - }, - "AddUserRoleCommand": { - "type": "object", - "properties": { - "global": { - "type": "boolean" - }, - "roleUid": { - "type": "string" - } - } - }, "Address": { "type": "object", "properties": { @@ -11372,26 +10756,6 @@ } } }, - "BrandingOptionsDTO": { - "type": "object", - "properties": { - "emailFooterLink": { - "type": "string" - }, - "emailFooterMode": { - "type": "string" - }, - "emailFooterText": { - "type": "string" - }, - "emailLogoUrl": { - "type": "string" - }, - "reportLogoUrl": { - "type": "string" - } - } - }, "CalculateDiffTarget": { "type": "object", "properties": { @@ -11454,88 +10818,6 @@ } } }, - "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" - }, - "scaleFactor": { - "type": "integer", - "format": "int64" - }, - "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": { @@ -11788,64 +11070,6 @@ } } }, - "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" - }, - "scaleFactor": { - "type": "integer", - "format": "int64" - }, - "schedule": { - "$ref": "#/definitions/ScheduleDTO" - }, - "state": { - "$ref": "#/definitions/State" - }, - "templateVars": { - "type": "object" - } - } - }, "CreateOrgCommand": { "type": "object", "properties": { @@ -11888,42 +11112,6 @@ } } }, - "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": { @@ -11957,53 +11145,6 @@ } } }, - "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": { @@ -12107,20 +11248,6 @@ } } }, - "DashboardDTO": { - "type": "object", - "properties": { - "dashboard": { - "$ref": "#/definitions/DashboardReportDTO" - }, - "reportVariables": { - "type": "object" - }, - "timeRange": { - "$ref": "#/definitions/TimeRangeDTO" - } - } - }, "DashboardFullWithMeta": { "type": "object", "properties": { @@ -12237,21 +11364,6 @@ } } }, - "DashboardReportDTO": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "uid": { - "type": "string" - } - } - }, "DashboardSnapshot": { "description": "DashboardSnapshot model", "type": "object", @@ -12603,83 +11715,6 @@ } } }, - "DataSourcePermissionRuleDTO": { - "type": "object", - "properties": { - "builtInRole": { - "type": "string" - }, - "created": { - "type": "string", - "format": "date-time" - }, - "datasourceId": { - "type": "integer", - "format": "int64" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "isManaged": { - "type": "boolean" - }, - "permission": { - "$ref": "#/definitions/DsPermissionType" - }, - "permissionName": { - "type": "string" - }, - "team": { - "type": "string" - }, - "teamAvatarUrl": { - "type": "string" - }, - "teamEmail": { - "type": "string" - }, - "teamId": { - "type": "integer", - "format": "int64" - }, - "updated": { - "type": "string", - "format": "date-time" - }, - "userAvatarUrl": { - "type": "string" - }, - "userEmail": { - "type": "string" - }, - "userId": { - "type": "integer", - "format": "int64" - }, - "userLogin": { - "type": "string" - } - } - }, - "DataSourcePermissionsDTO": { - "type": "object", - "properties": { - "datasourceId": { - "type": "integer", - "format": "int64" - }, - "enabled": { - "type": "boolean" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/DataSourcePermissionRuleDTO" - } - } - } - }, "DataTopic": { "type": "string", "title": "DataTopic is used to identify which topic the frame should be assigned to." @@ -12693,14 +11728,6 @@ } } }, - "DeleteTokenCommand": { - "type": "object", - "properties": { - "instance": { - "type": "string" - } - } - }, "DiscoveryBase": { "type": "object", "required": [ @@ -12721,11 +11748,6 @@ "DsAccess": { "type": "string" }, - "DsPermissionType": { - "description": "Datasource permission\nDescription:\n`0` - No Access\n`1` - Query\n`2` - Edit\nEnum: 0,1,2", - "type": "integer", - "format": "int64" - }, "Duration": { "description": "A Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years.", "type": "integer", @@ -12949,18 +11971,6 @@ } } }, - "FailedUser": { - "description": "FailedUser holds the information of an user that failed", - "type": "object", - "properties": { - "Error": { - "type": "string" - }, - "Login": { - "type": "string" - } - } - }, "Failure": { "$ref": "#/definitions/ResponseDetails" }, @@ -15039,26 +14049,6 @@ } } }, - "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" }, @@ -15505,20 +14495,6 @@ } } }, - "PrometheusRemoteWriteTargetJSON": { - "type": "object", - "properties": { - "data_source_uid": { - "type": "string" - }, - "id": { - "type": "string" - }, - "remote_write_path": { - "type": "string" - } - } - }, "Provenance": { "type": "string" }, @@ -16026,51 +15002,6 @@ } } }, - "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": false - } - }, - "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", @@ -16088,41 +15019,6 @@ } } }, - "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": { @@ -16157,79 +15053,6 @@ } } }, - "RoleAssignmentsDTO": { - "type": "object", - "properties": { - "role_uid": { - "type": "string" - }, - "service_accounts": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "teams": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "users": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - } - } - }, - "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", @@ -16745,49 +15568,6 @@ } } }, - "SetRoleAssignmentsCommand": { - "type": "object", - "properties": { - "service_accounts": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "teams": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "users": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - } - } - }, - "SetUserRolesCommand": { - "type": "object", - "properties": { - "global": { - "type": "boolean" - }, - "includeHidden": { - "type": "boolean" - }, - "roleUids": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "SettingsBag": { "type": "object", "additionalProperties": { @@ -16797,26 +15577,6 @@ } } }, - "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", @@ -16988,9 +15748,6 @@ "SmtpNotEnabled": { "$ref": "#/definitions/ResponseDetails" }, - "State": { - "type": "string" - }, "Status": { "type": "integer", "format": "int64" @@ -17006,39 +15763,6 @@ } } }, - "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.", @@ -17120,30 +15844,6 @@ } } }, - "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": { @@ -17461,104 +16161,6 @@ } } }, - "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": { @@ -17601,10 +16203,6 @@ } } }, - "TokenStatus": { - "type": "integer", - "format": "int64" - }, "TrimDashboardCommand": { "type": "object", "properties": { @@ -17627,9 +16225,6 @@ } } }, - "Type": { - "type": "string" - }, "URL": { "type": "object", "title": "URL is a custom URL type that allows validation at configuration load time.", @@ -18006,39 +16601,6 @@ } } }, - "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": { @@ -19002,21 +17564,6 @@ "$ref": "#/definitions/ErrorResponseBody" } }, - "addPermissionResponse": { - "description": "(empty)", - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "permissionId": { - "type": "integer", - "format": "int64" - } - } - } - }, "adminCreateUserResponse": { "description": "(empty)", "schema": { @@ -19066,16 +17613,6 @@ "$ref": "#/definitions/ErrorResponseBody" } }, - "contentResponse": { - "description": "(empty)", - "schema": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8" - } - } - }, "createCorrelationResponse": { "description": "(empty)", "schema": { @@ -19171,27 +17708,6 @@ "$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": { @@ -19376,12 +17892,6 @@ } } }, - "getAccessControlStatusResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/Status" - } - }, "getAlertNotificationChannelResponse": { "description": "(empty)", "schema": { @@ -19421,21 +17931,6 @@ } } }, - "getAllPermissionseResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/DataSourcePermissionsDTO" - } - }, - "getAllRolesResponse": { - "description": "(empty)", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleDTO" - } - } - }, "getAnnotationByIDResponse": { "description": "(empty)", "schema": { @@ -19487,15 +17982,6 @@ "$ref": "#/definitions/OrgDetailsDTO" } }, - "getCustomPermissionsReportResponse": { - "description": "(empty)", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomPermissionsRecordDTO" - } - } - }, "getDashboardPermissionsListResponse": { "description": "(empty)", "schema": { @@ -19597,12 +18083,6 @@ "$ref": "#/definitions/LibraryElementSearchResponse" } }, - "getLicenseTokenResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/Token" - } - }, "getOrgByIDResponse": { "description": "(empty)", "schema": { @@ -19711,39 +18191,6 @@ } } }, - "getReportResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/ConfigDTO" - } - }, - "getReportSettingsResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/SettingsDTO" - } - }, - "getReportsResponse": { - "description": "(empty)", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ConfigDTO" - } - } - }, - "getRoleAssignmentsResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/RoleAssignmentsDTO" - } - }, - "getRoleResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/RoleDTO" - } - }, "getSharingOptionsResponse": { "description": "(empty)", "schema": { @@ -19779,30 +18226,12 @@ } } }, - "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": { @@ -19866,36 +18295,6 @@ "$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": { @@ -20056,9 +18455,6 @@ } } }, - "postRenewLicenseTokenResponse": { - "description": "(empty)" - }, "preconditionFailedError": { "description": "PreconditionFailedError", "schema": { @@ -20080,24 +18476,6 @@ } } }, - "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": { @@ -20152,12 +18530,6 @@ "$ref": "#/definitions/SearchUserQueryResult" } }, - "setRoleAssignmentsResponse": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/RoleAssignmentsDTO" - } - }, "testAlertResponse": { "description": "(empty)", "schema": { diff --git a/public/api-spec.json b/public/api-spec.json index 1144cf60bec..bee5a749acf 100644 --- a/public/api-spec.json +++ b/public/api-spec.json @@ -22,623 +22,6 @@ }, "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:read` 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": "updateRole", - "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": "deleteRole", - "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/roles/{roleUID}/assignments": { - "get": { - "description": "Get role assignments for the role with the given UID.\n\nYou need to have a permission with action `teams.roles:list` and scope `teams:id:*` and `users.roles:list` and scope `users:id:*`.", - "tags": [ - "access_control", - "enterprise" - ], - "summary": "Get role assignments.", - "operationId": "getRoleAssignments", - "parameters": [ - { - "type": "string", - "name": "roleUID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/getRoleAssignmentsResponse" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "put": { - "description": "Set role assignments for the role with the given UID.\n\nYou need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:type:delegate`, and `users.roles:add` and `users.roles:remove` and scope `permissions:type:delegate`.", - "tags": [ - "access_control", - "enterprise" - ], - "summary": "Set role assignments.", - "operationId": "setRoleAssignments", - "parameters": [ - { - "type": "string", - "name": "roleUID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SetRoleAssignmentsCommand" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/setRoleAssignmentsResponse" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "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:read` 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:read` 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": [ @@ -810,27 +193,6 @@ } } }, - "/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": [ @@ -3463,7 +2825,7 @@ }, "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { "get": { - "description": "Proxies all calls to the actual data source.", + "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID.", "tags": [ "datasources" ], @@ -3476,11 +2838,19 @@ "in": "path", "required": true }, + { + "type": "integer", + "format": "int64", + "default": 1, + "description": "Page index for starting fetching folders", + "name": "page", + "in": "query" + }, { "type": "string", - "name": "uid", - "in": "path", - "required": true + "description": "The parent folder UID", + "name": "parent_uid", + "in": "query" } ], "responses": { @@ -4123,216 +3493,6 @@ } } }, - "/datasources/{datasourceId}/disable-permissions": { - "post": { - "description": "Disables permissions for the data source with the given id. All existing permissions will be removed and anyone will be able to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", - "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", @@ -4568,7 +3728,7 @@ }, "/folders": { "get": { - "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID.", + "description": "Returns all folders that the authenticated user has permission to view.", "tags": [ "folders" ], @@ -4590,12 +3750,6 @@ "description": "Page index for starting fetching folders", "name": "page", "in": "query" - }, - { - "type": "string", - "description": "The parent folder UID", - "name": "parent_uid", - "in": "query" } ], "responses": { @@ -5188,216 +4342,6 @@ } } }, - "/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": { "tags": [ @@ -6943,827 +5887,6 @@ } } }, - "/recording-rules": { - "get": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Lists all rules in the database: active or deleted.", - "operationId": "listRecordingRules", - "responses": { - "200": { - "$ref": "#/responses/listRecordingRulesResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "put": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Update the active status of a rule.", - "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": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Create a recording rule that is then registered and started.", - "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": { - "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Return the prometheus remote write target.", - "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": [ @@ -7908,7 +6031,7 @@ "tags": [ "service_accounts" ], - "summary": "Create service account", + "summary": "# Create service account", "operationId": "createServiceAccount", "parameters": [ { @@ -7944,7 +6067,7 @@ "tags": [ "service_accounts" ], - "summary": "Search service accounts with paging", + "summary": "# Search service accounts with paging", "operationId": "searchOrgServiceAccountsWithPaging", "parameters": [ { @@ -8000,7 +6123,7 @@ "tags": [ "service_accounts" ], - "summary": "Get single serviceaccount by Id", + "summary": "# Get single serviceaccount by Id", "operationId": "retrieveServiceAccount", "parameters": [ { @@ -8037,7 +6160,7 @@ "tags": [ "service_accounts" ], - "summary": "Delete service account", + "summary": "# Delete service account", "operationId": "deleteServiceAccount", "parameters": [ { @@ -8071,7 +6194,7 @@ "tags": [ "service_accounts" ], - "summary": "Update service account", + "summary": "# Update service account", "operationId": "updateServiceAccount", "parameters": [ { @@ -8117,7 +6240,7 @@ "tags": [ "service_accounts" ], - "summary": "Get service account tokens", + "summary": "# Get service account tokens", "operationId": "listTokens", "parameters": [ { @@ -8151,7 +6274,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": [ { @@ -8200,7 +6323,7 @@ "tags": [ "service_accounts" ], - "summary": "DeleteToken deletes service account tokens", + "summary": "# DeleteToken deletes service account tokens", "operationId": "deleteToken", "parameters": [ { @@ -8473,135 +6596,6 @@ } } }, - "/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": [ @@ -9745,42 +7739,6 @@ } }, "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" - } - } - }, "AddCommand": { "type": "object", "properties": { @@ -9887,25 +7845,6 @@ } } }, - "AddPermissionDTO": { - "type": "object", - "properties": { - "builtinRole": { - "type": "string" - }, - "permission": { - "$ref": "#/definitions/DsPermissionType" - }, - "teamId": { - "type": "integer", - "format": "int64" - }, - "userId": { - "type": "integer", - "format": "int64" - } - } - }, "AddServiceAccountTokenCommand": { "type": "object", "properties": { @@ -9927,25 +7866,6 @@ } } }, - "AddTeamRoleCommand": { - "type": "object", - "properties": { - "roleUid": { - "type": "string" - } - } - }, - "AddUserRoleCommand": { - "type": "object", - "properties": { - "global": { - "type": "boolean" - }, - "roleUid": { - "type": "string" - } - } - }, "Address": { "type": "object", "properties": { @@ -10349,26 +8269,6 @@ } } }, - "BrandingOptionsDTO": { - "type": "object", - "properties": { - "emailFooterLink": { - "type": "string" - }, - "emailFooterMode": { - "type": "string" - }, - "emailFooterText": { - "type": "string" - }, - "emailLogoUrl": { - "type": "string" - }, - "reportLogoUrl": { - "type": "string" - } - } - }, "CalculateDiffTarget": { "type": "object", "properties": { @@ -10401,88 +8301,6 @@ "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" - }, - "scaleFactor": { - "type": "integer", - "format": "int64" - }, - "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", @@ -10729,64 +8547,6 @@ } } }, - "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" - }, - "scaleFactor": { - "type": "integer", - "format": "int64" - }, - "schedule": { - "$ref": "#/definitions/ScheduleDTO" - }, - "state": { - "$ref": "#/definitions/State" - }, - "templateVars": { - "type": "object" - } - } - }, "CreateOrgCommand": { "type": "object", "properties": { @@ -10829,42 +8589,6 @@ } } }, - "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": { @@ -10898,53 +8622,6 @@ } } }, - "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": { @@ -11048,20 +8725,6 @@ } } }, - "DashboardDTO": { - "type": "object", - "properties": { - "dashboard": { - "$ref": "#/definitions/DashboardReportDTO" - }, - "reportVariables": { - "type": "object" - }, - "timeRange": { - "$ref": "#/definitions/TimeRangeDTO" - } - } - }, "DashboardFullWithMeta": { "type": "object", "properties": { @@ -11178,21 +8841,6 @@ } } }, - "DashboardReportDTO": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "uid": { - "type": "string" - } - } - }, "DashboardSnapshot": { "description": "DashboardSnapshot model", "type": "object", @@ -11544,83 +9192,6 @@ } } }, - "DataSourcePermissionRuleDTO": { - "type": "object", - "properties": { - "builtInRole": { - "type": "string" - }, - "created": { - "type": "string", - "format": "date-time" - }, - "datasourceId": { - "type": "integer", - "format": "int64" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "isManaged": { - "type": "boolean" - }, - "permission": { - "$ref": "#/definitions/DsPermissionType" - }, - "permissionName": { - "type": "string" - }, - "team": { - "type": "string" - }, - "teamAvatarUrl": { - "type": "string" - }, - "teamEmail": { - "type": "string" - }, - "teamId": { - "type": "integer", - "format": "int64" - }, - "updated": { - "type": "string", - "format": "date-time" - }, - "userAvatarUrl": { - "type": "string" - }, - "userEmail": { - "type": "string" - }, - "userId": { - "type": "integer", - "format": "int64" - }, - "userLogin": { - "type": "string" - } - } - }, - "DataSourcePermissionsDTO": { - "type": "object", - "properties": { - "datasourceId": { - "type": "integer", - "format": "int64" - }, - "enabled": { - "type": "boolean" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/DataSourcePermissionRuleDTO" - } - } - } - }, "DataTopic": { "type": "string", "title": "DataTopic is used to identify which topic the frame should be assigned to." @@ -11634,22 +9205,9 @@ } } }, - "DeleteTokenCommand": { - "type": "object", - "properties": { - "instance": { - "type": "string" - } - } - }, "DsAccess": { "type": "string" }, - "DsPermissionType": { - "description": "Datasource permission\nDescription:\n`0` - No Access\n`1` - Query\n`2` - Edit\nEnum: 0,1,2", - "type": "integer", - "format": "int64" - }, "Duration": { "description": "A Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years.", "type": "integer", @@ -11692,18 +9250,6 @@ } } }, - "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", @@ -12920,26 +10466,6 @@ } } }, - "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" @@ -13109,20 +10635,6 @@ } } }, - "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", @@ -13364,86 +10876,6 @@ } } }, - "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": {} - } - }, - "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", @@ -13470,79 +10902,6 @@ } } }, - "RoleAssignmentsDTO": { - "type": "object", - "properties": { - "role_uid": { - "type": "string" - }, - "service_accounts": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "teams": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "users": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - } - } - }, - "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": { @@ -13802,49 +11161,6 @@ } } }, - "SetRoleAssignmentsCommand": { - "type": "object", - "properties": { - "service_accounts": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "teams": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "users": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - } - } - }, - "SetUserRolesCommand": { - "type": "object", - "properties": { - "global": { - "type": "boolean" - }, - "includeHidden": { - "type": "boolean" - }, - "roleUids": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "SettingsBag": { "type": "object", "additionalProperties": { @@ -13854,29 +11170,6 @@ } } }, - "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": "integer", "format": "int64" @@ -13889,39 +11182,6 @@ } } }, - "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.", @@ -13970,30 +11230,6 @@ } } }, - "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": { @@ -14129,104 +11365,6 @@ "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": { @@ -14269,10 +11407,6 @@ } } }, - "TokenStatus": { - "type": "integer", - "format": "int64" - }, "TrimDashboardCommand": { "type": "object", "properties": { @@ -14295,9 +11429,6 @@ } } }, - "Type": { - "type": "string" - }, "UpdateAlertNotificationCommand": { "type": "object", "properties": { @@ -14635,39 +11766,6 @@ } } }, - "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": { @@ -14952,21 +12050,6 @@ "$ref": "#/definitions/ErrorResponseBody" } }, - "addPermissionResponse": { - "description": "", - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "permissionId": { - "type": "integer", - "format": "int64" - } - } - } - }, "adminCreateUserResponse": { "description": "", "schema": { @@ -15016,16 +12099,6 @@ "$ref": "#/definitions/ErrorResponseBody" } }, - "contentResponse": { - "description": "", - "schema": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8" - } - } - }, "createCorrelationResponse": { "description": "", "schema": { @@ -15121,27 +12194,6 @@ "$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": { @@ -15326,12 +12378,6 @@ } } }, - "getAccessControlStatusResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/Status" - } - }, "getAlertNotificationChannelResponse": { "description": "", "schema": { @@ -15371,21 +12417,6 @@ } } }, - "getAllPermissionseResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/DataSourcePermissionsDTO" - } - }, - "getAllRolesResponse": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleDTO" - } - } - }, "getAnnotationByIDResponse": { "description": "", "schema": { @@ -15437,15 +12468,6 @@ "$ref": "#/definitions/OrgDetailsDTO" } }, - "getCustomPermissionsReportResponse": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomPermissionsRecordDTO" - } - } - }, "getDashboardPermissionsListResponse": { "description": "", "schema": { @@ -15547,12 +12569,6 @@ "$ref": "#/definitions/LibraryElementSearchResponse" } }, - "getLicenseTokenResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/Token" - } - }, "getOrgByIDResponse": { "description": "", "schema": { @@ -15661,39 +12677,6 @@ } } }, - "getReportResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/ConfigDTO" - } - }, - "getReportSettingsResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/SettingsDTO" - } - }, - "getReportsResponse": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ConfigDTO" - } - } - }, - "getRoleAssignmentsResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/RoleAssignmentsDTO" - } - }, - "getRoleResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/RoleDTO" - } - }, "getSharingOptionsResponse": { "description": "", "schema": { @@ -15729,30 +12712,12 @@ } } }, - "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": { @@ -15816,36 +12781,6 @@ "$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": { @@ -16006,9 +12941,6 @@ } } }, - "postRenewLicenseTokenResponse": { - "description": "" - }, "preconditionFailedError": { "description": "PreconditionFailedError", "schema": { @@ -16021,24 +12953,6 @@ "$ref": "#/definitions/QueryDataResponse" } }, - "recordingRuleResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/RecordingRuleJSON" - } - }, - "recordingRuleWriteTargetResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" - } - }, - "refreshLicenseStatsResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/ActiveUserStats" - } - }, "retrieveServiceAccountResponse": { "description": "", "schema": { @@ -16093,12 +13007,6 @@ "$ref": "#/definitions/SearchUserQueryResult" } }, - "setRoleAssignmentsResponse": { - "description": "", - "schema": { - "$ref": "#/definitions/RoleAssignmentsDTO" - } - }, "testAlertResponse": { "description": "", "schema": { diff --git a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx index bcd7ebbef26..d0c6c30bbb0 100644 --- a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx +++ b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx @@ -34,6 +34,7 @@ import { import { PANEL_BORDER } from 'app/core/constants'; import { profiler } from 'app/core/profiler'; import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel'; +import { InspectTab } from 'app/features/inspector/types'; import { changeSeriesColorConfigFactory } from 'app/plugins/panel/timeseries/overrides/colorSeriesConfigFactory'; import { RenderEvent } from 'app/types/events'; @@ -45,7 +46,6 @@ import { DashboardModel, PanelModel } from '../state'; import { loadSnapshotData } from '../utils/loadSnapshotData'; import { PanelHeader } from './PanelHeader/PanelHeader'; -import { PanelHeaderLoadingIndicator } from './PanelHeader/PanelHeaderLoadingIndicator'; import { seriesVisibilityConfigFactory } from './SeriesVisibilityConfigFactory'; import { liveTimer } from './liveTimer'; @@ -566,6 +566,11 @@ export class PanelStateWrapper extends PureComponent { return !panel.hasTitle(); } + onOpenErrorInspect(e: React.SyntheticEvent, tab: string) { + e.stopPropagation(); + locationService.partial({ inspect: this.props.panel.id, inspectTab: tab }); + } + render() { const { dashboard, panel, isViewing, isEditing, width, height, plugin } = this.props; const { errorMessage, data } = this.state; @@ -581,17 +586,22 @@ export class PanelStateWrapper extends PureComponent { [`panel-alert-state--${alertState}`]: alertState !== undefined, }); - // for new panel header design - const onCancelQuery = () => panel.getQueryRunner().cancelQuery(); const title = panel.getDisplayTitle(); - const noPadding: PanelPadding = plugin.noPadding ? 'none' : 'md'; - const leftItems = [ - , - ]; + const padding: PanelPadding = plugin.noPadding ? 'none' : 'md'; if (config.featureToggles.newPanelChromeUI) { return ( - + this.onOpenErrorInspect(e, InspectTab.Error), + }} + > {(innerWidth, innerHeight) => ( <>