From 87ca3167d2d7497a10fd34554da8692765636f20 Mon Sep 17 00:00:00 2001 From: Matej Kubinec <32638572+matejkubinec@users.noreply.github.com> Date: Thu, 29 Jun 2023 12:26:29 +0200 Subject: [PATCH] PMM-12254 Grafana 9.2.20 (#673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * merge complete (#58272) * followup fix for backport (#58273) * merge complete (#58274) Co-authored-by: Ryan McKinley * Timeseries: Fix null pointer when matching fill below to field (#58030) (#58298) * Fix timeseries fill below to error * wip * modifications * add tests for fillBelowTo option (cherry picked from commit d673c8809b64237690b192d25bb6fefd177ae33d) Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> * MySQL: make it possible to add CA cert without using tlsAuth (#58226) (#58308) (cherry picked from commit b1bfae035022d6cedd89014744073e89741e4738) Co-authored-by: Oscar Kilhed * Auth: Check for OrgUsersAdd on frontend to display pending invites (#58217) (#58225) (cherry picked from commit 9ff2765bb9e7938c88f2333647a6210589a06535) Co-authored-by: Josh Hunt * Chore: Disable dashboard-time-zone e2e tests (#58320) (#58323) (cherry picked from commit d4e3d47f563de34cd09372e048943a8698861d59) Co-authored-by: Josh Hunt * @grafana/e2e: Fix addPanel for small screen size (#57398) (#58314) (cherry picked from commit d001a1b035bdbbaae384cdaf3d69f9ebfd5193a0) Co-authored-by: Andres Martinez Gotor * Toolkit: Fix Webpack less-loader config (#57950) (#58175) (cherry picked from commit b799be3052247f6d3da2a10ab18474dcb0705a5d) Co-authored-by: dessen-xu <1805680163@qq.com> * fix thanos semver string (#58335) (#58344) (cherry picked from commit 6bc8ec0f9bbcdc48e6865e8318eb7fb8de7068ab) Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> * Chore: Upgrade Go to 1.19.3 (v9.2) (#58339) * Datasource Loki: preserve header `X-ID-Token` (#57878) (#58346) (cherry picked from commit bc280d07492f66456e47eb262f935c933312b1ed) Co-authored-by: Si Mon <85333972+siiimooon@users.noreply.github.com> * MSSql/Postgres: Fix visual query editor filter disappearing (#58248) (#58354) (cherry picked from commit b47230623944f01aa6e2367913e2f7596ff284bf) * Alerting: Fix test fails in some environments (#58251) (#58356) (cherry picked from commit 8353f307aa2ed842c9045c1e420d51574019e905) Co-authored-by: George Robinson * Alerting: Append org ID to alert notification URLs (#57123) (#58349) (cherry picked from commit db1fd10ff13d936665210e0c8a86c50ecae09998) Co-authored-by: Neel <47709856+neel1996@users.noreply.github.com> * [v9.2.x] CI: Use full `dockerhub` repository name (#57979) (#57983) * CI: Use full `dockerhub` repository name (#57979) * Add full dockerhub repo name * Update grabpl version (cherry picked from commit 57ee0e4a4b3b6b5536e63b117718c6384920650f) * sign drone.yml Co-authored-by: Marcus Efraimsson * Docs: corrects outer join example (#58348) (#58366) * corrects outer join example * Update docs/sources/panels-visualizations/query-transform-data/transform-data/index.md * adds query tables back in (cherry picked from commit 0315f6317e2653da203c9ac0f21eceb9aa9e29de) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Alerting: Remove duplicate Slack notification title (#58107) (#58256) Move mentions to a markdown-formatted pretext field to prevent issues mixing blocks and legacy-attachment content. (cherry picked from commit d581b368bdeeaf8870e495a15dcfdf5aef293be9) Co-authored-by: Will Jordan * CallResource: don't set Content-Type header if status is 204 (#50780) (#58362) Grafana's HTTPServer ensures that the Content-Type header is always set in the response to a CallResource call, but when the status code is 204 No Content this shouldn't be done; the body should be empty and no Content-Type header should be set. We ran into this in the Grafana ML plugin where we were sending an empty response with status 204, but the frontend client saw that the content type was JSON and tried to parse it, resulting in an error that made it to the JS console. (cherry picked from commit 480277f6129b61d4f23e85a31b0e46b052cbb498) Co-authored-by: Ben Sully * Prometheus: Upgrades http client to v1.13.1 (#58363) (#58395) (cherry picked from commit faa0fda6eb846752983447c2590c68d68c6cb173) * Grafana Enterprise Packaging: Set to conflict with `grafana`, not replace (#58189) (#58418) * Grafana Enterprise Packaging: Set to conflict with `grafana`, not replace When `grafana` and `grafana-enterprise` are in the same RPM repository, grafana-enterprise takes precedence over Grafana This is not what we want. Users should be able to install either OSS or Enterprise * Set it only one way. It's how it's currently tested (cherry picked from commit 786c7faff2c70a563bd1f3f391e28564d1c59964) Co-authored-by: Julien Duchesne * Changelog: Updated changelog for 9.2.4 (#58429) (#58431) (cherry picked from commit 94573d3e6109b5a832c21013c83d9464c43ea4b4) * "Release: Updated versions in package to 9.2.5" (#58430) * Prometheus: remove /series endpoint calls in query builder label names and values for supported clients (#58087) (#58438) * add other filter variables to match param for label values query against filter values, in order to resolve bug in which filter value options would display that aren't relevant in the current query editor context, i.e. options would display that upon select would display no data * expanding current unit test coverage to cover calls to new API * interpolate the label name string instead of the match promql expression (cherry picked from commit 92817469143a222e6d1be8b3369151d55c7fe47d) Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> * properly format new .drone.yml in verify-drone (#58436) (#58452) (cherry picked from commit d593aede3d0bc712dbae34d442918532d8c158d4) Co-authored-by: Dan Cech * pkg/web: avoid shared middleware slice (#58458) (#58463) (cherry picked from commit 75701695d8a938d4958c12febdf37d96afcd6092) Co-authored-by: Emil Tullstedt * Tooltips: Make tooltips in FormField and FormLabel interactive and keyboard friendly (#57706) (#58471) * Tooltips: add tabindex and interactive A couple tooltips used in configuration of datasources like ADX were not clickable or didn't show on keyboard focus. - fixes #56561 - Same solution as #47137 * test: add test around tabbing to tooltips (cherry picked from commit 3e92a2dc7725677336534eae4008be6a679ed44b) Co-authored-by: Adam Simpson * Use fnv64 for InmemCacheService (#58468) (#58487) (cherry picked from commit 72275e97d281f6b4dfb2cd1188db1e7ec5cbb198) Co-authored-by: George Robinson * Alerting: Use hash of opts in singleflight (#58474) (#58488) (cherry picked from commit ad9ac85ee090f8bb006c5b095c0fe3ac7e1b71cd) Co-authored-by: George Robinson * Alerting: Fix screenshots were not cached (#58493) (#58494) (cherry picked from commit c646ff0ce3b5d68d6d96a9c98916186b91a3706c) * Dashboards: Provide better error messages in SaveDashboardAsForm (#57866) (#58432) The existing code uses `instanceof Error` to check for a `message` field on the thrown object. The objects that are thrown are never instances of the error interface. This change introduces a new type that extends Error so that the check works properly and displays a meaningful error message in the UI. (cherry picked from commit f07da85d8b64c7df00121b6b9ace36f9eca1b9b2) Co-authored-by: Joe Blubaugh * Tempo: Fix dropdown issue on tag field focus (#57616) (#57883) (cherry picked from commit 77be89eb1c743c681d0e070cb5f170e58ffa1bfb) Co-authored-by: xiyu95 <112968312+xiyu95@users.noreply.github.com> Co-authored-by: Will Browne * Elasticsearch: fix typo (#58519) (#58523) (cherry picked from commit fa5a304de862c438e25ab8818b7477d1c8304b13) Co-authored-by: Gareth Dawson * Docs: adjusts topics to align with task templates (#58478) (#58531) * updates topic to align with multiple task template * updates goal intro * aligns formatting with single task topic template * Update docs/sources/administration/team-management/index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * adds permissions requirements to two tasks Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> (cherry picked from commit 2dfe0a4060c84aaff8edc0ce3a07573d114f3f67) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Alerting: Improve debug logs in image service (#58507) (#58533) (cherry picked from commit b92a0223e3f5f60f2ae082e21ab43243d51469f0) Co-authored-by: George Robinson * Add new PageInfo component (#58421) (#58534) (cherry picked from commit 831ecb467cfaad7942cbe785f732bd91a43b479a) Co-authored-by: Ashley Harrison * Alerting: Fix images cached on rule instead of dashboard panel signature (#58510) (#58536) (cherry picked from commit 7e852720e3fd6394e62749383d1e502fd9fca83d) Co-authored-by: George Robinson * Alerting: Small improvements to staleResultsHandler (#58007) (#58513) (cherry picked from commit 1290951b65b75ac6a054b401d3e91388cddfe33d) * adjusts the stem sentence (#58538) (#58541) (cherry picked from commit ad374efcbdddfd896cc19bdd98ff1d1cc54c94b4) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Prometheus: Query builder label filters dropdown UI overload fix (#58266) (#58546) * WIP: try to support removing series endpoint for supported clients * add other filter variables to match param for label values query against filter values, in order to resolve bug in which filter value options would display that aren't relevant in the current query editor context, i.e. options would display that upon select would display no data * clean up console logs * refactor and comment * expanding current unit test coverage to cover calls to new API * fix unit test * whitespace * prettier * WIP: need to merge in other PR * WIP giving up and trying again * WIP: most functionality is working, split out shared loki/prom code * fix bug in which search results wouldn't take other label context into the query * Fix bug in which the previously selected value would conflict with the async search * interpolate the label name string instead of the match promql expression * remove type assertions * remove type assertion * clean up generic confusing types, and add back in a type assertion * remove generic type * make sure to interpolate label names * fix bugs with variables not interpolating before query * remove debug * assert partial properties on QueryBuilderLabelFilter * Force update betterer results :( * update regex so dropdown UX more closely matches current behavior * add eslint ignore * add eslint ignore and update betterer (cherry picked from commit ee7348afeea1f746a6ee4e6c7bbfc77743a43204) Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> * Linux repositories: Document `apt|rpm.grafana.com` (#57527) (#58475) * Linux repositories: Document `apt|rpm.grafana.com` We'll be moving off packages.grafana.com (it will be linked to the new repositories) The new package repositories are easier to use, so let's document them instead Question: Are the scripts in `scripts/build/update_repo` and `scripts/verify-repo-update` still used? They seem very old, and seem like the generation of scripts before grabpl was created * Shorter RPM docs. No need to copy the same snippet twice * Add warning about repository migration * oops (cherry picked from commit f1f401147f5ea3bf71099b6358a5ee81f7c68f6a) Co-authored-by: Julien Duchesne * Navigation: Expose new props to extend `Page`/`PluginPage` (#58465) (#58562) * add extensions and customisation to `Page` * adjust alignment (cherry picked from commit b3c761aaa79d374d7dc13c5456e322e1cc294b09) * Alerting: Log when alert rule cannot be screenshot to help debugging (#58537) (#58563) (cherry picked from commit 68600c224b36c4668cec75b7acc30369ac8f4eec) * Plugins: CallResource: Use canonical MIME headers when writing response (#58506) (#58567) * Plugins: CallResource: use canonical MIME headers when writing response * Plugins: add tests for canonical mime headers and Set-Cookie filter * Removed extra new line (cherry picked from commit 33f02839f0792974a103629136df36528159059a) Co-authored-by: Giuseppe Guerra * Alerting: Fix logging pointer address of DashboardUID and PanelID variables (#58539) (#58565) (cherry picked from commit c5ae1bcfe06449fafe6cc4abb8d4a4c17a8c94e4) * Canvas: Fix setting icon from field data #58499 (#58604) (cherry picked from commit 47055561ec92ddb6f4d1d1fdcedb09345cb3b0cf) Co-authored-by: Nathan Marrs * [v9.2.x] Canvas: Improve disabled inline editing UX (#58614) Canvas: Improve disabled inline editing UX (#58610) (cherry picked from commit fd6edbf8c5a52619f00a7e4e440e8bc93df18260) Co-authored-by: Nathan Marrs * [v9.2.x] Docs: Add feature flag example to override configuration with environment variables (#58615) Co-authored-by: Alexa V <239999+axelavargas@users.noreply.github.com> * [v9.2.x] Chore: Upgrade go-sqlite3 to v1.14.16 (#58588) (cherry picked from commit 990d8cd22e4a9ed2347663fe8c72dc37b46537d1) Co-authored-by: Emil Tullstedt * [v9.2.x] Tempo: Fix search removing service name from query (#58633) Tempo: Fix search removing service name from query (#58630) * Fix handleOnChange deps * Remove eslint disable (cherry picked from commit c76183a961edd87eb1c620e327bb0aa4ea930041) Co-authored-by: Joey Tawadrous <90795735+joey-grafana@users.noreply.github.com> * Bumping msw and xmldom to mitigate xmldom vulnerability (#58632) * Prometheus: Handle errors and warnings in buffered client (#58657) Prometheus: Handle errors in buffered client (#58504) * Handle prometheus errors in buffered client * Handle prometheus warnings * Fix tests * Add unit test for warnings (cherry picked from commit 8edeb1aa2268c0c9666a739d6e0841aab98390b9) * [v9.2.x] StateTimelinePanel: Fix duration on merged values (#58679) StateTimelinePanel: Fix duration on merged values (#58561) Fix stateTimeline duration (cherry picked from commit 79142340e085aa1aa1e02ae77bd59b481c2e5f96) Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> * [v9.2.x] Omit error from http response (#58445) * [v9.2.x] Toolkit: Fix compilation loop when watching plugins for changes (#58695) Toolkit: Fix compilation loop when watching plugins for changes (#58167) * fix(toolkit): ignore node_modules and dist directories when watching for changes to plugin * fix(toolkit): move watchOptions.ignored config to pluginDev watch call (cherry picked from commit ce5040074058062e1777feafe2ad419af1f6a216) Co-authored-by: Jack Westbrook * [v9.2.x] Docs: Add document for jsondata field alertmanagerUid (#57121) * Add document for jsondata field `alertmanagerUid` (#52895) alertmanagerUid can be used to specify Alert Manager for a particular Prometheus/Loki data source. Co-authored-by: Garrett Guillotte * Docs: Fix provisioning table formatting (#57042) Co-authored-by: Vũ Quốc Phong Co-authored-by: Daniel Lee * Fix: Email and username trimming and invitation validation (#58446) * Trim leading and trailing whitespaces from email and username on signup * Check whether the provided email address is the same as where the invitation sent Co-authored-by: Mihaly Gyongyosi * CI: Make build and store storybook trigger in the release process (#58686) (#58704) Make storybook trigger conditional (cherry picked from commit 09c3ead94573815e089a99caa8aaf536dd83193b) Co-authored-by: Dimitris Sotirakis * [v9.2.x] SQL: Fix issue where testing the datasource would always be successful if the `datasourceQueryMultiStatus` feature was enabled (#58685) SQL: Fix issue where testing the datasource would always be successful if the `datasourceQueryMultiStatus` feature was enabled (#58671) SQL Datasources: fix issue where testing the datasource connection would show success even when there was an error. Co-authored-by: Victor Marin (cherry picked from commit 75e435fb00942483c421d052066225b9f5fe9ce4) Co-authored-by: Oscar Kilhed * [v9.2.x] Docs: corrects relrefs (#58709) Docs: corrects relrefs (#58706) corrects relrefs (cherry picked from commit a9458c8c00c5aba6efcbf9879662ebdd6174c248) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * [v9.2.x] Snapshots: Allow user with viewer permissions to delete own snapshots (#58715) Snapshots: Allow user with viewer permissions to delete own snapshots (#58572) (cherry picked from commit 59d2cf2ff790ccc55b82902b66b241c8d809dcb2) Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> * [v9.2.x] Use relref resolved from nearest section (#58721) Use relref resolved from nearest section (#58718) As image-rendering is a branch bundle, it is considered a section by Hugo and relrefs should be resolved from there even for child pages. The behavior that worked in `next` but not `latest` could be explained by the lenient but potentially ambiguous relref resolution algorithm Hugo uses. However, I have not determined the exact difference between the two sets of content that causes `next` to work but `latest` not to. Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry (cherry picked from commit b9d8bcb59ba1725dcc58a0c0c7e3dc812d3a75b3) Co-authored-by: Jack Baldry * [v9.2.x] Search: Fixes issue with Recent/Starred section always displaying "General" folder (#58749) * [v9.2.x] CI: Remove base and arch args (#58209) (#58713) Remove base and arch args (#58209) (cherry picked from commit 9c1c10ab9a522db4a99310e1f2e01148b86e222d) # Conflicts: # .drone.yml # Conflicts: # .drone.yml * [v9.2.x] SSE: Keep value name from numeric table (#58850) SSE: Keep value name from numeric table (#58831) fixes #48868 (cherry picked from commit 1953d473c04eb4a5b6c9f4231384ab0cb3dae8f3) Co-authored-by: Kyle Brandt * Release: Bump version to 9.2.6 (#58857) "Release: Updated versions in package to 9.2.6" * [v9.2.x] Transformations: Make Card Descriptions Clickable (#58733) Transformations: Make Card Descriptions Clickable (#58717) replace Card Meta w Card Description (cherry picked from commit 16aa4376acf2d5eb559feeb514f1852cd3b48ff9) Co-authored-by: matt abrams <37156449+zuchka@users.noreply.github.com> * [v9.2.x] Changelog: Updated changelog for 9.2.5 (#58856) (#58862) * Changelog: Updated changelog for 9.2.5 (#58856) (cherry picked from commit df27164b8e0167b1b6c277d3f5a0fbd64b520eab) * [v9.2.x] Chore: Extract server lock error so it can be used with errors.As (#58905) Chore: Extract server lock error so it can be used with errors.As (#58899) chore: extract server lock Error so it can be used with error.As (cherry picked from commit 7e9d94cfda96f4229019d3a9ae1d854162595ae2) Co-authored-by: Jo * [v9.2.x] Alerting: Fix metric in Images in Notifications docs (#58978) Alerting: Fix metric in Images in Notifications docs (#58954) (cherry picked from commit 4da97aef7dc202f8fc671ef2f925bb14f3c90ad6) Co-authored-by: George Robinson * [v9.2.x] Docs: adjusts link to kms integration (#58982) Docs: adjusts link to kms integration (#58981) adjusts link to kms integration (cherry picked from commit e7b5bd34bdc126f696a9b13ecfcab19f660cfde9) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * [v9.2.x] Docs: adds permission validation setting (#58987) Docs: adds permission validation setting (#58970) * adds permission validation setting * Update docs/sources/administration/roles-and-permissions/access-control/configure-rbac/index.md Co-authored-by: Misi * makes prettier Co-authored-by: Misi (cherry picked from commit 780efa57917c2951054a7558710e53d19f140f22) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * resolves merge conflict (#58997) * [v9.2.x] Alerting: Add Troubleshooting to Images in notifications docs (#59025) Alerting: Add Troubleshooting to Images in notifications docs (#58955) (cherry picked from commit 2f878acd9df99881f5a92456ec987c6548f07ec7) Co-authored-by: George Robinson * [v9.2.x] Prometheus: fix Heatmap y buckets when legendFormat: auto (#59064) Prometheus: fix Heatmap y buckets when legendFormat: auto (#59053) (cherry picked from commit 1f4834a144087fcdb408baec9db00075384e27cd) Co-authored-by: Leon Sorokin * [v9.2.x] Alerting: Support Prometheus durations in Provisioning API (#59066) Alerting: Support Prometheus durations in Provisioning API (#58293) Provisioning API should support Prometheus durations (cherry picked from commit 57d6adbc7c4008143ac18fc7076607be227e12d3) Co-authored-by: Bart Peeters * [v9.2.x] MS/My/PostgresSQL: Migrate annotation query (#58847) (#59072) MS/My/PostgresSQL: Migrate annotation query (#58847) (cherry picked from commit 38f25a0bf56cc1727472dd9a2755d5206890fbce) * [v9.2.x] Azure Monitor: Fix resource picker selection for subresources (#59136) Azure Monitor: Fix resource picker selection for subresources (#56392) (cherry picked from commit 5b1ff83ee9c527c83439f0ac52d74d9b0df6d3c1) Co-authored-by: Andres Martinez Gotor * [v9.2.x] SQL: Fix code editor for SQL datasources (#59189) SQL: Fix code editor for SQL datasources (#58116) * SQL: Fix code editor for sql datasources * Fix: mysql completion with defaultdb (cherry picked from commit 75097b99fb68a5c7b1dad2c41d4927afc493d3c7) * [9.2.x] Fix #58598 X-ID-Token header missing on Loki Datasource (#58784) (#59196) * Fix #58598 X-ID-Token header missing on Loki Datasource (#58784) * Fix #58598 X-ID-Token header missing on Loki Datasource * Remove unecessary continue statements * Add getAuthHeadersForCallResource unit tests * Fix test and switch statement issues introduced during merge (cherry picked from commit f1ef63791ad17d4c3b16cd296148c403515ad37d) * update test * missed linting Co-authored-by: Yann Vigara * Changelog: Updated changelog for 9.2.6 (#59232) (#59244) (cherry picked from commit ae508c12f3dd9d9c69b0611b28df57c00dc5891f) # Conflicts: # CHANGELOG.md Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * Release: Bump version to 9.2.7 (#59245) "Release: Updated versions in package to 9.2.7" * [v9.2.x] Heatmap: Fix blurry text & rendering (#59261) Heatmap: Fix blurry text & rendering (#59260) (cherry picked from commit 6f00bc5674d994cb85716610807e4b4f3e232fbf) Co-authored-by: Leon Sorokin * [v9.2.x] Azure Monitor: Fix empty/errored responses for Logs variables (#59277) Azure Monitor: Fix empty/errored responses for Logs variables (#59240) (cherry picked from commit 276b54fe9d41d7c435eb255f75cc1a54bf415db3) Co-authored-by: Andres Martinez Gotor * [v9.2.x] PostgreSQL: Fix missing CA field from configuration (#59285) PostgreSQL: Fix missing CA field from configuration (#59280) * PostgreSQL: Fix missing CA field from configuration (cherry picked from commit be73418d0011c6303c2f638c49002445cd63ccf9) Co-authored-by: Oscar Kilhed * [v9.2.x] TimeseriesPanel: Preserve string fields for data link interpolation (#59296) TimeseriesPanel: Preserve string fields for data link interpolation (#58424) * TimeseriesPanel: Preserve string fields for data link interpolation * clean code * Modify tests so that string fields are allowed only when a valid time/number dataframe exists * performance mods * fix wrong length * remove console.log * Check if aligned dataframe has links (cherry picked from commit 0da77201bf0958b60fcc44b2bf62f5be2a47eeff) Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> * Access Control: Clear user's permission cache after resource creation (#59318) resolve merge conflicts * [v9.2.x] Navigation: Fix crash when Help is disabled (#59375) Navigation: Set navtree to an empty array instead of null (#58919) set navtree to an empty array instead of null (cherry picked from commit 4aa5dea96bd2f9bb137be704e1f69c09c00cdfb3) Co-authored-by: Leo <108552997+lpskdl@users.noreply.github.com> * [v9.2.x] BarChart: fix hover overlay for hz stacked (#59397) BarChart: fix hover overlay for hz stacked (#59359) (cherry picked from commit 13d5ad2ce2a7283dc25dace1328cbf0c11fec639) Co-authored-by: Leon Sorokin * Docs: Improve docs for images in notifications (#59033) (#59404) (cherry picked from commit 0af3515e95cf185b60242022ede43562127757be) * [v9.2.x] SSE: Make sure to forward headers, user and cookies/OAuth token (#58897) (#59430) SSE: Make sure to forward headers, user and cookies/OAuth token (#58897) Fixes #58793 and Fixes https://github.com/grafana/azure-data-explorer-datasource/issues/513 Co-authored-by: Marcus Efraimsson (cherry picked from commit 5623b5afafbf541eac66fab1d9398756bdf9052c) Co-authored-by: Kyle Brandt * [v9.2.x] SQL Datasources: Fix annotation migration (#59454) SQL Datasources: Fix annotation migration (#59438) (cherry picked from commit 71e4a8261df505cd1f14e3aeed18c7cd182dad0f) Co-authored-by: Zoltán Bedi * [v9.2.x] Fix: Allow creating snapshot with no dashboard id (#59465) Fix: Allow creating snapshot with no dashboard id (#58669) (cherry picked from commit d279b6d7b09b979add6cc285542bf44bd1eb85fe) Co-authored-by: Gabriel MABILLE * [v9.2.x] Docs: Add docs for labels with dots (#59486) Docs: Add docs for labels with dots (#59352) (cherry picked from commit c8c1499cd0cb76da66c8949332efe5050e5d656d) Co-authored-by: George Robinson * Release: Bump version to 9.2.8 (#59526) "Release: Updated versions in package to 9.2.8" * [v9.2.x] Changelog: Updated changelog for 9.2.7 (#59525) (#59528) Changelog: Updated changelog for 9.2.7 (#59525) (cherry picked from commit 312dbc979e3126bbdd491beb68c976910905f979) Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * Backport Fix XSS in runbook URL (#681) to v9.2.x (#683) (cherry picked from commit db1548c1491c2f5b522e3c0ceb1832b914a4b2f0) (cherry picked from commit 3135a81edf0ebeb575c95560dd548f9589c14d02) (cherry picked from commit fe17b64445d9cac8c0b4756867f609320c9cb049) * [v9.2.x] Docs: Remove publish.yml (#59536) Remove publish.yml * [v9.2.x] Fix: Unlocking the UI for AuthProxy users (#59529) Fix: Unlocking the UI for AuthProxy users (#59507) Unlocking the UI for AuthProxy users Co-authored-by: Eric Leijonmarck Co-authored-by: Eric Leijonmarck (cherry picked from commit 5bb99775bb995436e9fcf723ed1e622b685a9f1f) Co-authored-by: Gabriel MABILLE * [v9.2.x] Datasources: Use context logger in cache service (#59557) Datasources: Use context logger in cache service (#59547) (cherry picked from commit 0fca3cf9ddc1c0e4dd1407d36099ac630fa5a74f) Co-authored-by: Will Browne * [v9.2.x] Sessions: Remove invalid session cookie if it's invalid/expired/missing (#59588) only remove invalid session cookie if it's invalid/expired/missing (cherry picked from commit 270a893e127c7b9a050b9db16bb54ee0f5783191) * [v9.2.x] Automate docs publishing steps (#59565) * Automate docs publishing steps (#59550) Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry (cherry picked from commit 10a83714c87253c2951e97913cc2a2e61801eb41) * Remove dependency on test job (#59575) Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry * Fix release_branch_regexp (#59590) Apparently the non-capturing group was incorrect. I verified the logic in a branch in grafana-github-actions: https://github.com/grafana/grafana-github-actions/compare/jdb/2022-11-prove-grafana-regexp-behaves-correctly?expand=1 Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry Co-authored-by: Jack Baldry * [v9.2.x] AzureMonitor: Fix panic from empty response in ARG (#59706) AzureMonitor: Fix panic from empty response in ARG (#59691) AzureMonitor: Avoid panic from empty response in ARG (cherry picked from commit 231b5b587c2811d17f765e763b4f65bf58e1610c) Co-authored-by: Andres Martinez Gotor * [v9.2.x] DataSourcePermissions: Handle licensing properly for ds permissions (#59711) DataSourcePermissions: Handle licensing properly for ds permissions (#59694) * RBAC: add viewer grand if dspermissions enforcement is not enabled * RBAC: Change permissions based on role prefix * RBAC: Add option to for permission service to add a license middleware * RBAC: Remove actions from query struct (cherry picked from commit 6d1bcd9f40c5aabf6dee74fdc7a0373b7c25ee0f) * DataLinks: Backport 58934 to v9.2.x (#59457) * manual backport * manual backport * [v9.2.x] Restrict workflow to grafana/grafana repository (#59755) Restrict workflow to grafana/grafana repository (#59740) Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry (cherry picked from commit e7bdcb4ba865103253c7752bd3ade5f9ebfcf949) Co-authored-by: Jack Baldry * [v9.2.x] AzureMonitor: Automate location retrieval (#59810) * AzureMonitor: Automate location retrieval (#59602) * Automate location retrieval - Add function to retrieve provider information - Add function to retrieve subscription locations - Add parsers for each function - Add types - Update resourcePickerData with new functions - Remove old location metadata file * Improve types - Add types for responses - Use correct name parameter - Update response parser (parseProvider unnecessary) * Fix tests - Add necessary mocks * Fix logic and ensure maps are consistent * Add tests * Review * Lint issue (cherry picked from commit c52d4e2a64806e8cbf47782854fdd1f795cf549d) * Lint issues Co-authored-by: Andreas Christou * FIX: Remove service accounts from quota count (#59878) * [v9.2.x] Chore: Remote cache key prefix (#59838) (#59877) Chore: Remote cache key prefix (#59838) * attempt to implement a remote cache key prefix * add a test for the prefix store * oh, linter (cherry picked from commit 3978502d837986a9ad77f4bf303b433f038637b1) * [9.2.x] Instrumentation: Log plugin and datasource info for each plugin request. (#59882) Signed-off-by: bergquist * [v9.2.x] Chore: Add encryption codec to the remote cache (#59871) (#59896) * add encryption codec to the remote cache * change config files too * fix test constructor * pass codec into the test cache (cherry picked from commit f1fb202284a961bd8e3229742e57cc834a201078) * FeatureToggle: for storing signed in user object in a Remote Cache (#59883) * FeatureToggle: for storing sessions in a Remote Cache Co-authored-by: ievaVasiljeva * Fix conflicting modifications :D Co-authored-by: ievaVasiljeva * rename the flag to userRemoteCache * undo unintended change * Users: Add option to use remote cache for SignedInUsers (#59892) * Add remote cache to GetSignedInUserWithCacheCtx Co-authored-by: ievaVasiljeva * Populate SignedInUser remote cache Co-authored-by: ievaVasiljeva * Line * minor fixes to make this work Co-authored-by: ievaVasiljeva * Fix tests * change flag to updated name Co-authored-by: ievaVasiljeva Co-authored-by: ievaVasiljeva * Auth: Session cache [v9.2.x] (#59907) * add cache wrapper only cache token if not to rotate Co-authored-by: Kalle Persson anticipate next rotation Co-authored-by: ievaVasiljeva Co-authored-by: Kalle Persson Co-authored-by: Gabriel MABILLE (cherry picked from commit 07a4b2343d59cb593ad128355e1d9217ba493700) * FeatureToggle: for storing sessions in a Remote Cache Co-authored-by: ievaVasiljeva (cherry picked from commit b8a8c15148c53a76f14f76da1b0fa4cec9be9216) * use feature flag for session cache * ensure ttl is minimum 1 second Co-authored-by: ievaVasiljeva Co-authored-by: Kalle Persson Co-authored-by: Gabriel MABILLE * ensure 2 ttl window to prevent caching of tokens near rotation Co-authored-by: Kalle Persson * fix description of toggle Co-authored-by: gamab Co-authored-by: ievaVasiljeva Co-authored-by: Kalle Persson Co-authored-by: Gabriel MABILLE * [v9.2.x] Plugins: Add username to datasource plugin logging (#59947) Plugins: Add username to datasource plugin logging (#59893) Co-authored-by: Marcus Efraimsson Signed-off-by: bergquist (cherry picked from commit a5ace56be8644c725803e63798554a35eba27e79) Co-authored-by: Carl Bergquist * [9.2.x] Backport Contexthandler: Add uname as response header #59930 (#59950) * Contexthandler: Add uname as response header (#59930) Signed-off-by: bergquist (cherry picked from commit 1b676d0d49460572352af4639274a4e7fe03fc9b) * fixes tests broken due to moved featuremgt package Signed-off-by: bergquist Signed-off-by: bergquist * Auth: Logger for user remote cache (#59961) add logger * [v9.2.x] UsageInsights: Record events for Explore queries (#59992) * UsageInsights: Record events for Explore queries (#59931) * usageinsights: record events for Explore queries * usageinsights: make the source field optional It is not logical to have it for an event like the dashboard-view * usageinsights: add comment to Explore test Explain why we are reversing a previous decision (cherry picked from commit 74167b4d44119862c1246caa3367e4f488efd15e) * usageinsights: fix merge conflict * Empty-Commit to trigger build * usageinsights: fix broken tests after merge * [v9.2.x] Fix index out of range in regenerateLinksSupplier (#60069) Fix index out of range in regenerateLinksSupplier (#60011) (cherry picked from commit 896cb9ddceae6c02811a33e8a323b877cf100151) Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> * [v9.2.x] Fix branch filter for release workflows (#60123) Fix branch filter for release workflows (#59963) Ensures the workflow is run on every push to all version branches. This was thought to be working because it was tested with a manual dispatch, however, that trigger does not consider filters and was not an accurate test. Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry (cherry picked from commit 6f9ee7acf9a8fee8b4a55af94d9dfccced55032c) Co-authored-by: Jack Baldry * [v9.2.x] Use relative aliases for all non-current Grafana aliases (#60113) * Use relative aliases for all non-current Grafana aliases Prevents non-latest documentation "stealing" the page away from latest and through permanent redirects for latest pages that no longer exist. The redirected pages are indexed by search engines but our robots.txt forbids them crawling the non-latest page. Signed-off-by: Jack Baldry * Remove all current page aliases find docs/sources -type f -name '*.md' -exec sed -z -i 's#\n *- /docs/grafana/next/[^\n]*\n#\n#' {} \; find docs/sources -type f -name '*.md' -exec sed -z -i 's#\n *- /docs/grafana/latest/[^\n]*\n#\n#' {} \; find docs/sources -type f -name '*.md' -exec sed -Ez -i 's#\n((aliases:\n *-)|aliases:\n)#\n\2#' {} \; Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry * [v9.2.x] Snapshots: Build snapshot originalUrl on the backend (#60232) (#60256) Co-authored-by: kay delaney * Cloudwatch: Fix deeplink with default region (#60260) (#60273) Cloudwatch: fix deeplink with default region (cherry picked from commit d6bb2a74931a9c2b393fa22040737fb6480819f3) * [v9.2.x] Graphite: bug fix, strip white space from queries before comparing them (#60348) Graphite: bug fix, strip white space from queries before comparing them (#60133) strip white space from queries before comparing them (cherry picked from commit d5d07894b1222eab49f58157f3367d5a5ef2726e) Co-authored-by: Brendan O'Handley * [v9.2.x] Alerting: Set Dashboard and Panel IDs on rule group replacement (#60443) Alerting: Set Dashboard and Panel IDs on rule group replacement (#60374) * Set Dashboard and Panel IDs on rule group replacement * fix comments and abbreviate test variable name * Update pkg/services/ngalert/provisioning/alert_rules.go Co-authored-by: Jean-Philippe Quéméner Co-authored-by: Jean-Philippe Quéméner (cherry picked from commit 174c61b949a905ab567e9e0d65a84483f00e4079) Co-authored-by: Alex Moreno * [v9.2.x] Add copyright notice (#60662) * Add copyright notice (#60658) * Create copyright * add copyright notice (cherry picked from commit c7671b6d1daf7987e5b8bf72b766f9b404449daa) * yarn run prettier:write (cherry picked from commit 160ea3e262f7db24e925d375d16670fd0200105c) Signed-off-by: Jack Baldry Co-authored-by: Eve Meelan <81647476+Eve832@users.noreply.github.com> Co-authored-by: dsotirakis * [v9.2.x] BarChart: Clear tooltip when cursor exits bar (#60748) BarChart: Clear tooltip when cursor exits bar (#60617) (cherry picked from commit 9bd6e471e436fed37a908e5118593d515b134781) Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> * [v9.2.x] Prometheus: Fix Instant query time calculation (#60821) Prometheus: Fix Instant query time calculation (#60815) * Use single point in time instead of doing time range calculation * Comment update (cherry picked from commit 15d32546ea315f8ccada85cd64c5b49d55b0d6ec) * [v9.2.x] Alerting: Prevent uid collision in migration when db is case-insensitive (#60834) Alerting: Prevent uid collision in migration when db is case-insensitive (#60494) * Alerting: Prevent short uid collision in legacy migration when db is case-insensitive Two factors come into play that cause sporadic uid conflicts during legacy alert migration: - MySQL and MySQL-compatible backends use case-insensitive collation. - Our short uid generator is not a uniform RNG and generates uids in such a way that generations in quick succession have a higher probability of creating similar uids. Normally we would be guaranteed unique short uid generation, however if the source alphabet contains duplicate characters (for example, if we use case-insensitive comparison) this guarantee is void. Generating even ~1000 uids in quick succession is nearly guaranteed to create a case-insensitive duplicate. (cherry picked from commit 570b62091c681fec4af9a761db09fbec94b3f750) Co-authored-by: Matthew Jacobson * [v9.2.x] Chore: Upgrade Go to 1.19.4 (#60794) (#60826) * [v9.2.x] remove _build param from whatsnew (#59236) (#60888) remove `_build` param from whatsnew (#59236) * remove `_build` param from whatsnew * Update whats-new-in-v9-3.md Co-authored-by: Robby Milo * Docs: Add source code url field description in publish a plugin documentation (#61080) (#61133) * [v9.2.x] Canvas: Inconsistent save behavior (#61012) Canvas: Save element placement (#61007) (cherry picked from commit 88a8cba6b08901966aebf8e19c16b1a973da61f8) Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com> * [v9.2.x] remove splunk plugin from legacyRunner check (#61180) remove splunk plugin from legacyRunner check (#60979) (cherry picked from commit 7db284cfcb9f8f3c10df07a30ad42833e8890b77) Co-authored-by: Taewoo K * [v9.2.x] Update publishing workflows to use PATs with fine-grained access control (#61267) Update publishing workflows to use PATs with fine-grained access control (#61098) Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry (cherry picked from commit 87ccf10ffe9adf8cf9aee48d27964a6c704ee8ac) Co-authored-by: Jack Baldry * Add reference to Google OAuth docs (#61148) * [v9.2.x] Bugfix: Prevent previous query editor to set default values when changing data source (#61285) Bugfix: Prevent previous query editor to set default values when changing data source (#60218) * Fixed issue where the query editor of the previous ds sets default values on query passed to the query editor of the next ds. * Fixed issue with changing data source for query in Alerting. * Will apply default values from DS if available. * Fix failing tests. * fixed spell error. * reverted getDefaultQuery call so it can be added in a separate PR. (cherry picked from commit b633d5395db1d04cc074e295acdc5f448beb7b99) Co-authored-by: Marcus Andersson * [v9.2.x] Levitate: Only run against the main branch (#61401) (#61462) Levitate: Only run against the main branch (#61401) chore: only run Levitate against the main branch (cherry picked from commit b8aaf85fdca926c6aff3d20cb9955e063e997ec1) Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry Co-authored-by: Levente Balogh * [v9.2.x] Pin doc-validator image version to allow repository to opt in to breaking changes (#61480) Pin doc-validator image version to allow repository to opt in to breaking changes (#61456) Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry (cherry picked from commit 017d4f2cbbe5125098fbc183a694422a3117f3a3) Co-authored-by: Jack Baldry * [v9.2.x] Live: Fix `Subscription to the channel already exists` live streaming error (#61419) Live: Fix `Subscription to the channel already exists` live streaming error (#61406) #60570: Fix `subscription to the channel already exists` (cherry picked from commit 23dbc916e8a0ea72360fcda43fcccfc45f4dba80) Co-authored-by: Artur Wierzbicki * [v9.2.x] update docs docker image reference (#61501) update docs docker image reference (#61269) * update docs docker image * remove command (cherry picked from commit 98cadb3aa0d315e40599715d1687603943542347) Co-authored-by: Robby Milo * [v9.2.x] Auth: Fix correct error for updateapikey in context handler (#61564) Auth: Fix correct error for updateapikey in context handler (#61544) * fix: correct error for updateapikey * refactor: send the correct err forward * update: based on review (cherry picked from commit 07bbc0716c8a5e105bbf96cf6965c03cd6f199aa) Co-authored-by: Eric Leijonmarck * [v9.2.x] Docs: Renderer token (#61681) Docs: Renderer token (#59560) * Docs: renderer token * Apply suggestions from code review Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/image-rendering/_index.md * Update docs/sources/setup-grafana/configure-grafana/_index.md * makes prettier Co-authored-by: Joan López de la Franca Beltran Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Chris Moyer (cherry picked from commit d042c0b30b4962497480feee3f57f24c6050ea4e) Co-authored-by: Leonard Gram * [v9.2.x] Auth: Fix disable/remove duplicate user entries metrics for performance reasons (#61691) Auth: Fix disable/remove duplicate user entries metrics for performance reasons (#61675) * fix: remove metrics from duplicate user entries * fix: disable metrics collection for authinfo * fix: initifine goroutine loop that happened * removed: metrics (cherry picked from commit bedd2304d1bbc5e65512a7938ac1a231bb6b3f14) Co-authored-by: Eric Leijonmarck * [9.2.x] Use new GPG key when publishing (#61791) update .drone.yml Co-authored-by: Julien Duchesne * [v9.2.x] SearchV2: Fix star query when no stars exist (#61818) SearchV2: Fix star query when no stars exist (#61726) (cherry picked from commit c315946a9196c51c5c48ee5c1ceb1c509b709e5a) Co-authored-by: Ryan McKinley * [v9.2.x] Packaging: Use base64 key (#61822) backport Co-authored-by: Julien Duchesne * [v9.2.x] Update _index.md (#61828) Update _index.md (#61662) * Update _index.md The troubleshooting page was missing how to send dashboard panels for debugging so added it here. * Update docs/sources/troubleshooting/_index.md * Update docs/sources/troubleshooting/_index.md * removed empty lines Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Chris Moyer (cherry picked from commit 6c6c0f54025fe4183c03b529a2ab8bd5039afbda) Co-authored-by: Usman Ahmad <69509548+usmangt@users.noreply.github.com> * [v9.2.x] Canvas: Rectangle render error (#61888) * TextPanel: Refactor to functional component (#60885) (#61940) backport * Release: Bump version to 9.2.11 (#62038) "Release: Updated versions in package to 9.2.11" * Docs: Update publish a plugin FAQ to cover more common questions (#62… (#62064) * Changelog: Updated changelog for 9.2.10 (#62066) (#62076) * Changelog: Updated changelog for 9.2.10 * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Horst Gutmann (cherry picked from commit 87023c85cb767e275bda9f054d1863c5bab03caa) Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * [v9.2.x] SVG: Add dompurify preprocessor step (#62158) Co-authored-by: Ryan McKinley (cherry picked from commit 8b574e22b53aa4c5a35032a58844fd4aaaa12f5f) * [v9.2.x] QueryEditorRow: Fixes issue loading query editor when data source variable selected (#62179) QueryEditorRow: Fixes issue loading query editor when data source variable selected (#61927) * QueryEditorRow: Fixes issue loading query editor when data source variable selected * Fix func name * Removed wait * restore waiting for with better check * restore waiting for with better check (cherry picked from commit 9f7ddf1f0b5234a1fd82e1f92d1444f81a794e45) Co-authored-by: Torkel Ödegaard * [v9.2.x] update gpg secret names (#62250) update gpg secret names * [v9.2.x] Auth: Fix catch both both ErrInvalidAPIKey for context with APIKey (#62205) Auth: Fix catch both both ErrInvalidAPIKey for context with APIKey (#62193) * fix: capture both ErrInvalidAPIKey * rename of variable (cherry picked from commit c5cb5be3cc078cc99b0324ae0db429646e0603ad) Co-authored-by: Eric Leijonmarck * [v9.2.x] Login: Fix panic when UpsertUser is called without ReqContext (#62574) * Login: Fix panic when UpsertUser is called without ReqContext (#62539) (cherry picked from commit b1151dd118f2a1c305a6f757661e42e59cf145c1) (cherry picked from commit 679cc18648295053a6ab9b764b85cd68f773f81b) * [v9.2.x] Tempo: Fix span name being dropped from the query (#62591) Tempo: Fix span name being dropped from the query (#62257) (cherry picked from commit c3b476e1dcb310e1d3b425f058264ed5be00d1d8) Co-authored-by: Hamas Shafiq * [v9.2.x] Expressions: Fixes the issue showing expressions editor (#62626) * Expressions: Fixes the issue showing expressions editor (#62510) * Use suggested value for uid * update the snapshot * use __expr__ * replace all -100 with __expr__ * update snapshot * more changes * revert redundant change * Use expr.DatasourceUID where it's possible * generate files (cherry picked from commit 91221bc4362e50b9cca6dbff3a8342b2991900d2) * unit text fix * [v9.2.x] docs: deleted link to moved content (#62703) deleted link to moved content * [v9.2.x] docs: fix broken elasticsearch metrics play link (#62717) docs: fix broken elasticsearch metrics play link (#62715) fix broken elastic search play link (cherry picked from commit 1225e8d6d8a2076f2141065c0ad20b55241d6f25) Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * [v9.2.x] Fix/60084/save and test (#62748) Fix: Save and test error message does not persist across datasource instance settings anymore (cherry picked from commit ce50168b70b4444abb5a1aa36d695dc1b7c339b9) Co-authored-by: Timur Olzhabayev * [v9.2.x] Server: Switch from separate server & cli to a unified grafana binary (#58286) (#62754) * Server: Switch from separate server & cli to a unified grafana binary (#58286) * avoid the need for a second bulky binary for grafana-cli * look for grafana-server in $PATH as well as same directory * implement unified "grafana" command * update dockerfiles, fix grafana-cli -v * update packaging to work with single binary - add wrapper scripts for grafana and grafana-server - update and sync package files - implement --sign flag of build package command - stop packaging scripts folder, they are not useful for end users - add support for --configOverrides in server command - remove unused nfpm.yaml config file * windows support (cherry picked from commit de99ce139c96e7229bb5e194aed225e3321d8685) * Build: don't remove grafana-server and grafana-cli binaries from deb and rpm packages (#59890) * don't remove grafana-server and grafana-cli binaries from /usr/share/grafana/bin in deb and rpm packages * don't add config overrides in /usr/sbin/grafana-server (cherry picked from commit 01cba80cbd762a180a18592a82d6e5992c4fb941) --------- Co-authored-by: Dan Cech * [v9.2.x] MSSQL: Add support for macro function calls (#62887) MSSQL: Add support for macro function calls (#62742) * MSSQL: Add support for macro function calls * Add tests (cherry picked from commit 9fc3b360a43e9f0295f7366e9ea635a43521b341) Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> * [v9.2.x] Remove packages path from branch filter (#60946) Remove packages path from branch filter (#60128) That directory is no longer used in published docs and causes this workflow to fail when changes only affect the packages directory. Signed-off-by: Jack Baldry Signed-off-by: Jack Baldry (cherry picked from commit 1516aa27622ee5dc8d14cc3ebcd07647bf1619bd) Co-authored-by: Jack Baldry * [v9.2.x] Update publishing workflows to use organization secret (#63043) Update publishing workflows to use organization secret (#63001) The new tokens are managed centrally and have a longer expiry. Administrators of the grafanabot account will be notified of the pending expiry and the secret can be rotated centrally without the need for a repository administrator to update their secrets. The existing repository secrets can safely be removed. The tokens for those secrets will be removed by the end of this week. Signed-off-by: Jack Baldry (cherry picked from commit ba9bdf3455b24f3d86b425ccd24994b915327c3b) Co-authored-by: Jack Baldry * [v9.2.x] Server: Fix issue backporting #58286 to v9.2.x in #62754 (#63067) Fix issue backporting #58286 to v9.2.x in #62754 * [v9.2.x] Remove `gen-jsonnet` make target from `bra.toml` (#63102) Remove gen-jsonnet from toml * [v9.2.x] fix broken envelope encryption link (#63141) fix broken envelope encryption link (#63135) (cherry picked from commit 72ca7fe7fe30a95e75e558bf83efc4e791e5018e) Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * [v9.2.x] Fix MSSQL queries failing because of bad interpolation (#63170) Fix MSSQL queries failing because of bad interpolation (#63167) fix failing mssql queries (cherry picked from commit 62b078e4e4cad882e9e9a01f36cc8df4aa084eab) Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> * CI: Backport CI/Release related code to v9.2.x (#63251) * Cherry pick from 03b1cf7 * Remove publishpackages/go * Backport enterprise checks * CI: Allow other modules to register build sub-commands (#62741) * Allow other modules to register build sub-commands * CI: Fix retries on artifacts-page clone * Fix linting errors * Fix golint issues * Update to grabpl 3.0.21 (cherry picked from commit 312ea59e6da16c28226042b7cdebf4e660880ed7) * CI: Remove variants arg from `package` step (#62858) * Remove variants arg from package step * Fix starlark lint * Default to releaseModeConfig.Variants * Check for empty variants arg (cherry picked from commit e5c48ac9454a8513d526384751b953ff98d12ecb) * Remove verify-jsonnet-step * Revert github.com/grafana/thema bump * go mod tidy * Remove publish.star * Fix lib.star lint * CI: Running Redis integration tests without grabpl (#63028) This restores some changes from https://github.com/grafana/grafana/pull/61920 that were accidentally deleted. (cherry picked from commit 2804acd264ff247673f71854d25d79656b7b0775) * go mod tidy * Fix clone enterprise for custom events * Chore: Bump alpine version to `3.17.1` (#63252) Bump alpine version to 3.17.1 (cherry picked from commit 24c60486f62fd723b3d61718d45e7b9382f74656) --------- Co-authored-by: Kevin Minehart Co-authored-by: Horst Gutmann * [v9.2.x] MSSQL Datasource: Revert functions within macros change (#63596) MSSQL Datasource: Revert functions within macros change (#63592) * Revert functions within macros change * Add tests for function and macro for mssql * Remove macro support tests --------- Co-authored-by: Oscar Kilhed (cherry picked from commit 356e2e1933f5e717a0e8f7688ba1b44f7bf9fa01) Co-authored-by: Kyle Cunningham * [v9.2.x] docs: fixed headings and link to explore with logs (#63673) [9.3.x] docs: fixed headings and link to explore with logs (#63670) fixed headings and link to explore with logs (cherry picked from commit abfd8792e536ec8096f83f5abb4612fb7312f90b) Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * [v9.2.x] Update grafana/saml library (#689) SAML: update grafana/saml Co-authored-by: Jo Co-authored-by: linoman <2051016+linoman@users.noreply.github.com> Co-authored-by: Jo * [v9.2.x] SVG: Add dompurify preprocessor step (#704) * SVG: Add dompurify preprocessor step (#698) * add sanitized SVG component (cherry picked from commit dbbe819368f507b9493b7a3cf6e080a5dd752b3e) * remove added file Co-authored-by: Ryan McKinley * Auth: Update saml go.mod (missing query sig verification) [9.2.x] (#713) update saml go.mod (missing query sig verification) (cherry picked from commit 1e1dbd1a06455a451d722856dc619b2a7c78e2c0) * Release: Bump version to 9.2.11 (#728) "Release: Updated versions in package to 9.2.11" * [v9.2.x] Geomap: Sanitize the attribution string (#753) Geomap: Sanitize the attribution string (#745) * SAML: Update grafana/saml library (#691) Co-authored-by: jguer * SVG: Add dompurify preprocessor step (#698) * add sanitized SVG component * add sanitize * Fix frontend build * Remove unnecessary yarn.lock changes * Fix formatting * Re-add yarn.lock message as I guess it is needed --------- Co-authored-by: dsotirakis Co-authored-by: jguer Co-authored-by: nmarrs Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com> (cherry picked from commit 37b4af7ffacfc24d5f24d190356a9ef32d99aa6f) Co-authored-by: Ryan McKinley * [v9.2.x] TraceView: Add key and url escaping of json tag values (#760) * [v9.2.x] Docker Build: Use `tonistiigi/binfmt` image for cross compilation (#64115) Docker Build: Use `tonistiigi/binfmt` image for cross compilation (#64108) * Change docker image used for cross-compilation * Replace fmt.Println with log.Println * Add specific tag for docker image (cherry picked from commit b42fd92fad7c4e826cb6ae9ed360952bbc9a87a9) Co-authored-by: Dimitris Sotirakis * [v9.2.x] build: fix corss build (#63263) build: fix corss build (#61121) * build: fix corss build * fix lint (cherry picked from commit 37baae3699fcad37dac87a759491ae5db02369df) Co-authored-by: Jimmie Han * [9.2.x] CI: Move some build settings (#64491) (#64517) Backporting https://github.com/grafana/grafana/pull/64491. * Move some build settings to Vault * CI: Remove reference to DOWNSTREAM_REPO as it isn't used (cherry picked from commit 4b241804b401eed529e41fa775186d8ffe89ea1c) * [v9.2.x] CI: Add `PrereleaseBucket` field in `versions.go` (#64522) CI: Add `PrereleaseBucket` field in `versions.go` (#64519) Add PrereleaseBucket in versions.go (cherry picked from commit 29b3f3fbf4cd64a59422ac14c58d8fb81f7b17f9) Co-authored-by: Dimitris Sotirakis * [9.2.x] CI: Do not clone in artifacts-page pipeline (#64663) This is done in a later step. * [v9.2.x] Alerting: Fix queries not being previewed in detail view (#64977) * Alerting: Fix queries not being previewed in detail view (#64198) (cherry picked from commit 4e81aab60a587b102305a255891986e592a0d1a4) * Update imports --------- Co-authored-by: Gilles De Mey Co-authored-by: ismail simsek * [v9.2.x] Alerting: Fix expression issues in alert rule view and edit pages (#65008) * Fix rule viewer * Fix expressions editor and viewer in alerting * [v9.2.x] Update CODEOWNERship for grafana-delivery team (#64973) (#65020) Update CODEOWNERship for grafana-delivery team (#64973) (cherry picked from commit 2897ee37bf9f575eef19bcd35182232f965c6499) * [v9.2.x] CI: Update `grabpl` to `3.0.30` (#65028) (#65087) CI: Update `grabpl` to `3.0.30` (#65028) Update grabpl (cherry picked from commit 4a80233bedf6e750f0ce43fa9fe1f6eb7ab9f6fa) * [v9.2.x] NPM: Stop using the folder path before the name path (#65156) NPM: Stop using the folder path before the name path (#63851) Stop using the folder path before the name path (cherry picked from commit 177aa254c563dfe98ffabd2de56330bee960f160) Co-authored-by: Dimitris Sotirakis * [v9.2.x] Fix xss in Graphite functions tooltip (#810) Fix xss in Graphite functions tooltip (#804) (cherry picked from commit 87aad3f11836f810ee1fdfee27827e746ef36055) Co-authored-by: Ludovic Viaud * [v9.2.x] Changelog: Updated changelog for 9.2.15 (#65196) (#65200) Changelog: Updated changelog for 9.2.15 (#65196) * Changelog: Updated changelog for 9.2.15 * Update CHANGELOG.md --------- Co-authored-by: Horst Gutmann (cherry picked from commit a907e042f9cdba3d4c00e89f820bfd9030025af9) Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * Release: Bump version to 9.2.16 (#65202) "Release: Updated versions in package to 9.2.16" * [v9.2.x] CD: Remove `fetch-images` dependency from AWS marketplace automation (#65173) (#65193) CD: Remove `fetch-images` dependency from AWS marketplace automation (#65173) * Remove fetch-images dependency * Fix starlark link (cherry picked from commit d0be9610f0e22a4571a13c2ebf2aaabe281ecf48) * [v9.2.x] Expressions: More robust expression check (#65231) * Expressions: More robust expression check (#65006) More robust expression check (cherry picked from commit 1328878aceb37da7051c5685375e2ca32ef0a6b4) * Fix import * [v9.2.x] CI: Remove `grabpl` dependency from `publish-packages` steps (#65329) (#65331) CI: Remove `grabpl` dependency from `publish-packages` steps (#65329) Remove grabpl dependency from publish packages (cherry picked from commit 3b00d2c273d5b7622b225ae56381879b60a10c2a) # Conflicts: # .drone.yml * [v9.2.x] CI: Cleanup unnecessary `grabpl` dependencies (#65330) (#65345) CI: Cleanup unnecessary `grabpl` dependencies (#65330) * Remove unnecessary grabpl dependencies * Revert test-frontend change (cherry picked from commit 89d642e001513c72120aac89be997735717dd174) # Conflicts: # .drone.yml * [v9.2.x] CI: Allow overwriting of existing GitHub release assets (#65457) CI: Allow overwriting of existing GitHub release assets (#65127) * CI: Allow overwriting of existing GitHub release assets This closes #63698 * Use c for *cli.Context in publishgithub.go (cherry picked from commit 4ab3bd6f7e8bff7719c6c8756bfd8a86126a8616) Co-authored-by: Horst Gutmann * [v9.2] docs: fix alias and broken link (#65483) fixed alias and broken link * [v9.2.x] configure HTTPS documentation (#65558) configure HTTPS documentation (#65271) * configure HTTPS settings for grafana * Apply suggestions from code review * Apply suggestions from code review * rewrites and restructures content * Apply suggestions from code review * PR feedback review; https docs * Update docs/sources/setup-grafana/set-up-https.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/set-up-https.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/set-up-https.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/set-up-https.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/set-up-https.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/set-up-https.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/set-up-https.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * errata * make prettier * Apply suggestions from code review --------- Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Chris Moyer (cherry picked from commit 4839f1543a095b02fe3f1261fc8193046e37fd50) Co-authored-by: David Allen * [v9.2.x] Docs: Fix Nightly Builds URL (#65568) Docs: Fix Nightly Builds URL (#65552) Update _index.md URL for Nightly Builds leads to standard download page. - Updated to direct to correct Nightly Downloads page: https://grafana.com/grafana/download/nightly?edition=oss (cherry picked from commit 8717cd07614565c7104d8be0aa46f3e7f7fa7096) Co-authored-by: sarah-spang <86264026+sarah-spang@users.noreply.github.com> * [v9.2]: Remove redundant content or delete this page entirely (#65446) (#65544) Remove redundant content or delete this page entirely (#65446) * Remove redundant content or delete this page entirely The top of the page has redundant content pitching Grafana Cloud. "You can also configure the MS SQL Server data source on a Grafana Cloud instance without having to host Grafana yourself." Which is directly under the highlighted area explaining the same thing. The same content is floating in the right side of all the pages as well. Removed "> **Note:** You must install Grafana 5.1+ in order to use the integrated MS SQL data source." Wait, why does this page exist if the data source page has the relevant updated content? https://grafana.com/docs/grafana/latest/datasources/mssql/ * makes prettier --------- Co-authored-by: Chris Moyer (cherry picked from commit 2b73f8cfd5220038fa4fce3fc975b1fa147f44d9) Co-authored-by: mallettjared <110853992+mallettjared@users.noreply.github.com> * [v9.2] Docs: Fix markup for URL (#65576) (#65654) Docs: Fix markup for URL (#65576) * Docs: Fix markup for URL * updates absolute URL to a relref --------- Co-authored-by: Chris Moyer (cherry picked from commit 940768cf76cc5dbf6df3bbbf5655b680300a1cf0) Co-authored-by: sarah-spang <86264026+sarah-spang@users.noreply.github.com> * [v9.2.x] CI: Partial backport of #59615 (#65704) [v9.2.x] Partial backport of #59615 * [v9.2.x] Alerting: Fix integration test for creating silences (#65722) (#65794) * [v9.2.x] Backport `#65797` and `#65806` to v9.2.x (#65854) * CI: Make `init-enterprise` depend on `grabpl` (#65797) Make init-enterprise depend on grabpl # Conflicts: # .drone.yml (cherry picked from commit 821633c796ef06ed9f52734af527e2e59eb8dbd8) # Conflicts: # .drone.yml * CI: Exclude cloud related tags from tag events (#65806) * Exclude cloud related tags * Fix starlark lint errors (cherry picked from commit a18ea77aacfc7e4a12b75d4668c68efd83f99f53) # Conflicts: # .drone.yml * [v9.2.x] Docs: Add transformations doc link for What's New v9.2 (#65848) Docs: Add transformations doc link for What's New v9.2 (#65673) * Add transformations doc link Add transformations doc link to `Transformations: INNER JOINs` section. Related issue: https://github.com/grafana/grafana/issues/65671 * Apply suggestions from code review Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> --------- Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> (cherry picked from commit b86c0bc4fa8a023dfe65eb3265888be91be742ee) Co-authored-by: Christine Wang * [v9.2.x] update enhanced-ldap (#65865) update enhanced-ldap (#65687) * update enhanced-ldap documenting a potential issue with ldap active sync, when search filter and username attributes do not match. * Update docs/sources/setup-grafana/configure-security/configure-authentication/enhanced-ldap/index.md * formats example * Update docs/sources/setup-grafana/configure-security/configure-authentication/enhanced-ldap/index.md --------- Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Chris Moyer (cherry picked from commit 99ac39f0d2470ca83c5817d5a51c80f1999fa676) Co-authored-by: annelaurefroment <49911675+annelaurefroment@users.noreply.github.com> * [v9.2.x] CI: Move release integration pipeline to standalone promotion pipeline (#65787) (#65803) (cherry picked from commit e9aef20eb4e09637ce826189dbb8a13e10a1fcdf) Backporting #65787 * [v9.2.x] Add --init to all podman invocations to ensure ^C works on MacOS (#61745) (#63556) (cherry picked from commit 5f5f51b3bfba1d3b6f04847f15f81d6b78b97ce4) Signed-off-by: Jack Baldry * [v9.2.x] Docs: define RBAC n/a for a scope (#65944) Docs: define RBAC n/a for a scope (#65782) * define n/a scope * Update docs/sources/administration/roles-and-permissions/access-control/custom-role-actions-scopes/index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * linting --------- Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> (cherry picked from commit 80444d60f98bb94a98e96d642a84b0a1bea042ea) Co-authored-by: Ieva * [v9.2.x] Build: Add CloudMode to build versions (#65986) Build: Add CloudMode to build versions (#65651) * Add CloudMode to build versions * Use linux-amd64 variant without musl for cloud mode * Add cloud mode to version folder on package upload * Use musl variant for CloudMode * Only sign rpm packages if there's any to sign * Remove trailing whitespace (cherry picked from commit 8f282b8a6edc35bed269d90f01af81b3b7ddc83e) Co-authored-by: Guilherme Caulada * [v9.2.x] Docs: Small fixes for Template Variables Doc (#66136) Docs: Small fixes for Template Variables Doc (#65947) * Docs: Small fixes for Template Variables Doc * Docs: Minor fix to Variables Docs - Added missing word * Update docs/sources/dashboards/variables/add-template-variables/index.md Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * empty commit to trigger linting * small change to trigger linting --------- Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> Co-authored-by: Isabel Matwawana (cherry picked from commit 3685dd56e1a33aae2b3b18a807fbc3574601bdc5) Co-authored-by: sarah-spang <86264026+sarah-spang@users.noreply.github.com> * [v9.2] docs: fixes link (#66051) (#66120) docs: fixes link (#66051) * fixes link * Update docs/sources/setup-grafana/configure-security/configure-authentication/enhanced-ldap/index.md Co-authored-by: melGL <81323402+melgl@users.noreply.github.com> --------- Co-authored-by: melGL <81323402+melgl@users.noreply.github.com> (cherry picked from commit 421b911c4524b6e9832c6e4d8d8a685f9f84ff7e) * [v9.2.x] Fix website build errors (#66114) Fix website build errors Signed-off-by: Jack Baldry * [v9.2.x] CI: Split `/bin/build artifacts *` subcommand (#66005) (#66340) CI: Split `/bin/build artifacts *` subcommand (#66005) * Split go files * Modify publishartifacts.go * Split main * FIXME: Temp add GCSCopy to gcloud/storage * Fix lint * Exported flags * Update starlark - make drone * Further backend lint fixes * Add fallback_test.go * Fix go imports order * make drone * Remove GCSCopy from static assets * Remove GCSCopy from storybook * Fix lint * Remove GCSCopy * Remove success logline * drone yaml cleanup * Add artifacts-editions flag * Fix starlark * Add default sting slice in artifacts packages command (cherry picked from commit 24d348f804d07be66705995375c5af0f0bdc65ef) # Conflicts: # .drone.yml * [v9.2.x] Build: Unified dockerfile for all builds (#66445) Backport 59615 to v9.2.x * CI: Remove COPY kinds kinds (#66465) Remove COPY kinds kinds * [v9.2.x] Chore: Upgrade Go to 1.20.1 and Alpine to 3.17 (#63891) (#66450) * [v9.2.x] Chore: Upgrade Go to 1.20.1 and Alpine to 3.17 (#63891) * Fix lint errors * Fix lint * Backport e2e cloud tests * Skip e2e azure * Skip e2e azure cloud tests * [v9.2.x]docs: update broken link (#66527) backport PR to fix broken link * [v9.2.x] Alerting: Update migration to put alerts to the default folder if dashboard folder is missing (#66591) * Alerting: Update migration to put alerts to the default folder if dashboard folder is missing (#65577) * extract function * use context logger * put alert to general folder if folder is missing * move folderHelper init * add test * Update pkg/services/sqlstore/migrations/ualert/ualert.go Co-authored-by: Matthew Jacobson --------- Co-authored-by: Matthew Jacobson (cherry picked from commit 7b2f44762e87ab0b1eee87ee36e7293a8a26885e) * rename ID to Id and dashboards.Dashboard to models.Dashboard --------- Co-authored-by: Yuri Tseretyan * [v9.2.x] docs: add missing alias (#66673) docs: add missing alias (#66621) added missing alias (cherry picked from commit 2b7f41f4dfaf7c2d17f6648fc9c7cc8596c6a91a) Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * Chore: Upgrade Go to 1.20.3 (#66844) Backport of #66264 * [v9.2.x] [docs] remove auth/saml alias from team sync page (#66853) [docs] remove auth/saml alias from team sync page (#66796) removed auth/saml alias from team sync page (cherry picked from commit 60e6ff10386e05744ba87501dc70a885c69f4667) Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * [v9.2.x] Docs: adds legacy wording to api docs (#66939) Docs: adds legacy wording to api docs (#66937) adds legacy wording to api docs (cherry picked from commit 9b529ef0cde187ce8e5c70acf00d4bdc86f651b0) Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> * [v9.2.x] Doc: Fix typo (#67240) Doc: Fix typo (#66929) Update index.md (cherry picked from commit ff617722182aa75421bb4df3d69d069844839d82) Co-authored-by: oneoneonepig * Release: Bump version to 9.2.18 (#67255) "Release: Updated versions in package to 9.2.18" * AuthJWT: Fix JWT query param leak (CVE-2023-1387) [9.2.x] (#841) * fix JWT query param leak Co-authored-by: Gabriel MABILLE Co-authored-by: Kalle Persson * skip broken test --------- Co-authored-by: jguer Co-authored-by: Gabriel MABILLE Co-authored-by: Kalle Persson * [v9.2.x] Chore: Update SAML lib (#842) * AuthJWT: Fix JWT query param leak (CVE-2023-1387) [9.2.x] (#827) * fix JWT query param leak Co-authored-by: Gabriel MABILLE Co-authored-by: Kalle Persson * skip broken test --------- Co-authored-by: Gabriel MABILLE Co-authored-by: Kalle Persson * Update SAML lib * Replace golang.org/x/net with v0.7.0 * Revert "Replace golang.org/x/net with v0.7.0" This reverts commit 5df9a41749131aff2cedd26885429b99fdc4c3fd. --------- Co-authored-by: Jo Co-authored-by: Gabriel MABILLE Co-authored-by: Kalle Persson Co-authored-by: Mihaly Gyongyosi * [v9.2.x] Influxdb: Handle legacy Influxdb influxql annotations with target in migration (#67501) Influxdb: Handle legacy Influxdb influxql annotations with target in migration (#63225) * handle legacy influxdb annotations with target in migration * add types * don't check tags that are empty strings and give annotation a type (cherry picked from commit 7a3f7e26cefb2a85c8762ff24960eeb69cf33236) Co-authored-by: Brendan O'Handley * [v9.2.x] Grafana Cloud: Add `VariantLinuxAmd64` in build variants (#67526) Grafana Cloud: Add `VariantLinuxAmd64` in build variants (#66167) Add VariantLinuxAmd64 in build variants (cherry picked from commit 8dd87a79f7632035f867679a065d1dbc60116c98) Co-authored-by: Dimitris Sotirakis * [v9.2.x] Grafana Cloud: Put cloud artifacts to `*/release` dir (#67531) Grafana Cloud: Put cloud artifacts to `*/release` dir (#66168) Put cloud artifacts to */release dir (cherry picked from commit a2634495e53f9c6f762d0941e0d24fa819c48bb6) Co-authored-by: Dimitris Sotirakis * [v9.2.x] docs: move misplaced Configure legend page (#67668) docs: move misplaced Configure legend page (#67597) * move configure legend page and add alias * updated page weight and tried fixing alias * fixed alias * add preemptive alias for current page location * apply suggestion from review Co-authored-by: Jack Baldry * apply suggestions from review Co-authored-by: Jack Baldry * apply suggestions from review Co-authored-by: Jack Baldry --------- Co-authored-by: Jack Baldry (cherry picked from commit 688459f25c79b80872d08dd8e18abc341986999c) Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * [v9.2.x] Chore: Upgrade Go to 1.20.4 (#67761) Chore: Upgrade Go to 1.20.4 * [v9.2.x] CI: Add Windows backend tests in more places (#66438) (#68010) * CI: Add Windows backend tests in more places * CI: Add promotion pipeline for publishing new windows-test-images * CI: Ignore windows backend-test failures for now * CI: Fix linting issue in ci_images.star file (cherry picked from commit b2fc285a5ddaa25265aea9a137fb37512ecdaf57) Backport of https://github.com/grafana/grafana/pull/66438 * [v9.2.x] Prometheus: bug in creating autocomplete queries with labels (#68026) * Prometheus: bug in creating autocomplete queries with labels (#68003) Fix bug formatting multiple prometheus labels when doing metric query (cherry picked from commit a1bc1bd36855f1ad37dc5aba82984de890645c5a) * [v9.2.x] CI: Remove custom enterprise2 pipelines (#68056) (#68061) CI: Remove custom enterprise2 pipelines (#68056) Remove custom enterprise2 pipelines (cherry picked from commit 6ae952c7c5d7510977a335a7be2ab13968433291) * [v9.2.x] CI: Remove windows backend tests from release pipelines (#68166) (#68202) CI: Remove windows backend tests from release pipelines (#68166) Remove windows backend tests from release pipelines These are run in other places so there is no benefit to also include them here. (cherry picked from commit 1e8cad625bcecc48ae8bc6eeb0284633fde9be10) * [v9.2.x] CI: Move windows-tests into promotion pipeline (#68218) (#68235) (cherry picked from commit acd02e8a4848091bd8f548478c430f3c5d707682) Backport of https://github.com/grafana/grafana/pull/68218 * Release: Bump version to 9.2.19 (#68258) "Release: Updated versions in package to 9.2.19" * [v9.2.x] Changelog: Updated changelog for 9.2.18 (#68256) (#68257) Changelog: Updated changelog for 9.2.18 (#68256) (cherry picked from commit be918e04467978877bf08c3346be8b372ccea1db) Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * [v9.2.x] CI: Add `.drone.yml` in pathschanged trigger for `lint_backend` pipeline (#68348) (#68365) CI: Add `.drone.yml` in pathschanged trigger for `lint_backend` pipeline (#68348) Add .drone.yml in pathschanged for lint_backend (cherry picked from commit b7b13067a5d4269a9fe832a7decc28328f2f41ea) # Conflicts: # .drone.yml * [v9.2.x] CI: Update grabpl to 3.0.34 (#68456) (#68461) CI: Update grabpl to 3.0.34 (#68456) * CI: Port of init-enterprise fix from 9.4.10 * CI: Update grabpl to 3.0.34 (cherry picked from commit 35ccfa6131355b03f9a689d05064d5350d9f1c89) * [v9.2.x] CI: Add delivery bot secrets to publish images step (#68467) (#68469) CI: Add delivery bot secrets to publish images step (#68467) Add delivery bot secrets (cherry picked from commit 55622615ded8205ddeb466f14d6e5efd41a165bd) # Conflicts: # .drone.yml # scripts/drone/vault.star * [v9.2.x] G10: Post `docker pull` commands for local testing (#67489) (#68682) * G10: Post `docker pull` commands for local testing (#67489) * Add grabpl publish images Update grabpl - add github pr token * Replace github_pr_token with gh app # Conflicts: # .drone.yml # scripts/drone/vault.star # Conflicts: # .drone.yml # Conflicts: # .drone.yml * Lint starlark Add forgotten secrets Lint starlark Change secrets * Update grabpl to v3.0.35 * Lint starlark * Remove unnecessary secrets (cherry picked from commit 26bacf6d4c010d35202ad38f254b2ec2f5f9b5e3) # Conflicts: # .drone.yml * Update grabpl to v3.0.36 * [v9.2.x] Docker images: Don't fail if a PR comes from a fork (#68765) (#68779) Docker images: Don't fail if a PR comes from a fork (#68765) * Update grabpl * Allow publish images to fail for PRs (cherry picked from commit 04e2d9055de58224c5c186d75aaf7b60b48c7421) # Conflicts: # .drone.yml * [v9.2.x] Auth: Remove the session cookie only if it's invalid or revoked (#68795) Auth: Remove the session cookie only if it's invalid or revoked (#65984) Remove the cookie if it's invalid or revoked (cherry picked from commit 4cac95d1c22cc553723ceb72218b3167b8d13dcf) * [v9.2.x] Require alert.notifications:write permissions to test receivers and templates (#870) Require alert.notifications:write permissions to test receivers and templates (#865) (cherry picked from commit 3c21ab70075256d4ba8e4fbfdcb15f5a394161fa) * Auth: Remove Email Lookup from oauth integrations 9.2 (#898) backport https://github.com/grafana/grafana-private-mirror/pull/894 to 9.3.x * Release: Bump version to 9.2.20 (#902) "Release: Updated versions in package to 9.2.20" --------- Signed-off-by: Jack Baldry Signed-off-by: bergquist Co-authored-by: Eric Leijonmarck Co-authored-by: Ryan McKinley Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com> Co-authored-by: Oscar Kilhed Co-authored-by: Josh Hunt Co-authored-by: Andres Martinez Gotor Co-authored-by: dessen-xu <1805680163@qq.com> Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> Co-authored-by: Emil Tullstedt Co-authored-by: Si Mon <85333972+siiimooon@users.noreply.github.com> Co-authored-by: Zoltán Bedi Co-authored-by: George Robinson Co-authored-by: Neel <47709856+neel1996@users.noreply.github.com> Co-authored-by: Dimitris Sotirakis Co-authored-by: Marcus Efraimsson Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Will Jordan Co-authored-by: Ben Sully Co-authored-by: Julien Duchesne Co-authored-by: Dan Cech Co-authored-by: Adam Simpson Co-authored-by: Joe Blubaugh Co-authored-by: xiyu95 <112968312+xiyu95@users.noreply.github.com> Co-authored-by: Will Browne Co-authored-by: Gareth Dawson Co-authored-by: Ashley Harrison Co-authored-by: Giuseppe Guerra Co-authored-by: Nathan Marrs Co-authored-by: Alexa V <239999+axelavargas@users.noreply.github.com> Co-authored-by: Joey Tawadrous <90795735+joey-grafana@users.noreply.github.com> Co-authored-by: Timur Olzhabayev Co-authored-by: ismail simsek Co-authored-by: Karl Persson Co-authored-by: Jack Westbrook Co-authored-by: Garrett Guillotte <100453168+gguillotte-grafana@users.noreply.github.com> Co-authored-by: Vũ Quốc Phong Co-authored-by: Daniel Lee Co-authored-by: Jo Co-authored-by: Mihaly Gyongyosi Co-authored-by: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com> Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> Co-authored-by: Jack Baldry Co-authored-by: Kyle Brandt Co-authored-by: matt abrams <37156449+zuchka@users.noreply.github.com> Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com> Co-authored-by: Leon Sorokin Co-authored-by: Bart Peeters Co-authored-by: Sven Grossmann Co-authored-by: Yann Vigara Co-authored-by: owensmallwood Co-authored-by: Ieva Co-authored-by: Leo <108552997+lpskdl@users.noreply.github.com> Co-authored-by: Gabriel MABILLE Co-authored-by: Will Browne Co-authored-by: Andreas Christou Co-authored-by: Serge Zaitsev Co-authored-by: Carl Bergquist Co-authored-by: gamab Co-authored-by: kay delaney Co-authored-by: Isabella Siu Co-authored-by: Brendan O'Handley Co-authored-by: Alex Moreno Co-authored-by: Eve Meelan <81647476+Eve832@users.noreply.github.com> Co-authored-by: Matthew Jacobson Co-authored-by: Robby Milo Co-authored-by: Esteban Beltran Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com> Co-authored-by: Taewoo K Co-authored-by: linoman <2051016+linoman@users.noreply.github.com> Co-authored-by: Marcus Andersson Co-authored-by: Levente Balogh Co-authored-by: Artur Wierzbicki Co-authored-by: Leonard Gram Co-authored-by: Kevin Minehart Co-authored-by: Usman Ahmad <69509548+usmangt@users.noreply.github.com> Co-authored-by: Horst Gutmann Co-authored-by: Torkel Ödegaard Co-authored-by: Hamas Shafiq Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> Co-authored-by: Kyle Cunningham Co-authored-by: Andrej Ocenas Co-authored-by: Jimmie Han Co-authored-by: Gilles De Mey Co-authored-by: Ludovic Viaud Co-authored-by: David Allen Co-authored-by: sarah-spang <86264026+sarah-spang@users.noreply.github.com> Co-authored-by: mallettjared <110853992+mallettjared@users.noreply.github.com> Co-authored-by: Jean-Philippe Quéméner Co-authored-by: Christine Wang Co-authored-by: annelaurefroment <49911675+annelaurefroment@users.noreply.github.com> Co-authored-by: Guilherme Caulada Co-authored-by: Yuri Tseretyan Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> Co-authored-by: oneoneonepig Co-authored-by: jguer Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> --- .drone.star | 12 +- .drone.yml | 895 +- .github/CODEOWNERS | 7 - CHANGELOG.md | 5 + .../visualizations/configure-legend/index.md | 28 +- lerna.json | 2 +- package.json | 2 +- packages/grafana-data/package.json | 4 +- packages/grafana-e2e-selectors/package.json | 2 +- packages/grafana-e2e/package.json | 4 +- packages/grafana-runtime/package.json | 8 +- packages/grafana-schema/package.json | 2 +- packages/grafana-toolkit/package.json | 6 +- packages/grafana-ui/package.json | 8 +- packages/jaeger-ui-components/package.json | 10 +- pkg/api/login_oauth.go | 17 +- pkg/build/packaging/deb.go | 4 + pkg/services/alerting/store_test.go | 1 - pkg/services/ngalert/api/authorization.go | 2 +- pkg/services/ngalert/api/tooling/api.json | 34 + pkg/services/ngalert/api/tooling/post.json | 3 + pkg/services/ngalert/api/tooling/spec.json | 3 + pkg/setting/setting.go | 5 +- .../internal/input-datasource/package.json | 8 +- public/api-merged.json | 8112 +++++++++++------ public/api-spec.json | 7323 ++++++++++----- .../StorageLocationDetails.tsx | 1 + scripts/drone/events/main.star | 3 - scripts/drone/events/pr.star | 12 +- scripts/drone/events/release.star | 34 +- scripts/drone/pipelines/build.star | 14 + scripts/drone/pipelines/test_backend.star | 3 - scripts/drone/pipelines/windows.star | 12 +- scripts/drone/steps/lib.star | 30 +- scripts/drone/vault.star | 16 + yarn.lock | 54 +- 36 files changed, 10513 insertions(+), 6173 deletions(-) diff --git a/.drone.star b/.drone.star index db76fbd9dee1..3387b6b187d4 100644 --- a/.drone.star +++ b/.drone.star @@ -31,6 +31,10 @@ load( ) load("scripts/drone/pipelines/github.star", "publish_github_pipeline") load("scripts/drone/pipelines/aws_marketplace.star", "publish_aws_marketplace_pipeline") +load( + "scripts/drone/pipelines/windows.star", + "windows_test_backend", +) load("scripts/drone/version.star", "version_branch_pipelines") load("scripts/drone/events/cron.star", "cronjobs") load("scripts/drone/vault.star", "secrets") @@ -42,10 +46,6 @@ def main(_ctx): oss_pipelines() + enterprise_pipelines() + enterprise2_pipelines() + - enterprise2_pipelines( - prefix = "custom-", - trigger = {"event": ["custom"]}, - ) + publish_image_pipelines_public() + publish_image_pipelines_security() + publish_github_pipeline("public") + @@ -55,6 +55,10 @@ def main(_ctx): publish_artifacts_pipelines("public") + publish_npm_pipelines() + publish_packages_pipeline() + + [windows_test_backend({ + "event": ["promote"], + "target": ["test-windows"], + }, "oss", "testing")] + artifacts_page_pipeline() + version_branch_pipelines() + integration_test_pipelines() + diff --git a/.drone.yml b/.drone.yml index 7e7e84e4ea39..9edaab22ee1f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -120,7 +120,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -362,56 +362,6 @@ environment: image_pull_secrets: - dockerconfigjson kind: pipeline -name: pr-oss-test-backend-windows -platform: - arch: amd64 - os: windows - version: "1809" -services: [] -steps: -- commands: [] - image: grafana/grafana-ci-windows-test:0.1.0 - name: windows-init -- commands: - - go install github.com/google/wire/cmd/wire@v0.5.0 - - wire gen -tags oss ./pkg/server - depends_on: - - windows-init - image: grafana/grafana-ci-windows-test:0.1.0 - name: wire-install -- commands: - - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... - depends_on: - - wire-install - failure: ignore - image: grafana/grafana-ci-windows-test:0.1.0 - name: test-backend -trigger: - event: - - pull_request - paths: - exclude: - - docs/** - - '*.md' - - pkg/** - - packaging/** - - go.sum - - go.mod - include: [] -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -clone: - retries: 3 -depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline name: pr-lint-backend node: type: no-parallel @@ -476,6 +426,7 @@ trigger: include: - pkg/** - packaging/** + - .drone.yml - conf/** - go.sum - go.mod @@ -510,7 +461,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -781,6 +732,41 @@ steps: volumes: - name: docker path: /var/run/docker.sock +- commands: + - ./bin/build build-docker --edition oss --ubuntu -archs amd64 + depends_on: + - copy-packages-for-docker + - compile-build-cmd + environment: + GCP_KEY: + from_secret: gcp_key + image: google/cloud-sdk + name: build-docker-images-ubuntu + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana + depends_on: + - build-docker-images + - build-docker-images-ubuntu + environment: + DOCKER_PASSWORD: + from_secret: docker_password_pr + DOCKER_USER: + from_secret: docker_username_pr + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key + failure: ignore + image: google/cloud-sdk + name: publish-images-grafana + volumes: + - name: docker + path: /var/run/docker.sock trigger: event: - pull_request @@ -853,7 +839,7 @@ steps: name: clone-enterprise - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1143,7 +1129,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1385,7 +1371,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1681,6 +1667,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-grafana/grafana volumes: @@ -1701,6 +1693,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-grafana/grafana-oss volumes: @@ -1808,7 +1806,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1916,7 +1914,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/windows/grabpl.exe -OutFile grabpl.exe image: grafana/ci-wix:0.1.1 name: windows-init @@ -1963,127 +1961,6 @@ volumes: clone: retries: 3 depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: main-oss-test-backend-windows -platform: - arch: amd64 - os: windows - version: "1809" -services: [] -steps: -- commands: [] - image: grafana/grafana-ci-windows-test:0.1.0 - name: windows-init -- commands: - - go install github.com/google/wire/cmd/wire@v0.5.0 - - wire gen -tags oss ./pkg/server - depends_on: - - windows-init - image: grafana/grafana-ci-windows-test:0.1.0 - name: wire-install -- commands: - - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... - depends_on: - - wire-install - failure: ignore - image: grafana/grafana-ci-windows-test:0.1.0 - name: test-backend -trigger: - branch: main - event: - - push - paths: - exclude: - - '*.md' - - docs/** - - latest.json -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -clone: - disable: true -depends_on: [] -environment: - EDITION: enterprise -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: main-enterprise-test-backend-windows -platform: - arch: amd64 - os: windows - version: "1809" -services: [] -steps: -- commands: - - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe - -OutFile grabpl.exe - image: grafana/ci-wix:0.1.1 - name: grabpl -- commands: - - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - - cd grafana-enterprise - - git checkout main - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/ci-wix:0.1.1 - name: clone -- commands: - - cp -r grafana-enterprise C:\App\grafana-enterprise - - rm -r -force grafana-enterprise - - cp grabpl.exe C:\App\grabpl.exe - - rm -force grabpl.exe - - C:\App\grabpl.exe init-enterprise --github-token $$env:GITHUB_TOKEN C:\App\grafana-enterprise - main - - cp C:\App\grabpl.exe grabpl.exe - depends_on: - - clone - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/ci-wix:0.1.1 - name: windows-init -- commands: - - go install github.com/google/wire/cmd/wire@v0.5.0 - - wire gen -tags enterprise ./pkg/server - depends_on: - - windows-init - image: grafana/grafana-ci-windows-test:0.1.0 - name: wire-install -- commands: - - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... - depends_on: - - wire-install - failure: ignore - image: grafana/grafana-ci-windows-test:0.1.0 - name: test-backend -trigger: - branch: main - event: - - push - paths: - exclude: - - '*.md' - - docs/** - - latest.json -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -clone: - retries: 3 -depends_on: [] kind: pipeline name: notify-drone-changes platform: @@ -2216,7 +2093,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2519,7 +2396,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2626,59 +2503,11 @@ volumes: path: /var/run/docker.sock name: docker --- -clone: - retries: 3 -depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: release-oss-test-backend-windows -platform: - arch: amd64 - os: windows - version: "1809" -services: [] -steps: -- commands: [] - image: grafana/grafana-ci-windows-test:0.1.0 - name: windows-init -- commands: - - go install github.com/google/wire/cmd/wire@v0.5.0 - - wire gen -tags oss ./pkg/server - depends_on: - - windows-init - image: grafana/grafana-ci-windows-test:0.1.0 - name: wire-install -- commands: - - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... - depends_on: - - wire-install - failure: ignore - image: grafana/grafana-ci-windows-test:0.1.0 - name: test-backend -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- clone: retries: 3 depends_on: - release-oss-build-e2e-publish - release-oss-test-frontend -- release-oss-test-backend-windows environment: EDITION: oss image_pull_secrets: @@ -2697,7 +2526,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/windows/grabpl.exe -OutFile grabpl.exe image: grafana/ci-wix:0.1.1 name: windows-init @@ -2757,7 +2586,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3043,7 +2872,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3141,7 +2970,7 @@ steps: name: clone-enterprise - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3236,307 +3065,59 @@ platform: services: [] steps: - commands: - - echo $env:DRONE_RUNNER_NAME - image: mcr.microsoft.com/windows:1809 - name: identify-runner -- commands: - - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe - -OutFile grabpl.exe - - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - - cd grafana-enterprise - - git checkout ${DRONE_TAG} - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/ci-wix:0.1.1 - name: clone -- commands: - - cp -r grafana-enterprise C:\App\grafana-enterprise - - rm -r -force grafana-enterprise - - cp grabpl.exe C:\App\grabpl.exe - - rm -force grabpl.exe - - C:\App\grabpl.exe init-enterprise --github-token $$env:GITHUB_TOKEN C:\App\grafana-enterprise - ${DRONE_TAG} - - cp C:\App\grabpl.exe grabpl.exe - depends_on: - - clone - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/ci-wix:0.1.1 - name: windows-init -- commands: - - $$gcpKey = $$env:GCP_KEY - - '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey)) - > gcpkey.json' - - dos2unix gcpkey.json - - gcloud auth activate-service-account --key-file=gcpkey.json - - rm gcpkey.json - - cp C:\App\nssm-2.24.zip . - - .\grabpl.exe windows-installer --edition enterprise ${DRONE_TAG} - - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] - - gsutil cp $$fname gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/enterprise/release/ - - gsutil cp "$$fname.sha256" gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/enterprise/release/ - depends_on: - - windows-init - environment: - GCP_KEY: - from_secret: gcp_key - GITHUB_TOKEN: - from_secret: github_token - PRERELEASE_BUCKET: - from_secret: prerelease_bucket - image: grafana/ci-wix:0.1.1 - name: build-windows-installer -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -clone: - disable: true -depends_on: [] -environment: - EDITION: enterprise2 -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: release-enterprise2-build-e2e-publish -node: - type: no-parallel -platform: - arch: amd64 - os: linux -services: [] -steps: -- commands: - - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl - - chmod +x bin/grabpl - image: byrnedo/alpine-curl:0.1.8 - name: grabpl -- commands: - - echo $DRONE_RUNNER_NAME - image: alpine:3.17.1 - name: identify-runner -- commands: - - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - - cd grafana-enterprise - - git checkout ${DRONE_TAG} - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/build-container:1.7.4 - name: clone-enterprise -- commands: - - mv bin/grabpl /tmp/ - - rmdir bin - - mv grafana-enterprise /tmp/ - - /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise - ${DRONE_TAG} - - mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json - - mkdir bin - - mv /tmp/grabpl bin/ - depends_on: - - clone-enterprise - - grabpl - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/build-container:1.7.4 - name: init-enterprise -- commands: - - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd - depends_on: - - init-enterprise - environment: - CGO_ENABLED: 0 - image: golang:1.20.4 - name: compile-build-cmd -- commands: - - make gen-go - depends_on: - - init-enterprise - image: grafana/build-container:1.7.4 - name: wire-install -- commands: - - yarn install --immutable - depends_on: - - init-enterprise - image: grafana/build-container:1.7.4 - name: yarn-install -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - depends_on: - - init-enterprise - image: grafana/build-container:1.7.4 - name: verify-gen-cue -- commands: - - ./bin/build build-frontend --jobs 8 --edition enterprise ${DRONE_TAG} - depends_on: - - compile-build-cmd - - yarn-install - environment: - NODE_OPTIONS: --max_old_space_size=8192 - image: grafana/build-container:1.7.4 - name: build-frontend -- commands: - - ./bin/build build-frontend-packages --jobs 8 --edition enterprise ${DRONE_TAG} - depends_on: - - compile-build-cmd - - yarn-install - environment: - NODE_OPTIONS: --max_old_space_size=8192 - image: grafana/build-container:1.7.4 - name: build-frontend-packages -- commands: - - ./bin/build build-plugins --jobs 8 --edition enterprise - depends_on: - - compile-build-cmd - - yarn-install - environment: - GRAFANA_API_KEY: - from_secret: grafana_api_key - image: grafana/build-container:1.7.4 - name: build-plugins -- commands: - - ./bin/build build-backend --jobs 8 --edition enterprise2 ${DRONE_TAG} - depends_on: - - wire-install - - compile-build-cmd - image: grafana/build-container:1.7.4 - name: build-backend-enterprise2 -- commands: - - ./bin/build package --jobs 8 --edition enterprise2 --sign ${DRONE_TAG} - depends_on: - - build-plugins - - build-backend-enterprise2 - - build-frontend - - build-frontend-packages - environment: - GPG_KEY_PASSWORD: - from_secret: packages_gpg_passphrase - GPG_PRIV_KEY: - from_secret: packages_gpg_private_key - GPG_PUB_KEY: - from_secret: packages_gpg_public_key - GRAFANA_API_KEY: - from_secret: grafana_api_key - image: grafana/build-container:1.7.4 - name: package-enterprise2 -- commands: - - ./bin/build upload-cdn --edition enterprise2 - depends_on: - - package-enterprise2 - environment: - ENTERPRISE2_CDN_PATH: - from_secret: enterprise2-cdn-path - GCP_KEY: - from_secret: gcp_key - PRERELEASE_BUCKET: - from_secret: prerelease_bucket - image: grafana/grafana-ci-deploy:1.3.3 - name: upload-cdn-assets-enterprise2 -- commands: - - ls dist/*.tar.gz* - - cp dist/*.tar.gz* packaging/docker/ - depends_on: - - package-enterprise2 - image: grafana/build-container:1.7.4 - name: copy-packages-for-docker -- commands: - - ./bin/build build-docker --edition enterprise2 --shouldSave - depends_on: - - copy-packages-for-docker - - compile-build-cmd - environment: - DOCKER_ENTERPRISE2_REPO: - from_secret: docker_enterprise2_repo - GCP_KEY: - from_secret: gcp_key - image: google/cloud-sdk - name: build-docker-images - volumes: - - name: docker - path: /var/run/docker.sock -- commands: - - ./bin/build build-docker --edition enterprise2 --shouldSave --ubuntu - depends_on: - - copy-packages-for-docker - - compile-build-cmd - environment: - DOCKER_ENTERPRISE2_REPO: - from_secret: docker_enterprise2_repo - GCP_KEY: - from_secret: gcp_key - image: google/cloud-sdk - name: build-docker-images-ubuntu - volumes: - - name: docker - path: /var/run/docker.sock + - echo $env:DRONE_RUNNER_NAME + image: mcr.microsoft.com/windows:1809 + name: identify-runner - commands: - - ./bin/build artifacts docker fetch --edition enterprise2 - depends_on: - - build-docker-images - - build-docker-images-ubuntu + - $$ProgressPreference = "SilentlyContinue" + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/windows/grabpl.exe + -OutFile grabpl.exe + - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" + - cd grafana-enterprise + - git checkout ${DRONE_TAG} environment: - DOCKER_ENTERPRISE2_REPO: - from_secret: docker_enterprise2_repo - DOCKER_PASSWORD: - from_secret: docker_password - DOCKER_USER: - from_secret: docker_username - GCP_KEY: - from_secret: gcp_key - image: google/cloud-sdk - name: fetch-images-enterprise2 - volumes: - - name: docker - path: /var/run/docker.sock + GITHUB_TOKEN: + from_secret: github_token + image: grafana/ci-wix:0.1.1 + name: clone - commands: - - ./bin/build artifacts docker publish-enterprise2 --dockerhub-repo $${DOCKER_ENTERPRISE2_REPO} + - cp -r grafana-enterprise C:\App\grafana-enterprise + - rm -r -force grafana-enterprise + - cp grabpl.exe C:\App\grabpl.exe + - rm -force grabpl.exe + - C:\App\grabpl.exe init-enterprise --github-token $$env:GITHUB_TOKEN C:\App\grafana-enterprise + ${DRONE_TAG} + - cp C:\App\grabpl.exe grabpl.exe depends_on: - - fetch-images-enterprise2 + - clone environment: - DOCKER_ENTERPRISE2_REPO: - from_secret: docker_enterprise2_repo - DOCKER_PASSWORD: - from_secret: docker_password - DOCKER_USER: - from_secret: docker_username - GCP_KEY: - from_secret: gcp_key_hg - image: google/cloud-sdk - name: publish-images-enterprise2 - volumes: - - name: docker - path: /var/run/docker.sock + GITHUB_TOKEN: + from_secret: github_token + image: grafana/ci-wix:0.1.1 + name: windows-init - commands: - - ./bin/build upload-packages --edition enterprise2 + - $$gcpKey = $$env:GCP_KEY + - '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey)) + > gcpkey.json' + - dos2unix gcpkey.json + - gcloud auth activate-service-account --key-file=gcpkey.json + - rm gcpkey.json + - cp C:\App\nssm-2.24.zip . + - .\grabpl.exe windows-installer --edition enterprise ${DRONE_TAG} + - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] + - gsutil cp $$fname gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/enterprise/release/ + - gsutil cp "$$fname.sha256" gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/enterprise/release/ depends_on: - - package-enterprise2 + - windows-init environment: GCP_KEY: from_secret: gcp_key + GITHUB_TOKEN: + from_secret: github_token PRERELEASE_BUCKET: from_secret: prerelease_bucket - image: grafana/grafana-ci-deploy:1.3.3 - name: upload-packages-enterprise2 + image: grafana/ci-wix:0.1.1 + name: build-windows-installer trigger: event: exclude: @@ -3549,14 +3130,8 @@ trigger: type: docker volumes: - host: - path: /var/run/docker.sock + path: //./pipe/docker_engine/ name: docker -- name: postgres - temp: - medium: memory -- name: mysql - temp: - medium: memory --- clone: disable: true @@ -3566,7 +3141,7 @@ environment: image_pull_secrets: - dockerconfigjson kind: pipeline -name: custom-release-enterprise2-build-e2e-publish +name: release-enterprise2-build-e2e-publish node: type: no-parallel platform: @@ -3576,7 +3151,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3587,7 +3162,7 @@ steps: - commands: - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise - - git checkout ${DRONE_TARGET_BRANCH} + - git checkout ${DRONE_TAG} environment: GITHUB_TOKEN: from_secret: github_token @@ -3775,6 +3350,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key_hg + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-enterprise2 volumes: @@ -3793,7 +3374,13 @@ steps: name: upload-packages-enterprise2 trigger: event: - - custom + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* type: docker volumes: - host: @@ -3828,7 +3415,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3869,6 +3456,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-grafana/grafana volumes: @@ -3886,6 +3479,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-grafana/grafana-oss volumes: @@ -3924,7 +3523,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3965,6 +3564,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-grafana/grafana-enterprise volumes: @@ -4003,7 +3608,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -4044,6 +3649,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-grafana/grafana-enterprise volumes: @@ -4621,6 +4232,58 @@ volumes: clone: disable: true depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- dockerconfigjson +kind: pipeline +name: testing-oss-test-backend-windows +platform: + arch: amd64 + os: windows + version: "1809" +services: [] +steps: +- commands: + - git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" . + - git checkout -f $$env:DRONE_COMMIT + environment: + GITHUB_TOKEN: + from_secret: github_token + image: grafana/ci-wix:0.1.1 + name: clone +- commands: [] + depends_on: + - clone + image: grafana/grafana-ci-windows-test:0.1.0 + name: windows-init +- commands: + - go install github.com/google/wire/cmd/wire@v0.5.0 + - wire gen -tags oss ./pkg/server + depends_on: + - windows-init + image: grafana/grafana-ci-windows-test:0.1.0 + name: wire-install +- commands: + - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... + depends_on: + - wire-install + image: grafana/grafana-ci-windows-test:0.1.0 + name: test-backend +trigger: + event: + - promote + target: + - test-windows +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker +--- +clone: + disable: true +depends_on: [] environment: EDITION: enterprise image_pull_secrets: @@ -4636,7 +4299,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -4715,7 +4378,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -4994,7 +4657,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -5097,115 +4760,6 @@ environment: image_pull_secrets: - dockerconfigjson kind: pipeline -name: release-branch-oss-test-backend-windows -platform: - arch: amd64 - os: windows - version: "1809" -services: [] -steps: -- commands: [] - image: grafana/grafana-ci-windows-test:0.1.0 - name: windows-init -- commands: - - go install github.com/google/wire/cmd/wire@v0.5.0 - - wire gen -tags oss ./pkg/server - depends_on: - - windows-init - image: grafana/grafana-ci-windows-test:0.1.0 - name: wire-install -- commands: - - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... - depends_on: - - wire-install - failure: ignore - image: grafana/grafana-ci-windows-test:0.1.0 - name: test-backend -trigger: - ref: - - refs/heads/v[0-9]* -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -clone: - disable: true -depends_on: [] -environment: - EDITION: enterprise -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: release-branch-enterprise-test-backend-windows -platform: - arch: amd64 - os: windows - version: "1809" -services: [] -steps: -- commands: - - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe - -OutFile grabpl.exe - image: grafana/ci-wix:0.1.1 - name: grabpl -- commands: - - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - - cd grafana-enterprise - - git checkout $$env:DRONE_BRANCH - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/ci-wix:0.1.1 - name: clone -- commands: - - cp -r grafana-enterprise C:\App\grafana-enterprise - - rm -r -force grafana-enterprise - - cp grabpl.exe C:\App\grabpl.exe - - rm -force grabpl.exe - - C:\App\grabpl.exe init-enterprise --github-token $$env:GITHUB_TOKEN C:\App\grafana-enterprise - $$env:DRONE_BRANCH - - cp C:\App\grabpl.exe grabpl.exe - depends_on: - - clone - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/ci-wix:0.1.1 - name: windows-init -- commands: - - go install github.com/google/wire/cmd/wire@v0.5.0 - - wire gen -tags enterprise ./pkg/server - depends_on: - - windows-init - image: grafana/grafana-ci-windows-test:0.1.0 - name: wire-install -- commands: - - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... - depends_on: - - wire-install - failure: ignore - image: grafana/grafana-ci-windows-test:0.1.0 - name: test-backend -trigger: - ref: - - refs/heads/v[0-9]* -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -clone: - retries: 3 -depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline name: release-branch-oss-integration-tests node: type: no-parallel @@ -5236,7 +4790,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -5311,7 +4865,6 @@ clone: depends_on: - release-branch-oss-build-e2e-publish - release-branch-oss-test-frontend -- release-branch-oss-test-backend-windows environment: EDITION: oss image_pull_secrets: @@ -5330,7 +4883,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/windows/grabpl.exe -OutFile grabpl.exe image: grafana/ci-wix:0.1.1 name: windows-init @@ -5380,7 +4933,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -5672,7 +5225,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -5763,7 +5316,7 @@ steps: name: clone-enterprise - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -5876,7 +5429,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -6018,7 +5571,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/windows/grabpl.exe -OutFile grabpl.exe - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise @@ -6089,7 +5642,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -6289,6 +5842,12 @@ steps: from_secret: docker_username GCP_KEY: from_secret: gcp_key_hg + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key image: google/cloud-sdk name: publish-images-enterprise2 volumes: @@ -6358,7 +5917,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -6473,7 +6032,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.37/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -6926,7 +6485,25 @@ get: kind: secret name: enterprise2_security_prefix --- +get: + name: app-id + path: infra/data/ci/grafana-release-eng/grafana-delivery-bot +kind: secret +name: delivery-bot-app-id +--- +get: + name: app-installation-id + path: infra/data/ci/grafana-release-eng/grafana-delivery-bot +kind: secret +name: delivery-bot-app-installation-id +--- +get: + name: app-private-key + path: infra/data/ci/grafana-release-eng/grafana-delivery-bot +kind: secret +name: delivery-bot-app-private-key +--- kind: signature -hmac: 74d07313b535ea68d5cbc704b3bd0d88cb2a100b627fd34cf5c43fc5fb90d06e +hmac: 462fc8e153052bdb786a26a31e1f5884cf9ad55999da14e7f5db315568c7f882 ... \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5b3546d204f9..ab6368eb9e1e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -218,13 +218,6 @@ WORKFLOW.md @torkelo /packaging/ @DanCech -# Backend code, developers environment -/devenv/docker/blocks/auth @grafana/grafana-authnz-team - -# Logs code, developers environment -/devenv/docker/blocks/loki* @grafana/observability-logs -/devenv/docker/blocks/elastic* @grafana/observability-logs - # Continuous Integration .drone.yml @grafana/grafana-delivery .drone.star @grafana/grafana-delivery diff --git a/CHANGELOG.md b/CHANGELOG.md index 227e9dcaaf98..9ed7b6678117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,11 @@ - **Tooltips:** Make tooltips in FormField and FormLabel interactive and keyboard friendly. [#57706](https://github.com/grafana/grafana/pull/57706), [@asimpson](https://github.com/asimpson) + + +# 9.2.18 (2023-05-08) + + # 9.2.4 (2022-11-07) diff --git a/docs/sources/visualizations/configure-legend/index.md b/docs/sources/visualizations/configure-legend/index.md index 9ff1cf0f8824..6694068f96e9 100644 --- a/docs/sources/visualizations/configure-legend/index.md +++ b/docs/sources/visualizations/configure-legend/index.md @@ -1,17 +1,9 @@ --- aliases: -<<<<<<<< HEAD:docs/sources/visualizations/configure-legend/index.md - - /docs/grafana/latest/panels/working-with-panels/configure-legend/ - - /docs/grafana/latest/visualizations/configure-legend/ - - /docs/grafana/latest/panels-visualizations/visualizations/configure-legend/ -title: Configure a legend -weight: 1300 -======== - ../panels/working-with-panels/configure-legend/ - visualizations/configure-legend/ title: Configure a legend weight: 400 ->>>>>>>> release-9.2.18:docs/sources/panels-visualizations/configure-legend/index.md --- # Configure a legend @@ -38,12 +30,12 @@ When you apply your changes, the visualization changes appear to all users of th This topic currently applies to the following visualizations: -- [Bar chart]({{< relref "../bar-chart/" >}}) -- [Histogram]({{< relref "../histogram/" >}}) -- [Pie chart]({{< relref "../pie-chart/" >}}) -- [State timeline]({{< relref "../state-timeline/" >}}) -- [Status history]({{< relref "../status-history/" >}}) -- [Time series]({{< relref "../time-series/" >}}) +- [Bar chart]({{< relref "../visualizations/bar-chart/" >}}) +- [Histogram]({{< relref "../visualizations/histogram/" >}}) +- [Pie chart]({{< relref "../visualizations/pie-chart/" >}}) +- [State timeline]({{< relref "../visualizations/state-timeline/" >}}) +- [Status history]({{< relref "../visualizations/status-history/" >}}) +- [Time series]({{< relref "../visualizations/time-series/" >}}) ## Add values to a legend @@ -75,10 +67,10 @@ By default, Grafana specifies the color of your series data, which you can chang ## Sort series -You can change legend mode to **Table** and choose [calculations]({{< relref "../../calculation-types/" >}}) to be displayed in the legend. Click the calculation name header in the legend table to sort the values in the table in ascending or descending order. - -The sort order affects the positions of the bars in the Bar chart panel as well as the order of stacked series in the Time series and Bar chart panels. +You can change legend mode to **Table** and choose [calculations]({{< relref "../calculation-types/" >}}) to be displayed in the legend. Click the calculation name header in the legend table to sort the values in the table in ascending or descending order. -> **Note:** This feature is only supported in these panels: Bar chart, Histogram, Time series, XY Chart. +{{% admonition type="note" %}} +This feature is only supported in these panels: Bar chart, Histogram, Time series. +{{% /admonition %}} ![Sort legend series](/static/img/docs/legend/legend-series-sort-8-3.png). diff --git a/lerna.json b/lerna.json index ac8b674f6956..2a3f41c963a5 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "packages": ["packages/*"], - "version": "9.2.18" + "version": "9.2.20" } diff --git a/package.json b/package.json index 05d2bcea0e0b..11a3fe2d426c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "license": "AGPL-3.0-only", "private": true, "name": "grafana", - "version": "9.2.18", + "version": "9.2.20", "repository": "github:grafana/grafana", "scripts": { "api-tests": "jest --notify --watch --config=devenv/e2e-api-tests/jest.js", diff --git a/packages/grafana-data/package.json b/packages/grafana-data/package.json index e9b3e64ed82a..37140f90b1c2 100644 --- a/packages/grafana-data/package.json +++ b/packages/grafana-data/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/data", - "version": "9.2.18", + "version": "9.2.20", "description": "Grafana Data Library", "keywords": [ "typescript" @@ -34,7 +34,7 @@ }, "dependencies": { "@braintree/sanitize-url": "6.0.0", - "@grafana/schema": "9.2.18", + "@grafana/schema": "9.2.20", "@types/d3-interpolate": "^1.4.0", "d3-interpolate": "1.4.0", "date-fns": "2.29.1", diff --git a/packages/grafana-e2e-selectors/package.json b/packages/grafana-e2e-selectors/package.json index 8eb70eba0956..b4443ecd391b 100644 --- a/packages/grafana-e2e-selectors/package.json +++ b/packages/grafana-e2e-selectors/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/e2e-selectors", - "version": "9.2.18", + "version": "9.2.20", "description": "Grafana End-to-End Test Selectors Library", "keywords": [ "cli", diff --git a/packages/grafana-e2e/package.json b/packages/grafana-e2e/package.json index 73ca699b2333..60da7f3a734e 100644 --- a/packages/grafana-e2e/package.json +++ b/packages/grafana-e2e/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/e2e", - "version": "9.2.18", + "version": "9.2.20", "description": "Grafana End-to-End Test Library", "keywords": [ "cli", @@ -61,7 +61,7 @@ "@babel/core": "7.19.0", "@babel/preset-env": "7.19.0", "@cypress/webpack-preprocessor": "5.12.0", - "@grafana/e2e-selectors": "9.2.18", + "@grafana/e2e-selectors": "9.2.20", "@grafana/tsconfig": "^1.2.0-rc1", "@mochajs/json-file-reporter": "^1.2.0", "babel-loader": "8.2.5", diff --git a/packages/grafana-runtime/package.json b/packages/grafana-runtime/package.json index 0936d23a933f..9a45b559949f 100644 --- a/packages/grafana-runtime/package.json +++ b/packages/grafana-runtime/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/runtime", - "version": "9.2.18", + "version": "9.2.20", "description": "Grafana Runtime Library", "keywords": [ "grafana", @@ -36,9 +36,9 @@ }, "dependencies": { "@grafana/agent-web": "^0.4.0", - "@grafana/data": "9.2.18", - "@grafana/e2e-selectors": "9.2.18", - "@grafana/ui": "9.2.18", + "@grafana/data": "9.2.20", + "@grafana/e2e-selectors": "9.2.20", + "@grafana/ui": "9.2.20", "@sentry/browser": "6.19.7", "history": "4.10.1", "lodash": "4.17.21", diff --git a/packages/grafana-schema/package.json b/packages/grafana-schema/package.json index 2b265ef9864d..2548dac5f4ec 100644 --- a/packages/grafana-schema/package.json +++ b/packages/grafana-schema/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/schema", - "version": "9.2.18", + "version": "9.2.20", "description": "Grafana Schema Library", "keywords": [ "typescript" diff --git a/packages/grafana-toolkit/package.json b/packages/grafana-toolkit/package.json index 9d867393ce0b..02072d8d30d3 100644 --- a/packages/grafana-toolkit/package.json +++ b/packages/grafana-toolkit/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/toolkit", - "version": "9.2.18", + "version": "9.2.20", "description": "Grafana Toolkit", "keywords": [ "grafana", @@ -50,10 +50,10 @@ "@babel/preset-env": "7.18.9", "@babel/preset-react": "7.18.6", "@babel/preset-typescript": "7.18.6", - "@grafana/data": "9.2.18", + "@grafana/data": "9.2.20", "@grafana/eslint-config": "5.0.0", "@grafana/tsconfig": "^1.2.0-rc1", - "@grafana/ui": "9.2.18", + "@grafana/ui": "9.2.20", "@jest/core": "27.5.1", "@types/command-exists": "^1.2.0", "@types/eslint": "8.4.1", diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index 549ec6cee170..d6d98806119d 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/ui", - "version": "9.2.18", + "version": "9.2.20", "description": "Grafana Components Library", "keywords": [ "grafana", @@ -47,9 +47,9 @@ "dependencies": { "@emotion/css": "11.9.0", "@emotion/react": "11.9.3", - "@grafana/data": "9.2.18", - "@grafana/e2e-selectors": "9.2.18", - "@grafana/schema": "9.2.18", + "@grafana/data": "9.2.20", + "@grafana/e2e-selectors": "9.2.20", + "@grafana/schema": "9.2.20", "@monaco-editor/react": "4.4.5", "@popperjs/core": "2.11.5", "@react-aria/button": "3.6.1", diff --git a/packages/jaeger-ui-components/package.json b/packages/jaeger-ui-components/package.json index f15967054066..51692772d081 100644 --- a/packages/jaeger-ui-components/package.json +++ b/packages/jaeger-ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@jaegertracing/jaeger-ui-components", - "version": "9.2.18", + "version": "9.2.20", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -31,10 +31,10 @@ }, "dependencies": { "@emotion/css": "11.9.0", - "@grafana/data": "9.2.18", - "@grafana/e2e-selectors": "9.2.18", - "@grafana/runtime": "9.2.18", - "@grafana/ui": "9.2.18", + "@grafana/data": "9.2.20", + "@grafana/e2e-selectors": "9.2.20", + "@grafana/runtime": "9.2.20", + "@grafana/ui": "9.2.20", "chance": "^1.0.10", "classnames": "^2.2.5", "combokeys": "^3.0.0", diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go index 44692eea894d..13c2f4c4bc07 100644 --- a/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go @@ -302,16 +302,17 @@ func (hs *HTTPServer) SyncUser( connect social.SocialConnector, ) (*user.User, error) { oauthLogger.Debug("Syncing Grafana user with corresponding OAuth profile") + lookupParams := models.UserLookupParams{} + if hs.Cfg.OAuthAllowInsecureEmailLookup { + lookupParams.Email = &extUser.Email + } + // add/update user in Grafana cmd := &models.UpsertUserCommand{ - ReqContext: ctx, - ExternalUser: extUser, - SignupAllowed: connect.IsSignupAllowed(), - UserLookupParams: models.UserLookupParams{ - Email: &extUser.Email, - UserID: nil, - Login: nil, - }, + ReqContext: ctx, + ExternalUser: extUser, + SignupAllowed: connect.IsSignupAllowed(), + UserLookupParams: lookupParams, } if err := hs.Login.UpsertUser(ctx.Req.Context(), cmd); err != nil { diff --git a/pkg/build/packaging/deb.go b/pkg/build/packaging/deb.go index 1781b345fff5..094207b02701 100644 --- a/pkg/build/packaging/deb.go +++ b/pkg/build/packaging/deb.go @@ -170,7 +170,11 @@ func UpdateDebRepo(cfg PublishConfig, workDir string) error { return cli.Exit(fmt.Sprintf("failed to update Debian %q repository: %s", tp, output), 1) } } + + // Update database in GCS + u = fmt.Sprintf("gs://%s/%s", cfg.DebDBBucket, strings.ToLower(string(cfg.Edition))) if cfg.DryRun { + log.Printf("Simulating upload of Debian repo database to GCS (%s)\n", u) } else { log.Printf("Uploading Debian repo database to GCS (%s)...\n", u) //nolint:gosec diff --git a/pkg/services/alerting/store_test.go b/pkg/services/alerting/store_test.go index 0d04c52f55cc..21364aa9c8a0 100644 --- a/pkg/services/alerting/store_test.go +++ b/pkg/services/alerting/store_test.go @@ -160,7 +160,6 @@ func TestIntegrationAlertingDataAccess(t *testing.T) { t.Run("Viewer can read alerts", func(t *testing.T) { setup(t) - // @Percona TODO: ??? viewerUser := &user.SignedInUser{OrgRole: org.RoleViewer, OrgID: 1} alertQuery := models.GetAlertsQuery{DashboardIDs: []int64{testDash.Id}, PanelId: 1, OrgId: 1, User: viewerUser} err2 := store.HandleAlertsQuery(context.Background(), &alertQuery) diff --git a/pkg/services/ngalert/api/authorization.go b/pkg/services/ngalert/api/authorization.go index 49e95481c28e..afc58f8034e6 100644 --- a/pkg/services/ngalert/api/authorization.go +++ b/pkg/services/ngalert/api/authorization.go @@ -158,7 +158,7 @@ func (api *API) authorize(method, path string) web.Handler { eval = ac.EvalPermission(ac.ActionAlertingNotificationsRead) case http.MethodPost + "/api/alertmanager/grafana/config/api/v1/receivers/test": fallback = middleware.ReqEditorRole - eval = ac.EvalPermission(ac.ActionAlertingNotificationsRead) + eval = ac.EvalPermission(ac.ActionAlertingNotificationsWrite) // External Alertmanager Paths case http.MethodDelete + "/api/alertmanager/{DatasourceUID}/config/api/v1/alerts": diff --git a/pkg/services/ngalert/api/tooling/api.json b/pkg/services/ngalert/api/tooling/api.json index 3ba09a98fc6e..0a7fe10c2d5c 100644 --- a/pkg/services/ngalert/api/tooling/api.json +++ b/pkg/services/ngalert/api/tooling/api.json @@ -187,6 +187,9 @@ "AlertStateType": { "type": "string" }, + "AlertStateType": { + "type": "string" + }, "AlertingRule": { "description": "adapted from cortex", "properties": { @@ -3645,6 +3648,37 @@ ], "type": "object" }, + "integration": { + "description": "Integration integration", + "properties": { + "lastNotifyAttempt": { + "description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time", + "format": "date-time", + "type": "string" + }, + "lastNotifyAttemptDuration": { + "description": "Duration of the last attempt to deliver a notification in humanized format (`1s` or `15ms`, etc).", + "type": "string" + }, + "lastNotifyAttemptError": { + "description": "Error string for the last attempt to deliver a notification. Empty if the last attempt was successful.", + "type": "string" + }, + "name": { + "description": "name", + "type": "string" + }, + "sendResolved": { + "description": "send resolved", + "type": "boolean" + } + }, + "required": [ + "name", + "sendResolved" + ], + "type": "object" + }, "labelSet": { "additionalProperties": { "type": "string" diff --git a/pkg/services/ngalert/api/tooling/post.json b/pkg/services/ngalert/api/tooling/post.json index 57e26c180347..c8a336a9e75e 100644 --- a/pkg/services/ngalert/api/tooling/post.json +++ b/pkg/services/ngalert/api/tooling/post.json @@ -187,6 +187,9 @@ "AlertStateType": { "type": "string" }, + "AlertStateType": { + "type": "string" + }, "AlertingRule": { "description": "adapted from cortex", "properties": { diff --git a/pkg/services/ngalert/api/tooling/spec.json b/pkg/services/ngalert/api/tooling/spec.json index b7d863844479..9c6a7d3dc5b4 100644 --- a/pkg/services/ngalert/api/tooling/spec.json +++ b/pkg/services/ngalert/api/tooling/spec.json @@ -3289,6 +3289,9 @@ "AlertStateType": { "type": "string" }, + "AlertStateType": { + "type": "string" + }, "AlertingRule": { "description": "adapted from cortex", "type": "object", diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 20e8f78a2f55..03aa5c17d868 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -318,7 +318,8 @@ type Cfg struct { AuthProxySyncTTL int // OAuth - OAuthCookieMaxAge int + OAuthCookieMaxAge int + OAuthAllowInsecureEmailLookup bool // JWT Auth JWTAuthEnabled bool @@ -1305,6 +1306,8 @@ func readAuthSettings(iniFile *ini.File, cfg *Cfg) (err error) { return err } + cfg.OAuthAllowInsecureEmailLookup = auth.Key("oauth_allow_insecure_email_lookup").MustBool(false) + const defaultMaxLifetime = "30d" maxLifetimeDurationVal := valueAsString(auth, "login_maximum_lifetime_duration", defaultMaxLifetime) cfg.LoginMaxLifetime, err = gtime.ParseDuration(maxLifetimeDurationVal) diff --git a/plugins-bundled/internal/input-datasource/package.json b/plugins-bundled/internal/input-datasource/package.json index eafc010c24a3..9ec1aa629b4e 100644 --- a/plugins-bundled/internal/input-datasource/package.json +++ b/plugins-bundled/internal/input-datasource/package.json @@ -1,6 +1,6 @@ { "name": "@grafana-plugins/input-datasource", - "version": "9.2.18", + "version": "9.2.20", "description": "Input Datasource", "private": true, "repository": { @@ -15,15 +15,15 @@ }, "author": "Grafana Labs", "devDependencies": { - "@grafana/toolkit": "9.2.18", + "@grafana/toolkit": "9.2.20", "@types/jest": "26.0.15", "@types/lodash": "4.14.149", "@types/react": "17.0.30", "lodash": "4.17.21" }, "dependencies": { - "@grafana/data": "9.2.18", - "@grafana/ui": "9.2.18", + "@grafana/data": "9.2.20", + "@grafana/ui": "9.2.20", "jquery": "3.5.1", "react": "17.0.1", "react-dom": "17.0.1", diff --git a/public/api-merged.json b/public/api-merged.json index 8f5f60e3f494..afde593da62c 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -26,25 +26,25 @@ }, "basePath": "/api", "paths": { - "/admin/ldap/reload": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "boolean", + "name": "delegatable", + "in": "query" } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.", - "tags": [ - "admin_ldap" - ], - "summary": "Reloads the LDAP configuration.", - "operationId": "reloadLDAPCfg", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/listRolesResponse" }, "403": { "$ref": "#/responses/forbiddenError" @@ -53,27 +53,31 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/ldap/status": { - "get": { - "security": [ + }, + "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": [ { - "basic": [] + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRoleForm" + } } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`.", - "tags": [ - "admin_ldap" - ], - "summary": "Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.", - "operationId": "getLDAPStatus", "responses": { - "200": { - "$ref": "#/responses/okResponse" + "201": { + "$ref": "#/responses/createRoleResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" @@ -84,61 +88,99 @@ } } }, - "/admin/ldap/sync/{user_id}": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "string", + "name": "roleUID", + "in": "path", + "required": true } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`.", + "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": [ - "admin_ldap" + "access_control", + "enterprise" ], - "summary": "Enables a single Grafana user to be synchronized against LDAP.", - "operationId": "postSyncUserWithLDAP", + "summary": "Update a custom role.", + "operationId": "updateRole", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRoleCommand" + } + }, + { + "type": "string", + "name": "roleUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getRoleResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/ldap/{user_name}": { - "get": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`.", + }, + "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": [ - "admin_ldap" + "access_control", + "enterprise" ], - "summary": "Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.", - "operationId": "getUserFromLDAP", + "summary": "Delete a custom role.", + "operationId": "deleteRole", "parameters": [ + { + "type": "boolean", + "name": "force", + "in": "query" + }, + { + "type": "boolean", + "name": "global", + "in": "query" + }, { "type": "string", - "name": "user_name", + "name": "roleUID", "in": "path", "required": true } @@ -147,8 +189,8 @@ "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" @@ -159,121 +201,127 @@ } } }, - "/admin/pause-all-alerts": { - "post": { - "security": [ - { - "basic": [] - } - ], + "/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": [ - "admin" + "access_control", + "enterprise" ], - "summary": "Pause/unpause all (legacy) alerts.", - "operationId": "pauseAllAlerts", + "summary": "Get role assignments.", + "operationId": "getRoleAssignments", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PauseAllAlertsCommand" - } + "type": "string", + "name": "roleUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/pauseAlertsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/getRoleAssignmentsResponse" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/provisioning/dashboards/reload": { - "post": { - "security": [ + }, + "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": [ { - "basic": [] + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SetRoleAssignmentsCommand" + } } ], - "description": "Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`.", - "tags": [ - "admin_provisioning" - ], - "summary": "Reload dashboard provisioning configurations.", - "operationId": "adminProvisioningReloadDashboards", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/setRoleAssignmentsResponse" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/provisioning/datasources/reload": { - "post": { - "security": [ - { - "basic": [] - } - ], - "description": "Reloads the provisioning config files for datasources again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:datasources`.", + "/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": [ - "admin_provisioning" + "access_control", + "enterprise" ], - "summary": "Reload datasource provisioning configurations.", - "operationId": "adminProvisioningReloadDatasources", + "summary": "Get status.", + "operationId": "getAccessControlStatus", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/getAccessControlStatusResponse" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/provisioning/notifications/reload": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], - "description": "Reloads the provisioning config files for legacy alert notifiers again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:notifications`.", - "tags": [ - "admin_provisioning" - ], - "summary": "Reload legacy alert notifier provisioning configurations.", - "operationId": "adminProvisioningReloadNotifications", "responses": { "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" @@ -282,150 +330,226 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/provisioning/plugins/reload": { - "post": { - "security": [ + }, + "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": [ { - "basic": [] + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], - "description": "Reloads the provisioning config files for plugins again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:plugin`.", - "tags": [ - "admin_provisioning" - ], - "summary": "Reload plugin provisioning configurations.", - "operationId": "adminProvisioningReloadPlugins", "responses": { "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/settings": { - "get": { - "security": [ + }, + "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": [ { - "basic": [] + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTeamRoleCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `settings:read` and scopes: `settings:*`, `settings:auth.saml:` and `settings:auth.saml:enabled` (property level).", - "tags": [ - "admin" - ], - "summary": "Fetch settings.", - "operationId": "adminGetSettings", "responses": { "200": { - "$ref": "#/responses/adminGetSettingsResponse" + "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/admin/stats": { - "get": { - "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `server:stats:read`.", + "/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": [ - "admin" + "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 + } ], - "summary": "Fetch Grafana Stats.", - "operationId": "adminGetStats", "responses": { "200": { - "$ref": "#/responses/adminGetStatsResponse" + "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:create`.\nNote that OrgId is an optional parameter that can be used to assign a new user to a different organization when `auto_assign_org` is set to `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": [ - "admin_users" + "access_control", + "enterprise" ], - "summary": "Create new user.", - "operationId": "adminCreateUser", + "summary": "Set user role assignments.", + "operationId": "setUserRoles", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AdminCreateUserForm" + "$ref": "#/definitions/SetUserRolesCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/adminCreateUserResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, "403": { "$ref": "#/responses/forbiddenError" }, - "412": { - "$ref": "#/responses/preconditionFailedError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/users/{user_id}": { - "delete": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:delete` and scope `global.users:*`.", + }, + "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": [ - "admin_users" + "access_control", + "enterprise" ], - "summary": "Delete global User.", - "operationId": "adminDeleteUser", + "summary": "Add a user role assignment.", + "operationId": "addUserRole", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddUserRoleCommand" + } + }, { "type": "integer", "format": "int64", - "name": "user_id", + "name": "userId", "in": "path", "required": true } @@ -434,9 +558,6 @@ "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, "403": { "$ref": "#/responses/forbiddenError" }, @@ -449,31 +570,66 @@ } } }, - "/admin/users/{user_id}/auth-tokens": { - "get": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:list` and scope `global.users:*`.", + "/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": [ - "admin_users" + "access_control", + "enterprise" ], - "summary": "Return a list of all auth tokens (devices) that the user currently have logged in from.", - "operationId": "adminGetUserAuthTokens", + "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": "user_id", + "name": "userId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/adminGetUserAuthTokensResponse" + "$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" @@ -487,28 +643,19 @@ } } }, - "/admin/users/{user_id}/disable": { + "/admin/ldap/reload": { "post": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:disable` and scope `global.users:1` (userIDScope).", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.", "tags": [ - "admin_users" - ], - "summary": "Disable user.", - "operationId": "adminDisableUser", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_ldap" ], + "summary": "Reloads the LDAP configuration.", + "operationId": "reloadLDAPCfg", "responses": { "200": { "$ref": "#/responses/okResponse" @@ -519,37 +666,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/enable": { - "post": { + "/admin/ldap/status": { + "get": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:enable` and scope `global.users:1` (userIDScope).", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`.", "tags": [ - "admin_users" - ], - "summary": "Enable user.", - "operationId": "adminEnableUser", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_ldap" ], + "summary": "Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.", + "operationId": "getLDAPStatus", "responses": { "200": { "$ref": "#/responses/okResponse" @@ -560,28 +695,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/logout": { + "/admin/ldap/sync/{user_id}": { "post": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.logout` and scope `global.users:*`.", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`.", "tags": [ - "admin_users" + "admin_ldap" ], - "summary": "Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity.", - "operationId": "adminLogoutUser", + "summary": "Enables a single Grafana user to be synchronized against LDAP.", + "operationId": "postSyncUserWithLDAP", "parameters": [ { "type": "integer", @@ -595,50 +727,35 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/password": { - "put": { + "/admin/ldap/{user_name}": { + "get": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.password:update` and scope `global.users:*`.", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`.", "tags": [ - "admin_users" + "admin_ldap" ], - "summary": "Set password for user.", - "operationId": "adminUpdateUserPassword", + "summary": "Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.", + "operationId": "getUserFromLDAP", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AdminUpdateUserPasswordForm" - } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "name": "user_name", "in": "path", "required": true } @@ -647,9 +764,6 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -662,37 +776,31 @@ } } }, - "/admin/users/{user_id}/permissions": { - "put": { - "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.permissions:update` and scope `global.users:*`.", + "/admin/pause-all-alerts": { + "post": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "admin_users" + "admin" ], - "summary": "Set permissions for user.", - "operationId": "adminUpdateUserPermissions", + "summary": "Pause/unpause all (legacy) alerts.", + "operationId": "pauseAllAlerts", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AdminUpdateUserPermissionsForm" + "$ref": "#/definitions/PauseAllAlertsCommand" } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/pauseAlertsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -706,31 +814,43 @@ } } }, - "/admin/users/{user_id}/quotas": { - "get": { + "/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": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global.users:1` (userIDScope).", + "description": "Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`.", "tags": [ - "admin_users" - ], - "summary": "Fetch user quota.", - "operationId": "getUserQuota", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_provisioning" ], + "summary": "Reload dashboard provisioning configurations.", + "operationId": "adminProvisioningReloadDashboards", "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -738,51 +858,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/quotas/{quota_target}": { - "put": { + "/admin/provisioning/datasources/reload": { + "post": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:update` and scope `global.users:1` (userIDScope).", + "description": "Reloads the provisioning config files for datasources again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:datasources`.", "tags": [ - "admin_users" - ], - "summary": "Update user quota.", - "operationId": "updateUserQuota", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserQuotaCmd" - } - }, - { - "type": "string", - "name": "quota_target", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_provisioning" ], + "summary": "Reload datasource provisioning configurations.", + "operationId": "adminProvisioningReloadDatasources", "responses": { "200": { "$ref": "#/responses/okResponse" @@ -793,78 +887,57 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/revoke-auth-token": { + "/admin/provisioning/notifications/reload": { "post": { "security": [ { "basic": [] } ], - "description": "Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:update` and scope `global.users:*`.", + "description": "Reloads the provisioning config files for legacy alert notifiers again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:notifications`.", "tags": [ - "admin_users" - ], - "summary": "Revoke auth token for user.", - "operationId": "adminRevokeUserAuthToken", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RevokeAuthTokenCmd" - } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_provisioning" ], + "summary": "Reload legacy alert notifier provisioning configurations.", + "operationId": "adminProvisioningReloadNotifications", "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" } } } }, - "/alert-notifications": { - "get": { - "description": "Returns all notification channels that the authenticated user has permission to view.", + "/admin/provisioning/plugins/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for plugins again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:plugin`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_provisioning" ], - "summary": "Get all notification channels.", - "operationId": "getAlertNotificationChannels", + "summary": "Reload plugin provisioning configurations.", + "operationId": "adminProvisioningReloadPlugins", "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelsResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -876,54 +949,45 @@ "$ref": "#/responses/internalServerError" } } - }, - "post": { - "description": "You can find the full list of [supported notifiers](https://grafana.com/docs/grafana/latest/alerting/old-alerting/notifications/#list-of-supported-notifiers) on the alert notifiers page.", - "tags": [ - "legacy_alerts_notification_channels" - ], - "summary": "Create notification channel.", - "operationId": "createAlertNotificationChannel", - "parameters": [ + } + }, + "/admin/settings": { + "get": { + "security": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateAlertNotificationCommand" - } + "basic": [] } ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `settings:read` and scopes: `settings:*`, `settings:auth.saml:` and `settings:auth.saml:enabled` (property level).", + "tags": [ + "admin" + ], + "summary": "Fetch settings.", + "operationId": "adminGetSettings", "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/adminGetSettingsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } } }, - "/alert-notifications/lookup": { + "/admin/stats": { "get": { - "description": "Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule.", + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `server:stats:read`.", "tags": [ - "legacy_alerts_notification_channels" + "admin" ], - "summary": "Get all notification channels (lookup).", - "operationId": "getAlertNotificationLookup", + "summary": "Fetch Grafana Stats.", + "operationId": "adminGetStats", "responses": { "200": { - "$ref": "#/responses/getAlertNotificationLookupResponse" + "$ref": "#/responses/adminGetStatsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -937,27 +1001,32 @@ } } }, - "/alert-notifications/test": { + "/admin/users": { "post": { - "description": "Sends a test notification to the channel.", + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:create`.\nNote that OrgId is an optional parameter that can be used to assign a new user to a different organization when `auto_assign_org` is set to `true`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Test notification channel.", - "operationId": "notificationChannelTest", + "summary": "Create new user.", + "operationId": "adminCreateUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/NotificationTestCommand" + "$ref": "#/definitions/AdminCreateUserForm" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/adminCreateUserResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -969,7 +1038,7 @@ "$ref": "#/responses/forbiddenError" }, "412": { - "$ref": "#/responses/SMTPNotEnabledError" + "$ref": "#/responses/preconditionFailedError" }, "500": { "$ref": "#/responses/internalServerError" @@ -977,25 +1046,31 @@ } } }, - "/alert-notifications/uid/{notification_channel_uid}": { - "get": { - "description": "Returns the notification channel given the notification channel UID.", - "tags": [ - "legacy_alerts_notification_channels" + "/admin/users/{user_id}": { + "delete": { + "security": [ + { + "basic": [] + } ], - "summary": "Get notification channel by UID.", - "operationId": "getAlertNotificationChannelByUID", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:delete` and scope `global.users:*`.", + "tags": [ + "admin_users" + ], + "summary": "Delete global User.", + "operationId": "adminDeleteUser", "parameters": [ { - "type": "string", - "name": "notification_channel_uid", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1010,33 +1085,71 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { - "description": "Updates an existing notification channel identified by uid.", + } + }, + "/admin/users/{user_id}/auth-tokens": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:list` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Update notification channel by UID.", - "operationId": "updateAlertNotificationChannelByUID", + "summary": "Return a list of all auth tokens (devices) that the user currently have logged in from.", + "operationId": "adminGetUserAuthTokens", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAlertNotificationWithUidCommand" - } + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/adminGetUserAuthTokensResponse" }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/disable": { + "post": { + "security": [ { - "type": "string", - "name": "notification_channel_uid", + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:disable` and scope `global.users:1` (userIDScope).", + "tags": [ + "admin_users" + ], + "summary": "Disable user.", + "operationId": "adminDisableUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1051,25 +1164,33 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Deletes an existing notification channel identified by UID.", + } + }, + "/admin/users/{user_id}/enable": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:enable` and scope `global.users:1` (userIDScope).", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Delete alert notification by UID.", - "operationId": "deleteAlertNotificationChannelByUID", + "summary": "Enable user.", + "operationId": "adminEnableUser", "parameters": [ { - "type": "string", - "name": "notification_channel_uid", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/deleteAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1086,26 +1207,34 @@ } } }, - "/alert-notifications/{notification_channel_id}": { - "get": { - "description": "Returns the notification channel given the notification channel ID.", + "/admin/users/{user_id}/logout": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.logout` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Get notification channel by ID.", - "operationId": "getAlertNotificationChannelByID", + "summary": "Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity.", + "operationId": "adminLogoutUser", "parameters": [ { "type": "integer", "format": "int64", - "name": "notification_channel_id", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1120,34 +1249,44 @@ "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/admin/users/{user_id}/password": { "put": { - "description": "Updates an existing notification channel identified by ID.", + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.password:update` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Update notification channel by ID.", - "operationId": "updateAlertNotificationChannel", + "summary": "Set password for user.", + "operationId": "adminUpdateUserPassword", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateAlertNotificationCommand" + "$ref": "#/definitions/AdminUpdateUserPasswordForm" } }, { "type": "integer", "format": "int64", - "name": "notification_channel_id", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1155,26 +1294,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Deletes an existing notification channel identified by ID.", + } + }, + "/admin/users/{user_id}/permissions": { + "put": { + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.permissions:update` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Delete alert notification by ID.", - "operationId": "deleteAlertNotificationChannel", + "summary": "Set permissions for user.", + "operationId": "adminUpdateUserPermissions", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUpdateUserPermissionsForm" + } + }, { "type": "integer", "format": "int64", - "name": "notification_channel_id", + "name": "user_id", "in": "path", "required": true } @@ -1183,170 +1329,221 @@ "200": { "$ref": "#/responses/okResponse" }, + "400": { + "$ref": "#/responses/badRequestError" + }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts": { + "/admin/users/{user_id}/quotas": { "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global.users:1` (userIDScope).", "tags": [ - "legacy_alerts" + "admin_users" ], - "summary": "Get legacy alerts.", - "operationId": "getAlerts", + "summary": "Fetch user quota.", + "operationId": "getUserQuota", "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "description": "Limit response to alerts in specified dashboard(s). You can specify multiple dashboards.", - "name": "dashboardId", - "in": "query" - }, { "type": "integer", "format": "int64", - "description": "Limit response to alert for a specified panel on a dashboard.", - "name": "panelId", - "in": "query" + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" }, - { - "type": "string", - "description": "Limit response to alerts having a name like this value.", - "name": "query", - "in": "query" + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "enum": [ - "all", - "no_data", - "paused", - "alerting", - "ok", - "pending", - "unknown" - ], - "type": "string", - "description": "Return alerts with one or more of the following alert states", - "name": "state", - "in": "query" + "403": { + "$ref": "#/responses/forbiddenError" }, - { - "type": "integer", - "format": "int64", - "description": "Limit response to X number of alerts.", - "name": "limit", - "in": "query" + "404": { + "$ref": "#/responses/notFoundError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/quotas/{quota_target}": { + "put": { + "security": [ { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders", - "name": "folderId", - "in": "query" + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:update` and scope `global.users:1` (userIDScope).", + "tags": [ + "admin_users" + ], + "summary": "Update user quota.", + "operationId": "updateUserQuota", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserQuotaCmd" + } }, { "type": "string", - "description": "Limit response to alerts having a dashboard name like this value./ Limit response to alerts having a dashboard name like this value.", - "name": "dashboardQuery", - "in": "query" + "name": "quota_target", + "in": "path", + "required": true }, { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "Limit response to alerts of dashboards with specified tags. To do an “AND” filtering with multiple tags, specify the tags parameter multiple times", - "name": "dashboardTag", - "in": "query" + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertsResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts/states-for-dashboard": { - "get": { + "/admin/users/{user_id}/revoke-auth-token": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:update` and scope `global.users:*`.", "tags": [ - "legacy_alerts" + "admin_users" ], - "summary": "Get alert states for a dashboard.", - "operationId": "getDashboardStates", + "summary": "Revoke auth token for user.", + "operationId": "adminRevokeUserAuthToken", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RevokeAuthTokenCmd" + } + }, { "type": "integer", "format": "int64", - "name": "dashboardId", - "in": "query", + "name": "user_id", + "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardStatesResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts/test": { + "/alert-notifications": { + "get": { + "description": "Returns all notification channels that the authenticated user has permission to view.", + "tags": [ + "legacy_alerts_notification_channels" + ], + "summary": "Get all notification channels.", + "operationId": "getAlertNotificationChannels", + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, "post": { + "description": "You can find the full list of [supported notifiers](https://grafana.com/docs/grafana/latest/alerting/old-alerting/notifications/#list-of-supported-notifiers) on the alert notifiers page.", "tags": [ - "legacy_alerts" + "legacy_alerts_notification_channels" ], - "summary": "Test alert.", - "operationId": "testAlert", + "summary": "Create notification channel.", + "operationId": "createAlertNotificationChannel", "parameters": [ { "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/AlertTestCommand" + "$ref": "#/definitions/CreateAlertNotificationCommand" } } ], "responses": { "200": { - "$ref": "#/responses/testAlertResponse" + "$ref": "#/responses/getAlertNotificationChannelResponse" }, - "400": { - "$ref": "#/responses/badRequestError" + "401": { + "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -1354,61 +1551,54 @@ } } }, - "/alerts/{alert_id}": { + "/alert-notifications/lookup": { "get": { - "description": "“evalMatches” data in the response is cached in the db when and only when the state of the alert changes (e.g. transitioning from “ok” to “alerting” state).\nIf data from one server triggers the alert first and, before that server is seen leaving alerting state, a second server also enters a state that would trigger the alert, the second server will not be visible in “evalMatches” data.", + "description": "Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule.", "tags": [ - "legacy_alerts" - ], - "summary": "Get alert by ID.", - "operationId": "getAlertByID", - "parameters": [ - { - "type": "string", - "name": "alert_id", - "in": "path", - "required": true - } + "legacy_alerts_notification_channels" ], + "summary": "Get all notification channels (lookup).", + "operationId": "getAlertNotificationLookup", "responses": { "200": { - "$ref": "#/responses/getAlertResponse" + "$ref": "#/responses/getAlertNotificationLookupResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts/{alert_id}/pause": { + "/alert-notifications/test": { "post": { + "description": "Sends a test notification to the channel.", "tags": [ - "legacy_alerts" + "legacy_alerts_notification_channels" ], - "summary": "Pause/unpause alert by id.", - "operationId": "pauseAlert", + "summary": "Test notification channel.", + "operationId": "notificationChannelTest", "parameters": [ - { - "type": "string", - "name": "alert_id", - "in": "path", - "required": true - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PauseAlertCommand" + "$ref": "#/definitions/NotificationTestCommand" } } ], "responses": { "200": { - "$ref": "#/responses/pauseAlertResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1416,8 +1606,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "412": { + "$ref": "#/responses/SMTPNotEnabledError" }, "500": { "$ref": "#/responses/internalServerError" @@ -1425,169 +1615,66 @@ } } }, - "/annotations": { + "/alert-notifications/uid/{notification_channel_uid}": { "get": { - "description": "Starting in Grafana v6.4 regions annotations are now returned in one entity that now includes the timeEnd property.", + "description": "Returns the notification channel given the notification channel UID.", "tags": [ - "annotations" + "legacy_alerts_notification_channels" ], - "summary": "Find Annotations.", - "operationId": "getAnnotations", + "summary": "Get notification channel by UID.", + "operationId": "getAlertNotificationChannelByUID", "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": "string", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" }, - { - "type": "integer", - "format": "int64", - "description": "Limit response to annotations created by specific user.", - "name": "userId", - "in": "query" + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "type": "integer", - "format": "int64", - "description": "Find annotations for a specified alert.", - "name": "alertId", - "in": "query" + "403": { + "$ref": "#/responses/forbiddenError" }, - { - "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" + "404": { + "$ref": "#/responses/notFoundError" }, "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.", + "put": { + "description": "Updates an existing notification channel identified by uid.", "tags": [ - "annotations" + "legacy_alerts_notification_channels" ], - "summary": "Create Annotation.", - "operationId": "postAnnotation", + "summary": "Update notification channel by UID.", + "operationId": "updateAlertNotificationChannelByUID", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PostAnnotationsCmd" + "$ref": "#/definitions/UpdateAlertNotificationWithUidCommand" } - } - ], - "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" - } + "type": "string", + "name": "notification_channel_uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/postAnnotationResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getAlertNotificationChannelResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1595,134 +1682,110 @@ "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" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/annotations/tags": { - "get": { - "description": "Find all the event tags created in the annotations.", + }, + "delete": { + "description": "Deletes an existing notification channel identified by UID.", "tags": [ - "annotations" + "legacy_alerts_notification_channels" ], - "summary": "Find Annotations Tags.", - "operationId": "getAnnotationTags", + "summary": "Delete alert notification by UID.", + "operationId": "deleteAlertNotificationChannelByUID", "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" + "name": "notification_channel_uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAnnotationTagsResponse" + "$ref": "#/responses/deleteAlertNotificationChannelResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/annotations/{annotation_id}": { + "/alert-notifications/{notification_channel_id}": { "get": { + "description": "Returns the notification channel given the notification channel ID.", "tags": [ - "annotations" + "legacy_alerts_notification_channels" ], - "summary": "Get Annotation by ID.", - "operationId": "getAnnotationByID", + "summary": "Get notification channel by ID.", + "operationId": "getAlertNotificationChannelByID", "parameters": [ { - "type": "string", - "name": "annotation_id", + "type": "integer", + "format": "int64", + "name": "notification_channel_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAnnotationByIDResponse" + "$ref": "#/responses/getAlertNotificationChannelResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "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.", + "description": "Updates an existing notification channel identified by ID.", "tags": [ - "annotations" + "legacy_alerts_notification_channels" ], - "summary": "Update Annotation.", - "operationId": "updateAnnotation", + "summary": "Update notification channel by ID.", + "operationId": "updateAlertNotificationChannel", "parameters": [ - { - "type": "string", - "name": "annotation_id", - "in": "path", - "required": true - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateAnnotationsCmd" + "$ref": "#/definitions/UpdateAlertNotificationCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "notification_channel_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getAlertNotificationChannelResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1730,22 +1793,26 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "delete": { - "description": "Deletes the annotation that matches the specified ID.", + "description": "Deletes an existing notification channel identified by ID.", "tags": [ - "annotations" + "legacy_alerts_notification_channels" ], - "summary": "Delete Annotation By ID.", - "operationId": "deleteAnnotationByID", + "summary": "Delete alert notification by ID.", + "operationId": "deleteAlertNotificationChannel", "parameters": [ { - "type": "string", - "name": "annotation_id", + "type": "integer", + "format": "int64", + "name": "notification_channel_id", "in": "path", "required": true } @@ -1760,22 +1827,211 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "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.", + } + }, + "/alerts": { + "get": { "tags": [ - "annotations" + "legacy_alerts" ], - "summary": "Patch Annotation.", - "operationId": "patchAnnotation", - "parameters": [ + "summary": "Get legacy alerts.", + "operationId": "getAlerts", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "description": "Limit response to alerts in specified dashboard(s). You can specify multiple dashboards.", + "name": "dashboardId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Limit response to alert for a specified panel on a dashboard.", + "name": "panelId", + "in": "query" + }, { "type": "string", - "name": "annotation_id", + "description": "Limit response to alerts having a name like this value.", + "name": "query", + "in": "query" + }, + { + "enum": [ + "all", + "no_data", + "paused", + "alerting", + "ok", + "pending", + "unknown" + ], + "type": "string", + "description": "Return alerts with one or more of the following alert states", + "name": "state", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Limit response to X number of alerts.", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders", + "name": "folderId", + "in": "query" + }, + { + "type": "string", + "description": "Limit response to alerts having a dashboard name like this value./ Limit response to alerts having a dashboard name like this value.", + "name": "dashboardQuery", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Limit response to alerts of dashboards with specified tags. To do an “AND” filtering with multiple tags, specify the tags parameter multiple times", + "name": "dashboardTag", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/states-for-dashboard": { + "get": { + "tags": [ + "legacy_alerts" + ], + "summary": "Get alert states for a dashboard.", + "operationId": "getDashboardStates", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "dashboardId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardStatesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/test": { + "post": { + "tags": [ + "legacy_alerts" + ], + "summary": "Test alert.", + "operationId": "testAlert", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AlertTestCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/testAlertResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}": { + "get": { + "description": "“evalMatches” data in the response is cached in the db when and only when the state of the alert changes (e.g. transitioning from “ok” to “alerting” state).\nIf data from one server triggers the alert first and, before that server is seen leaving alerting state, a second server also enters a state that would trigger the alert, the second server will not be visible in “evalMatches” data.", + "tags": [ + "legacy_alerts" + ], + "summary": "Get alert by ID.", + "operationId": "getAlertByID", + "parameters": [ + { + "type": "string", + "name": "alert_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}/pause": { + "post": { + "tags": [ + "legacy_alerts" + ], + "summary": "Pause/unpause alert by id.", + "operationId": "pauseAlert", + "parameters": [ + { + "type": "string", + "name": "alert_id", "in": "path", "required": true }, @@ -1784,696 +2040,2244 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PatchAnnotationsCmd" + "$ref": "#/definitions/PauseAlertCommand" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/pauseAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations": { + "get": { + "description": "Starting in Grafana v6.4 regions annotations are now returned in one entity that now includes the timeEnd property.", + "tags": [ + "annotations" + ], + "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": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Create a new alert rule.", + "operationId": "RoutePostAlertRule", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + } + ], + "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" + } + } + ], + "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": "Get all the contact points.", + "operationId": "RouteGetContactpoints", + "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", + "tags": [ + "dashboard_versions" + ], + "summary": "Get a specific dashboard version.", + "operationId": "getDashboardVersionByID", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/import": { + "post": { + "tags": [ + "dashboards" + ], + "summary": "Import dashboard.", + "operationId": "importDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ImportDashboardRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/importDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/tags": { + "get": { + "tags": [ + "dashboards" + ], + "summary": "Get all dashboards tags of an organisation.", + "operationId": "getDashboardTags", + "responses": { + "200": { + "$ref": "#/responses/getDashboardsTagsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/alert-rules": { + "/dashboards/trim": { "post": { - "consumes": [ - "application/json" - ], "tags": [ - "provisioning" + "dashboards" ], - "summary": "Create a new alert rule.", - "operationId": "RoutePostAlertRule", + "summary": "Trim defaults from dashboard.", + "operationId": "trimDashboard", "parameters": [ { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" + "$ref": "#/definitions/TrimDashboardCommand" } } ], "responses": { - "201": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "200": { + "$ref": "#/responses/trimDashboardResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/alert-rules/{UID}": { + "/dashboards/uid/{uid}": { "get": { + "description": "Will return the dashboard given the dashboard unique identifier (uid).", "tags": [ - "provisioning" + "dashboards" ], - "summary": "Get a specific alert rule by UID.", - "operationId": "RouteGetAlertRule", + "summary": "Get dashboard by uid.", + "operationId": "getDashboardByUID", "parameters": [ { "type": "string", - "description": "Alert rule UID", - "name": "UID", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "$ref": "#/responses/dashboardResponse" }, - "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 + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } - } - ], - "responses": { - "200": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "403": { + "$ref": "#/responses/forbiddenError" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "delete": { + "description": "Will delete the dashboard given the specified unique identifier (uid).", "tags": [ - "provisioning" + "dashboards" ], - "summary": "Delete a specific alert rule by UID.", - "operationId": "RouteDeleteAlertRule", + "summary": "Delete dashboard by uid.", + "operationId": "deleteDashboardByUID", "parameters": [ { "type": "string", - "description": "Alert rule UID", - "name": "UID", + "name": "uid", "in": "path", "required": true } ], "responses": { - "204": { - "description": " The alert rule was deleted successfully." + "200": { + "$ref": "#/responses/deleteDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/contact-points": { + "/dashboards/uid/{uid}/permissions": { "get": { "tags": [ - "provisioning" + "dashboard_permissions" ], - "summary": "Get all the contact points.", - "operationId": "RouteGetContactpoints", + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissionsListByUID", "parameters": [ { "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "description": "ContactPoints", - "schema": { - "$ref": "#/definitions/ContactPoints" - } + "$ref": "#/responses/getDashboardPermissionsListResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "post": { - "consumes": [ - "application/json" - ], + "description": "This operation will remove existing permissions if they’re not included in the request.", "tags": [ - "provisioning" + "dashboard_permissions" ], - "summary": "Create a contact point.", - "operationId": "RoutePostContactpoints", + "summary": "Updates permissions for a dashboard.", + "operationId": "updateDashboardPermissionsByUID", "parameters": [ { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" - } - } - ], - "responses": { - "202": { - "description": "EmbeddedContactPoint", - "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" + "$ref": "#/definitions/UpdateDashboardACLCommand" } }, - "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", + "name": "uid", "in": "path", "required": true - }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" - } } ], "responses": { - "202": { - "description": "Ack", - "schema": { - "$ref": "#/definitions/Ack" - } + "200": { + "$ref": "#/responses/okResponse" }, "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "consumes": [ - "application/json" - ], + } + }, + "/dashboards/uid/{uid}/restore": { + "post": { "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Delete a contact point.", - "operationId": "RouteDeleteContactpoints", + "summary": "Restore a dashboard to a given dashboard version using UID.", + "operationId": "restoreDashboardVersionByUID", "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RestoreDashboardVersionCommand" + } + }, { "type": "string", - "description": "UID is the contact point unique identifier", - "name": "UID", + "name": "uid", "in": "path", "required": true } ], "responses": { - "204": { - "description": " The contact point was deleted successfully." + "200": { + "$ref": "#/responses/postDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "/dashboards/uid/{uid}/versions": { "get": { "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Get a rule group.", - "operationId": "RouteGetAlertRuleGroup", + "summary": "Gets all existing versions for the dashboard using UID.", + "operationId": "getDashboardVersionsByUID", "parameters": [ { "type": "string", - "name": "FolderUID", + "name": "uid", "in": "path", "required": true }, { - "type": "string", - "name": "Group", - "in": "path", - "required": true + "type": "integer", + "format": "int64", + "default": 0, + "description": "Maximum number of results to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "description": "Version to start from when returning queries", + "name": "start", + "in": "query" } ], "responses": { "200": { - "description": "AlertRuleGroup", - "schema": { - "$ref": "#/definitions/AlertRuleGroup" - } + "$ref": "#/responses/dashboardVersionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "put": { - "consumes": [ - "application/json" - ], + } + }, + "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { + "get": { "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Update the interval of a rule group.", - "operationId": "RoutePutAlertRuleGroup", + "summary": "Get a specific dashboard version using UID.", + "operationId": "getDashboardVersionByUID", "parameters": [ { - "type": "string", - "name": "FolderUID", + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", "in": "path", "required": true }, { "type": "string", - "name": "Group", + "name": "uid", "in": "path", "required": true - }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/AlertRuleGroup" - } } ], "responses": { "200": { - "description": "AlertRuleGroup", - "schema": { - "$ref": "#/definitions/AlertRuleGroup" - } + "$ref": "#/responses/dashboardVersionResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/mute-timings": { + "/datasources": { "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 scope: `datasources:*`.", "tags": [ - "provisioning" + "datasources" ], - "summary": "Get all the mute timings.", - "operationId": "RouteGetMuteTimings", + "summary": "Get all data sources.", + "operationId": "getDataSources", "responses": { "200": { - "description": "MuteTimings", - "schema": { - "$ref": "#/definitions/MuteTimings" - } + "$ref": "#/responses/getDataSourcesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "post": { - "consumes": [ - "application/json" - ], + "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", "tags": [ - "provisioning" + "datasources" ], - "summary": "Create a new mute timing.", - "operationId": "RoutePostMuteTiming", + "summary": "Create a data source.", + "operationId": "addDataSource", "parameters": [ { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/MuteTimeInterval" + "$ref": "#/definitions/AddDataSourceCommand" } } ], "responses": { - "201": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/mute-timings/{name}": { + "/datasources/correlations": { "get": { "tags": [ - "provisioning" - ], - "summary": "Get a mute timing.", - "operationId": "RouteGetMuteTiming", - "parameters": [ - { - "type": "string", - "description": "Mute timing name", - "name": "name", - "in": "path", - "required": true - } + "correlations" ], + "summary": "Gets all correlations.", + "operationId": "getCorrelations", "responses": { "200": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "$ref": "#/responses/getCorrelationsResponse" }, - "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 + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } - } - ], - "responses": { - "200": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "404": { + "$ref": "#/responses/notFoundError" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "delete": { + } + }, + "/datasources/id/{name}": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", "tags": [ - "provisioning" + "datasources" ], - "summary": "Delete a mute timing.", - "operationId": "RouteDeleteMuteTiming", + "summary": "Get data source Id by Name.", + "operationId": "getDataSourceIdByName", "parameters": [ { "type": "string", - "description": "Mute timing name", "name": "name", "in": "path", "required": true } ], "responses": { - "204": { - "description": " The mute timing was deleted successfully." + "200": { + "$ref": "#/responses/getDataSourceIDResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/policies": { + "/datasources/name/{name}": { "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", "tags": [ - "provisioning" - ], - "summary": "Get the notification policy tree.", - "operationId": "RouteGetPolicyTree", - "responses": { - "200": { - "description": "Route", - "schema": { - "$ref": "#/definitions/Route" - } - } - } - }, - "put": { - "consumes": [ - "application/json" - ], - "tags": [ - "provisioning" + "datasources" ], - "summary": "Sets the notification policy tree.", - "operationId": "RoutePutPolicyTree", + "summary": "Get a single data source by Name.", + "operationId": "getDataSourceByName", "parameters": [ { - "description": "The new notification routing tree to use", - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/Route" - } + "type": "string", + "name": "name", + "in": "path", + "required": true } ], "responses": { - "202": { - "description": "Ack", - "schema": { - "$ref": "#/definitions/Ack" - } + "200": { + "$ref": "#/responses/getDataSourceResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "delete": { - "consumes": [ - "application/json" - ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", "tags": [ - "provisioning" + "datasources" ], - "summary": "Clears the notification policy tree.", - "operationId": "RouteResetPolicyTree", - "responses": { - "202": { - "description": "Ack", - "schema": { - "$ref": "#/definitions/Ack" - } + "summary": "Delete an existing data source by name.", + "operationId": "deleteDataSourceByName", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true } - } - } - }, - "/api/v1/provisioning/templates": { - "get": { - "tags": [ - "provisioning" ], - "summary": "Get all message templates.", - "operationId": "RouteGetTemplates", "responses": { "200": { - "description": "MessageTemplates", - "schema": { - "$ref": "#/definitions/MessageTemplates" - } + "$ref": "#/responses/deleteDataSourceByNameResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/templates/{name}": { + "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { "get": { + "description": "Proxies all calls to the actual data source.", "tags": [ - "provisioning" + "datasources" ], - "summary": "Get a message template.", - "operationId": "RouteGetTemplate", + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETByUIDcalls", "parameters": [ { "type": "string", - "description": "Template Name", - "name": "name", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "MessageTemplate", - "schema": { - "$ref": "#/definitions/MessageTemplate" - } + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, - "put": { - "consumes": [ - "application/json" - ], + "post": { + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", "tags": [ - "provisioning" + "datasources" ], - "summary": "Updates an existing template.", - "operationId": "RoutePutTemplate", + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTByUIDcalls", "parameters": [ + { + "name": "DatasourceProxyParam", + "in": "body", + "required": true, + "schema": {} + }, { "type": "string", - "description": "Template Name", - "name": "name", + "name": "datasource_proxy_route", "in": "path", "required": true }, { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/MessageTemplateContent" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { + "201": { + "description": "(empty)" + }, "202": { - "description": "MessageTemplate", - "schema": { - "$ref": "#/definitions/MessageTemplate" - } + "description": "(empty)" }, "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "delete": { + "description": "Proxies all calls to the actual data source.", "tags": [ - "provisioning" + "datasources" ], - "summary": "Delete a template.", - "operationId": "RouteDeleteTemplate", + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEByUIDcalls", "parameters": [ { "type": "string", - "description": "Template Name", - "name": "name", + "name": "uid", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true } ], "responses": { - "204": { - "description": " The template was deleted successfully." + "202": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/auth/keys": { + "/datasources/proxy/{id}/{datasource_proxy_route}": { "get": { - "description": "Will return auth keys.", + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", "tags": [ - "api_keys" + "datasources" ], - "summary": "Get auth keys.", - "operationId": "getAPIkeys", + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETcalls", + "deprecated": true, "parameters": [ { - "type": "boolean", - "default": false, - "description": "Show expired keys", - "name": "includeExpired", - "in": "query" + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAPIkeyResponse" + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2490,25 +4294,39 @@ } }, "post": { - "description": "Will return details of the created API key.", + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined\n\nPlease refer to [updated API](#/datasources/datasourceProxyPOSTByUIDcalls) instead", "tags": [ - "api_keys" + "datasources" ], - "summary": "Creates an API key.", - "operationId": "addAPIkey", + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTcalls", + "deprecated": true, "parameters": [ { - "name": "Body", + "name": "DatasourceProxyParam", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/AddCommand" - } + "schema": {} + }, + { + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "id", + "in": "path", + "required": true } ], "responses": { - "200": { - "$ref": "#/responses/postAPIkeyResponse" + "201": { + "description": "(empty)" + }, + "202": { + "description": "(empty)" }, "400": { "$ref": "#/responses/badRequestError" @@ -2519,34 +4337,42 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/auth/keys/{id}": { + }, "delete": { + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", "tags": [ - "api_keys" + "datasources" ], - "summary": "Delete API key.", - "operationId": "deleteAPIkey", + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEcalls", + "deprecated": true, "parameters": [ { - "type": "integer", - "format": "int64", + "type": "string", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "202": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2563,79 +4389,64 @@ } } }, - "/dashboard/snapshots": { + "/datasources/uid/{sourceUID}/correlations": { "get": { "tags": [ - "snapshots" + "correlations" ], - "summary": "List snapshots.", - "operationId": "searchDashboardSnapshots", + "summary": "Gets all correlations originating from the given data source.", + "operationId": "getCorrelationsBySourceUID", "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" + "name": "sourceUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/searchDashboardSnapshotsResponse" + "$ref": "#/responses/getCorrelationsBySourceUIDResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/calculate-diff": { + }, "post": { - "produces": [ - "application/json", - "text/html" - ], "tags": [ - "dashboards" + "correlations" ], - "summary": "Perform diff on two dashboards.", - "operationId": "calculateDashboardDiff", + "summary": "Add correlation.", + "operationId": "createCorrelation", "parameters": [ { - "name": "Body", + "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" - } - } + "$ref": "#/definitions/CreateCorrelationCommand" } + }, + { + "type": "string", + "name": "sourceUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/calculateDashboardDiffResponse" + "$ref": "#/responses/createCorrelationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2643,99 +4454,122 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/db": { - "post": { - "description": "Creates a new dashboard or updates an existing dashboard.", + "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "get": { "tags": [ - "dashboards" + "correlations" ], - "summary": "Create / Update dashboard", - "operationId": "postDashboard", + "summary": "Gets a correlation.", + "operationId": "getCorrelation", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SaveDashboardCommand" - } + "type": "string", + "name": "sourceUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "correlationUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getCorrelationResponse" }, "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": { + }, + "patch": { "tags": [ - "dashboards" + "correlations" + ], + "summary": "Updates a correlation.", + "operationId": "updateCorrelation", + "parameters": [ + { + "type": "string", + "name": "sourceUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "correlationUID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UpdateCorrelationCommand" + } + } ], - "summary": "Get home dashboard.", - "operationId": "getHomeDashboard", "responses": { "200": { - "$ref": "#/responses/getHomeDashboardResponse" + "$ref": "#/responses/updateCorrelationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/id/{DashboardID}/permissions": { + "/datasources/uid/{uid}": { "get": { - "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsListByUID) instead", + "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:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissionsListByID", - "deprecated": true, + "summary": "Get a single data source by UID.", + "operationId": "getDataSourceByUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsListResponse" + "$ref": "#/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2751,37 +4585,62 @@ } } }, - "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.", + "put": { + "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:1` (single data source).", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Updates permissions for a dashboard.", - "operationId": "updateDashboardPermissionsByID", - "deprecated": true, + "summary": "Update an existing data source.", + "operationId": "updateDataSourceByUID", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" + "$ref": "#/definitions/UpdateDataSourceCommand" } }, { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, - "400": { - "$ref": "#/responses/badRequestError" + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + "tags": [ + "datasources" + ], + "summary": "Delete an existing data source by UID.", + "operationId": "deleteDataSourceByUID", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2798,35 +4657,30 @@ } } }, - "/dashboards/id/{DashboardID}/restore": { - "post": { - "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", + "/datasources/uid/{uid}/correlations/{correlationUID}": { + "delete": { "tags": [ - "dashboard_versions" + "correlations" ], - "summary": "Restore a dashboard to a given dashboard version.", - "operationId": "restoreDashboardVersionByID", - "deprecated": true, + "summary": "Delete a correlation.", + "operationId": "deleteCorrelation", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RestoreDashboardVersionCommand" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true }, { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "correlationUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" + "$ref": "#/responses/deleteCorrelationResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2843,27 +4697,27 @@ } } }, - "/dashboards/id/{DashboardID}/versions": { + "/datasources/uid/{uid}/health": { "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Gets all existing versions for the dashboard.", - "operationId": "getDashboardVersionsByID", - "deprecated": true, + "summary": "Sends a health check request to the plugin datasource identified by the UID.", + "operationId": "checkDatasourceHealthWithUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2871,43 +4725,39 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Get a specific dashboard version.", - "operationId": "getDashboardVersionByID", - "deprecated": true, + "summary": "Fetch data source resources.", + "operationId": "callDatasourceResourceWithUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true }, { - "type": "integer", - "format": "int64", - "name": "DashboardVersionID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2924,26 +4774,26 @@ } } }, - "/dashboards/import": { + "/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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Import dashboard.", - "operationId": "importDashboard", + "summary": "Disable permissions for a data source.", + "operationId": "disablePermissions", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ImportDashboardRequest" - } + "type": "string", + "name": "datasourceId", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/importDashboardResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -2951,11 +4801,11 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "412": { - "$ref": "#/responses/preconditionFailedError" + "403": { + "$ref": "#/responses/forbiddenError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -2963,75 +4813,122 @@ } } }, - "/dashboards/tags": { - "get": { + "/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": [ - "dashboards" + "datasource_permissions", + "enterprise" + ], + "summary": "Enable permissions for a data source.", + "operationId": "enablePermissions", + "parameters": [ + { + "type": "string", + "name": "datasourceId", + "in": "path", + "required": true + } ], - "summary": "Get all dashboards tags of an organisation.", - "operationId": "getDashboardTags", "responses": { "200": { - "$ref": "#/responses/getDashboardsTagsResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/trim": { - "post": { + "/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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Trim defaults from dashboard.", - "operationId": "trimDashboard", + "summary": "Get permissions for a data source.", + "operationId": "getAllPermissions", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TrimDashboardCommand" - } + "type": "string", + "name": "datasourceId", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/trimDashboardResponse" + "$ref": "#/responses/getAllPermissionseResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/uid/{uid}": { - "get": { - "description": "Will return the dashboard given the dashboard unique identifier (uid).", + }, + "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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Get dashboard by uid.", - "operationId": "getDashboardByUID", + "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": "uid", + "name": "builtinRole", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "name": "permission", + "in": "query" + }, + { + "type": "string", + "name": "datasourceId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardResponse" + "$ref": "#/responses/addPermissionResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3046,25 +4943,34 @@ "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/datasources/{datasourceId}/permissions/{permissionId}": { "delete": { - "description": "Will delete the dashboard given the specified unique identifier (uid).", + "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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Delete dashboard by uid.", - "operationId": "deleteDashboardByUID", + "summary": "Remove permission for a data source.", + "operationId": "deletePermissions", "parameters": [ { "type": "string", - "name": "uid", + "name": "datasourceId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "permissionId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/deleteDashboardResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3074,31 +4980,33 @@ }, "404": { "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{uid}/permissions": { + "/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", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissionsListByUID", + "summary": "Get a single data source by Id.", + "operationId": "getDataSourceByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsListResponse" + "$ref": "#/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3114,35 +5022,33 @@ } } }, - "post": { - "description": "This operation will remove existing permissions if they’re not included in the request.", + "put": { + "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/updateDataSourceByUID) instead", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Updates permissions for a dashboard.", - "operationId": "updateDashboardPermissionsByUID", + "summary": "Update an existing data source by its sequential ID.", + "operationId": "updateDataSourceByID", + "deprecated": true, "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" + "$ref": "#/definitions/UpdateDataSourceCommand" } }, { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3150,41 +5056,30 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/uid/{uid}/restore": { - "post": { + }, + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/deleteDataSourceByUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Restore a dashboard to a given dashboard version using UID.", - "operationId": "restoreDashboardVersionByUID", + "summary": "Delete an existing data source by id.", + "operationId": "deleteDataSourceByID", + "deprecated": true, "parameters": [ - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RestoreDashboardVersionCommand" - } - }, { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3201,40 +5096,29 @@ } } }, - "/dashboards/uid/{uid}/versions": { + "/datasources/{id}/health": { "get": { + "description": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Gets all existing versions for the dashboard using UID.", - "operationId": "getDashboardVersionsByUID", + "summary": "Sends a health check request to the plugin datasource identified by the ID.", + "operationId": "checkDatasourceHealthByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true - }, - { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Maximum number of results to return", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Version to start from when returning queries", - "name": "start", - "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3242,40 +5126,41 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { + "/datasources/{id}/resources/{datasource_proxy_route}": { "get": { + "description": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Get a specific dashboard version using UID.", - "operationId": "getDashboardVersionByUID", + "summary": "Fetch data source resources by Id.", + "operationId": "callDatasourceResourceByID", + "deprecated": true, "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardVersionID", + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true }, { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3292,81 +5177,39 @@ } } }, - "/datasources": { - "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 scope: `datasources:*`.", - "tags": [ - "datasources" - ], - "summary": "Get all data sources.", - "operationId": "getDataSources", - "responses": { - "200": { - "$ref": "#/responses/getDataSourcesResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, + "/ds/query": { "post": { - "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:query`.", "tags": [ - "datasources" + "ds" ], - "summary": "Create a data source.", - "operationId": "addDataSource", + "summary": "DataSource query metrics with expressions.", + "operationId": "queryMetricsWithExpressions", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddDataSourceCommand" + "$ref": "#/definitions/MetricRequest" } } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/queryMetricsWithExpressionsRespons" }, - "409": { - "$ref": "#/responses/conflictError" + "207": { + "$ref": "#/responses/queryMetricsWithExpressionsRespons" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/datasources/correlations": { - "get": { - "tags": [ - "correlations" - ], - "summary": "Gets all correlations.", - "operationId": "getCorrelations", - "responses": { - "200": { - "$ref": "#/responses/getCorrelationsResponse" + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -3374,25 +5217,35 @@ } } }, - "/datasources/id/{name}": { + "/folders": { "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + "description": "Returns all folders that the authenticated user has permission to view.", "tags": [ - "datasources" + "folders" ], - "summary": "Get data source Id by Name.", - "operationId": "getDataSourceIdByName", + "summary": "Get all folders.", + "operationId": "getFolders", "parameters": [ { - "type": "string", - "name": "name", - "in": "path", - "required": true + "type": "integer", + "format": "int64", + "default": 1000, + "description": "Limit the maximum number of folders to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "description": "Page index for starting fetching folders", + "name": "page", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceIDResponse" + "$ref": "#/responses/getFoldersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3400,34 +5253,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/name/{name}": { - "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + }, + "post": { "tags": [ - "datasources" + "folders" ], - "summary": "Get a single data source by Name.", - "operationId": "getDataSourceByName", + "summary": "Create folder.", + "operationId": "createFolder", "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateFolderCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" + "$ref": "#/responses/folderResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3435,29 +5287,35 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + } + }, + "/folders/id/{folder_id}": { + "get": { + "description": "Returns the folder identified by id.", "tags": [ - "datasources" + "folders" ], - "summary": "Delete an existing data source by name.", - "operationId": "deleteDataSourceByName", + "summary": "Get folder by id.", + "operationId": "getFolderByID", "parameters": [ { - "type": "string", - "name": "name", + "type": "integer", + "format": "int64", + "name": "folder_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/deleteDataSourceByNameResponse" + "$ref": "#/responses/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3474,34 +5332,24 @@ } } }, - "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "/folders/{folder_uid}": { "get": { - "description": "Proxies all calls to the actual data source.", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETByUIDcalls", + "summary": "Get folder by uid.", + "operationId": "getFolderByUID", "parameters": [ { "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "uid", + "name": "folder_uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "(empty)" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3517,39 +5365,32 @@ } } }, - "post": { - "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", + "put": { "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTByUIDcalls", + "summary": "Update folder.", + "operationId": "updateFolder", "parameters": [ - { - "name": "DatasourceProxyParam", - "in": "body", - "required": true, - "schema": {} - }, { "type": "string", - "name": "datasource_proxy_route", + "name": "folder_uid", "in": "path", "required": true }, { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "description": "To change the unique identifier (uid), provide another one.\nTo overwrite an existing folder with newer version, set `overwrite` to `true`.\nProvide the current version to safelly update the folder: if the provided version differs from the stored one the request will fail, unless `overwrite` is `true`.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateFolderCommand" + } } ], "responses": { - "201": { - "description": "(empty)" - }, - "202": { - "description": "(empty)" + "200": { + "$ref": "#/responses/folderResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3563,35 +5404,39 @@ "404": { "$ref": "#/responses/notFoundError" }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "delete": { - "description": "Proxies all calls to the actual data source.", + "description": "Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted.", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEByUIDcalls", + "summary": "Delete folder.", + "operationId": "deleteFolder", "parameters": [ { "type": "string", - "name": "uid", + "name": "folder_uid", "in": "path", "required": true }, { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true + "type": "boolean", + "default": false, + "description": "If `true` any Grafana 8 Alerts under this folder will be deleted.\nSet to `false` so that the request will fail if the folder contains any Grafana 8 Alerts.", + "name": "forceDeleteRules", + "in": "query" } ], "responses": { - "202": { - "description": "(empty)" + "200": { + "$ref": "#/responses/deleteFolderResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3611,35 +5456,24 @@ } } }, - "/datasources/proxy/{id}/{datasource_proxy_route}": { + "/folders/{folder_uid}/permissions": { "get": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", "tags": [ - "datasources" + "folder_permissions" ], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETcalls", - "deprecated": true, + "summary": "Gets all existing permissions for the folder with the given `uid`.", + "operationId": "getFolderPermissionList", "parameters": [ { "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "id", + "name": "folder_uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "(empty)" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getFolderPermissionListResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3656,42 +5490,30 @@ } }, "post": { - "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined\n\nPlease refer to [updated API](#/datasources/datasourceProxyPOSTByUIDcalls) instead", "tags": [ - "datasources" + "folder_permissions" ], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTcalls", - "deprecated": true, + "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", + "operationId": "updateFolderPermissions", "parameters": [ - { - "name": "DatasourceProxyParam", - "in": "body", - "required": true, - "schema": {} - }, { "type": "string", - "name": "datasource_proxy_route", + "name": "folder_uid", "in": "path", "required": true }, { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardACLCommand" + } } ], "responses": { - "201": { - "description": "(empty)" - }, - "202": { - "description": "(empty)" - }, - "400": { - "$ref": "#/responses/badRequestError" + "200": { + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3706,106 +5528,111 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", + } + }, + "/library-elements": { + "get": { + "description": "Returns a list of all library elements the authenticated user has permission to view.\nUse the `perPage` query parameter to control the maximum number of library elements returned; the default limit is `100`.\nYou can also use the `page` query parameter to fetch library elements from any page other than the first one.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEcalls", - "deprecated": true, + "summary": "Get all library elements.", + "operationId": "getLibraryElements", "parameters": [ { "type": "string", - "name": "id", - "in": "path", - "required": true + "description": "Part of the name or description searched for.", + "name": "searchString", + "in": "query" }, { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "(empty)" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "enum": [ + 1, + 2 + ], + "type": "integer", + "format": "int64", + "description": "Kind of element to search for.", + "name": "kind", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "enum": [ + "alpha-asc", + "alpha-desc" + ], + "type": "string", + "description": "Sort order of elements.", + "name": "sortDirection", + "in": "query" }, - "404": { - "$ref": "#/responses/notFoundError" + { + "type": "string", + "description": "A comma separated list of types to filter the elements by", + "name": "typeFilter", + "in": "query" + }, + { + "type": "string", + "description": "Element UID to exclude from search results.", + "name": "excludeUid", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/datasources/uid/{sourceUID}/correlations": { - "get": { - "tags": [ - "correlations" - ], - "summary": "Gets all correlations originating from the given data source.", - "operationId": "getCorrelationsBySourceUID", - "parameters": [ { "type": "string", - "name": "sourceUID", - "in": "path", - "required": true + "description": "A comma separated list of folder ID(s) to filter the elements by.", + "name": "folderFilter", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 100, + "description": "The number of results per page.", + "name": "perPage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", + "name": "page", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getCorrelationsBySourceUIDResponse" + "$ref": "#/responses/getLibraryElementsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { + "description": "Creates a new library element.", "tags": [ - "correlations" + "library_elements" ], - "summary": "Add correlation.", - "operationId": "createCorrelation", + "summary": "Create library element.", + "operationId": "createLibraryElement", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateCorrelationCommand" + "$ref": "#/definitions/CreateLibraryElementCommand" } - }, - { - "type": "string", - "name": "sourceUID", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/createCorrelationResponse" + "$ref": "#/responses/getLibraryElementResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3825,30 +5652,25 @@ } } }, - "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "/library-elements/name/{library_element_name}": { "get": { + "description": "Returns a library element with the given name.", "tags": [ - "correlations" + "library_elements" ], - "summary": "Gets a correlation.", - "operationId": "getCorrelation", + "summary": "Get library element by name.", + "operationId": "getLibraryElementByName", "parameters": [ { "type": "string", - "name": "sourceUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", + "name": "library_element_name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getCorrelationResponse" + "$ref": "#/responses/getLibraryElementResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3860,47 +5682,31 @@ "$ref": "#/responses/internalServerError" } } - }, - "patch": { + } + }, + "/library-elements/{library_element_uid}": { + "get": { + "description": "Returns a library element with the given UID.", "tags": [ - "correlations" + "library_elements" ], - "summary": "Updates a correlation.", - "operationId": "updateCorrelation", + "summary": "Get library element by UID.", + "operationId": "getLibraryElementByUID", "parameters": [ { "type": "string", - "name": "sourceUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", + "name": "library_element_uid", "in": "path", "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/UpdateCorrelationCommand" - } } ], "responses": { "200": { - "$ref": "#/responses/updateCorrelationResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getLibraryElementResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "404": { "$ref": "#/responses/notFoundError" }, @@ -3908,27 +5714,25 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/uid/{uid}": { - "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:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + }, + "delete": { + "description": "Deletes an existing library element as specified by the UID. This operation cannot be reverted.\nYou cannot delete a library element that is connected. This operation cannot be reverted.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Get a single data source by UID.", - "operationId": "getDataSourceByUID", + "summary": "Delete library element.", + "operationId": "deleteLibraryElementByUID", "parameters": [ { "type": "string", - "name": "uid", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3947,32 +5751,35 @@ } } }, - "put": { - "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:1` (single data source).", + "patch": { + "description": "Updates an existing library element identified by uid.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Update an existing data source.", - "operationId": "updateDataSourceByUID", + "summary": "Update library element.", + "operationId": "updateLibraryElement", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDataSourceCommand" + "$ref": "#/definitions/PatchLibraryElementCommand" } }, { "type": "string", - "name": "uid", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3980,36 +5787,41 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + } + }, + "/library-elements/{library_element_uid}/connections/": { + "get": { + "description": "Returns a list of connections for a library element based on the UID specified.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Delete an existing data source by UID.", - "operationId": "deleteDataSourceByUID", + "summary": "Get library element connections.", + "operationId": "getLibraryElementConnections", "parameters": [ { "type": "string", - "name": "uid", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getLibraryElementConnectionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "404": { "$ref": "#/responses/notFoundError" }, @@ -4019,64 +5831,144 @@ } } }, - "/datasources/uid/{uid}/correlations/{correlationUID}": { - "delete": { + "/licensing/check": { + "get": { "tags": [ - "correlations" + "licensing", + "enterprise" ], - "summary": "Delete a correlation.", - "operationId": "deleteCorrelation", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", - "in": "path", - "required": true + "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/deleteCorrelationResponse" + "$ref": "#/responses/getCustomPermissionsReportResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "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" }, - "404": { - "$ref": "#/responses/notFoundError" + "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" } } - } - }, - "/datasources/uid/{uid}/health": { - "get": { + } + }, + "/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": [ - "datasources" + "licensing", + "enterprise" ], - "summary": "Sends a health check request to the plugin datasource identified by the UID.", - "operationId": "checkDatasourceHealthWithUID", + "summary": "Remove license from database.", + "operationId": "deleteLicenseToken", "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "202": { + "$ref": "#/responses/acceptedResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4087,45 +5979,58 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { - "get": { + "/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": [ - "datasources" + "licensing", + "enterprise" ], - "summary": "Fetch data source resources.", - "operationId": "callDatasourceResourceWithUID", + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", "parameters": [ { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/postRenewLicenseTokenResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "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" @@ -4136,29 +6041,16 @@ } } }, - "/datasources/{id}": { + "/org": { "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", "tags": [ - "datasources" - ], - "summary": "Get a single data source by Id.", - "operationId": "getDataSourceByID", - "deprecated": true, - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true - } + "org" ], + "summary": "Get current Organization.", + "operationId": "getCurrentOrg", "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getCurrentOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4166,41 +6058,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "put": { - "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/updateDataSourceByUID) instead", "tags": [ - "datasources" + "org" ], - "summary": "Update an existing data source by its sequential ID.", - "operationId": "updateDataSourceByID", - "deprecated": true, + "summary": "Update current Organization.", + "operationId": "updateCurrentOrg", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDataSourceCommand" + "$ref": "#/definitions/UpdateOrgForm" } - }, - { - "type": "string", - "name": "id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4212,65 +6096,54 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/deleteDataSourceByUID) instead", + } + }, + "/org/address": { + "put": { "tags": [ - "datasources" + "org" ], - "summary": "Delete an existing data source by id.", - "operationId": "deleteDataSourceByID", - "deprecated": true, + "summary": "Update current Organization's address.", + "operationId": "updateCurrentOrgAddress", "parameters": [ { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } } ], "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" } } } }, - "/datasources/{id}/health": { + "/org/invites": { "get": { - "description": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", "tags": [ - "datasources" - ], - "summary": "Sends a health check request to the plugin datasource identified by the ID.", - "operationId": "checkDatasourceHealthByID", - "deprecated": true, - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true - } + "org_invites" ], + "summary": "Get pending invites.", + "operationId": "getPendingOrgInvites", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getPendingOrgInvitesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4282,29 +6155,21 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/{id}/resources/{datasource_proxy_route}": { - "get": { - "description": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", + }, + "post": { "tags": [ - "datasources" + "org_invites" ], - "summary": "Fetch data source resources by Id.", - "operationId": "callDatasourceResourceByID", - "deprecated": true, + "summary": "Add invite.", + "operationId": "addOrgInvite", "parameters": [ { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddInviteForm" + } } ], "responses": { @@ -4320,8 +6185,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "412": { + "$ref": "#/responses/SMTPNotEnabledError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4329,33 +6194,24 @@ } } }, - "/ds/query": { - "post": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:query`.", + "/org/invites/{invitation_code}/revoke": { + "delete": { "tags": [ - "ds" + "org_invites" ], - "summary": "DataSource query metrics with expressions.", - "operationId": "queryMetricsWithExpressions", + "summary": "Revoke invite.", + "operationId": "revokeInvite", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MetricRequest" - } + "type": "string", + "name": "invitation_code", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/queryMetricsWithExpressionsRespons" - }, - "207": { - "$ref": "#/responses/queryMetricsWithExpressionsRespons" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4363,41 +6219,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/folders": { - "get": { - "description": "Returns all folders that the authenticated user has permission to view.", - "tags": [ - "folders" - ], - "summary": "Get all folders.", - "operationId": "getFolders", - "parameters": [ - { - "type": "integer", - "format": "int64", - "default": 1000, - "description": "Limit the maximum number of folders to return", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 1, - "description": "Page index for starting fetching folders", - "name": "page", - "in": "query" - } + "/org/preferences": { + "get": { + "tags": [ + "org_preferences" ], + "summary": "Get Current Org Prefs.", + "operationId": "getOrgPreferences", "responses": { "200": { - "$ref": "#/responses/getFoldersResponse" + "$ref": "#/responses/getPreferencesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4410,25 +6250,25 @@ } } }, - "post": { + "put": { "tags": [ - "folders" + "org_preferences" ], - "summary": "Create folder.", - "operationId": "createFolder", + "summary": "Update Current Org Prefs.", + "operationId": "updateOrgPreferences", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateFolderCommand" + "$ref": "#/definitions/UpdatePrefsCmd" } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4439,35 +6279,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/folders/id/{folder_id}": { - "get": { - "description": "Returns the folder identified by id.", + }, + "patch": { "tags": [ - "folders" + "org_preferences" ], - "summary": "Get folder by id.", - "operationId": "getFolderByID", + "summary": "Patch Current Org Prefs.", + "operationId": "patchOrgPreferences", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "folder_id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchPrefsCmd" + } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4475,33 +6313,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/folders/{folder_uid}": { + "/org/users": { "get": { + "description": "Returns all org users within the current organization. Accessible to users with org admin role.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", "tags": [ - "folders" - ], - "summary": "Get folder by uid.", - "operationId": "getFolderByUID", - "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - } + "org" ], + "summary": "Get all users within the current organization.", + "operationId": "getOrgUsersForCurrentOrg", "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/getOrgUsersForCurrentOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4509,43 +6337,31 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "put": { + "post": { + "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", "tags": [ - "folders" + "org" ], - "summary": "Update folder.", - "operationId": "updateFolder", + "summary": "Add a new user to the current organization.", + "operationId": "addOrgUserToCurrentOrg", "parameters": [ { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - }, - { - "description": "To change the unique identifier (uid), provide another one.\nTo overwrite an existing folder with newer version, set `overwrite` to `true`.\nProvide the current version to safelly update the folder: if the provided version differs from the stored one the request will fail, unless `overwrite` is `true`.", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateFolderCommand" + "$ref": "#/definitions/AddOrgUserCommand" } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4553,45 +6369,36 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted.", + } + }, + "/org/users/lookup": { + "get": { + "description": "Returns all org users within the current organization, but with less detailed information.\nAccessible to users with org admin role, admin in any folder or admin of any team.\nMainly used by Grafana UI for providing list of users when adding team members and when editing folder/dashboard permissions.", "tags": [ - "folders" + "org" ], - "summary": "Delete folder.", - "operationId": "deleteFolder", + "summary": "Get all users within the current organization (lookup)", + "operationId": "getOrgUsersForCurrentOrgLookup", "parameters": [ { "type": "string", - "name": "folder_uid", - "in": "path", - "required": true + "name": "query", + "in": "query" }, { - "type": "boolean", - "default": false, - "description": "If `true` any Grafana 8 Alerts under this folder will be deleted.\nSet to `false` so that the request will fail if the folder contains any Grafana 8 Alerts.", - "name": "forceDeleteRules", + "type": "integer", + "format": "int64", + "name": "limit", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/deleteFolderResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getOrgUsersForCurrentOrgLookupResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4599,33 +6406,35 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/folders/{folder_uid}/permissions": { - "get": { + "/org/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", "tags": [ - "folder_permissions" + "org" ], - "summary": "Gets all existing permissions for the folder with the given `uid`.", - "operationId": "getFolderPermissionList", + "summary": "Delete user in current organization.", + "operationId": "removeOrgUserForCurrentOrg", "parameters": [ { - "type": "string", - "name": "folder_uid", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getFolderPermissionListResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4633,161 +6442,132 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { + "patch": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", "tags": [ - "folder_permissions" + "org" ], - "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", - "operationId": "updateFolderPermissions", + "summary": "Updates the given user.", + "operationId": "updateOrgUserForCurrentOrg", "parameters": [ { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - }, - { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" + "$ref": "#/definitions/UpdateOrgUserCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "user_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" } } } }, - "/library-elements": { + "/orgs": { "get": { - "description": "Returns a list of all library elements the authenticated user has permission to view.\nUse the `perPage` query parameter to control the maximum number of library elements returned; the default limit is `100`.\nYou can also use the `page` query parameter to fetch library elements from any page other than the first one.", + "security": [ + { + "basic": [] + } + ], "tags": [ - "library_elements" + "orgs" ], - "summary": "Get all library elements.", - "operationId": "getLibraryElements", + "summary": "Search all Organizations.", + "operationId": "searchOrgs", "parameters": [ { - "type": "string", - "description": "Part of the name or description searched for.", - "name": "searchString", - "in": "query" - }, - { - "enum": [ - 1, - 2 - ], "type": "integer", "format": "int64", - "description": "Kind of element to search for.", - "name": "kind", - "in": "query" - }, - { - "enum": [ - "alpha-asc", - "alpha-desc" - ], - "type": "string", - "description": "Sort order of elements.", - "name": "sortDirection", - "in": "query" - }, - { - "type": "string", - "description": "A comma separated list of types to filter the elements by", - "name": "typeFilter", - "in": "query" - }, - { - "type": "string", - "description": "Element UID to exclude from search results.", - "name": "excludeUid", - "in": "query" - }, - { - "type": "string", - "description": "A comma separated list of folder ID(s) to filter the elements by.", - "name": "folderFilter", + "default": 1, + "name": "page", "in": "query" }, { "type": "integer", "format": "int64", - "default": 100, - "description": "The number of results per page.", - "name": "perPage", + "default": 1000, + "description": "Number of items per page\nThe totalCount field in the response can be used for pagination list E.g. if totalCount is equal to 100 teams and the perpage parameter is set to 10 then there are 10 pages of teams.", + "name": "perpage", "in": "query" }, { - "type": "integer", - "format": "int64", - "default": 1, - "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", - "name": "page", + "type": "string", + "name": "name", + "in": "query" + }, + { + "type": "string", + "description": "If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.", + "name": "query", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementsResponse" + "$ref": "#/responses/searchOrgsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { - "description": "Creates a new library element.", + "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", "tags": [ - "library_elements" + "orgs" ], - "summary": "Create library element.", - "operationId": "createLibraryElement", + "summary": "Create Organization.", + "operationId": "createOrg", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateLibraryElementCommand" + "$ref": "#/definitions/CreateOrgCommand" } } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4795,8 +6575,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4804,31 +6584,35 @@ } } }, - "/library-elements/name/{library_element_name}": { + "/orgs/name/{org_name}": { "get": { - "description": "Returns a library element with the given name.", + "security": [ + { + "basic": [] + } + ], "tags": [ - "library_elements" + "orgs" ], - "summary": "Get library element by name.", - "operationId": "getLibraryElementByName", + "summary": "Get Organization by ID.", + "operationId": "getOrgByName", "parameters": [ { "type": "string", - "name": "library_element_name", + "name": "org_name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/getOrgByNameResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4836,48 +6620,66 @@ } } }, - "/library-elements/{library_element_uid}": { + "/orgs/{org_id}": { "get": { - "description": "Returns a library element with the given UID.", + "security": [ + { + "basic": [] + } + ], "tags": [ - "library_elements" + "orgs" ], - "summary": "Get library element by UID.", - "operationId": "getLibraryElementByUID", + "summary": "Get Organization by ID.", + "operationId": "getOrgByID", "parameters": [ { - "type": "string", - "name": "library_element_uid", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/getOrgByIDResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "delete": { - "description": "Deletes an existing library element as specified by the UID. This operation cannot be reverted.\nYou cannot delete a library element that is connected. This operation cannot be reverted.", + "put": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "library_elements" + "orgs" ], - "summary": "Delete library element.", - "operationId": "deleteLibraryElementByUID", + "summary": "Update Organization.", + "operationId": "updateOrg", "parameters": [ { - "type": "string", - "name": "library_element_uid", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgForm" + } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } @@ -4895,40 +6697,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "description": "Updates an existing library element identified by uid.", + "delete": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "library_elements" + "orgs" ], - "summary": "Update library element.", - "operationId": "updateLibraryElement", + "summary": "Delete Organization.", + "operationId": "deleteOrgByID", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchLibraryElementCommand" - } - }, - { - "type": "string", - "name": "library_element_uid", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4942,57 +6738,42 @@ "404": { "$ref": "#/responses/notFoundError" }, - "412": { - "$ref": "#/responses/preconditionFailedError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/library-elements/{library_element_uid}/connections/": { - "get": { - "description": "Returns a list of connections for a library element based on the UID specified.", + "/orgs/{org_id}/address": { + "put": { "tags": [ - "library_elements" + "orgs" ], - "summary": "Get library element connections.", - "operationId": "getLibraryElementConnections", + "summary": "Update Organization's address.", + "operationId": "updateOrgAddress", "parameters": [ { - "type": "string", - "name": "library_element_uid", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementConnectionsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "$ref": "#/responses/okResponse" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/org": { - "get": { - "tags": [ - "org" - ], - "summary": "Get current Organization.", - "operationId": "getCurrentOrg", - "responses": { - "200": { - "$ref": "#/responses/getCurrentOrgResponse" + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5004,29 +6785,28 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { + } + }, + "/orgs/{org_id}/quotas": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:read` and scope `org:id:1` (orgIDScope).", "tags": [ - "org" + "orgs" ], - "summary": "Update current Organization.", - "operationId": "updateCurrentOrg", + "summary": "Fetch Organization quota.", + "operationId": "getOrgQuota", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgForm" - } + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getQuotaResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5034,58 +6814,95 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/address": { + "/orgs/{org_id}/quotas/{quota_target}": { "put": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).", "tags": [ - "org" + "orgs" ], - "summary": "Update current Organization's address.", - "operationId": "updateCurrentOrgAddress", + "summary": "Update user quota.", + "operationId": "updateOrgQuota", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgAddressForm" + "$ref": "#/definitions/UpdateOrgQuotaCmd" } + }, + { + "type": "string", + "name": "quota_target", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "org_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" } } } }, - "/org/invites": { + "/orgs/{org_id}/users": { "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", "tags": [ - "org_invites" + "orgs" + ], + "summary": "Get Users in Organization.", + "operationId": "getOrgUsers", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + } ], - "summary": "Get pending invites.", - "operationId": "getPendingOrgInvites", "responses": { "200": { - "$ref": "#/responses/getPendingOrgInvitesResponse" + "$ref": "#/responses/getOrgUsersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5099,54 +6916,65 @@ } }, "post": { + "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", "tags": [ - "org_invites" + "orgs" ], - "summary": "Add invite.", - "operationId": "addOrgInvite", + "summary": "Add a new user to the current organization.", + "operationId": "addOrgUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddInviteForm" + "$ref": "#/definitions/AddOrgUserCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "412": { - "$ref": "#/responses/SMTPNotEnabledError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/invites/{invitation_code}/revoke": { + "/orgs/{org_id}/users/{user_id}": { "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", "tags": [ - "org_invites" + "orgs" ], - "summary": "Revoke invite.", - "operationId": "revokeInvite", + "summary": "Delete user in current organization.", + "operationId": "removeOrgUser", "parameters": [ { - "type": "string", - "name": "invitation_code", + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } @@ -5155,31 +6983,8 @@ "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/org/preferences": { - "get": { - "tags": [ - "org_preferences" - ], - "summary": "Get Current Org Prefs.", - "operationId": "getOrgPreferences", - "responses": { - "200": { - "$ref": "#/responses/getPreferencesResponse" + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5192,20 +6997,35 @@ } } }, - "put": { + "patch": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", "tags": [ - "org_preferences" + "orgs" ], - "summary": "Update Current Org Prefs.", - "operationId": "updateOrgPreferences", + "summary": "Update Users in Organization.", + "operationId": "updateOrgUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdatePrefsCmd" + "$ref": "#/definitions/UpdateOrgUserCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { @@ -5225,29 +7045,57 @@ "$ref": "#/responses/internalServerError" } } + } + }, + "/playlists": { + "get": { + "tags": [ + "playlists" + ], + "summary": "Get playlists.", + "operationId": "searchPlaylists", + "parameters": [ + { + "type": "string", + "name": "query", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "in:limit", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/searchPlaylistsResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } }, - "patch": { + "post": { "tags": [ - "org_preferences" + "playlists" ], - "summary": "Patch Current Org Prefs.", - "operationId": "patchOrgPreferences", + "summary": "Create playlist.", + "operationId": "createPlaylist", "parameters": [ { - "name": "body", + "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PatchPrefsCmd" + "$ref": "#/definitions/CreatePlaylistCommand" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createPlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5255,23 +7103,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/users": { + "/playlists/{uid}": { "get": { - "description": "Returns all org users within the current organization. Accessible to users with org admin role.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", "tags": [ - "org" + "playlists" + ], + "summary": "Get playlist.", + "operationId": "getPlaylist", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } ], - "summary": "Get all users within the current organization.", - "operationId": "getOrgUsersForCurrentOrg", "responses": { "200": { - "$ref": "#/responses/getOrgUsersForCurrentOrgResponse" + "$ref": "#/responses/getPlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5279,31 +7137,39 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", + "put": { "tags": [ - "org" + "playlists" ], - "summary": "Add a new user to the current organization.", - "operationId": "addOrgUserToCurrentOrg", + "summary": "Update playlist.", + "operationId": "updatePlaylist", "parameters": [ { - "name": "body", + "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddOrgUserCommand" + "$ref": "#/definitions/UpdatePlaylistCommand" } + }, + { + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/updatePlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5311,36 +7177,31 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/org/users/lookup": { - "get": { - "description": "Returns all org users within the current organization, but with less detailed information.\nAccessible to users with org admin role, admin in any folder or admin of any team.\nMainly used by Grafana UI for providing list of users when adding team members and when editing folder/dashboard permissions.", + }, + "delete": { "tags": [ - "org" + "playlists" ], - "summary": "Get all users within the current organization (lookup)", - "operationId": "getOrgUsersForCurrentOrgLookup", + "summary": "Delete playlist.", + "operationId": "deletePlaylist", "parameters": [ { "type": "string", - "name": "query", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getOrgUsersForCurrentOrgLookupResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5348,35 +7209,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/users/{user_id}": { - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + "/playlists/{uid}/dashboards": { + "get": { "tags": [ - "org" + "playlists" ], - "summary": "Delete user in current organization.", - "operationId": "removeOrgUserForCurrentOrg", + "summary": "Get playlist dashboards.", + "operationId": "getPlaylistDashboards", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getPlaylistDashboardsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5384,41 +7243,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "patch": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", + } + }, + "/playlists/{uid}/items": { + "get": { "tags": [ - "org" + "playlists" ], - "summary": "Updates the given user.", - "operationId": "updateOrgUserForCurrentOrg", + "summary": "Get playlist items.", + "operationId": "getPlaylistItems", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgUserCommand" - } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getPlaylistItemsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5426,99 +7277,158 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs": { + "/query-history": { "get": { - "security": [ - { - "basic": [] - } - ], + "description": "Returns a list of queries in the query history that matches the search criteria.\nQuery history search supports pagination. Use the `limit` parameter to control the maximum number of queries returned; the default limit is 100.\nYou can also use the `page` query parameter to fetch queries from any page other than the first one.", "tags": [ - "orgs" + "query_history" ], - "summary": "Search all Organizations.", - "operationId": "searchOrgs", + "summary": "Query history search.", + "operationId": "searchQueries", "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "List of data source UIDs to search for", + "name": "datasourceUid", + "in": "query" + }, + { + "type": "string", + "description": "Text inside query or comments that is searched for", + "name": "searchString", + "in": "query" + }, + { + "type": "boolean", + "description": "Flag indicating if only starred queries should be returned", + "name": "onlyStarred", + "in": "query" + }, + { + "enum": [ + "time-desc", + "time-asc" + ], + "type": "string", + "default": "time-desc", + "description": "Sort method", + "name": "sort", + "in": "query" + }, { "type": "integer", "format": "int64", - "default": 1, + "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", "name": "page", "in": "query" }, { "type": "integer", "format": "int64", - "default": 1000, - "description": "Number of items per page\nThe totalCount field in the response can be used for pagination list E.g. if totalCount is equal to 100 teams and the perpage parameter is set to 10 then there are 10 pages of teams.", - "name": "perpage", + "description": "Limit the number of returned results", + "name": "limit", "in": "query" }, { - "type": "string", - "name": "name", + "type": "integer", + "format": "int64", + "description": "From range for the query history search", + "name": "from", "in": "query" }, { - "type": "string", - "description": "If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.", - "name": "query", + "type": "integer", + "format": "int64", + "description": "To range for the query history search", + "name": "to", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/searchOrgsResponse" + "$ref": "#/responses/getQueryHistorySearchResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { - "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", + "description": "Adds new query to query history.", "tags": [ - "orgs" + "query_history" ], - "summary": "Create Organization.", - "operationId": "createOrg", + "summary": "Add query to query history.", + "operationId": "createQuery", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateOrgCommand" + "$ref": "#/definitions/CreateQueryInQueryHistoryCommand" } } ], "responses": { "200": { - "$ref": "#/responses/createOrgResponse" + "$ref": "#/responses/getQueryHistoryResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/query-history/migrate": { + "post": { + "description": "Adds multiple queries to query history.", + "tags": [ + "query_history" + ], + "summary": "Migrate queries to query history.", + "operationId": "migrateQueries", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MigrateQueriesToQueryHistoryCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQueryHistoryMigrationResponse" }, - "409": { - "$ref": "#/responses/conflictError" + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, "500": { "$ref": "#/responses/internalServerError" @@ -5526,109 +7436,116 @@ } } }, - "/orgs/name/{org_name}": { - "get": { - "security": [ + "/query-history/star/{query_history_uid}": { + "post": { + "description": "Adds star to query in query history as specified by the UID.", + "tags": [ + "query_history" + ], + "summary": "Add star to query in query history.", + "operationId": "starQuery", + "parameters": [ { - "basic": [] + "type": "string", + "name": "query_history_uid", + "in": "path", + "required": true } ], + "responses": { + "200": { + "$ref": "#/responses/getQueryHistoryResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Removes star from query in query history as specified by the UID.", "tags": [ - "orgs" + "query_history" ], - "summary": "Get Organization by ID.", - "operationId": "getOrgByName", + "summary": "Remove star to query in query history.", + "operationId": "unstarQuery", "parameters": [ { "type": "string", - "name": "org_name", + "name": "query_history_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getOrgByNameResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}": { - "get": { - "security": [ - { - "basic": [] - } - ], + "/query-history/{query_history_uid}": { + "delete": { + "description": "Deletes an existing query in query history as specified by the UID. This operation cannot be reverted.", "tags": [ - "orgs" + "query_history" ], - "summary": "Get Organization by ID.", - "operationId": "getOrgByID", + "summary": "Delete query in query history.", + "operationId": "deleteQuery", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "name": "query_history_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getOrgByIDResponse" + "$ref": "#/responses/getQueryHistoryDeleteQueryResponse" }, "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/unauthorisedError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "put": { - "security": [ - { - "basic": [] - } - ], + "patch": { + "description": "Updates comment for query in query history as specified by the UID.", "tags": [ - "orgs" + "query_history" ], - "summary": "Update Organization.", - "operationId": "updateOrg", + "summary": "Update comment for query in query history.", + "operationId": "patchQueryComment", "parameters": [ + { + "type": "string", + "name": "query_history_uid", + "in": "path", + "required": true + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgForm" + "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5636,40 +7553,23 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "security": [ - { - "basic": [] - } - ], + } + }, + "/recording-rules": { + "get": { "tags": [ - "orgs" - ], - "summary": "Delete Organization.", - "operationId": "deleteOrgByID", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - } + "recording_rules", + "enterprise" ], + "summary": "Lists all rules in the database: active or deleted.", + "operationId": "listRecordingRules", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/listRecordingRulesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5684,38 +7584,27 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs/{org_id}/address": { + }, "put": { "tags": [ - "orgs" + "recording_rules", + "enterprise" ], - "summary": "Update Organization's address.", - "operationId": "updateOrgAddress", + "summary": "Update the active status of a rule.", + "operationId": "updateRecordingRule", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgAddressForm" + "$ref": "#/definitions/RecordingRuleJSON" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/recordingRuleResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5723,32 +7612,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs/{org_id}/quotas": { - "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:read` and scope `org:id:1` (orgIDScope).", + }, + "post": { "tags": [ - "orgs" + "recording_rules", + "enterprise" ], - "summary": "Fetch Organization quota.", - "operationId": "getOrgQuota", + "summary": "Create a recording rule that is then registered and started.", + "operationId": "createRecordingRule", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } } ], "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" + "$ref": "#/responses/recordingRuleResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5765,40 +7656,22 @@ } } }, - "/orgs/{org_id}/quotas/{quota_target}": { - "put": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).", + "/recording-rules/test": { + "post": { "tags": [ - "orgs" + "recording_rules", + "enterprise" ], - "summary": "Update user quota.", - "operationId": "updateOrgQuota", + "summary": "Test a recording rule.", + "operationId": "testCreateRecordingRule", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgQuotaCmd" + "$ref": "#/definitions/RecordingRuleJSON" } - }, - { - "type": "string", - "name": "quota_target", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { @@ -5814,37 +7687,26 @@ "404": { "$ref": "#/responses/notFoundError" }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}/users": { + "/recording-rules/writer": { "get": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", "tags": [ - "orgs" - ], - "summary": "Get Users in Organization.", - "operationId": "getOrgUsers", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - } + "recording_rules", + "enterprise" ], + "summary": "Return the prometheus remote write target.", + "operationId": "getRecordingRuleWriteTarget", "responses": { "200": { - "$ref": "#/responses/getOrgUsersResponse" + "$ref": "#/responses/recordingRuleWriteTargetResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5852,38 +7714,35 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { - "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", + "description": "It returns a 422 if there is not an existing prometheus data source configured.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ], - "summary": "Add a new user to the current organization.", - "operationId": "addOrgUser", + "summary": "Create a remote write target.", + "operationId": "createRecordingRuleWriteTarget", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddOrgUserCommand" + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/recordingRuleWriteTargetResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5891,81 +7750,56 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs/{org_id}/users/{user_id}": { + }, "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", "tags": [ - "orgs" - ], - "summary": "Delete user in current organization.", - "operationId": "removeOrgUser", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "recording_rules", + "enterprise" ], + "summary": "Delete the remote write target.", + "operationId": "deleteRecordingRuleWriteTarget", "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" } } - }, - "patch": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", + } + }, + "/recording-rules/{recordingRuleID}": { + "delete": { "tags": [ - "orgs" + "recording_rules", + "enterprise" ], - "summary": "Update Users in Organization.", - "operationId": "updateOrgUser", + "summary": "Delete removes the rule from the registry and stops it.", + "operationId": "deleteRecordingRule", "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgUserCommand" - } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "name": "user_id", + "name": "recordingRuleID", "in": "path", "required": true } @@ -5974,45 +7808,39 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/playlists": { - "get": { - "tags": [ - "playlists" - ], - "summary": "Get playlists.", - "operationId": "searchPlaylists", - "parameters": [ - { - "type": "string", - "name": "query", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "in:limit", - "name": "limit", - "in": "query" - } + "/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/searchPlaylistsResponse" + "$ref": "#/responses/getReportsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -6020,24 +7848,29 @@ } }, "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": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Create playlist.", - "operationId": "createPlaylist", + "summary": "Create a report.", + "operationId": "createReport", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreatePlaylistCommand" + "$ref": "#/definitions/CreateOrUpdateConfigCmd" } } ], "responses": { "200": { - "$ref": "#/responses/createPlaylistResponse" + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6054,24 +7887,31 @@ } } }, - "/playlists/{uid}": { - "get": { + "/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": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Get playlist.", - "operationId": "getPlaylist", + "summary": "Send a report.", + "operationId": "sendReport", "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportEmailDTO" + } } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6086,98 +7926,176 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { + } + }, + "/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": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Update playlist.", - "operationId": "updatePlaylist", + "summary": "Render report for dashboard.", + "operationId": "renderReportPDF", + "deprecated": true, "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePlaylistCommand" - } + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true }, { - "type": "string", - "name": "uid", + "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/updatePlaylistResponse" + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { + } + }, + "/reports/render/pdfs": { + "get": { + "description": "Available to all users and with a valid license.", + "produces": [ + "application/pdf" + ], "tags": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Delete playlist.", - "operationId": "deletePlaylist", + "summary": "Render report for multiple dashboards.", + "operationId": "renderReportPDFs", "parameters": [ { "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "dashboardID", + "in": "query" + }, + { + "type": "string", + "name": "orientation", + "in": "query" + }, + { + "type": "string", + "name": "layout", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/playlists/{uid}/dashboards": { + "/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": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Get playlist dashboards.", - "operationId": "getPlaylistDashboards", + "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": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SettingsDTO" + } } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistDashboardsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6185,33 +8103,37 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/playlists/{uid}/items": { - "get": { + "/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": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Get playlist items.", - "operationId": "getPlaylistItems", + "summary": "Send test report via email.", + "operationId": "sendTestEmail", "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistItemsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6228,109 +8150,73 @@ } } }, - "/query-history": { + "/reports/{id}": { "get": { - "description": "Returns a list of queries in the query history that matches the search criteria.\nQuery history search supports pagination. Use the `limit` parameter to control the maximum number of queries returned; the default limit is 100.\nYou can also use the `page` query parameter to fetch queries from any page other than the first one.", + "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": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Query history search.", - "operationId": "searchQueries", + "summary": "Get a report.", + "operationId": "getReport", "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "List of data source UIDs to search for", - "name": "datasourceUid", - "in": "query" - }, - { - "type": "string", - "description": "Text inside query or comments that is searched for", - "name": "searchString", - "in": "query" - }, - { - "type": "boolean", - "description": "Flag indicating if only starred queries should be returned", - "name": "onlyStarred", - "in": "query" - }, - { - "enum": [ - "time-desc", - "time-asc" - ], - "type": "string", - "default": "time-desc", - "description": "Sort method", - "name": "sort", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "Limit the number of returned results", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "From range for the query history search", - "name": "from", - "in": "query" - }, { "type": "integer", "format": "int64", - "description": "To range for the query history search", - "name": "to", - "in": "query" + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistorySearchResponse" + "$ref": "#/responses/getReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Adds new query to query history.", + "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": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Add query to query history.", - "operationId": "createQuery", + "summary": "Update a report.", + "operationId": "updateReport", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateQueryInQueryHistoryCommand" + "$ref": "#/definitions/CreateOrUpdateConfigCmd" } + }, + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6338,33 +8224,37 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/query-history/migrate": { - "post": { - "description": "Adds multiple queries to query history.", + }, + "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": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Migrate queries to query history.", - "operationId": "migrateQueries", + "summary": "Delete a report.", + "operationId": "deleteReport", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MigrateQueriesToQueryHistoryCommand" - } + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryMigrationResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6372,128 +8262,117 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/query-history/star/{query_history_uid}": { + "/saml/acs": { "post": { - "description": "Adds star to query in query history as specified by the UID.", "tags": [ - "query_history" + "saml", + "enterprise" ], - "summary": "Add star to query in query history.", - "operationId": "starQuery", + "summary": "It performs assertion Consumer Service (ACS).", + "operationId": "postACS", "parameters": [ { "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true + "name": "RelayState", + "in": "query" } ], "responses": { - "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "302": { + "description": "(empty)" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Removes star from query in query history as specified by the UID.", - "tags": [ - "query_history" + } + }, + "/saml/metadata": { + "get": { + "produces": [ + "application/xml;application/samlmetadata+xml" ], - "summary": "Remove star to query in query history.", - "operationId": "unstarQuery", - "parameters": [ - { - "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true - } + "tags": [ + "saml", + "enterprise" ], + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "operationId": "getMetadata", "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "$ref": "#/responses/contentResponse" } } } }, - "/query-history/{query_history_uid}": { - "delete": { - "description": "Deletes an existing query in query history as specified by the UID. This operation cannot be reverted.", + "/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": [ - "query_history" - ], - "summary": "Delete query in query history.", - "operationId": "deleteQuery", - "parameters": [ - { - "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true - } + "saml", + "enterprise" ], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "getSLO", "responses": { - "200": { - "$ref": "#/responses/getQueryHistoryDeleteQueryResponse" + "302": { + "description": "(empty)" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "description": "Updates comment for query in query history as specified by the UID.", + "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": [ - "query_history" + "saml", + "enterprise" ], - "summary": "Update comment for query in query history.", - "operationId": "patchQueryComment", + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", "parameters": [ { "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true + "name": "SAMLRequest", + "in": "query" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" - } + "type": "string", + "name": "SAMLResponse", + "in": "query" } ], "responses": { - "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "302": { + "description": "(empty)" }, "400": { "$ref": "#/responses/badRequestError" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -7196,7 +9075,133 @@ ], "responses": { "200": { - "$ref": "#/responses/searchTeamsResponse" + "$ref": "#/responses/searchTeamsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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" @@ -7204,6 +9209,9 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } @@ -8286,6 +10294,63 @@ "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" + } + } + }, + "AddBuiltInRoleCommand": { + "type": "object", + "properties": { + "builtInRole": { + "type": "string", + "enum": [ + "Viewer", + " Editor", + " Admin", + " Grafana Admin" + ] + }, + "global": { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to create organization local assignment. Refer to the Built-in role assignments for more information.", + "type": "boolean" + }, + "roleUid": { + "type": "string" + } + } + }, "AddCommand": { "type": "object", "properties": { @@ -8392,6 +10457,25 @@ } } }, + "AddPermissionDTO": { + "type": "object", + "properties": { + "builtinRole": { + "type": "string" + }, + "permission": { + "$ref": "#/definitions/DsPermissionType" + }, + "teamId": { + "type": "integer", + "format": "int64" + }, + "userId": { + "type": "integer", + "format": "int64" + } + } + }, "AddServiceAccountTokenCommand": { "type": "object", "properties": { @@ -8834,8 +10918,7 @@ "type": "array", "items": { "$ref": "#/definitions/ProvisionedAlertRule" - }, - "x-go-name": "Rules" + } }, "title": { "type": "string", @@ -13298,6 +15381,51 @@ } } }, + "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", @@ -13349,6 +15477,79 @@ } } }, + "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", @@ -13821,6 +16022,49 @@ } } }, + "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": { @@ -15301,7 +17545,6 @@ } }, "alertGroups": { - "description": "AlertGroups alert groups", "type": "array", "items": { "$ref": "#/definitions/alertGroup" @@ -15710,8 +17953,6 @@ "description": "Receiver receiver", "type": "object", "required": [ - "active", - "integrations", "name" ], "properties": { @@ -16243,6 +18484,30 @@ } } }, + "getCurrentOrgResponse": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/Correlation" + } + }, + "getCorrelationsBySourceUIDResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Correlation" + } + } + }, + "getCorrelationsResponse": { + "description": "(empty)", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Correlation" + } + } + }, "getCurrentOrgResponse": { "description": "(empty)", "schema": { @@ -16458,6 +18723,39 @@ } } }, + "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": { @@ -16797,6 +19095,12 @@ "$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 594e73115941..f2543decfcb3 100644 --- a/public/api-spec.json +++ b/public/api-spec.json @@ -26,25 +26,25 @@ }, "basePath": "/api", "paths": { - "/admin/ldap/reload": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "boolean", + "name": "delegatable", + "in": "query" } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.", - "tags": [ - "admin_ldap" - ], - "summary": "Reloads the LDAP configuration.", - "operationId": "reloadLDAPCfg", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/listRolesResponse" }, "403": { "$ref": "#/responses/forbiddenError" @@ -53,27 +53,31 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/ldap/status": { - "get": { - "security": [ + }, + "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": [ { - "basic": [] + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRoleForm" + } } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`.", - "tags": [ - "admin_ldap" - ], - "summary": "Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.", - "operationId": "getLDAPStatus", "responses": { - "200": { - "$ref": "#/responses/okResponse" + "201": { + "$ref": "#/responses/createRoleResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" @@ -84,61 +88,99 @@ } } }, - "/admin/ldap/sync/{user_id}": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "string", + "name": "roleUID", + "in": "path", + "required": true } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`.", + "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": [ - "admin_ldap" + "access_control", + "enterprise" ], - "summary": "Enables a single Grafana user to be synchronized against LDAP.", - "operationId": "postSyncUserWithLDAP", + "summary": "Update a custom role.", + "operationId": "updateRole", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRoleCommand" + } + }, + { + "type": "string", + "name": "roleUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getRoleResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/ldap/{user_name}": { - "get": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`.", + }, + "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": [ - "admin_ldap" + "access_control", + "enterprise" ], - "summary": "Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.", - "operationId": "getUserFromLDAP", + "summary": "Delete a custom role.", + "operationId": "deleteRole", "parameters": [ + { + "type": "boolean", + "name": "force", + "in": "query" + }, + { + "type": "boolean", + "name": "global", + "in": "query" + }, { "type": "string", - "name": "user_name", + "name": "roleUID", "in": "path", "required": true } @@ -147,8 +189,8 @@ "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" @@ -159,121 +201,127 @@ } } }, - "/admin/pause-all-alerts": { - "post": { - "security": [ - { - "basic": [] - } - ], + "/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": [ - "admin" + "access_control", + "enterprise" ], - "summary": "Pause/unpause all (legacy) alerts.", - "operationId": "pauseAllAlerts", + "summary": "Get role assignments.", + "operationId": "getRoleAssignments", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PauseAllAlertsCommand" - } + "type": "string", + "name": "roleUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/pauseAlertsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/getRoleAssignmentsResponse" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/provisioning/dashboards/reload": { - "post": { - "security": [ + }, + "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": [ { - "basic": [] + "type": "string", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SetRoleAssignmentsCommand" + } } ], - "description": "Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`.", - "tags": [ - "admin_provisioning" - ], - "summary": "Reload dashboard provisioning configurations.", - "operationId": "adminProvisioningReloadDashboards", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/setRoleAssignmentsResponse" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/provisioning/datasources/reload": { - "post": { - "security": [ - { - "basic": [] - } - ], - "description": "Reloads the provisioning config files for datasources again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:datasources`.", + "/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": [ - "admin_provisioning" + "access_control", + "enterprise" ], - "summary": "Reload datasource provisioning configurations.", - "operationId": "adminProvisioningReloadDatasources", + "summary": "Get status.", + "operationId": "getAccessControlStatus", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/getAccessControlStatusResponse" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/provisioning/notifications/reload": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], - "description": "Reloads the provisioning config files for legacy alert notifiers again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:notifications`.", - "tags": [ - "admin_provisioning" - ], - "summary": "Reload legacy alert notifier provisioning configurations.", - "operationId": "adminProvisioningReloadNotifications", "responses": { "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" @@ -282,150 +330,226 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/provisioning/plugins/reload": { - "post": { - "security": [ + }, + "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": [ { - "basic": [] + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], - "description": "Reloads the provisioning config files for plugins again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:plugin`.", - "tags": [ - "admin_provisioning" - ], - "summary": "Reload plugin provisioning configurations.", - "operationId": "adminProvisioningReloadPlugins", "responses": { "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/settings": { - "get": { - "security": [ + }, + "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": [ { - "basic": [] + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTeamRoleCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `settings:read` and scopes: `settings:*`, `settings:auth.saml:` and `settings:auth.saml:enabled` (property level).", - "tags": [ - "admin" - ], - "summary": "Fetch settings.", - "operationId": "adminGetSettings", "responses": { "200": { - "$ref": "#/responses/adminGetSettingsResponse" + "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/admin/stats": { - "get": { - "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `server:stats:read`.", + "/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": [ - "admin" + "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 + } ], - "summary": "Fetch Grafana Stats.", - "operationId": "adminGetStats", "responses": { "200": { - "$ref": "#/responses/adminGetStatsResponse" + "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users": { - "post": { - "security": [ + "/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": [ { - "basic": [] + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:create`.\nNote that OrgId is an optional parameter that can be used to assign a new user to a different organization when `auto_assign_org` is set to `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": [ - "admin_users" + "access_control", + "enterprise" ], - "summary": "Create new user.", - "operationId": "adminCreateUser", + "summary": "Set user role assignments.", + "operationId": "setUserRoles", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AdminCreateUserForm" + "$ref": "#/definitions/SetUserRolesCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "userId", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/adminCreateUserResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, "403": { "$ref": "#/responses/forbiddenError" }, - "412": { - "$ref": "#/responses/preconditionFailedError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/admin/users/{user_id}": { - "delete": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:delete` and scope `global.users:*`.", + }, + "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": [ - "admin_users" + "access_control", + "enterprise" ], - "summary": "Delete global User.", - "operationId": "adminDeleteUser", + "summary": "Add a user role assignment.", + "operationId": "addUserRole", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddUserRoleCommand" + } + }, { "type": "integer", "format": "int64", - "name": "user_id", + "name": "userId", "in": "path", "required": true } @@ -434,9 +558,6 @@ "200": { "$ref": "#/responses/okResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, "403": { "$ref": "#/responses/forbiddenError" }, @@ -449,31 +570,66 @@ } } }, - "/admin/users/{user_id}/auth-tokens": { - "get": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:list` and scope `global.users:*`.", + "/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": [ - "admin_users" + "access_control", + "enterprise" ], - "summary": "Return a list of all auth tokens (devices) that the user currently have logged in from.", - "operationId": "adminGetUserAuthTokens", + "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": "user_id", + "name": "userId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/adminGetUserAuthTokensResponse" + "$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" @@ -487,28 +643,19 @@ } } }, - "/admin/users/{user_id}/disable": { + "/admin/ldap/reload": { "post": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:disable` and scope `global.users:1` (userIDScope).", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.", "tags": [ - "admin_users" - ], - "summary": "Disable user.", - "operationId": "adminDisableUser", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_ldap" ], + "summary": "Reloads the LDAP configuration.", + "operationId": "reloadLDAPCfg", "responses": { "200": { "$ref": "#/responses/okResponse" @@ -519,37 +666,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/enable": { - "post": { + "/admin/ldap/status": { + "get": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:enable` and scope `global.users:1` (userIDScope).", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`.", "tags": [ - "admin_users" - ], - "summary": "Enable user.", - "operationId": "adminEnableUser", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_ldap" ], + "summary": "Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.", + "operationId": "getLDAPStatus", "responses": { "200": { "$ref": "#/responses/okResponse" @@ -560,28 +695,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/logout": { + "/admin/ldap/sync/{user_id}": { "post": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.logout` and scope `global.users:*`.", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`.", "tags": [ - "admin_users" + "admin_ldap" ], - "summary": "Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity.", - "operationId": "adminLogoutUser", + "summary": "Enables a single Grafana user to be synchronized against LDAP.", + "operationId": "postSyncUserWithLDAP", "parameters": [ { "type": "integer", @@ -595,50 +727,35 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/password": { - "put": { + "/admin/ldap/{user_name}": { + "get": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.password:update` and scope `global.users:*`.", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`.", "tags": [ - "admin_users" + "admin_ldap" ], - "summary": "Set password for user.", - "operationId": "adminUpdateUserPassword", + "summary": "Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.", + "operationId": "getUserFromLDAP", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AdminUpdateUserPasswordForm" - } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "name": "user_name", "in": "path", "required": true } @@ -647,9 +764,6 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -662,37 +776,31 @@ } } }, - "/admin/users/{user_id}/permissions": { - "put": { - "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.permissions:update` and scope `global.users:*`.", + "/admin/pause-all-alerts": { + "post": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "admin_users" + "admin" ], - "summary": "Set permissions for user.", - "operationId": "adminUpdateUserPermissions", + "summary": "Pause/unpause all (legacy) alerts.", + "operationId": "pauseAllAlerts", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AdminUpdateUserPermissionsForm" + "$ref": "#/definitions/PauseAllAlertsCommand" } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/pauseAlertsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -706,31 +814,43 @@ } } }, - "/admin/users/{user_id}/quotas": { - "get": { + "/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": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global.users:1` (userIDScope).", + "description": "Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`.", "tags": [ - "admin_users" - ], - "summary": "Fetch user quota.", - "operationId": "getUserQuota", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_provisioning" ], + "summary": "Reload dashboard provisioning configurations.", + "operationId": "adminProvisioningReloadDashboards", "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -738,51 +858,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/quotas/{quota_target}": { - "put": { + "/admin/provisioning/datasources/reload": { + "post": { "security": [ { "basic": [] } ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:update` and scope `global.users:1` (userIDScope).", + "description": "Reloads the provisioning config files for datasources again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:datasources`.", "tags": [ - "admin_users" - ], - "summary": "Update user quota.", - "operationId": "updateUserQuota", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserQuotaCmd" - } - }, - { - "type": "string", - "name": "quota_target", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_provisioning" ], + "summary": "Reload datasource provisioning configurations.", + "operationId": "adminProvisioningReloadDatasources", "responses": { "200": { "$ref": "#/responses/okResponse" @@ -793,78 +887,57 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/admin/users/{user_id}/revoke-auth-token": { + "/admin/provisioning/notifications/reload": { "post": { "security": [ { "basic": [] } ], - "description": "Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:update` and scope `global.users:*`.", + "description": "Reloads the provisioning config files for legacy alert notifiers again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:notifications`.", "tags": [ - "admin_users" - ], - "summary": "Revoke auth token for user.", - "operationId": "adminRevokeUserAuthToken", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RevokeAuthTokenCmd" - } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "admin_provisioning" ], + "summary": "Reload legacy alert notifier provisioning configurations.", + "operationId": "adminProvisioningReloadNotifications", "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" } } } }, - "/alert-notifications": { - "get": { - "description": "Returns all notification channels that the authenticated user has permission to view.", + "/admin/provisioning/plugins/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for plugins again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:plugin`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_provisioning" ], - "summary": "Get all notification channels.", - "operationId": "getAlertNotificationChannels", + "summary": "Reload plugin provisioning configurations.", + "operationId": "adminProvisioningReloadPlugins", "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelsResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -876,54 +949,45 @@ "$ref": "#/responses/internalServerError" } } - }, - "post": { - "description": "You can find the full list of [supported notifiers](https://grafana.com/docs/grafana/latest/alerting/old-alerting/notifications/#list-of-supported-notifiers) on the alert notifiers page.", - "tags": [ - "legacy_alerts_notification_channels" - ], - "summary": "Create notification channel.", - "operationId": "createAlertNotificationChannel", - "parameters": [ + } + }, + "/admin/settings": { + "get": { + "security": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateAlertNotificationCommand" - } + "basic": [] } ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `settings:read` and scopes: `settings:*`, `settings:auth.saml:` and `settings:auth.saml:enabled` (property level).", + "tags": [ + "admin" + ], + "summary": "Fetch settings.", + "operationId": "adminGetSettings", "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/adminGetSettingsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } } }, - "/alert-notifications/lookup": { + "/admin/stats": { "get": { - "description": "Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule.", + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `server:stats:read`.", "tags": [ - "legacy_alerts_notification_channels" + "admin" ], - "summary": "Get all notification channels (lookup).", - "operationId": "getAlertNotificationLookup", + "summary": "Fetch Grafana Stats.", + "operationId": "adminGetStats", "responses": { "200": { - "$ref": "#/responses/getAlertNotificationLookupResponse" + "$ref": "#/responses/adminGetStatsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -937,27 +1001,32 @@ } } }, - "/alert-notifications/test": { + "/admin/users": { "post": { - "description": "Sends a test notification to the channel.", + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:create`.\nNote that OrgId is an optional parameter that can be used to assign a new user to a different organization when `auto_assign_org` is set to `true`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Test notification channel.", - "operationId": "notificationChannelTest", + "summary": "Create new user.", + "operationId": "adminCreateUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/NotificationTestCommand" + "$ref": "#/definitions/AdminCreateUserForm" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/adminCreateUserResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -969,7 +1038,7 @@ "$ref": "#/responses/forbiddenError" }, "412": { - "$ref": "#/responses/SMTPNotEnabledError" + "$ref": "#/responses/preconditionFailedError" }, "500": { "$ref": "#/responses/internalServerError" @@ -977,25 +1046,31 @@ } } }, - "/alert-notifications/uid/{notification_channel_uid}": { - "get": { - "description": "Returns the notification channel given the notification channel UID.", - "tags": [ - "legacy_alerts_notification_channels" + "/admin/users/{user_id}": { + "delete": { + "security": [ + { + "basic": [] + } ], - "summary": "Get notification channel by UID.", - "operationId": "getAlertNotificationChannelByUID", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:delete` and scope `global.users:*`.", + "tags": [ + "admin_users" + ], + "summary": "Delete global User.", + "operationId": "adminDeleteUser", "parameters": [ { - "type": "string", - "name": "notification_channel_uid", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1010,33 +1085,71 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { - "description": "Updates an existing notification channel identified by uid.", + } + }, + "/admin/users/{user_id}/auth-tokens": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:list` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Update notification channel by UID.", - "operationId": "updateAlertNotificationChannelByUID", + "summary": "Return a list of all auth tokens (devices) that the user currently have logged in from.", + "operationId": "adminGetUserAuthTokens", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAlertNotificationWithUidCommand" - } + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/adminGetUserAuthTokensResponse" }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/disable": { + "post": { + "security": [ { - "type": "string", - "name": "notification_channel_uid", + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:disable` and scope `global.users:1` (userIDScope).", + "tags": [ + "admin_users" + ], + "summary": "Disable user.", + "operationId": "adminDisableUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1051,25 +1164,33 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Deletes an existing notification channel identified by UID.", + } + }, + "/admin/users/{user_id}/enable": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:enable` and scope `global.users:1` (userIDScope).", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Delete alert notification by UID.", - "operationId": "deleteAlertNotificationChannelByUID", + "summary": "Enable user.", + "operationId": "adminEnableUser", "parameters": [ { - "type": "string", - "name": "notification_channel_uid", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/deleteAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1086,26 +1207,34 @@ } } }, - "/alert-notifications/{notification_channel_id}": { - "get": { - "description": "Returns the notification channel given the notification channel ID.", + "/admin/users/{user_id}/logout": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.logout` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Get notification channel by ID.", - "operationId": "getAlertNotificationChannelByID", + "summary": "Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity.", + "operationId": "adminLogoutUser", "parameters": [ { "type": "integer", "format": "int64", - "name": "notification_channel_id", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1120,34 +1249,44 @@ "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/admin/users/{user_id}/password": { "put": { - "description": "Updates an existing notification channel identified by ID.", + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.password:update` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Update notification channel by ID.", - "operationId": "updateAlertNotificationChannel", + "summary": "Set password for user.", + "operationId": "adminUpdateUserPassword", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateAlertNotificationCommand" + "$ref": "#/definitions/AdminUpdateUserPasswordForm" } }, { "type": "integer", "format": "int64", - "name": "notification_channel_id", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertNotificationChannelResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1155,26 +1294,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Deletes an existing notification channel identified by ID.", + } + }, + "/admin/users/{user_id}/permissions": { + "put": { + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.permissions:update` and scope `global.users:*`.", "tags": [ - "legacy_alerts_notification_channels" + "admin_users" ], - "summary": "Delete alert notification by ID.", - "operationId": "deleteAlertNotificationChannel", + "summary": "Set permissions for user.", + "operationId": "adminUpdateUserPermissions", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUpdateUserPermissionsForm" + } + }, { "type": "integer", "format": "int64", - "name": "notification_channel_id", + "name": "user_id", "in": "path", "required": true } @@ -1183,170 +1329,221 @@ "200": { "$ref": "#/responses/okResponse" }, + "400": { + "$ref": "#/responses/badRequestError" + }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts": { + "/admin/users/{user_id}/quotas": { "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global.users:1` (userIDScope).", "tags": [ - "legacy_alerts" + "admin_users" ], - "summary": "Get legacy alerts.", - "operationId": "getAlerts", + "summary": "Fetch user quota.", + "operationId": "getUserQuota", "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "description": "Limit response to alerts in specified dashboard(s). You can specify multiple dashboards.", - "name": "dashboardId", - "in": "query" - }, { "type": "integer", "format": "int64", - "description": "Limit response to alert for a specified panel on a dashboard.", - "name": "panelId", - "in": "query" + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" }, - { - "type": "string", - "description": "Limit response to alerts having a name like this value.", - "name": "query", - "in": "query" + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "enum": [ - "all", - "no_data", - "paused", - "alerting", - "ok", - "pending", - "unknown" - ], - "type": "string", - "description": "Return alerts with one or more of the following alert states", - "name": "state", - "in": "query" + "403": { + "$ref": "#/responses/forbiddenError" }, - { - "type": "integer", - "format": "int64", - "description": "Limit response to X number of alerts.", - "name": "limit", - "in": "query" + "404": { + "$ref": "#/responses/notFoundError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/quotas/{quota_target}": { + "put": { + "security": [ { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders", - "name": "folderId", - "in": "query" + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:update` and scope `global.users:1` (userIDScope).", + "tags": [ + "admin_users" + ], + "summary": "Update user quota.", + "operationId": "updateUserQuota", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserQuotaCmd" + } }, { "type": "string", - "description": "Limit response to alerts having a dashboard name like this value./ Limit response to alerts having a dashboard name like this value.", - "name": "dashboardQuery", - "in": "query" + "name": "quota_target", + "in": "path", + "required": true }, { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "Limit response to alerts of dashboards with specified tags. To do an “AND” filtering with multiple tags, specify the tags parameter multiple times", - "name": "dashboardTag", - "in": "query" + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAlertsResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts/states-for-dashboard": { - "get": { + "/admin/users/{user_id}/revoke-auth-token": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:update` and scope `global.users:*`.", "tags": [ - "legacy_alerts" + "admin_users" ], - "summary": "Get alert states for a dashboard.", - "operationId": "getDashboardStates", + "summary": "Revoke auth token for user.", + "operationId": "adminRevokeUserAuthToken", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RevokeAuthTokenCmd" + } + }, { "type": "integer", "format": "int64", - "name": "dashboardId", - "in": "query", + "name": "user_id", + "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardStatesResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts/test": { + "/alert-notifications": { + "get": { + "description": "Returns all notification channels that the authenticated user has permission to view.", + "tags": [ + "legacy_alerts_notification_channels" + ], + "summary": "Get all notification channels.", + "operationId": "getAlertNotificationChannels", + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, "post": { + "description": "You can find the full list of [supported notifiers](https://grafana.com/docs/grafana/latest/alerting/old-alerting/notifications/#list-of-supported-notifiers) on the alert notifiers page.", "tags": [ - "legacy_alerts" + "legacy_alerts_notification_channels" ], - "summary": "Test alert.", - "operationId": "testAlert", + "summary": "Create notification channel.", + "operationId": "createAlertNotificationChannel", "parameters": [ { "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/AlertTestCommand" + "$ref": "#/definitions/CreateAlertNotificationCommand" } } ], "responses": { "200": { - "$ref": "#/responses/testAlertResponse" + "$ref": "#/responses/getAlertNotificationChannelResponse" }, - "400": { - "$ref": "#/responses/badRequestError" + "401": { + "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -1354,61 +1551,54 @@ } } }, - "/alerts/{alert_id}": { + "/alert-notifications/lookup": { "get": { - "description": "“evalMatches” data in the response is cached in the db when and only when the state of the alert changes (e.g. transitioning from “ok” to “alerting” state).\nIf data from one server triggers the alert first and, before that server is seen leaving alerting state, a second server also enters a state that would trigger the alert, the second server will not be visible in “evalMatches” data.", + "description": "Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule.", "tags": [ - "legacy_alerts" - ], - "summary": "Get alert by ID.", - "operationId": "getAlertByID", - "parameters": [ - { - "type": "string", - "name": "alert_id", - "in": "path", - "required": true - } + "legacy_alerts_notification_channels" ], + "summary": "Get all notification channels (lookup).", + "operationId": "getAlertNotificationLookup", "responses": { "200": { - "$ref": "#/responses/getAlertResponse" + "$ref": "#/responses/getAlertNotificationLookupResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/alerts/{alert_id}/pause": { + "/alert-notifications/test": { "post": { + "description": "Sends a test notification to the channel.", "tags": [ - "legacy_alerts" + "legacy_alerts_notification_channels" ], - "summary": "Pause/unpause alert by id.", - "operationId": "pauseAlert", + "summary": "Test notification channel.", + "operationId": "notificationChannelTest", "parameters": [ - { - "type": "string", - "name": "alert_id", - "in": "path", - "required": true - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PauseAlertCommand" + "$ref": "#/definitions/NotificationTestCommand" } } ], "responses": { "200": { - "$ref": "#/responses/pauseAlertResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1416,8 +1606,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "412": { + "$ref": "#/responses/SMTPNotEnabledError" }, "500": { "$ref": "#/responses/internalServerError" @@ -1425,67 +1615,276 @@ } } }, - "/annotations": { + "/alert-notifications/uid/{notification_channel_uid}": { "get": { - "description": "Starting in Grafana v6.4 regions annotations are now returned in one entity that now includes the timeEnd property.", + "description": "Returns the notification channel given the notification channel UID.", "tags": [ - "annotations" + "legacy_alerts_notification_channels" ], - "summary": "Find Annotations.", - "operationId": "getAnnotations", + "summary": "Get notification channel by UID.", + "operationId": "getAlertNotificationChannelByUID", "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": "string", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" }, - { - "type": "integer", - "format": "int64", - "description": "Limit response to annotations created by specific user.", - "name": "userId", - "in": "query" + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "type": "integer", - "format": "int64", - "description": "Find annotations for a specified alert.", - "name": "alertId", - "in": "query" + "403": { + "$ref": "#/responses/forbiddenError" }, - { - "type": "integer", - "format": "int64", - "description": "Find annotations that are scoped to a specific dashboard", - "name": "dashboardId", - "in": "query" + "404": { + "$ref": "#/responses/notFoundError" }, - { + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Updates an existing notification channel identified by uid.", + "tags": [ + "legacy_alerts_notification_channels" + ], + "summary": "Update notification channel by UID.", + "operationId": "updateAlertNotificationChannelByUID", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAlertNotificationWithUidCommand" + } + }, + { "type": "string", - "description": "Find annotations that are scoped to a specific dashboard", - "name": "dashboardUID", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing notification channel identified by UID.", + "tags": [ + "legacy_alerts_notification_channels" + ], + "summary": "Delete alert notification by UID.", + "operationId": "deleteAlertNotificationChannelByUID", + "parameters": [ + { + "type": "string", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/{notification_channel_id}": { + "get": { + "description": "Returns the notification channel given the notification channel ID.", + "tags": [ + "legacy_alerts_notification_channels" + ], + "summary": "Get notification channel by ID.", + "operationId": "getAlertNotificationChannelByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "notification_channel_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Updates an existing notification channel identified by ID.", + "tags": [ + "legacy_alerts_notification_channels" + ], + "summary": "Update notification channel by ID.", + "operationId": "updateAlertNotificationChannel", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAlertNotificationCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "notification_channel_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing notification channel identified by ID.", + "tags": [ + "legacy_alerts_notification_channels" + ], + "summary": "Delete alert notification by ID.", + "operationId": "deleteAlertNotificationChannel", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "notification_channel_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" + } + } + } + }, + "/alerts": { + "get": { + "tags": [ + "legacy_alerts" + ], + "summary": "Get legacy alerts.", + "operationId": "getAlerts", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "description": "Limit response to alerts in specified dashboard(s). You can specify multiple dashboards.", + "name": "dashboardId", "in": "query" }, { "type": "integer", "format": "int64", - "description": "Find annotations that are scoped to a specific panel", + "description": "Limit response to alert for a specified panel on a dashboard.", "name": "panelId", "in": "query" }, + { + "type": "string", + "description": "Limit response to alerts having a name like this value.", + "name": "query", + "in": "query" + }, + { + "enum": [ + "all", + "no_data", + "paused", + "alerting", + "ok", + "pending", + "unknown" + ], + "type": "string", + "description": "Return alerts with one or more of the following alert states", + "name": "state", + "in": "query" + }, { "type": "integer", "format": "int64", - "description": "Max limit for results returned.", + "description": "Limit response to X number of alerts.", "name": "limit", "in": "query" }, @@ -1495,62 +1894,1531 @@ "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", + "description": "Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders", + "name": "folderId", "in": "query" }, { - "enum": [ - "alert", - "annotation" - ], "type": "string", - "description": "Return alerts or user created annotations", - "name": "type", + "description": "Limit response to alerts having a dashboard name like this value./ Limit response to alerts having a dashboard name like this value.", + "name": "dashboardQuery", "in": "query" }, { - "type": "boolean", - "description": "Match any or all tags", - "name": "matchAny", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Limit response to alerts of dashboards with specified tags. To do an “AND” filtering with multiple tags, specify the tags parameter multiple times", + "name": "dashboardTag", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getAnnotationsResponse" + "$ref": "#/responses/getAlertsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/states-for-dashboard": { + "get": { + "tags": [ + "legacy_alerts" + ], + "summary": "Get alert states for a dashboard.", + "operationId": "getDashboardStates", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "dashboardId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardStatesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/test": { + "post": { + "tags": [ + "legacy_alerts" + ], + "summary": "Test alert.", + "operationId": "testAlert", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AlertTestCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/testAlertResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}": { + "get": { + "description": "“evalMatches” data in the response is cached in the db when and only when the state of the alert changes (e.g. transitioning from “ok” to “alerting” state).\nIf data from one server triggers the alert first and, before that server is seen leaving alerting state, a second server also enters a state that would trigger the alert, the second server will not be visible in “evalMatches” data.", + "tags": [ + "legacy_alerts" + ], + "summary": "Get alert by ID.", + "operationId": "getAlertByID", + "parameters": [ + { + "type": "string", + "name": "alert_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}/pause": { + "post": { + "tags": [ + "legacy_alerts" + ], + "summary": "Pause/unpause alert by id.", + "operationId": "pauseAlert", + "parameters": [ + { + "type": "string", + "name": "alert_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PauseAlertCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/pauseAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations": { + "get": { + "description": "Starting in Grafana v6.4 regions annotations are now returned in one entity that now includes the timeEnd property.", + "tags": [ + "annotations" + ], + "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" + } + } + } + }, + "/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", + "tags": [ + "dashboard_versions" + ], + "summary": "Get a specific dashboard version.", + "operationId": "getDashboardVersionByID", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/import": { + "post": { + "tags": [ + "dashboards" + ], + "summary": "Import dashboard.", + "operationId": "importDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ImportDashboardRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/importDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/tags": { + "get": { + "tags": [ + "dashboards" + ], + "summary": "Get all dashboards tags of an organisation.", + "operationId": "getDashboardTags", + "responses": { + "200": { + "$ref": "#/responses/getDashboardsTagsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/trim": { + "post": { + "tags": [ + "dashboards" + ], + "summary": "Trim defaults from dashboard.", + "operationId": "trimDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TrimDashboardCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/trimDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/uid/{uid}": { + "get": { + "description": "Will return the dashboard given the dashboard unique identifier (uid).", + "tags": [ + "dashboards" + ], + "summary": "Get dashboard by uid.", + "operationId": "getDashboardByUID", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Will delete the dashboard given the specified unique identifier (uid).", + "tags": [ + "dashboards" + ], + "summary": "Delete dashboard by uid.", + "operationId": "deleteDashboardByUID", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/uid/{uid}/permissions": { + "get": { + "tags": [ + "dashboard_permissions" + ], + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissionsListByUID", + "parameters": [ + { + "type": "string", + "name": "uid", + "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": "This operation will remove existing permissions if they’re not included in the request.", + "tags": [ + "dashboard_permissions" + ], + "summary": "Updates permissions for a dashboard.", + "operationId": "updateDashboardPermissionsByUID", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardACLCommand" + } + }, + { + "type": "string", + "name": "uid", + "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/uid/{uid}/restore": { + "post": { + "tags": [ + "dashboard_versions" + ], + "summary": "Restore a dashboard to a given dashboard version using UID.", + "operationId": "restoreDashboardVersionByUID", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RestoreDashboardVersionCommand" + } + }, + { + "type": "string", + "name": "uid", + "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/uid/{uid}/versions": { + "get": { + "tags": [ + "dashboard_versions" + ], + "summary": "Gets all existing versions for the dashboard using UID.", + "operationId": "getDashboardVersionsByUID", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "description": "Maximum number of results to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "description": "Version to start from when returning queries", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { + "get": { + "tags": [ + "dashboard_versions" + ], + "summary": "Get a specific dashboard version using UID.", + "operationId": "getDashboardVersionByUID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources": { + "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 scope: `datasources:*`.", + "tags": [ + "datasources" + ], + "summary": "Get all data sources.", + "operationId": "getDataSources", + "responses": { + "200": { + "$ref": "#/responses/getDataSourcesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", + "tags": [ + "datasources" + ], + "summary": "Create a data source.", + "operationId": "addDataSource", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddDataSourceCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/correlations": { + "get": { + "tags": [ + "correlations" + ], + "summary": "Gets all correlations.", + "operationId": "getCorrelations", + "responses": { + "200": { + "$ref": "#/responses/getCorrelationsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/id/{name}": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + "tags": [ + "datasources" + ], + "summary": "Get data source Id by Name.", + "operationId": "getDataSourceIdByName", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDataSourceIDResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "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.", + } + }, + "/datasources/name/{name}": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", "tags": [ - "annotations" + "datasources" ], - "summary": "Create Annotation.", - "operationId": "postAnnotation", + "summary": "Get a single data source by Name.", + "operationId": "getDataSourceByName", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostAnnotationsCmd" - } + "type": "string", + "name": "name", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/postAnnotationResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getDataSourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1562,32 +3430,25 @@ "$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).", + }, + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", "tags": [ - "annotations" + "datasources" ], - "summary": "Create Annotation in Graphite format.", - "operationId": "postGraphiteAnnotation", + "summary": "Delete an existing data source by name.", + "operationId": "deleteDataSourceByName", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostGraphiteAnnotationsCmd" - } + "type": "string", + "name": "name", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/postAnnotationResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/deleteDataSourceByNameResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1595,131 +3456,178 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/annotations/mass-delete": { - "post": { + "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "get": { + "description": "Proxies all calls to the actual data source.", "tags": [ - "annotations" + "datasources" ], - "summary": "Delete multiple annotations.", - "operationId": "massDeleteAnnotations", + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETByUIDcalls", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MassDeleteAnnotationsCmd" - } + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/annotations/tags": { - "get": { - "description": "Find all the event tags created in the annotations.", + }, + "post": { + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", "tags": [ - "annotations" + "datasources" ], - "summary": "Find Annotations Tags.", - "operationId": "getAnnotationTags", + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTByUIDcalls", "parameters": [ + { + "name": "DatasourceProxyParam", + "in": "body", + "required": true, + "schema": {} + }, { "type": "string", - "description": "Tag is a string that you can use to filter tags.", - "name": "tag", - "in": "query" + "name": "datasource_proxy_route", + "in": "path", + "required": true }, { "type": "string", - "default": "100", - "description": "Max limit for results returned.", - "name": "limit", - "in": "query" + "name": "uid", + "in": "path", + "required": true } ], "responses": { - "200": { - "$ref": "#/responses/getAnnotationTagsResponse" + "201": { + "description": "" + }, + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/annotations/{annotation_id}": { - "get": { + }, + "delete": { + "description": "Proxies all calls to the actual data source.", "tags": [ - "annotations" + "datasources" ], - "summary": "Get Annotation by ID.", - "operationId": "getAnnotationByID", + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEByUIDcalls", "parameters": [ { "type": "string", - "name": "annotation_id", + "name": "uid", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/getAnnotationByIDResponse" + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "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.", + } + }, + "/datasources/proxy/{id}/{datasource_proxy_route}": { + "get": { + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", "tags": [ - "annotations" + "datasources" ], - "summary": "Update Annotation.", - "operationId": "updateAnnotation", + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETcalls", + "deprecated": true, "parameters": [ { "type": "string", - "name": "annotation_id", + "name": "datasource_proxy_route", "in": "path", "required": true }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAnnotationsCmd" - } + "type": "string", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "description": "" }, "400": { "$ref": "#/responses/badRequestError" @@ -1730,29 +3638,51 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "delete": { - "description": "Deletes the annotation that matches the specified ID.", + "post": { + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined\n\nPlease refer to [updated API](#/datasources/datasourceProxyPOSTByUIDcalls) instead", "tags": [ - "annotations" + "datasources" ], - "summary": "Delete Annotation By ID.", - "operationId": "deleteAnnotationByID", + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTcalls", + "deprecated": true, "parameters": [ + { + "name": "DatasourceProxyParam", + "in": "body", + "required": true, + "schema": {} + }, { "type": "string", - "name": "annotation_id", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "id", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "201": { + "description": "" + }, + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1760,37 +3690,42 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "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.", + "delete": { + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", "tags": [ - "annotations" + "datasources" ], - "summary": "Patch Annotation.", - "operationId": "patchAnnotation", + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEcalls", + "deprecated": true, "parameters": [ { "type": "string", - "name": "annotation_id", + "name": "id", "in": "path", "required": true }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchAnnotationsCmd" - } + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -1807,33 +3742,28 @@ } } }, - "/auth/keys": { + "/datasources/uid/{sourceUID}/correlations": { "get": { - "description": "Will return auth keys.", "tags": [ - "api_keys" + "correlations" ], - "summary": "Get auth keys.", - "operationId": "getAPIkeys", + "summary": "Gets all correlations originating from the given data source.", + "operationId": "getCorrelationsBySourceUID", "parameters": [ { - "type": "boolean", - "default": false, - "description": "Show expired keys", - "name": "includeExpired", - "in": "query" + "type": "string", + "name": "sourceUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAPIkeyResponse" + "$ref": "#/responses/getCorrelationsBySourceUIDResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "404": { "$ref": "#/responses/notFoundError" }, @@ -1843,25 +3773,30 @@ } }, "post": { - "description": "Will return details of the created API key.", "tags": [ - "api_keys" + "correlations" ], - "summary": "Creates an API key.", - "operationId": "addAPIkey", + "summary": "Add correlation.", + "operationId": "createCorrelation", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddCommand" + "$ref": "#/definitions/CreateCorrelationCommand" } + }, + { + "type": "string", + "name": "sourceUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/postAPIkeyResponse" + "$ref": "#/responses/createCorrelationResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -1872,8 +3807,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -1881,32 +3816,34 @@ } } }, - "/auth/keys/{id}": { - "delete": { + "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "get": { "tags": [ - "api_keys" + "correlations" ], - "summary": "Delete API key.", - "operationId": "deleteAPIkey", + "summary": "Gets a correlation.", + "operationId": "getCorrelation", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "id", + "type": "string", + "name": "sourceUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "correlationUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getCorrelationResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "404": { "$ref": "#/responses/notFoundError" }, @@ -1914,115 +3851,37 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboard/snapshots": { - "get": { + }, + "patch": { "tags": [ - "snapshots" + "correlations" ], - "summary": "List snapshots.", - "operationId": "searchDashboardSnapshots", + "summary": "Updates a correlation.", + "operationId": "updateCorrelation", "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" + "name": "sourceUID", + "in": "path", + "required": true }, - "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" + "type": "string", + "name": "correlationUID", + "in": "path", + "required": true }, - "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", + "name": "body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/SaveDashboardCommand" + "$ref": "#/definitions/UpdateCorrelationCommand" } } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" + "$ref": "#/responses/updateCorrelationResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -2036,59 +3895,34 @@ "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": { + "/datasources/uid/{uid}": { "get": { - "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsListByUID) instead", + "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:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", "tags": [ - "dashboard_permissions" - ], - "summary": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissionsListByID", - "deprecated": true, + "datasources" + ], + "summary": "Get a single data source by UID.", + "operationId": "getDataSourceByUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsListResponse" + "$ref": "#/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2104,37 +3938,62 @@ } } }, - "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.", + "put": { + "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:1` (single data source).", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Updates permissions for a dashboard.", - "operationId": "updateDashboardPermissionsByID", - "deprecated": true, + "summary": "Update an existing data source.", + "operationId": "updateDataSourceByUID", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" + "$ref": "#/definitions/UpdateDataSourceCommand" } }, { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, - "400": { - "$ref": "#/responses/badRequestError" + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + "tags": [ + "datasources" + ], + "summary": "Delete an existing data source by UID.", + "operationId": "deleteDataSourceByUID", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2151,35 +4010,30 @@ } } }, - "/dashboards/id/{DashboardID}/restore": { - "post": { - "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", + "/datasources/uid/{uid}/correlations/{correlationUID}": { + "delete": { "tags": [ - "dashboard_versions" + "correlations" ], - "summary": "Restore a dashboard to a given dashboard version.", - "operationId": "restoreDashboardVersionByID", - "deprecated": true, + "summary": "Delete a correlation.", + "operationId": "deleteCorrelation", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RestoreDashboardVersionCommand" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true }, { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "correlationUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" + "$ref": "#/responses/deleteCorrelationResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2196,27 +4050,27 @@ } } }, - "/dashboards/id/{DashboardID}/versions": { + "/datasources/uid/{uid}/health": { "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Gets all existing versions for the dashboard.", - "operationId": "getDashboardVersionsByID", - "deprecated": true, + "summary": "Sends a health check request to the plugin datasource identified by the UID.", + "operationId": "checkDatasourceHealthWithUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2224,43 +4078,39 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Get a specific dashboard version.", - "operationId": "getDashboardVersionByID", - "deprecated": true, + "summary": "Fetch data source resources.", + "operationId": "callDatasourceResourceWithUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true }, { - "type": "integer", - "format": "int64", - "name": "DashboardVersionID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2277,26 +4127,26 @@ } } }, - "/dashboards/import": { + "/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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Import dashboard.", - "operationId": "importDashboard", + "summary": "Disable permissions for a data source.", + "operationId": "disablePermissions", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ImportDashboardRequest" - } + "type": "string", + "name": "datasourceId", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/importDashboardResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -2304,11 +4154,11 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "412": { - "$ref": "#/responses/preconditionFailedError" + "403": { + "$ref": "#/responses/forbiddenError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -2316,75 +4166,122 @@ } } }, - "/dashboards/tags": { - "get": { + "/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": [ - "dashboards" + "datasource_permissions", + "enterprise" + ], + "summary": "Enable permissions for a data source.", + "operationId": "enablePermissions", + "parameters": [ + { + "type": "string", + "name": "datasourceId", + "in": "path", + "required": true + } ], - "summary": "Get all dashboards tags of an organisation.", - "operationId": "getDashboardTags", "responses": { "200": { - "$ref": "#/responses/getDashboardsTagsResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/trim": { - "post": { + "/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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Trim defaults from dashboard.", - "operationId": "trimDashboard", + "summary": "Get permissions for a data source.", + "operationId": "getAllPermissions", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TrimDashboardCommand" - } + "type": "string", + "name": "datasourceId", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/trimDashboardResponse" + "$ref": "#/responses/getAllPermissionseResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/uid/{uid}": { - "get": { - "description": "Will return the dashboard given the dashboard unique identifier (uid).", + }, + "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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Get dashboard by uid.", - "operationId": "getDashboardByUID", + "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": "uid", + "name": "builtinRole", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "name": "permission", + "in": "query" + }, + { + "type": "string", + "name": "datasourceId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardResponse" + "$ref": "#/responses/addPermissionResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2399,25 +4296,34 @@ "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/datasources/{datasourceId}/permissions/{permissionId}": { "delete": { - "description": "Will delete the dashboard given the specified unique identifier (uid).", + "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": [ - "dashboards" + "datasource_permissions", + "enterprise" ], - "summary": "Delete dashboard by uid.", - "operationId": "deleteDashboardByUID", + "summary": "Remove permission for a data source.", + "operationId": "deletePermissions", "parameters": [ { "type": "string", - "name": "uid", + "name": "datasourceId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "permissionId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/deleteDashboardResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2427,31 +4333,33 @@ }, "404": { "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{uid}/permissions": { + "/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", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissionsListByUID", + "summary": "Get a single data source by Id.", + "operationId": "getDataSourceByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsListResponse" + "$ref": "#/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2467,35 +4375,33 @@ } } }, - "post": { - "description": "This operation will remove existing permissions if they’re not included in the request.", + "put": { + "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/updateDataSourceByUID) instead", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Updates permissions for a dashboard.", - "operationId": "updateDashboardPermissionsByUID", + "summary": "Update an existing data source by its sequential ID.", + "operationId": "updateDataSourceByID", + "deprecated": true, "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" + "$ref": "#/definitions/UpdateDataSourceCommand" } }, { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2503,41 +4409,30 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/uid/{uid}/restore": { - "post": { + }, + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/deleteDataSourceByUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Restore a dashboard to a given dashboard version using UID.", - "operationId": "restoreDashboardVersionByUID", + "summary": "Delete an existing data source by id.", + "operationId": "deleteDataSourceByID", + "deprecated": true, "parameters": [ - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RestoreDashboardVersionCommand" - } - }, { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2554,40 +4449,29 @@ } } }, - "/dashboards/uid/{uid}/versions": { + "/datasources/{id}/health": { "get": { + "description": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Gets all existing versions for the dashboard using UID.", - "operationId": "getDashboardVersionsByUID", + "summary": "Sends a health check request to the plugin datasource identified by the ID.", + "operationId": "checkDatasourceHealthByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true - }, - { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Maximum number of results to return", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Version to start from when returning queries", - "name": "start", - "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2595,40 +4479,41 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { + "/datasources/{id}/resources/{datasource_proxy_route}": { "get": { + "description": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Get a specific dashboard version using UID.", - "operationId": "getDashboardVersionByUID", + "summary": "Fetch data source resources by Id.", + "operationId": "callDatasourceResourceByID", + "deprecated": true, "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardVersionID", + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true }, { "type": "string", - "name": "uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2645,81 +4530,39 @@ } } }, - "/datasources": { - "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 scope: `datasources:*`.", - "tags": [ - "datasources" - ], - "summary": "Get all data sources.", - "operationId": "getDataSources", - "responses": { - "200": { - "$ref": "#/responses/getDataSourcesResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, + "/ds/query": { "post": { - "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:query`.", "tags": [ - "datasources" + "ds" ], - "summary": "Create a data source.", - "operationId": "addDataSource", + "summary": "DataSource query metrics with expressions.", + "operationId": "queryMetricsWithExpressions", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddDataSourceCommand" + "$ref": "#/definitions/MetricRequest" } } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/queryMetricsWithExpressionsRespons" }, - "409": { - "$ref": "#/responses/conflictError" + "207": { + "$ref": "#/responses/queryMetricsWithExpressionsRespons" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/datasources/correlations": { - "get": { - "tags": [ - "correlations" - ], - "summary": "Gets all correlations.", - "operationId": "getCorrelations", - "responses": { - "200": { - "$ref": "#/responses/getCorrelationsResponse" + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -2727,25 +4570,35 @@ } } }, - "/datasources/id/{name}": { + "/folders": { "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + "description": "Returns all folders that the authenticated user has permission to view.", "tags": [ - "datasources" + "folders" ], - "summary": "Get data source Id by Name.", - "operationId": "getDataSourceIdByName", + "summary": "Get all folders.", + "operationId": "getFolders", "parameters": [ { - "type": "string", - "name": "name", - "in": "path", - "required": true + "type": "integer", + "format": "int64", + "default": 1000, + "description": "Limit the maximum number of folders to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "description": "Page index for starting fetching folders", + "name": "page", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceIDResponse" + "$ref": "#/responses/getFoldersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2753,34 +4606,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/name/{name}": { - "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + }, + "post": { "tags": [ - "datasources" + "folders" ], - "summary": "Get a single data source by Name.", - "operationId": "getDataSourceByName", + "summary": "Create folder.", + "operationId": "createFolder", "parameters": [ { - "type": "string", - "name": "name", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateFolderCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" + "$ref": "#/responses/folderResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2788,29 +4640,35 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + } + }, + "/folders/id/{folder_id}": { + "get": { + "description": "Returns the folder identified by id.", "tags": [ - "datasources" + "folders" ], - "summary": "Delete an existing data source by name.", - "operationId": "deleteDataSourceByName", + "summary": "Get folder by id.", + "operationId": "getFolderByID", "parameters": [ { - "type": "string", - "name": "name", + "type": "integer", + "format": "int64", + "name": "folder_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/deleteDataSourceByNameResponse" + "$ref": "#/responses/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2827,34 +4685,24 @@ } } }, - "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "/folders/{folder_uid}": { "get": { - "description": "Proxies all calls to the actual data source.", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETByUIDcalls", + "summary": "Get folder by uid.", + "operationId": "getFolderByUID", "parameters": [ { "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "uid", + "name": "folder_uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2870,39 +4718,32 @@ } } }, - "post": { - "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", + "put": { "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTByUIDcalls", + "summary": "Update folder.", + "operationId": "updateFolder", "parameters": [ - { - "name": "DatasourceProxyParam", - "in": "body", - "required": true, - "schema": {} - }, { "type": "string", - "name": "datasource_proxy_route", + "name": "folder_uid", "in": "path", "required": true }, { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "description": "To change the unique identifier (uid), provide another one.\nTo overwrite an existing folder with newer version, set `overwrite` to `true`.\nProvide the current version to safelly update the folder: if the provided version differs from the stored one the request will fail, unless `overwrite` is `true`.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateFolderCommand" + } } ], "responses": { - "201": { - "description": "" - }, - "202": { - "description": "" + "200": { + "$ref": "#/responses/folderResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -2916,35 +4757,39 @@ "404": { "$ref": "#/responses/notFoundError" }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "delete": { - "description": "Proxies all calls to the actual data source.", + "description": "Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted.", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEByUIDcalls", + "summary": "Delete folder.", + "operationId": "deleteFolder", "parameters": [ { "type": "string", - "name": "uid", + "name": "folder_uid", "in": "path", "required": true }, { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true + "type": "boolean", + "default": false, + "description": "If `true` any Grafana 8 Alerts under this folder will be deleted.\nSet to `false` so that the request will fail if the folder contains any Grafana 8 Alerts.", + "name": "forceDeleteRules", + "in": "query" } ], "responses": { - "202": { - "description": "" + "200": { + "$ref": "#/responses/deleteFolderResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -2964,35 +4809,24 @@ } } }, - "/datasources/proxy/{id}/{datasource_proxy_route}": { + "/folders/{folder_uid}/permissions": { "get": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", "tags": [ - "datasources" + "folder_permissions" ], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETcalls", - "deprecated": true, + "summary": "Gets all existing permissions for the folder with the given `uid`.", + "operationId": "getFolderPermissionList", "parameters": [ { "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "id", + "name": "folder_uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getFolderPermissionListResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3009,42 +4843,30 @@ } }, "post": { - "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined\n\nPlease refer to [updated API](#/datasources/datasourceProxyPOSTByUIDcalls) instead", "tags": [ - "datasources" + "folder_permissions" ], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTcalls", - "deprecated": true, + "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", + "operationId": "updateFolderPermissions", "parameters": [ - { - "name": "DatasourceProxyParam", - "in": "body", - "required": true, - "schema": {} - }, { "type": "string", - "name": "datasource_proxy_route", + "name": "folder_uid", "in": "path", "required": true }, { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardACLCommand" + } } ], "responses": { - "201": { - "description": "" - }, - "202": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "200": { + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3059,106 +4881,111 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", + } + }, + "/library-elements": { + "get": { + "description": "Returns a list of all library elements the authenticated user has permission to view.\nUse the `perPage` query parameter to control the maximum number of library elements returned; the default limit is `100`.\nYou can also use the `page` query parameter to fetch library elements from any page other than the first one.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEcalls", - "deprecated": true, + "summary": "Get all library elements.", + "operationId": "getLibraryElements", "parameters": [ { "type": "string", - "name": "id", - "in": "path", - "required": true + "description": "Part of the name or description searched for.", + "name": "searchString", + "in": "query" }, { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - } - ], - "responses": { - "202": { - "description": "" + "enum": [ + 1, + 2 + ], + "type": "integer", + "format": "int64", + "description": "Kind of element to search for.", + "name": "kind", + "in": "query" }, - "400": { - "$ref": "#/responses/badRequestError" + { + "enum": [ + "alpha-asc", + "alpha-desc" + ], + "type": "string", + "description": "Sort order of elements.", + "name": "sortDirection", + "in": "query" }, - "401": { - "$ref": "#/responses/unauthorisedError" + { + "type": "string", + "description": "A comma separated list of types to filter the elements by", + "name": "typeFilter", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "type": "string", + "description": "Element UID to exclude from search results.", + "name": "excludeUid", + "in": "query" }, - "404": { - "$ref": "#/responses/notFoundError" + { + "type": "string", + "description": "A comma separated list of folder ID(s) to filter the elements by.", + "name": "folderFilter", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/datasources/uid/{sourceUID}/correlations": { - "get": { - "tags": [ - "correlations" - ], - "summary": "Gets all correlations originating from the given data source.", - "operationId": "getCorrelationsBySourceUID", - "parameters": [ { - "type": "string", - "name": "sourceUID", - "in": "path", - "required": true + "type": "integer", + "format": "int64", + "default": 100, + "description": "The number of results per page.", + "name": "perPage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", + "name": "page", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getCorrelationsBySourceUIDResponse" + "$ref": "#/responses/getLibraryElementsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { + "description": "Creates a new library element.", "tags": [ - "correlations" + "library_elements" ], - "summary": "Add correlation.", - "operationId": "createCorrelation", + "summary": "Create library element.", + "operationId": "createLibraryElement", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateCorrelationCommand" + "$ref": "#/definitions/CreateLibraryElementCommand" } - }, - { - "type": "string", - "name": "sourceUID", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/createCorrelationResponse" + "$ref": "#/responses/getLibraryElementResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3178,30 +5005,25 @@ } } }, - "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "/library-elements/name/{library_element_name}": { "get": { + "description": "Returns a library element with the given name.", "tags": [ - "correlations" + "library_elements" ], - "summary": "Gets a correlation.", - "operationId": "getCorrelation", + "summary": "Get library element by name.", + "operationId": "getLibraryElementByName", "parameters": [ { "type": "string", - "name": "sourceUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", + "name": "library_element_name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getCorrelationResponse" + "$ref": "#/responses/getLibraryElementResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3213,47 +5035,31 @@ "$ref": "#/responses/internalServerError" } } - }, - "patch": { + } + }, + "/library-elements/{library_element_uid}": { + "get": { + "description": "Returns a library element with the given UID.", "tags": [ - "correlations" + "library_elements" ], - "summary": "Updates a correlation.", - "operationId": "updateCorrelation", + "summary": "Get library element by UID.", + "operationId": "getLibraryElementByUID", "parameters": [ { "type": "string", - "name": "sourceUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", + "name": "library_element_uid", "in": "path", "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/UpdateCorrelationCommand" - } } ], "responses": { "200": { - "$ref": "#/responses/updateCorrelationResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getLibraryElementResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "404": { "$ref": "#/responses/notFoundError" }, @@ -3261,27 +5067,25 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/uid/{uid}": { - "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:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + }, + "delete": { + "description": "Deletes an existing library element as specified by the UID. This operation cannot be reverted.\nYou cannot delete a library element that is connected. This operation cannot be reverted.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Get a single data source by UID.", - "operationId": "getDataSourceByUID", + "summary": "Delete library element.", + "operationId": "deleteLibraryElementByUID", "parameters": [ { "type": "string", - "name": "uid", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3300,32 +5104,35 @@ } } }, - "put": { - "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:1` (single data source).", + "patch": { + "description": "Updates an existing library element identified by uid.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Update an existing data source.", - "operationId": "updateDataSourceByUID", + "summary": "Update library element.", + "operationId": "updateLibraryElement", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDataSourceCommand" + "$ref": "#/definitions/PatchLibraryElementCommand" } }, { "type": "string", - "name": "uid", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3333,36 +5140,41 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + } + }, + "/library-elements/{library_element_uid}/connections/": { + "get": { + "description": "Returns a list of connections for a library element based on the UID specified.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Delete an existing data source by UID.", - "operationId": "deleteDataSourceByUID", + "summary": "Get library element connections.", + "operationId": "getLibraryElementConnections", "parameters": [ { "type": "string", - "name": "uid", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getLibraryElementConnectionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "404": { "$ref": "#/responses/notFoundError" }, @@ -3372,39 +5184,33 @@ } } }, - "/datasources/uid/{uid}/correlations/{correlationUID}": { - "delete": { + "/licensing/check": { + "get": { "tags": [ - "correlations" + "licensing", + "enterprise" ], - "summary": "Delete a correlation.", - "operationId": "deleteCorrelation", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", - "in": "path", - "required": true + "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/deleteCorrelationResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "$ref": "#/responses/getCustomPermissionsReportResponse" }, "500": { "$ref": "#/responses/internalServerError" @@ -3412,33 +5218,21 @@ } } }, - "/datasources/uid/{uid}/health": { + "/licensing/custom-permissions-csv": { "get": { - "tags": [ - "datasources" + "description": "You need to have a permission with action `licensing.reports:read`.", + "produces": [ + "text/csv" ], - "summary": "Sends a health check request to the plugin datasource identified by the UID.", - "operationId": "checkDatasourceHealthWithUID", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - } + "tags": [ + "licensing", + "enterprise" ], + "summary": "Get custom permissions report in CSV format.", + "operationId": "getCustomPermissionsCSV", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/getCustomPermissionsReportResponse" }, "500": { "$ref": "#/responses/internalServerError" @@ -3446,42 +5240,18 @@ } } }, - "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { + "/licensing/refresh-stats": { "get": { + "description": "You need to have a permission with action `licensing:read`.", "tags": [ - "datasources" - ], - "summary": "Fetch data source resources.", - "operationId": "callDatasourceResourceWithUID", - "parameters": [ - { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - } + "licensing", + "enterprise" ], + "summary": "Refresh license stats.", + "operationId": "refreshLicenseStats", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "$ref": "#/responses/refreshLicenseStatsResponse" }, "500": { "$ref": "#/responses/internalServerError" @@ -3489,71 +5259,72 @@ } } }, - "/datasources/{id}": { + "/licensing/token": { "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", + "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": [ - "datasources" + "licensing", + "enterprise" ], - "summary": "Get a single data source by Id.", - "operationId": "getDataSourceByID", - "deprecated": true, + "summary": "Create license token.", + "operationId": "postLicenseToken", "parameters": [ { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" + "$ref": "#/responses/getLicenseTokenResponse" }, "400": { "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } }, - "put": { - "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/updateDataSourceByUID) instead", + "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": [ - "datasources" + "licensing", + "enterprise" ], - "summary": "Update an existing data source by its sequential ID.", - "operationId": "updateDataSourceByID", - "deprecated": true, + "summary": "Remove license from database.", + "operationId": "deleteLicenseToken", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDataSourceCommand" + "$ref": "#/definitions/DeleteTokenCommand" } - }, - { - "type": "string", - "name": "id", - "in": "path", - "required": true } ], "responses": { - "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3561,36 +5332,58 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/deleteDataSourceByUID) instead", + } + }, + "/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": [ - "datasources" + "licensing", + "enterprise" ], - "summary": "Delete an existing data source by id.", - "operationId": "deleteDataSourceByID", - "deprecated": true, + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", "parameters": [ { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/postRenewLicenseTokenResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "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" @@ -3601,29 +5394,16 @@ } } }, - "/datasources/{id}/health": { + "/org": { "get": { - "description": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", "tags": [ - "datasources" - ], - "summary": "Sends a health check request to the plugin datasource identified by the ID.", - "operationId": "checkDatasourceHealthByID", - "deprecated": true, - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true - } + "org" ], + "summary": "Get current Organization.", + "operationId": "getCurrentOrg", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getCurrentOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3635,29 +5415,21 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/{id}/resources/{datasource_proxy_route}": { - "get": { - "description": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", + }, + "put": { "tags": [ - "datasources" + "org" ], - "summary": "Fetch data source resources by Id.", - "operationId": "callDatasourceResourceByID", - "deprecated": true, + "summary": "Update current Organization.", + "operationId": "updateCurrentOrg", "parameters": [ { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgForm" + } } ], "responses": { @@ -3673,39 +5445,32 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/ds/query": { - "post": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:query`.", + "/org/address": { + "put": { "tags": [ - "ds" + "org" ], - "summary": "DataSource query metrics with expressions.", - "operationId": "queryMetricsWithExpressions", + "summary": "Update current Organization's address.", + "operationId": "updateCurrentOrgAddress", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/MetricRequest" + "$ref": "#/definitions/UpdateOrgAddressForm" } } ], "responses": { "200": { - "$ref": "#/responses/queryMetricsWithExpressionsRespons" - }, - "207": { - "$ref": "#/responses/queryMetricsWithExpressionsRespons" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3722,35 +5487,16 @@ } } }, - "/folders": { + "/org/invites": { "get": { - "description": "Returns all folders that the authenticated user has permission to view.", "tags": [ - "folders" - ], - "summary": "Get all folders.", - "operationId": "getFolders", - "parameters": [ - { - "type": "integer", - "format": "int64", - "default": 1000, - "description": "Limit the maximum number of folders to return", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 1, - "description": "Page index for starting fetching folders", - "name": "page", - "in": "query" - } + "org_invites" ], + "summary": "Get pending invites.", + "operationId": "getPendingOrgInvites", "responses": { "200": { - "$ref": "#/responses/getFoldersResponse" + "$ref": "#/responses/getPendingOrgInvitesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3765,23 +5511,23 @@ }, "post": { "tags": [ - "folders" + "org_invites" ], - "summary": "Create folder.", - "operationId": "createFolder", + "summary": "Add invite.", + "operationId": "addOrgInvite", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateFolderCommand" + "$ref": "#/definitions/AddInviteForm" } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3792,8 +5538,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" + "412": { + "$ref": "#/responses/SMTPNotEnabledError" }, "500": { "$ref": "#/responses/internalServerError" @@ -3801,26 +5547,24 @@ } } }, - "/folders/id/{folder_id}": { - "get": { - "description": "Returns the folder identified by id.", + "/org/invites/{invitation_code}/revoke": { + "delete": { "tags": [ - "folders" + "org_invites" ], - "summary": "Get folder by id.", - "operationId": "getFolderByID", + "summary": "Revoke invite.", + "operationId": "revokeInvite", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "folder_id", + "type": "string", + "name": "invitation_code", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3837,24 +5581,16 @@ } } }, - "/folders/{folder_uid}": { + "/org/preferences": { "get": { "tags": [ - "folders" - ], - "summary": "Get folder by uid.", - "operationId": "getFolderByUID", - "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - } + "org_preferences" ], + "summary": "Get Current Org Prefs.", + "operationId": "getOrgPreferences", "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/getPreferencesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3862,9 +5598,6 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } @@ -3872,30 +5605,23 @@ }, "put": { "tags": [ - "folders" + "org_preferences" ], - "summary": "Update folder.", - "operationId": "updateFolder", - "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - }, + "summary": "Update Current Org Prefs.", + "operationId": "updateOrgPreferences", + "parameters": [ { - "description": "To change the unique identifier (uid), provide another one.\nTo overwrite an existing folder with newer version, set `overwrite` to `true`.\nProvide the current version to safelly update the folder: if the provided version differs from the stored one the request will fail, unless `overwrite` is `true`.", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateFolderCommand" + "$ref": "#/definitions/UpdatePrefsCmd" } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3906,42 +5632,30 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "delete": { - "description": "Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted.", + "patch": { "tags": [ - "folders" + "org_preferences" ], - "summary": "Delete folder.", - "operationId": "deleteFolder", + "summary": "Patch Current Org Prefs.", + "operationId": "patchOrgPreferences", "parameters": [ { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - }, - { - "type": "boolean", - "default": false, - "description": "If `true` any Grafana 8 Alerts under this folder will be deleted.\nSet to `false` so that the request will fail if the folder contains any Grafana 8 Alerts.", - "name": "forceDeleteRules", - "in": "query" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchPrefsCmd" + } } ], "responses": { "200": { - "$ref": "#/responses/deleteFolderResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3952,33 +5666,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/folders/{folder_uid}/permissions": { + "/org/users": { "get": { + "description": "Returns all org users within the current organization. Accessible to users with org admin role.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", "tags": [ - "folder_permissions" - ], - "summary": "Gets all existing permissions for the folder with the given `uid`.", - "operationId": "getFolderPermissionList", - "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - } + "org" ], + "summary": "Get all users within the current organization.", + "operationId": "getOrgUsersForCurrentOrg", "responses": { "200": { - "$ref": "#/responses/getFolderPermissionListResponse" + "$ref": "#/responses/getOrgUsersForCurrentOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3986,33 +5690,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { + "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", "tags": [ - "folder_permissions" + "org" ], - "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", - "operationId": "updateFolderPermissions", + "summary": "Add a new user to the current organization.", + "operationId": "addOrgUserToCurrentOrg", "parameters": [ { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - }, - { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" + "$ref": "#/definitions/AddOrgUserCommand" } } ], @@ -4026,118 +5722,69 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/library-elements": { + "/org/users/lookup": { "get": { - "description": "Returns a list of all library elements the authenticated user has permission to view.\nUse the `perPage` query parameter to control the maximum number of library elements returned; the default limit is `100`.\nYou can also use the `page` query parameter to fetch library elements from any page other than the first one.", + "description": "Returns all org users within the current organization, but with less detailed information.\nAccessible to users with org admin role, admin in any folder or admin of any team.\nMainly used by Grafana UI for providing list of users when adding team members and when editing folder/dashboard permissions.", "tags": [ - "library_elements" + "org" ], - "summary": "Get all library elements.", - "operationId": "getLibraryElements", + "summary": "Get all users within the current organization (lookup)", + "operationId": "getOrgUsersForCurrentOrgLookup", "parameters": [ { "type": "string", - "description": "Part of the name or description searched for.", - "name": "searchString", - "in": "query" - }, - { - "enum": [ - 1, - 2 - ], - "type": "integer", - "format": "int64", - "description": "Kind of element to search for.", - "name": "kind", - "in": "query" - }, - { - "enum": [ - "alpha-asc", - "alpha-desc" - ], - "type": "string", - "description": "Sort order of elements.", - "name": "sortDirection", - "in": "query" - }, - { - "type": "string", - "description": "A comma separated list of types to filter the elements by", - "name": "typeFilter", - "in": "query" - }, - { - "type": "string", - "description": "Element UID to exclude from search results.", - "name": "excludeUid", - "in": "query" - }, - { - "type": "string", - "description": "A comma separated list of folder ID(s) to filter the elements by.", - "name": "folderFilter", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 100, - "description": "The number of results per page.", - "name": "perPage", + "name": "query", "in": "query" }, { "type": "integer", "format": "int64", - "default": 1, - "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", - "name": "page", + "name": "limit", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementsResponse" + "$ref": "#/responses/getOrgUsersForCurrentOrgLookupResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "post": { - "description": "Creates a new library element.", + } + }, + "/org/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", "tags": [ - "library_elements" + "org" ], - "summary": "Create library element.", - "operationId": "createLibraryElement", + "summary": "Delete user in current organization.", + "operationId": "removeOrgUserForCurrentOrg", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateLibraryElementCommand" - } + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4148,40 +5795,47 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/library-elements/name/{library_element_name}": { - "get": { - "description": "Returns a library element with the given name.", + }, + "patch": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", "tags": [ - "library_elements" + "org" ], - "summary": "Get library element by name.", - "operationId": "getLibraryElementByName", + "summary": "Updates the given user.", + "operationId": "updateOrgUserForCurrentOrg", "parameters": [ { - "type": "string", - "name": "library_element_name", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgUserCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4189,58 +5843,49 @@ } } }, - "/library-elements/{library_element_uid}": { + "/orgs": { "get": { - "description": "Returns a library element with the given UID.", - "tags": [ - "library_elements" - ], - "summary": "Get library element by UID.", - "operationId": "getLibraryElementByUID", - "parameters": [ + "security": [ { - "type": "string", - "name": "library_element_uid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/getLibraryElementResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "delete": { - "description": "Deletes an existing library element as specified by the UID. This operation cannot be reverted.\nYou cannot delete a library element that is connected. This operation cannot be reverted.", + "basic": [] + } + ], "tags": [ - "library_elements" + "orgs" ], - "summary": "Delete library element.", - "operationId": "deleteLibraryElementByUID", + "summary": "Search all Organizations.", + "operationId": "searchOrgs", "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1, + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "description": "Number of items per page\nThe totalCount field in the response can be used for pagination list E.g. if totalCount is equal to 100 teams and the perpage parameter is set to 10 then there are 10 pages of teams.", + "name": "perpage", + "in": "query" + }, { "type": "string", - "name": "library_element_uid", - "in": "path", - "required": true + "name": "name", + "in": "query" + }, + { + "type": "string", + "description": "If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.", + "name": "query", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/searchOrgsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4248,43 +5893,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "description": "Updates an existing library element identified by uid.", + "post": { + "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", "tags": [ - "library_elements" + "orgs" ], - "summary": "Update library element.", - "operationId": "updateLibraryElement", + "summary": "Create Organization.", + "operationId": "createOrg", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PatchLibraryElementCommand" + "$ref": "#/definitions/CreateOrgCommand" } - }, - { - "type": "string", - "name": "library_element_uid", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4292,11 +5928,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "412": { - "$ref": "#/responses/preconditionFailedError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4304,31 +5937,35 @@ } } }, - "/library-elements/{library_element_uid}/connections/": { + "/orgs/name/{org_name}": { "get": { - "description": "Returns a list of connections for a library element based on the UID specified.", + "security": [ + { + "basic": [] + } + ], "tags": [ - "library_elements" + "orgs" ], - "summary": "Get library element connections.", - "operationId": "getLibraryElementConnections", + "summary": "Get Organization by ID.", + "operationId": "getOrgByName", "parameters": [ { "type": "string", - "name": "library_element_uid", + "name": "org_name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementConnectionsResponse" + "$ref": "#/responses/getOrgByNameResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4336,16 +5973,30 @@ } } }, - "/org": { + "/orgs/{org_id}": { "get": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "org" + "orgs" + ], + "summary": "Get Organization by ID.", + "operationId": "getOrgByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + } ], - "summary": "Get current Organization.", - "operationId": "getCurrentOrg", "responses": { "200": { - "$ref": "#/responses/getCurrentOrgResponse" + "$ref": "#/responses/getOrgByIDResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4359,11 +6010,16 @@ } }, "put": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "org" + "orgs" ], - "summary": "Update current Organization.", - "operationId": "updateCurrentOrg", + "summary": "Update Organization.", + "operationId": "updateOrg", "parameters": [ { "name": "body", @@ -4372,6 +6028,13 @@ "schema": { "$ref": "#/definitions/UpdateOrgForm" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { @@ -4391,23 +6054,25 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/org/address": { - "put": { + }, + "delete": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "org" + "orgs" ], - "summary": "Update current Organization's address.", - "operationId": "updateCurrentOrgAddress", + "summary": "Delete Organization.", + "operationId": "deleteOrgByID", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgAddressForm" - } + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { @@ -4423,22 +6088,45 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/invites": { - "get": { + "/orgs/{org_id}/address": { + "put": { "tags": [ - "org_invites" + "orgs" + ], + "summary": "Update Organization's address.", + "operationId": "updateOrgAddress", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + } ], - "summary": "Get pending invites.", - "operationId": "getPendingOrgInvites", "responses": { "200": { - "$ref": "#/responses/getPendingOrgInvitesResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4450,29 +6138,28 @@ "$ref": "#/responses/internalServerError" } } - }, - "post": { + } + }, + "/orgs/{org_id}/quotas": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:read` and scope `org:id:1` (orgIDScope).", "tags": [ - "org_invites" + "orgs" ], - "summary": "Add invite.", - "operationId": "addOrgInvite", + "summary": "Fetch Organization quota.", + "operationId": "getOrgQuota", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddInviteForm" - } + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getQuotaResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4480,8 +6167,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "412": { - "$ref": "#/responses/SMTPNotEnabledError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4489,17 +6176,38 @@ } } }, - "/org/invites/{invitation_code}/revoke": { - "delete": { + "/orgs/{org_id}/quotas/{quota_target}": { + "put": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).", "tags": [ - "org_invites" + "orgs" ], - "summary": "Revoke invite.", - "operationId": "revokeInvite", + "summary": "Update user quota.", + "operationId": "updateOrgQuota", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgQuotaCmd" + } + }, { "type": "string", - "name": "invitation_code", + "name": "quota_target", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } @@ -4523,16 +6231,31 @@ } } }, - "/org/preferences": { + "/orgs/{org_id}/users": { "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", "tags": [ - "org_preferences" + "orgs" + ], + "summary": "Get Users in Organization.", + "operationId": "getOrgUsers", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + } ], - "summary": "Get Current Org Prefs.", - "operationId": "getOrgPreferences", "responses": { "200": { - "$ref": "#/responses/getPreferencesResponse" + "$ref": "#/responses/getOrgUsersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4545,29 +6268,34 @@ } } }, - "put": { + "post": { + "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", "tags": [ - "org_preferences" + "orgs" ], - "summary": "Update Current Org Prefs.", - "operationId": "updateOrgPreferences", + "summary": "Add a new user to the current organization.", + "operationId": "addOrgUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdatePrefsCmd" + "$ref": "#/definitions/AddOrgUserCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -4578,21 +6306,30 @@ "$ref": "#/responses/internalServerError" } } - }, - "patch": { + } + }, + "/orgs/{org_id}/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", "tags": [ - "org_preferences" + "orgs" ], - "summary": "Patch Current Org Prefs.", - "operationId": "patchOrgPreferences", + "summary": "Delete user in current organization.", + "operationId": "removeOrgUser", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchPrefsCmd" - } + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { @@ -4612,52 +6349,45 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/org/users": { - "get": { - "description": "Returns all org users within the current organization. Accessible to users with org admin role.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", - "tags": [ - "org" - ], - "summary": "Get all users within the current organization.", - "operationId": "getOrgUsersForCurrentOrg", - "responses": { - "200": { - "$ref": "#/responses/getOrgUsersForCurrentOrgResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } }, - "post": { - "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", + "patch": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", "tags": [ - "org" + "orgs" ], - "summary": "Add a new user to the current organization.", - "operationId": "addOrgUserToCurrentOrg", + "summary": "Update Users in Organization.", + "operationId": "updateOrgUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddOrgUserCommand" + "$ref": "#/definitions/UpdateOrgUserCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { "200": { "$ref": "#/responses/okResponse" }, + "400": { + "$ref": "#/responses/badRequestError" + }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -4670,14 +6400,13 @@ } } }, - "/org/users/lookup": { + "/playlists": { "get": { - "description": "Returns all org users within the current organization, but with less detailed information.\nAccessible to users with org admin role, admin in any folder or admin of any team.\nMainly used by Grafana UI for providing list of users when adding team members and when editing folder/dashboard permissions.", "tags": [ - "org" + "playlists" ], - "summary": "Get all users within the current organization (lookup)", - "operationId": "getOrgUsersForCurrentOrgLookup", + "summary": "Get playlists.", + "operationId": "searchPlaylists", "parameters": [ { "type": "string", @@ -4687,49 +6416,39 @@ { "type": "integer", "format": "int64", + "description": "in:limit", "name": "limit", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getOrgUsersForCurrentOrgLookupResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/searchPlaylistsResponse" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/org/users/{user_id}": { - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + }, + "post": { "tags": [ - "org" + "playlists" ], - "summary": "Delete user in current organization.", - "operationId": "removeOrgUserForCurrentOrg", + "summary": "Create playlist.", + "operationId": "createPlaylist", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreatePlaylistCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createPlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4737,41 +6456,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "patch": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", + } + }, + "/playlists/{uid}": { + "get": { "tags": [ - "org" + "playlists" ], - "summary": "Updates the given user.", - "operationId": "updateOrgUserForCurrentOrg", + "summary": "Get playlist.", + "operationId": "getPlaylist", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgUserCommand" - } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getPlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4779,55 +6490,39 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs": { - "get": { - "security": [ - { - "basic": [] - } - ], + }, + "put": { "tags": [ - "orgs" + "playlists" ], - "summary": "Search all Organizations.", - "operationId": "searchOrgs", - "parameters": [ - { - "type": "integer", - "format": "int64", - "default": 1, - "name": "page", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 1000, - "description": "Number of items per page\nThe totalCount field in the response can be used for pagination list E.g. if totalCount is equal to 100 teams and the perpage parameter is set to 10 then there are 10 pages of teams.", - "name": "perpage", - "in": "query" - }, + "summary": "Update playlist.", + "operationId": "updatePlaylist", + "parameters": [ { - "type": "string", - "name": "name", - "in": "query" + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePlaylistCommand" + } }, { "type": "string", - "description": "If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.", - "name": "query", - "in": "query" + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/searchOrgsResponse" + "$ref": "#/responses/updatePlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4835,34 +6530,31 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", + "delete": { "tags": [ - "orgs" + "playlists" ], - "summary": "Create Organization.", - "operationId": "createOrg", + "summary": "Delete playlist.", + "operationId": "deletePlaylist", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateOrgCommand" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrgResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4870,8 +6562,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4879,29 +6571,24 @@ } } }, - "/orgs/name/{org_name}": { + "/playlists/{uid}/dashboards": { "get": { - "security": [ - { - "basic": [] - } - ], "tags": [ - "orgs" + "playlists" ], - "summary": "Get Organization by ID.", - "operationId": "getOrgByName", + "summary": "Get playlist dashboards.", + "operationId": "getPlaylistDashboards", "parameters": [ { "type": "string", - "name": "org_name", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getOrgByNameResponse" + "$ref": "#/responses/getPlaylistDashboardsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4909,36 +6596,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}": { + "/playlists/{uid}/items": { "get": { - "security": [ - { - "basic": [] - } - ], "tags": [ - "orgs" + "playlists" ], - "summary": "Get Organization by ID.", - "operationId": "getOrgByID", + "summary": "Get playlist items.", + "operationId": "getPlaylistItems", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getOrgByIDResponse" + "$ref": "#/responses/getPlaylistItemsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4946,80 +6630,118 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "put": { - "security": [ - { - "basic": [] - } - ], + } + }, + "/query-history": { + "get": { + "description": "Returns a list of queries in the query history that matches the search criteria.\nQuery history search supports pagination. Use the `limit` parameter to control the maximum number of queries returned; the default limit is 100.\nYou can also use the `page` query parameter to fetch queries from any page other than the first one.", "tags": [ - "orgs" + "query_history" ], - "summary": "Update Organization.", - "operationId": "updateOrg", + "summary": "Query history search.", + "operationId": "searchQueries", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgForm" - } + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "List of data source UIDs to search for", + "name": "datasourceUid", + "in": "query" + }, + { + "type": "string", + "description": "Text inside query or comments that is searched for", + "name": "searchString", + "in": "query" + }, + { + "type": "boolean", + "description": "Flag indicating if only starred queries should be returned", + "name": "onlyStarred", + "in": "query" + }, + { + "enum": [ + "time-desc", + "time-asc" + ], + "type": "string", + "default": "time-desc", + "description": "Sort method", + "name": "sort", + "in": "query" }, { "type": "integer", "format": "int64", - "name": "org_id", - "in": "path", - "required": true + "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Limit the number of returned results", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "From range for the query history search", + "name": "from", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "To range for the query history search", + "name": "to", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getQueryHistorySearchResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "delete": { - "security": [ - { - "basic": [] - } - ], + "post": { + "description": "Adds new query to query history.", "tags": [ - "orgs" + "query_history" ], - "summary": "Delete Organization.", - "operationId": "deleteOrgByID", + "summary": "Add query to query history.", + "operationId": "createQuery", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateQueryInQueryHistoryCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5027,45 +6749,33 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}/address": { - "put": { + "/query-history/migrate": { + "post": { + "description": "Adds multiple queries to query history.", "tags": [ - "orgs" + "query_history" ], - "summary": "Update Organization's address.", - "operationId": "updateOrgAddress", + "summary": "Migrate queries to query history.", + "operationId": "migrateQueries", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgAddressForm" + "$ref": "#/definitions/MigrateQueriesToQueryHistoryCommand" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryMigrationResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5073,213 +6783,146 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}/quotas": { - "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:read` and scope `org:id:1` (orgIDScope).", + "/query-history/star/{query_history_uid}": { + "post": { + "description": "Adds star to query in query history as specified by the UID.", "tags": [ - "orgs" + "query_history" ], - "summary": "Fetch Organization quota.", - "operationId": "getOrgQuota", + "summary": "Add star to query in query history.", + "operationId": "starQuery", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "name": "query_history_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs/{org_id}/quotas/{quota_target}": { - "put": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).", + }, + "delete": { + "description": "Removes star from query in query history as specified by the UID.", "tags": [ - "orgs" + "query_history" ], - "summary": "Update user quota.", - "operationId": "updateOrgQuota", + "summary": "Remove star to query in query history.", + "operationId": "unstarQuery", "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgQuotaCmd" - } - }, { "type": "string", - "name": "quota_target", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", + "name": "query_history_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}/users": { - "get": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", + "/query-history/{query_history_uid}": { + "delete": { + "description": "Deletes an existing query in query history as specified by the UID. This operation cannot be reverted.", "tags": [ - "orgs" + "query_history" ], - "summary": "Get Users in Organization.", - "operationId": "getOrgUsers", + "summary": "Delete query in query history.", + "operationId": "deleteQuery", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "name": "query_history_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getOrgUsersResponse" + "$ref": "#/responses/getQueryHistoryDeleteQueryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", + "patch": { + "description": "Updates comment for query in query history as specified by the UID.", "tags": [ - "orgs" + "query_history" ], - "summary": "Add a new user to the current organization.", - "operationId": "addOrgUser", + "summary": "Update comment for query in query history.", + "operationId": "patchQueryComment", "parameters": [ + { + "type": "string", + "name": "query_history_uid", + "in": "path", + "required": true + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddOrgUserCommand" + "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}/users/{user_id}": { - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + "/recording-rules": { + "get": { "tags": [ - "orgs" - ], - "summary": "Delete user in current organization.", - "operationId": "removeOrgUser", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } + "recording_rules", + "enterprise" ], + "summary": "Lists all rules in the database: active or deleted.", + "operationId": "listRecordingRules", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/listRecordingRulesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5287,48 +6930,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users.role:update` with scope `users:*`.", + "put": { "tags": [ - "orgs" + "recording_rules", + "enterprise" ], - "summary": "Update Users in Organization.", - "operationId": "updateOrgUser", + "summary": "Update the active status of a rule.", + "operationId": "updateRecordingRule", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgUserCommand" + "$ref": "#/definitions/RecordingRuleJSON" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/recordingRuleResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5336,61 +6965,71 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/playlists": { - "get": { + }, + "post": { "tags": [ - "playlists" + "recording_rules", + "enterprise" ], - "summary": "Get playlists.", - "operationId": "searchPlaylists", + "summary": "Create a recording rule that is then registered and started.", + "operationId": "createRecordingRule", "parameters": [ { - "type": "string", - "name": "query", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "in:limit", - "name": "limit", - "in": "query" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } } ], "responses": { "200": { - "$ref": "#/responses/searchPlaylistsResponse" + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/recording-rules/test": { "post": { "tags": [ - "playlists" + "recording_rules", + "enterprise" ], - "summary": "Create playlist.", - "operationId": "createPlaylist", + "summary": "Test a recording rule.", + "operationId": "testCreateRecordingRule", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreatePlaylistCommand" + "$ref": "#/definitions/RecordingRuleJSON" } } ], "responses": { "200": { - "$ref": "#/responses/createPlaylistResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5401,30 +7040,26 @@ "404": { "$ref": "#/responses/notFoundError" }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/playlists/{uid}": { + "/recording-rules/writer": { "get": { "tags": [ - "playlists" - ], - "summary": "Get playlist.", - "operationId": "getPlaylist", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - } + "recording_rules", + "enterprise" ], + "summary": "Return the prometheus remote write target.", + "operationId": "getRecordingRuleWriteTarget", "responses": { "200": { - "$ref": "#/responses/getPlaylistResponse" + "$ref": "#/responses/recordingRuleWriteTargetResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5440,31 +7075,55 @@ } } }, - "put": { + "post": { + "description": "It returns a 422 if there is not an existing prometheus data source configured.", "tags": [ - "playlists" + "recording_rules", + "enterprise" ], - "summary": "Update playlist.", - "operationId": "updatePlaylist", + "summary": "Create a remote write target.", + "operationId": "createRecordingRuleWriteTarget", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdatePlaylistCommand" + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" }, - { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "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/updatePlaylistResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5479,17 +7138,21 @@ "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/recording-rules/{recordingRuleID}": { "delete": { "tags": [ - "playlists" + "recording_rules", + "enterprise" ], - "summary": "Delete playlist.", - "operationId": "deletePlaylist", + "summary": "Delete removes the rule from the registry and stops it.", + "operationId": "deleteRecordingRule", "parameters": [ { - "type": "string", - "name": "uid", + "type": "integer", + "format": "int64", + "name": "recordingRuleID", "in": "path", "required": true } @@ -5513,24 +7176,54 @@ } } }, - "/playlists/{uid}/dashboards": { + "/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": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Get playlist dashboards.", - "operationId": "getPlaylistDashboards", + "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": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistDashboardsResponse" + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5547,24 +7240,31 @@ } } }, - "/playlists/{uid}/items": { - "get": { + "/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": [ - "playlists" + "reports", + "enterprise" ], - "summary": "Get playlist items.", - "operationId": "getPlaylistItems", + "summary": "Send a report.", + "operationId": "sendReport", "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportEmailDTO" + } } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistItemsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5581,109 +7281,171 @@ } } }, - "/query-history": { + "/reports/render/pdf/{dashboardID}": { "get": { - "description": "Returns a list of queries in the query history that matches the search criteria.\nQuery history search supports pagination. Use the `limit` parameter to control the maximum number of queries returned; the default limit is 100.\nYou can also use the `page` query parameter to fetch queries from any page other than the first one.", + "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", + "produces": [ + "application/pdf" + ], "tags": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Query history search.", - "operationId": "searchQueries", + "summary": "Render report for dashboard.", + "operationId": "renderReportPDF", + "deprecated": true, "parameters": [ { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "List of data source UIDs to search for", - "name": "datasourceUid", + "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", - "description": "Text inside query or comments that is searched for", - "name": "searchString", + "name": "variables", "in": "query" }, { - "type": "boolean", - "description": "Flag indicating if only starred queries should be returned", - "name": "onlyStarred", + "type": "string", + "name": "from", "in": "query" }, { - "enum": [ - "time-desc", - "time-asc" - ], "type": "string", - "default": "time-desc", - "description": "Sort method", - "name": "sort", + "name": "to", "in": "query" }, { - "type": "integer", - "format": "int64", - "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", - "name": "page", + "type": "string", + "name": "orientation", "in": "query" }, { - "type": "integer", - "format": "int64", - "description": "Limit the number of returned results", - "name": "limit", + "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": "integer", - "format": "int64", - "description": "From range for the query history search", - "name": "from", + "type": "string", + "name": "dashboardID", "in": "query" }, { - "type": "integer", - "format": "int64", - "description": "To range for the query history search", - "name": "to", + "type": "string", + "name": "orientation", + "in": "query" + }, + { + "type": "string", + "name": "layout", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistorySearchResponse" + "$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": "Adds new query to query history.", + "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": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Add query to query history.", - "operationId": "createQuery", + "summary": "Save settings.", + "operationId": "saveReportSettings", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateQueryInQueryHistoryCommand" + "$ref": "#/definitions/SettingsDTO" } } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5691,33 +7453,37 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/query-history/migrate": { + "/reports/test-email": { "post": { - "description": "Adds multiple queries to query history.", + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", "tags": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Migrate queries to query history.", - "operationId": "migrateQueries", + "summary": "Send test report via email.", + "operationId": "sendTestEmail", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/MigrateQueriesToQueryHistoryCommand" + "$ref": "#/definitions/CreateOrUpdateConfigCmd" } } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryMigrationResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5725,128 +7491,241 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/query-history/star/{query_history_uid}": { - "post": { - "description": "Adds star to query in query history as specified by the UID.", + "/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": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Add star to query in query history.", - "operationId": "starQuery", + "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": [ { - "type": "string", - "name": "query_history_uid", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + }, + { + "type": "integer", + "format": "int64", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$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": "Removes star from query in query history as specified by the UID.", + "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": [ - "query_history" + "reports", + "enterprise" ], - "summary": "Remove star to query in query history.", - "operationId": "unstarQuery", + "summary": "Delete a report.", + "operationId": "deleteReport", "parameters": [ { - "type": "string", - "name": "query_history_uid", + "type": "integer", + "format": "int64", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/query-history/{query_history_uid}": { - "delete": { - "description": "Deletes an existing query in query history as specified by the UID. This operation cannot be reverted.", + "/saml/acs": { + "post": { "tags": [ - "query_history" + "saml", + "enterprise" ], - "summary": "Delete query in query history.", - "operationId": "deleteQuery", + "summary": "It performs assertion Consumer Service (ACS).", + "operationId": "postACS", "parameters": [ { "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true + "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/getQueryHistoryDeleteQueryResponse" + "$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": "" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "description": "Updates comment for query in query history as specified by the UID.", + "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": [ - "query_history" + "saml", + "enterprise" ], - "summary": "Update comment for query in query history.", - "operationId": "patchQueryComment", + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", "parameters": [ { "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true + "name": "SAMLRequest", + "in": "query" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" - } + "type": "string", + "name": "SAMLResponse", + "in": "query" } ], "responses": { - "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "302": { + "description": "" }, "400": { "$ref": "#/responses/badRequestError" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -6563,6 +8442,135 @@ } } }, + "/teams/{teamId}/groups": { + "get": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Get External Groups.", + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Add External Group.", + "operationId": "addTeamGroupApi", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamGroupMapping" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{teamId}/groups/{groupId}": { + "delete": { + "tags": [ + "sync_team_groups", + "enterprise" + ], + "summary": "Remove External Group.", + "operationId": "removeTeamGroupApi", + "parameters": [ + { + "type": "string", + "name": "groupId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, "/teams/{team_id}": { "get": { "tags": [ @@ -7633,9 +9641,66 @@ } } } - } - }, - "definitions": { + } + }, + "definitions": { + "ActiveSyncStatusDTO": { + "description": "ActiveSyncStatusDTO holds the information for LDAP background Sync", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "nextSync": { + "type": "string", + "format": "date-time" + }, + "prevSync": { + "$ref": "#/definitions/SyncResult" + }, + "schedule": { + "type": "string" + } + } + }, + "ActiveUserStats": { + "type": "object", + "properties": { + "active_admins_and_editors": { + "type": "integer", + "format": "int64" + }, + "active_users": { + "type": "integer", + "format": "int64" + }, + "active_viewers": { + "type": "integer", + "format": "int64" + } + } + }, + "AddBuiltInRoleCommand": { + "type": "object", + "properties": { + "builtInRole": { + "type": "string", + "enum": [ + "Viewer", + " Editor", + " Admin", + " Grafana Admin" + ] + }, + "global": { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to create organization local assignment. Refer to the Built-in role assignments for more information.", + "type": "boolean" + }, + "roleUid": { + "type": "string" + } + } + }, "AddCommand": { "type": "object", "properties": { @@ -7742,6 +9807,25 @@ } } }, + "AddPermissionDTO": { + "type": "object", + "properties": { + "builtinRole": { + "type": "string" + }, + "permission": { + "$ref": "#/definitions/DsPermissionType" + }, + "teamId": { + "type": "integer", + "format": "int64" + }, + "userId": { + "type": "integer", + "format": "int64" + } + } + }, "AddServiceAccountTokenCommand": { "type": "object", "properties": { @@ -8166,6 +10250,26 @@ } } }, + "BrandingOptionsDTO": { + "type": "object", + "properties": { + "emailFooterLink": { + "type": "string" + }, + "emailFooterMode": { + "type": "string" + }, + "emailFooterText": { + "type": "string" + }, + "emailLogoUrl": { + "type": "string" + }, + "reportLogoUrl": { + "type": "string" + } + } + }, "CalculateDiffTarget": { "type": "object", "properties": { @@ -9081,6 +11185,18 @@ } } }, + "FailedUser": { + "description": "FailedUser holds the information of an user that failed", + "type": "object", + "properties": { + "Error": { + "type": "string" + }, + "Login": { + "type": "string" + } + } + }, "Field": { "description": "A Field is essentially a slice of various types with extra properties and methods.\nSee NewField() for supported types.\n\nThe slice data in the Field is a not exported, so methods on the Field are used to to manipulate its data.", "type": "object", @@ -10695,6 +12811,86 @@ } } }, + "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", @@ -10721,6 +12917,79 @@ } } }, + "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": { @@ -10937,6 +13206,49 @@ } } }, + "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": { @@ -12250,6 +14562,30 @@ } } }, + "getCurrentOrgResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Correlation" + } + }, + "getCorrelationsBySourceUIDResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Correlation" + } + } + }, + "getCorrelationsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Correlation" + } + } + }, "getCurrentOrgResponse": { "description": "", "schema": { @@ -12465,6 +14801,39 @@ } } }, + "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": { @@ -12795,6 +15164,12 @@ "$ref": "#/definitions/SearchUserQueryResult" } }, + "setRoleAssignmentsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RoleAssignmentsDTO" + } + }, "testAlertResponse": { "description": "", "schema": { diff --git a/public/app/percona/backup/components/StorageLocations/StorageLocationDetails/StorageLocationDetails.tsx b/public/app/percona/backup/components/StorageLocations/StorageLocationDetails/StorageLocationDetails.tsx index c09d445b06dd..4b2fa795c710 100644 --- a/public/app/percona/backup/components/StorageLocations/StorageLocationDetails/StorageLocationDetails.tsx +++ b/public/app/percona/backup/components/StorageLocations/StorageLocationDetails/StorageLocationDetails.tsx @@ -20,6 +20,7 @@ export const StorageLocationDetails: FC = ({ locati {isS3Location(location) ? ( <> + {/* eslint-disable-next-line jsx-a11y/no-access-key */} ) : null} diff --git a/scripts/drone/events/main.star b/scripts/drone/events/main.star index 1d43da3f8c6f..f3228431503c 100644 --- a/scripts/drone/events/main.star +++ b/scripts/drone/events/main.star @@ -32,7 +32,6 @@ load( load( "scripts/drone/pipelines/windows.star", "windows", - "windows_test_backend", ) load( "scripts/drone/pipelines/trigger_downstream.star", @@ -90,8 +89,6 @@ def main_pipelines(): build_e2e(trigger, ver_mode), integration_tests(trigger, prefix = ver_mode, ver_mode = ver_mode), windows(trigger, edition = "oss", ver_mode = ver_mode), - windows_test_backend(trigger, "oss", ver_mode), - windows_test_backend(trigger, "enterprise", ver_mode), notify_pipeline( name = "notify-drone-changes", slack_channel = "slack-webhooks-test", diff --git a/scripts/drone/events/pr.star b/scripts/drone/events/pr.star index 9e1ba26a046a..14605cd79099 100644 --- a/scripts/drone/events/pr.star +++ b/scripts/drone/events/pr.star @@ -15,10 +15,6 @@ load( "scripts/drone/pipelines/integration_tests.star", "integration_tests", ) -load( - "scripts/drone/pipelines/windows.star", - "windows_test_backend", -) load( "scripts/drone/pipelines/build.star", "build_e2e", @@ -104,18 +100,12 @@ def pr_pipelines(): ), ver_mode, ), - windows_test_backend( - get_pr_trigger( - exclude_paths = ["pkg/**", "packaging/**", "go.sum", "go.mod"], - ), - "oss", - ver_mode, - ), lint_backend_pipeline( get_pr_trigger( include_paths = [ "pkg/**", "packaging/**", + ".drone.yml", "conf/**", "go.sum", "go.mod", diff --git a/scripts/drone/events/release.star b/scripts/drone/events/release.star index 61a242475c21..8dcbcb4f95c3 100644 --- a/scripts/drone/events/release.star +++ b/scripts/drone/events/release.star @@ -60,10 +60,6 @@ load( "test_backend", "test_backend_enterprise", ) -load( - "scripts/drone/pipelines/windows.star", - "windows_test_backend", -) load("scripts/drone/vault.star", "from_secret", "prerelease_bucket") ver_mode = "release" @@ -214,20 +210,10 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger): integration_test_steps = [] volumes = [] - windows_pipeline = pipeline( - name = "{}-oss-windows".format(ver_mode), - edition = "oss", - trigger = trigger, - steps = get_windows_steps(edition = "oss", ver_mode = ver_mode), - platform = "windows", - depends_on = [ - "{}-oss-build-e2e-publish".format(ver_mode), - "{}-oss-test-frontend".format(ver_mode), - "{}-oss-test-backend-windows".format(ver_mode), - ], - environment = environment, - ) - + windows_pipeline_dependencies = [ + "{}-oss-build-e2e-publish".format(ver_mode), + "{}-oss-test-frontend".format(ver_mode), + ] pipelines = [ pipeline( name = "{}-oss-build-e2e-publish".format(ver_mode), @@ -240,8 +226,6 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger): ), test_frontend(trigger, ver_mode), test_backend(trigger, ver_mode), - windows_test_backend(trigger, "oss", ver_mode), - windows_test_backend(trigger, "enterprise", ver_mode), ] if ver_mode not in ("release"): @@ -261,6 +245,16 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger): volumes = volumes, )) + windows_pipeline = pipeline( + name = "{}-oss-windows".format(ver_mode), + edition = "oss", + trigger = trigger, + steps = get_windows_steps(edition = "oss", ver_mode = ver_mode), + platform = "windows", + depends_on = windows_pipeline_dependencies, + environment = environment, + ) + pipelines.append(windows_pipeline) return pipelines diff --git a/scripts/drone/pipelines/build.star b/scripts/drone/pipelines/build.star index 8b37a176a2e9..ef4c85d7918a 100644 --- a/scripts/drone/pipelines/build.star +++ b/scripts/drone/pipelines/build.star @@ -143,6 +143,20 @@ def build_e2e(trigger, ver_mode): ], edition = edition, ), + build_docker_images_step( + archs = [ + "amd64", + ], + edition = edition, + ubuntu = True, + ), + publish_images_step( + docker_repo = "grafana", + edition = edition, + mode = "", + trigger = trigger_oss, + ver_mode = ver_mode, + ), ], ) diff --git a/scripts/drone/pipelines/test_backend.star b/scripts/drone/pipelines/test_backend.star index b75277139cfc..a3abb40e6675 100644 --- a/scripts/drone/pipelines/test_backend.star +++ b/scripts/drone/pipelines/test_backend.star @@ -58,9 +58,6 @@ def test_backend(trigger, ver_mode): if ver_mode in ("release-branch", "release"): pipeline_name = "{}-{}-test-backend".format(ver_mode, "oss") - pipeline_name = '{}-test-backend'.format(ver_mode) - if ver_mode in ("release-branch", "release"): - pipeline_name = '{}-{}-test-backend'.format(ver_mode, edition) return pipeline( name = pipeline_name, edition = "oss", diff --git a/scripts/drone/pipelines/windows.star b/scripts/drone/pipelines/windows.star index 3669cfb9986e..f00b0a16fd1b 100644 --- a/scripts/drone/pipelines/windows.star +++ b/scripts/drone/pipelines/windows.star @@ -9,6 +9,7 @@ load( load( "scripts/drone/steps/lib.star", "get_windows_steps", + "windows_clone_step", "windows_go_image", "windows_init_enterprise_steps", "windows_test_backend_step", @@ -26,7 +27,9 @@ def windows_test_backend(trigger, edition, ver_mode): A single pipeline running backend tests for Windows """ environment = {"EDITION": edition} - steps = [] + steps = [ + windows_clone_step(), + ] if edition == "enterprise": steps.extend(windows_init_enterprise_steps(ver_mode)) @@ -34,6 +37,7 @@ def windows_test_backend(trigger, edition, ver_mode): steps.extend([{ "name": "windows-init", "image": windows_go_image, + "depends_on": ["clone"], "commands": [], }]) @@ -41,7 +45,7 @@ def windows_test_backend(trigger, edition, ver_mode): windows_wire_install_step(edition), windows_test_backend_step(), ]) - return pipeline( + pl = pipeline( name = "{}-{}-test-backend-windows".format(ver_mode, edition), edition = edition, trigger = trigger, @@ -50,6 +54,10 @@ def windows_test_backend(trigger, edition, ver_mode): platform = "windows", environment = environment, ) + pl["clone"] = { + "disable": True, + } + return pl def windows(trigger, edition, ver_mode): """Generates the pipeline used for building Grafana on Windows. diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index ee484a6b6990..185d9bad894e 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -8,7 +8,7 @@ load( "prerelease_bucket", ) -grabpl_version = "v3.0.30" +grabpl_version = "v3.0.37" build_image = "grafana/build-container:1.7.4" publish_image = "grafana/grafana-ci-deploy:1.3.3" deploy_docker_image = "us.gcr.io/kubernetes-dev/drone/plugins/deploy-image" @@ -686,7 +686,6 @@ def test_backend_step(image = build_image): def windows_test_backend_step(): step = test_backend_step(image = windows_go_image) - step["failure"] = "ignore" return step def test_backend_integration_step(): @@ -1125,6 +1124,9 @@ def publish_images_step(edition, ver_mode, mode, docker_repo, trigger = None): "GCP_KEY": from_secret("gcp_key"), "DOCKER_USER": from_secret("docker_username"), "DOCKER_PASSWORD": from_secret("docker_password"), + "GITHUB_APP_ID": from_secret("delivery-bot-app-id"), + "GITHUB_APP_INSTALLATION_ID": from_secret("delivery-bot-app-installation-id"), + "GITHUB_APP_PRIVATE_KEY": from_secret("delivery-bot-app-private-key"), } cmd = "./bin/grabpl artifacts docker publish {}--dockerhub-repo {}".format( @@ -1150,6 +1152,15 @@ def publish_images_step(edition, ver_mode, mode, docker_repo, trigger = None): docker_repo, ) + if ver_mode == "pr": + environment = { + "DOCKER_USER": from_secret("docker_username_pr"), + "DOCKER_PASSWORD": from_secret("docker_password_pr"), + "GITHUB_APP_ID": from_secret("delivery-bot-app-id"), + "GITHUB_APP_INSTALLATION_ID": from_secret("delivery-bot-app-installation-id"), + "GITHUB_APP_PRIVATE_KEY": from_secret("delivery-bot-app-private-key"), + } + step = { "name": "publish-images-{}".format(name), "image": "google/cloud-sdk", @@ -1160,6 +1171,8 @@ def publish_images_step(edition, ver_mode, mode, docker_repo, trigger = None): } if trigger and ver_mode in ("release-branch", "main"): step = dict(step, when = trigger) + if ver_mode == "pr": + step = dict(step, failure = "ignore") return step @@ -1361,6 +1374,19 @@ def publish_linux_packages_step(edition, package_manager = "deb"): }, } +def windows_clone_step(): + return { + "name": "clone", + "image": wix_image, + "environment": { + "GITHUB_TOKEN": from_secret("github_token"), + }, + "commands": [ + 'git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" .', + "git checkout -f $$env:DRONE_COMMIT", + ], + } + def get_windows_steps(edition, ver_mode): """Generate the list of Windows steps. diff --git a/scripts/drone/vault.star b/scripts/drone/vault.star index e6aa40db100d..d1a08bf7e414 100644 --- a/scripts/drone/vault.star +++ b/scripts/drone/vault.star @@ -120,4 +120,20 @@ def secrets(): "infra/data/ci/grafana-release-eng/enterprise2", "security_prefix", ), + # grafana-delivery-bot secrets + vault_secret( + "delivery-bot-app-id", + "infra/data/ci/grafana-release-eng/grafana-delivery-bot", + "app-id", + ), + vault_secret( + "delivery-bot-app-installation-id", + "infra/data/ci/grafana-release-eng/grafana-delivery-bot", + "app-installation-id", + ), + vault_secret( + "delivery-bot-app-private-key", + "infra/data/ci/grafana-release-eng/grafana-delivery-bot", + "app-private-key", + ), ] diff --git a/yarn.lock b/yarn.lock index 5bb657224f1a..938f1b3e841c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5334,9 +5334,9 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/input-datasource@workspace:plugins-bundled/internal/input-datasource" dependencies: - "@grafana/data": 9.2.18 - "@grafana/toolkit": 9.2.18 - "@grafana/ui": 9.2.18 + "@grafana/data": 9.2.20 + "@grafana/toolkit": 9.2.20 + "@grafana/ui": 9.2.20 "@types/jest": 26.0.15 "@types/lodash": 4.14.149 "@types/react": 17.0.30 @@ -5380,12 +5380,12 @@ __metadata: languageName: node linkType: hard -"@grafana/data@9.2.18, @grafana/data@workspace:*, @grafana/data@workspace:packages/grafana-data": +"@grafana/data@9.2.20, @grafana/data@workspace:*, @grafana/data@workspace:packages/grafana-data": version: 0.0.0-use.local resolution: "@grafana/data@workspace:packages/grafana-data" dependencies: "@braintree/sanitize-url": 6.0.0 - "@grafana/schema": 9.2.18 + "@grafana/schema": 9.2.20 "@grafana/tsconfig": ^1.2.0-rc1 "@rollup/plugin-commonjs": 22.0.1 "@rollup/plugin-json": 4.1.0 @@ -5444,7 +5444,7 @@ __metadata: languageName: unknown linkType: soft -"@grafana/e2e-selectors@9.2.18, @grafana/e2e-selectors@workspace:*, @grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors": +"@grafana/e2e-selectors@9.2.20, @grafana/e2e-selectors@workspace:*, @grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors": version: 0.0.0-use.local resolution: "@grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors" dependencies: @@ -5470,7 +5470,7 @@ __metadata: "@babel/core": 7.19.0 "@babel/preset-env": 7.19.0 "@cypress/webpack-preprocessor": 5.12.0 - "@grafana/e2e-selectors": 9.2.18 + "@grafana/e2e-selectors": 9.2.20 "@grafana/tsconfig": ^1.2.0-rc1 "@mochajs/json-file-reporter": ^1.2.0 "@rollup/plugin-node-resolve": 13.3.0 @@ -5557,15 +5557,15 @@ __metadata: languageName: node linkType: hard -"@grafana/runtime@9.2.18, @grafana/runtime@workspace:*, @grafana/runtime@workspace:packages/grafana-runtime": +"@grafana/runtime@9.2.20, @grafana/runtime@workspace:*, @grafana/runtime@workspace:packages/grafana-runtime": version: 0.0.0-use.local resolution: "@grafana/runtime@workspace:packages/grafana-runtime" dependencies: "@grafana/agent-web": ^0.4.0 - "@grafana/data": 9.2.18 - "@grafana/e2e-selectors": 9.2.18 + "@grafana/data": 9.2.20 + "@grafana/e2e-selectors": 9.2.20 "@grafana/tsconfig": ^1.2.0-rc1 - "@grafana/ui": 9.2.18 + "@grafana/ui": 9.2.20 "@rollup/plugin-commonjs": 22.0.1 "@rollup/plugin-node-resolve": 13.3.0 "@sentry/browser": 6.19.7 @@ -5601,7 +5601,7 @@ __metadata: languageName: unknown linkType: soft -"@grafana/schema@9.2.18, @grafana/schema@workspace:*, @grafana/schema@workspace:packages/grafana-schema": +"@grafana/schema@9.2.20, @grafana/schema@workspace:*, @grafana/schema@workspace:packages/grafana-schema": version: 0.0.0-use.local resolution: "@grafana/schema@workspace:packages/grafana-schema" dependencies: @@ -5621,7 +5621,7 @@ __metadata: languageName: unknown linkType: soft -"@grafana/toolkit@9.2.18, @grafana/toolkit@workspace:*, @grafana/toolkit@workspace:packages/grafana-toolkit": +"@grafana/toolkit@9.2.20, @grafana/toolkit@workspace:*, @grafana/toolkit@workspace:packages/grafana-toolkit": version: 0.0.0-use.local resolution: "@grafana/toolkit@workspace:packages/grafana-toolkit" dependencies: @@ -5637,10 +5637,10 @@ __metadata: "@babel/preset-env": 7.18.9 "@babel/preset-react": 7.18.6 "@babel/preset-typescript": 7.18.6 - "@grafana/data": 9.2.18 + "@grafana/data": 9.2.20 "@grafana/eslint-config": 5.0.0 "@grafana/tsconfig": ^1.2.0-rc1 - "@grafana/ui": 9.2.18 + "@grafana/ui": 9.2.20 "@jest/core": 27.5.1 "@types/command-exists": ^1.2.0 "@types/eslint": 8.4.1 @@ -5721,16 +5721,16 @@ __metadata: languageName: node linkType: hard -"@grafana/ui@9.2.18, @grafana/ui@workspace:*, @grafana/ui@workspace:packages/grafana-ui": +"@grafana/ui@9.2.20, @grafana/ui@workspace:*, @grafana/ui@workspace:packages/grafana-ui": version: 0.0.0-use.local resolution: "@grafana/ui@workspace:packages/grafana-ui" dependencies: "@babel/core": 7.19.0 "@emotion/css": 11.9.0 "@emotion/react": 11.9.3 - "@grafana/data": 9.2.18 - "@grafana/e2e-selectors": 9.2.18 - "@grafana/schema": 9.2.18 + "@grafana/data": 9.2.20 + "@grafana/e2e-selectors": 9.2.20 + "@grafana/schema": 9.2.20 "@grafana/tsconfig": ^1.2.0-rc1 "@mdx-js/react": 1.6.22 "@monaco-editor/react": 4.4.5 @@ -6013,11 +6013,11 @@ __metadata: resolution: "@jaegertracing/jaeger-ui-components@workspace:packages/jaeger-ui-components" dependencies: "@emotion/css": 11.9.0 - "@grafana/data": 9.2.18 - "@grafana/e2e-selectors": 9.2.18 - "@grafana/runtime": 9.2.18 + "@grafana/data": 9.2.20 + "@grafana/e2e-selectors": 9.2.20 + "@grafana/runtime": 9.2.20 "@grafana/tsconfig": ^1.2.0-rc1 - "@grafana/ui": 9.2.18 + "@grafana/ui": 9.2.20 "@testing-library/jest-dom": 5.16.4 "@testing-library/react": 12.1.4 "@testing-library/user-event": 14.4.3 @@ -9218,7 +9218,7 @@ __metadata: linkType: hard "@reactour/tour@npm:^3.0.0": - version: 3.0.0 + version: 3.4.0 resolution: "@reactour/tour@npm:3.4.0" dependencies: "@reactour/mask": "*" @@ -33776,14 +33776,14 @@ __metadata: linkType: hard "schema-utils@npm:>1.0.0": - version: 4.0.1 - resolution: "schema-utils@npm:4.0.1" + version: 4.2.0 + resolution: "schema-utils@npm:4.2.0" dependencies: "@types/json-schema": ^7.0.9 ajv: ^8.9.0 ajv-formats: ^2.1.1 ajv-keywords: ^5.1.0 - checksum: 745e7293c6b6c84940de16753c207311da821aa9911b9e2d158cfd9ffc5bf1f880147abbbe775b96cb8cd3c7f48890950fe0164f54eed9a8aabb948ebf8a3fdd + checksum: 26a0463d47683258106e6652e9aeb0823bf0b85843039e068b57da1892f7ae6b6b1094d48e9ed5ba5cbe9f7166469d880858b9d91abe8bd249421eb813850cde languageName: node linkType: hard