diff --git a/pkg/services/ngalert/api/authorization_test.go b/pkg/services/ngalert/api/authorization_test.go index 8b63894eba4..c1f9c43b748 100644 --- a/pkg/services/ngalert/api/authorization_test.go +++ b/pkg/services/ngalert/api/authorization_test.go @@ -47,6 +47,7 @@ func TestAuthorize(t *testing.T) { t.Run("should not panic on known routes", func(t *testing.T) { for path, methods := range paths { + path := swaggerSpec.Spec().BasePath + path for _, method := range methods { require.NotPanics(t, func() { api.authorize(method, path) diff --git a/pkg/services/ngalert/api/tooling/README.md b/pkg/services/ngalert/api/tooling/README.md index bee2a4dcb4f..b6bd9cb0f53 100644 --- a/pkg/services/ngalert/api/tooling/README.md +++ b/pkg/services/ngalert/api/tooling/README.md @@ -24,5 +24,5 @@ We have some endpoints that we document publically as being stable, and others t To stabilize an endpoint, add the `stable` tag to its route comment: ``` -// swagger:route GET /api/provisioning/contact-points provisioning stable RouteGetContactpoints +// swagger:route GET /provisioning/contact-points provisioning stable RouteGetContactpoints ``` diff --git a/pkg/services/ngalert/api/tooling/api.json b/pkg/services/ngalert/api/tooling/api.json index 908ae51925a..cf77940b62e 100644 --- a/pkg/services/ngalert/api/tooling/api.json +++ b/pkg/services/ngalert/api/tooling/api.json @@ -1,5 +1,5 @@ { - "basePath": "/api/v1", + "basePath": "/api", "consumes": [ "application/json" ], @@ -4414,7 +4414,6 @@ "type": "object" }, "alertGroup": { - "description": "AlertGroup alert group", "properties": { "alerts": { "description": "alerts", @@ -4438,6 +4437,7 @@ "type": "object" }, "alertGroups": { + "description": "AlertGroups alert groups", "items": { "$ref": "#/definitions/alertGroup" }, @@ -4542,6 +4542,7 @@ "type": "object" }, "gettableAlert": { + "description": "GettableAlert gettable alert", "properties": { "annotations": { "$ref": "#/definitions/labelSet" @@ -4597,7 +4598,6 @@ "type": "object" }, "gettableAlerts": { - "description": "GettableAlerts gettable alerts", "items": { "$ref": "#/definitions/gettableAlert" }, @@ -4652,13 +4652,13 @@ "type": "object" }, "gettableSilences": { - "description": "GettableSilences gettable silences", "items": { "$ref": "#/definitions/gettableSilence" }, "type": "array" }, "integration": { + "description": "Integration integration", "properties": { "lastNotifyAttempt": { "description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time", @@ -4840,6 +4840,7 @@ "type": "object" }, "receiver": { + "description": "Receiver receiver", "properties": { "active": { "description": "active", @@ -4959,7 +4960,7 @@ "version": "1.1.0" }, "paths": { - "/api/v1/provisioning/alert-rules": { + "/v1/provisioning/alert-rules": { "get": { "operationId": "RouteGetAlertRules", "responses": { @@ -5014,7 +5015,7 @@ ] } }, - "/api/v1/provisioning/alert-rules/export": { + "/v1/provisioning/alert-rules/export": { "get": { "operationId": "RouteGetAlertRulesExport", "parameters": [ @@ -5071,7 +5072,7 @@ ] } }, - "/api/v1/provisioning/alert-rules/{UID}": { + "/v1/provisioning/alert-rules/{UID}": { "delete": { "operationId": "RouteDeleteAlertRule", "parameters": [ @@ -5171,7 +5172,7 @@ ] } }, - "/api/v1/provisioning/alert-rules/{UID}/export": { + "/v1/provisioning/alert-rules/{UID}/export": { "get": { "operationId": "RouteGetAlertRuleExport", "parameters": [ @@ -5219,7 +5220,7 @@ ] } }, - "/api/v1/provisioning/contact-points": { + "/v1/provisioning/contact-points": { "get": { "operationId": "RouteGetContactpoints", "parameters": [ @@ -5282,7 +5283,7 @@ ] } }, - "/api/v1/provisioning/contact-points/export": { + "/v1/provisioning/contact-points/export": { "get": { "operationId": "RouteGetContactpointsExport", "parameters": [ @@ -5334,7 +5335,7 @@ ] } }, - "/api/v1/provisioning/contact-points/{UID}": { + "/v1/provisioning/contact-points/{UID}": { "delete": { "consumes": [ "application/json" @@ -5405,7 +5406,7 @@ ] } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { "get": { "operationId": "RouteGetAlertRuleGroup", "parameters": [ @@ -5489,7 +5490,7 @@ ] } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { "get": { "operationId": "RouteGetAlertRuleGroupExport", "parameters": [ @@ -5542,7 +5543,7 @@ ] } }, - "/api/v1/provisioning/mute-timings": { + "/v1/provisioning/mute-timings": { "get": { "operationId": "RouteGetMuteTimings", "responses": { @@ -5597,7 +5598,7 @@ ] } }, - "/api/v1/provisioning/mute-timings/export": { + "/v1/provisioning/mute-timings/export": { "get": { "operationId": "RouteExportMuteTimings", "parameters": [ @@ -5636,7 +5637,7 @@ ] } }, - "/api/v1/provisioning/mute-timings/{name}": { + "/v1/provisioning/mute-timings/{name}": { "delete": { "operationId": "RouteDeleteMuteTiming", "parameters": [ @@ -5737,7 +5738,7 @@ ] } }, - "/api/v1/provisioning/mute-timings/{name}/export": { + "/v1/provisioning/mute-timings/{name}/export": { "get": { "operationId": "RouteExportMuteTiming", "parameters": [ @@ -5783,7 +5784,7 @@ ] } }, - "/api/v1/provisioning/policies": { + "/v1/provisioning/policies": { "delete": { "consumes": [ "application/json" @@ -5857,7 +5858,7 @@ ] } }, - "/api/v1/provisioning/policies/export": { + "/v1/provisioning/policies/export": { "get": { "operationId": "RouteGetPolicyTreeExport", "responses": { @@ -5880,7 +5881,7 @@ ] } }, - "/api/v1/provisioning/templates": { + "/v1/provisioning/templates": { "get": { "operationId": "RouteGetTemplates", "responses": { @@ -5900,7 +5901,7 @@ ] } }, - "/api/v1/provisioning/templates/{name}": { + "/v1/provisioning/templates/{name}": { "delete": { "operationId": "RouteDeleteTemplate", "parameters": [ diff --git a/pkg/services/ngalert/api/tooling/definitions/admin.go b/pkg/services/ngalert/api/tooling/definitions/admin.go index 25488d1fb6e..3c7e3ef3944 100644 --- a/pkg/services/ngalert/api/tooling/definitions/admin.go +++ b/pkg/services/ngalert/api/tooling/definitions/admin.go @@ -4,7 +4,7 @@ import ( v1 "github.com/prometheus/client_golang/api/prometheus/v1" ) -// swagger:route GET /api/v1/ngalert configuration RouteGetStatus +// swagger:route GET /v1/ngalert configuration RouteGetStatus // // Get the status of the alerting engine // @@ -14,7 +14,7 @@ import ( // Responses: // 200: AlertingStatus -// swagger:route GET /api/v1/ngalert/alertmanagers configuration RouteGetAlertmanagers +// swagger:route GET /v1/ngalert/alertmanagers configuration RouteGetAlertmanagers // // Get the discovered and dropped Alertmanagers of the user's organization based on the specified configuration. // @@ -24,7 +24,7 @@ import ( // Responses: // 200: GettableAlertmanagers -// swagger:route GET /api/v1/ngalert/admin_config configuration RouteGetNGalertConfig +// swagger:route GET /v1/ngalert/admin_config configuration RouteGetNGalertConfig // // Get the NGalert configuration of the user's organization, returns 404 if no configuration is present. // @@ -36,7 +36,7 @@ import ( // 404: Failure // 500: Failure -// swagger:route POST /api/v1/ngalert/admin_config configuration RoutePostNGalertConfig +// swagger:route POST /v1/ngalert/admin_config configuration RoutePostNGalertConfig // // Creates or updates the NGalert configuration of the user's organization. If no value is sent for alertmanagersChoice, it defaults to "all". // @@ -47,7 +47,7 @@ import ( // 201: Ack // 400: ValidationError -// swagger:route DELETE /api/v1/ngalert/admin_config configuration RouteDeleteNGalertConfig +// swagger:route DELETE /v1/ngalert/admin_config configuration RouteDeleteNGalertConfig // // Deletes the NGalert configuration of the user's organization. // diff --git a/pkg/services/ngalert/api/tooling/definitions/alertmanager.go b/pkg/services/ngalert/api/tooling/definitions/alertmanager.go index 9e3d3a28c14..a6fe8912455 100644 --- a/pkg/services/ngalert/api/tooling/definitions/alertmanager.go +++ b/pkg/services/ngalert/api/tooling/definitions/alertmanager.go @@ -17,7 +17,7 @@ import ( "gopkg.in/yaml.v3" ) -// swagger:route POST /api/alertmanager/grafana/config/api/v1/alerts alertmanager RoutePostGrafanaAlertingConfig +// swagger:route POST /alertmanager/grafana/config/api/v1/alerts alertmanager RoutePostGrafanaAlertingConfig // // sets an Alerting config // @@ -25,7 +25,7 @@ import ( // 201: Ack // 400: ValidationError -// swagger:route POST /api/alertmanager/{DatasourceUID}/config/api/v1/alerts alertmanager RoutePostAlertingConfig +// swagger:route POST /alertmanager/{DatasourceUID}/config/api/v1/alerts alertmanager RoutePostAlertingConfig // // sets an Alerting config // @@ -34,7 +34,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route GET /api/alertmanager/grafana/config/api/v1/alerts alertmanager RouteGetGrafanaAlertingConfig +// swagger:route GET /alertmanager/grafana/config/api/v1/alerts alertmanager RouteGetGrafanaAlertingConfig // // gets an Alerting config // @@ -42,7 +42,7 @@ import ( // 200: GettableUserConfig // 400: ValidationError -// swagger:route GET /api/alertmanager/{DatasourceUID}/config/api/v1/alerts alertmanager RouteGetAlertingConfig +// swagger:route GET /alertmanager/{DatasourceUID}/config/api/v1/alerts alertmanager RouteGetAlertingConfig // // gets an Alerting config // @@ -51,14 +51,14 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route GET /api/alertmanager/grafana/config/history alertmanager RouteGetGrafanaAlertingConfigHistory +// swagger:route GET /alertmanager/grafana/config/history alertmanager RouteGetGrafanaAlertingConfigHistory // // gets Alerting configurations that were successfully applied in the past // // Responses: // 200: GettableHistoricUserConfigs -// swagger:route POST /api/alertmanager/grafana/config/history/{id}/_activate alertmanager RoutePostGrafanaAlertingConfigHistoryActivate +// swagger:route POST /alertmanager/grafana/config/history/{id}/_activate alertmanager RoutePostGrafanaAlertingConfigHistoryActivate // // revert Alerting configuration to the historical configuration specified by the given id // @@ -67,7 +67,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route DELETE /api/alertmanager/grafana/config/api/v1/alerts alertmanager RouteDeleteGrafanaAlertingConfig +// swagger:route DELETE /alertmanager/grafana/config/api/v1/alerts alertmanager RouteDeleteGrafanaAlertingConfig // // deletes the Alerting config for a tenant // @@ -75,7 +75,7 @@ import ( // 200: Ack // 400: ValidationError -// swagger:route DELETE /api/alertmanager/{DatasourceUID}/config/api/v1/alerts alertmanager RouteDeleteAlertingConfig +// swagger:route DELETE /alertmanager/{DatasourceUID}/config/api/v1/alerts alertmanager RouteDeleteAlertingConfig // // deletes the Alerting config for a tenant // @@ -84,7 +84,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route GET /api/alertmanager/grafana/api/v2/status alertmanager RouteGetGrafanaAMStatus +// swagger:route GET /alertmanager/grafana/api/v2/status alertmanager RouteGetGrafanaAMStatus // // get alertmanager status and configuration // @@ -92,7 +92,7 @@ import ( // 200: GettableStatus // 400: ValidationError -// swagger:route GET /api/alertmanager/{DatasourceUID}/api/v2/status alertmanager RouteGetAMStatus +// swagger:route GET /alertmanager/{DatasourceUID}/api/v2/status alertmanager RouteGetAMStatus // // get alertmanager status and configuration // @@ -101,7 +101,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route GET /api/alertmanager/grafana/api/v2/alerts alertmanager RouteGetGrafanaAMAlerts +// swagger:route GET /alertmanager/grafana/api/v2/alerts alertmanager RouteGetGrafanaAMAlerts // // get alertmanager alerts // @@ -109,7 +109,7 @@ import ( // 200: gettableAlerts // 400: ValidationError -// swagger:route GET /api/alertmanager/{DatasourceUID}/api/v2/alerts alertmanager RouteGetAMAlerts +// swagger:route GET /alertmanager/{DatasourceUID}/api/v2/alerts alertmanager RouteGetAMAlerts // // get alertmanager alerts // @@ -118,7 +118,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route POST /api/alertmanager/{DatasourceUID}/api/v2/alerts alertmanager RoutePostAMAlerts +// swagger:route POST /alertmanager/{DatasourceUID}/api/v2/alerts alertmanager RoutePostAMAlerts // // create alertmanager alerts // @@ -127,7 +127,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route GET /api/alertmanager/grafana/api/v2/alerts/groups alertmanager RouteGetGrafanaAMAlertGroups +// swagger:route GET /alertmanager/grafana/api/v2/alerts/groups alertmanager RouteGetGrafanaAMAlertGroups // // get alertmanager alerts // @@ -135,7 +135,7 @@ import ( // 200: alertGroups // 400: ValidationError -// swagger:route GET /api/alertmanager/{DatasourceUID}/api/v2/alerts/groups alertmanager RouteGetAMAlertGroups +// swagger:route GET /alertmanager/{DatasourceUID}/api/v2/alerts/groups alertmanager RouteGetAMAlertGroups // // get alertmanager alerts // @@ -144,14 +144,14 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route GET /api/alertmanager/grafana/config/api/v1/receivers alertmanager RouteGetGrafanaReceivers +// swagger:route GET /alertmanager/grafana/config/api/v1/receivers alertmanager RouteGetGrafanaReceivers // // Get a list of all receivers // // Responses: // 200: receiversResponse -// swagger:route POST /api/alertmanager/grafana/config/api/v1/receivers/test alertmanager RoutePostTestGrafanaReceivers +// swagger:route POST /alertmanager/grafana/config/api/v1/receivers/test alertmanager RoutePostTestGrafanaReceivers // // Test Grafana managed receivers without saving them. // @@ -165,7 +165,7 @@ import ( // 408: Failure // 409: AlertManagerNotReady -// swagger:route POST /api/alertmanager/grafana/config/api/v1/templates/test alertmanager RoutePostTestGrafanaTemplates +// swagger:route POST /alertmanager/grafana/config/api/v1/templates/test alertmanager RoutePostTestGrafanaTemplates // // Test Grafana managed templates without saving them. // Produces: @@ -178,7 +178,7 @@ import ( // 403: PermissionDenied // 409: AlertManagerNotReady -// swagger:route GET /api/alertmanager/grafana/api/v2/silences alertmanager RouteGetGrafanaSilences +// swagger:route GET /alertmanager/grafana/api/v2/silences alertmanager RouteGetGrafanaSilences // // get silences // @@ -186,7 +186,7 @@ import ( // 200: gettableSilences // 400: ValidationError -// swagger:route GET /api/alertmanager/{DatasourceUID}/api/v2/silences alertmanager RouteGetSilences +// swagger:route GET /alertmanager/{DatasourceUID}/api/v2/silences alertmanager RouteGetSilences // // get silences // @@ -195,7 +195,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route POST /api/alertmanager/grafana/api/v2/silences alertmanager RouteCreateGrafanaSilence +// swagger:route POST /alertmanager/grafana/api/v2/silences alertmanager RouteCreateGrafanaSilence // // create silence // @@ -203,7 +203,7 @@ import ( // 202: postSilencesOKBody // 400: ValidationError -// swagger:route POST /api/alertmanager/{DatasourceUID}/api/v2/silences alertmanager RouteCreateSilence +// swagger:route POST /alertmanager/{DatasourceUID}/api/v2/silences alertmanager RouteCreateSilence // // create silence // @@ -212,7 +212,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route GET /api/alertmanager/grafana/api/v2/silence/{SilenceId} alertmanager RouteGetGrafanaSilence +// swagger:route GET /alertmanager/grafana/api/v2/silence/{SilenceId} alertmanager RouteGetGrafanaSilence // // get silence // @@ -220,7 +220,7 @@ import ( // 200: gettableSilence // 400: ValidationError -// swagger:route GET /api/alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId} alertmanager RouteGetSilence +// swagger:route GET /alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId} alertmanager RouteGetSilence // // get silence // @@ -229,7 +229,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route DELETE /api/alertmanager/grafana/api/v2/silence/{SilenceId} alertmanager RouteDeleteGrafanaSilence +// swagger:route DELETE /alertmanager/grafana/api/v2/silence/{SilenceId} alertmanager RouteDeleteGrafanaSilence // // delete silence // @@ -237,7 +237,7 @@ import ( // 200: Ack // 400: ValidationError -// swagger:route DELETE /api/alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId} alertmanager RouteDeleteSilence +// swagger:route DELETE /alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId} alertmanager RouteDeleteSilence // // delete silence // diff --git a/pkg/services/ngalert/api/tooling/definitions/api.go b/pkg/services/ngalert/api/tooling/definitions/api.go index b1a5b1a9fde..0c9c6786dc9 100644 --- a/pkg/services/ngalert/api/tooling/definitions/api.go +++ b/pkg/services/ngalert/api/tooling/definitions/api.go @@ -4,7 +4,7 @@ // spec for the Grafana Alerting API. // // Schemes: http, https -// BasePath: /api/v1 +// BasePath: /api // Version: 1.1.0 // // Consumes: diff --git a/pkg/services/ngalert/api/tooling/definitions/cortex-ruler.go b/pkg/services/ngalert/api/tooling/definitions/cortex-ruler.go index f4f06ca5e7b..98e2837921e 100644 --- a/pkg/services/ngalert/api/tooling/definitions/cortex-ruler.go +++ b/pkg/services/ngalert/api/tooling/definitions/cortex-ruler.go @@ -8,7 +8,7 @@ import ( "github.com/prometheus/common/model" ) -// swagger:route Get /api/ruler/grafana/api/v1/rules ruler RouteGetGrafanaRulesConfig +// swagger:route Get /ruler/grafana/api/v1/rules ruler RouteGetGrafanaRulesConfig // // List rule groups // @@ -20,7 +20,7 @@ import ( // 403: ForbiddenError // -// swagger:route Get /api/ruler/grafana/api/v1/export/rules ruler RouteGetRulesForExport +// swagger:route Get /ruler/grafana/api/v1/export/rules ruler RouteGetRulesForExport // // List rules in provisioning format // @@ -33,7 +33,7 @@ import ( // 403: ForbiddenError // 404: description: Not found. -// swagger:route Get /api/ruler/{DatasourceUID}/api/v1/rules ruler RouteGetRulesConfig +// swagger:route Get /ruler/{DatasourceUID}/api/v1/rules ruler RouteGetRulesConfig // // List rule groups // @@ -45,7 +45,7 @@ import ( // 403: ForbiddenError // 404: NotFound -// swagger:route POST /api/ruler/grafana/api/v1/rules/{Namespace} ruler RoutePostNameGrafanaRulesConfig +// swagger:route POST /ruler/grafana/api/v1/rules/{Namespace} ruler RoutePostNameGrafanaRulesConfig // // Creates or updates a rule group // @@ -58,7 +58,7 @@ import ( // 403: ForbiddenError // -// swagger:route POST /api/ruler/grafana/api/v1/rules/{Namespace}/export ruler RoutePostRulesGroupForExport +// swagger:route POST /ruler/grafana/api/v1/rules/{Namespace}/export ruler RoutePostRulesGroupForExport // // Converts submitted rule group to provisioning format // @@ -71,7 +71,7 @@ import ( // 403: ForbiddenError // 404: description: Not found. -// swagger:route POST /api/ruler/{DatasourceUID}/api/v1/rules/{Namespace} ruler RoutePostNameRulesConfig +// swagger:route POST /ruler/{DatasourceUID}/api/v1/rules/{Namespace} ruler RoutePostNameRulesConfig // // Creates or updates a rule group // @@ -84,7 +84,7 @@ import ( // 403: ForbiddenError // 404: NotFound -// swagger:route Get /api/ruler/grafana/api/v1/rules/{Namespace} ruler RouteGetNamespaceGrafanaRulesConfig +// swagger:route Get /ruler/grafana/api/v1/rules/{Namespace} ruler RouteGetNamespaceGrafanaRulesConfig // // Get rule groups by namespace // @@ -95,7 +95,7 @@ import ( // 403: ForbiddenError // 202: NamespaceConfigResponse -// swagger:route Get /api/ruler/{DatasourceUID}/api/v1/rules/{Namespace} ruler RouteGetNamespaceRulesConfig +// swagger:route Get /ruler/{DatasourceUID}/api/v1/rules/{Namespace} ruler RouteGetNamespaceRulesConfig // // Get rule groups by namespace // @@ -107,7 +107,7 @@ import ( // 403: ForbiddenError // 404: NotFound -// swagger:route Delete /api/ruler/grafana/api/v1/rules/{Namespace} ruler RouteDeleteNamespaceGrafanaRulesConfig +// swagger:route Delete /ruler/grafana/api/v1/rules/{Namespace} ruler RouteDeleteNamespaceGrafanaRulesConfig // // Delete namespace // @@ -115,7 +115,7 @@ import ( // 202: Ack // 403: ForbiddenError -// swagger:route Delete /api/ruler/{DatasourceUID}/api/v1/rules/{Namespace} ruler RouteDeleteNamespaceRulesConfig +// swagger:route Delete /ruler/{DatasourceUID}/api/v1/rules/{Namespace} ruler RouteDeleteNamespaceRulesConfig // // Delete namespace // @@ -124,7 +124,7 @@ import ( // 403: ForbiddenError // 404: NotFound -// swagger:route Get /api/ruler/grafana/api/v1/rules/{Namespace}/{Groupname} ruler RouteGetGrafanaRuleGroupConfig +// swagger:route Get /ruler/grafana/api/v1/rules/{Namespace}/{Groupname} ruler RouteGetGrafanaRuleGroupConfig // // Get rule group // @@ -135,7 +135,7 @@ import ( // 202: RuleGroupConfigResponse // 403: ForbiddenError -// swagger:route Get /api/ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname} ruler RouteGetRulegGroupConfig +// swagger:route Get /ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname} ruler RouteGetRulegGroupConfig // // Get rule group // @@ -147,7 +147,7 @@ import ( // 403: ForbiddenError // 404: NotFound -// swagger:route Delete /api/ruler/grafana/api/v1/rules/{Namespace}/{Groupname} ruler RouteDeleteGrafanaRuleGroupConfig +// swagger:route Delete /ruler/grafana/api/v1/rules/{Namespace}/{Groupname} ruler RouteDeleteGrafanaRuleGroupConfig // // Delete rule group // @@ -155,7 +155,7 @@ import ( // 202: Ack // 403: ForbiddenError -// swagger:route Delete /api/ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname} ruler RouteDeleteRuleGroupConfig +// swagger:route Delete /ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname} ruler RouteDeleteRuleGroupConfig // // Delete rule group // diff --git a/pkg/services/ngalert/api/tooling/definitions/prom.go b/pkg/services/ngalert/api/tooling/definitions/prom.go index 97e03ee74c8..43ae592d329 100644 --- a/pkg/services/ngalert/api/tooling/definitions/prom.go +++ b/pkg/services/ngalert/api/tooling/definitions/prom.go @@ -9,14 +9,14 @@ import ( v1 "github.com/prometheus/client_golang/api/prometheus/v1" ) -// swagger:route GET /api/prometheus/grafana/api/v1/rules prometheus RouteGetGrafanaRuleStatuses +// swagger:route GET /prometheus/grafana/api/v1/rules prometheus RouteGetGrafanaRuleStatuses // // gets the evaluation statuses of all rules // // Responses: // 200: RuleResponse -// swagger:route GET /api/prometheus/{DatasourceUID}/api/v1/rules prometheus RouteGetRuleStatuses +// swagger:route GET /prometheus/{DatasourceUID}/api/v1/rules prometheus RouteGetRuleStatuses // // gets the evaluation statuses of all rules // @@ -24,14 +24,14 @@ import ( // 200: RuleResponse // 404: NotFound -// swagger:route GET /api/prometheus/grafana/api/v1/alerts prometheus RouteGetGrafanaAlertStatuses +// swagger:route GET /prometheus/grafana/api/v1/alerts prometheus RouteGetGrafanaAlertStatuses // // gets the current alerts // // Responses: // 200: AlertResponse -// swagger:route GET /api/prometheus/{DatasourceUID}/api/v1/alerts prometheus RouteGetAlertStatuses +// swagger:route GET /prometheus/{DatasourceUID}/api/v1/alerts prometheus RouteGetAlertStatuses // // gets the current alerts // diff --git a/pkg/services/ngalert/api/tooling/definitions/provisioning_alert_rules.go b/pkg/services/ngalert/api/tooling/definitions/provisioning_alert_rules.go index 30233f8cff1..1471a7c7ade 100644 --- a/pkg/services/ngalert/api/tooling/definitions/provisioning_alert_rules.go +++ b/pkg/services/ngalert/api/tooling/definitions/provisioning_alert_rules.go @@ -6,14 +6,14 @@ import ( "github.com/prometheus/common/model" ) -// swagger:route GET /api/v1/provisioning/alert-rules provisioning stable RouteGetAlertRules +// swagger:route GET /v1/provisioning/alert-rules provisioning stable RouteGetAlertRules // // Get all the alert rules. // // Responses: // 200: ProvisionedAlertRules -// swagger:route GET /api/v1/provisioning/alert-rules/export provisioning stable RouteGetAlertRulesExport +// swagger:route GET /v1/provisioning/alert-rules/export provisioning stable RouteGetAlertRulesExport // // Export all alert rules in provisioning file format. // @@ -21,7 +21,7 @@ import ( // 200: AlertingFileExport // 404: description: Not found. -// swagger:route GET /api/v1/provisioning/alert-rules/{UID} provisioning stable RouteGetAlertRule +// swagger:route GET /v1/provisioning/alert-rules/{UID} provisioning stable RouteGetAlertRule // // Get a specific alert rule by UID. // @@ -29,7 +29,7 @@ import ( // 200: ProvisionedAlertRule // 404: description: Not found. -// swagger:route GET /api/v1/provisioning/alert-rules/{UID}/export provisioning stable RouteGetAlertRuleExport +// swagger:route GET /v1/provisioning/alert-rules/{UID}/export provisioning stable RouteGetAlertRuleExport // // Export an alert rule in provisioning file format. // @@ -42,7 +42,7 @@ import ( // 200: AlertingFileExport // 404: description: Not found. -// swagger:route POST /api/v1/provisioning/alert-rules provisioning stable RoutePostAlertRule +// swagger:route POST /v1/provisioning/alert-rules provisioning stable RoutePostAlertRule // // Create a new alert rule. // @@ -53,7 +53,7 @@ import ( // 201: ProvisionedAlertRule // 400: ValidationError -// swagger:route PUT /api/v1/provisioning/alert-rules/{UID} provisioning stable RoutePutAlertRule +// swagger:route PUT /v1/provisioning/alert-rules/{UID} provisioning stable RoutePutAlertRule // // Update an existing alert rule. // @@ -64,7 +64,7 @@ import ( // 200: ProvisionedAlertRule // 400: ValidationError -// swagger:route DELETE /api/v1/provisioning/alert-rules/{UID} provisioning stable RouteDeleteAlertRule +// swagger:route DELETE /v1/provisioning/alert-rules/{UID} provisioning stable RouteDeleteAlertRule // // Delete a specific alert rule by UID. // @@ -158,7 +158,7 @@ type ProvisionedAlertRule struct { IsPaused bool `json:"isPaused"` } -// swagger:route GET /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group} provisioning stable RouteGetAlertRuleGroup +// swagger:route GET /v1/provisioning/folder/{FolderUID}/rule-groups/{Group} provisioning stable RouteGetAlertRuleGroup // // Get a rule group. // @@ -166,7 +166,7 @@ type ProvisionedAlertRule struct { // 200: AlertRuleGroup // 404: description: Not found. -// swagger:route GET /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export provisioning stable RouteGetAlertRuleGroupExport +// swagger:route GET /v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export provisioning stable RouteGetAlertRuleGroupExport // // Export an alert rule group in provisioning file format. // @@ -179,7 +179,7 @@ type ProvisionedAlertRule struct { // 200: AlertingFileExport // 404: description: Not found. -// swagger:route PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group} provisioning stable RoutePutAlertRuleGroup +// swagger:route PUT /v1/provisioning/folder/{FolderUID}/rule-groups/{Group} provisioning stable RoutePutAlertRuleGroup // // Update the interval of a rule group. // diff --git a/pkg/services/ngalert/api/tooling/definitions/provisioning_contactpoints.go b/pkg/services/ngalert/api/tooling/definitions/provisioning_contactpoints.go index cea1209f0d0..e7ca49a8043 100644 --- a/pkg/services/ngalert/api/tooling/definitions/provisioning_contactpoints.go +++ b/pkg/services/ngalert/api/tooling/definitions/provisioning_contactpoints.go @@ -4,14 +4,14 @@ import ( "github.com/grafana/grafana/pkg/components/simplejson" ) -// swagger:route GET /api/v1/provisioning/contact-points provisioning stable RouteGetContactpoints +// swagger:route GET /v1/provisioning/contact-points provisioning stable RouteGetContactpoints // // Get all the contact points. // // Responses: // 200: ContactPoints -// swagger:route GET /api/v1/provisioning/contact-points/export provisioning stable RouteGetContactpointsExport +// swagger:route GET /v1/provisioning/contact-points/export provisioning stable RouteGetContactpointsExport // // Export all contact points in provisioning file format. // @@ -19,7 +19,7 @@ import ( // 200: AlertingFileExport // 403: PermissionDenied -// swagger:route POST /api/v1/provisioning/contact-points provisioning stable RoutePostContactpoints +// swagger:route POST /v1/provisioning/contact-points provisioning stable RoutePostContactpoints // // Create a contact point. // @@ -30,7 +30,7 @@ import ( // 202: EmbeddedContactPoint // 400: ValidationError -// swagger:route PUT /api/v1/provisioning/contact-points/{UID} provisioning stable RoutePutContactpoint +// swagger:route PUT /v1/provisioning/contact-points/{UID} provisioning stable RoutePutContactpoint // // Update an existing contact point. // @@ -41,7 +41,7 @@ import ( // 202: Ack // 400: ValidationError -// swagger:route DELETE /api/v1/provisioning/contact-points/{UID} provisioning stable RouteDeleteContactpoints +// swagger:route DELETE /v1/provisioning/contact-points/{UID} provisioning stable RouteDeleteContactpoints // // Delete a contact point. // diff --git a/pkg/services/ngalert/api/tooling/definitions/provisioning_mute_timings.go b/pkg/services/ngalert/api/tooling/definitions/provisioning_mute_timings.go index d003beff89f..232e5a366fb 100644 --- a/pkg/services/ngalert/api/tooling/definitions/provisioning_mute_timings.go +++ b/pkg/services/ngalert/api/tooling/definitions/provisioning_mute_timings.go @@ -4,14 +4,14 @@ import ( "github.com/prometheus/alertmanager/config" ) -// swagger:route GET /api/v1/provisioning/mute-timings provisioning stable RouteGetMuteTimings +// swagger:route GET /v1/provisioning/mute-timings provisioning stable RouteGetMuteTimings // // Get all the mute timings. // // Responses: // 200: MuteTimings -// swagger:route GET /api/v1/provisioning/mute-timings/export provisioning stable RouteExportMuteTimings +// swagger:route GET /v1/provisioning/mute-timings/export provisioning stable RouteExportMuteTimings // // Export all mute timings in provisioning format. // @@ -19,7 +19,7 @@ import ( // 200: AlertingFileExport // 403: PermissionDenied -// swagger:route GET /api/v1/provisioning/mute-timings/{name} provisioning stable RouteGetMuteTiming +// swagger:route GET /v1/provisioning/mute-timings/{name} provisioning stable RouteGetMuteTiming // // Get a mute timing. // @@ -27,7 +27,7 @@ import ( // 200: MuteTimeInterval // 404: description: Not found. -// swagger:route GET /api/v1/provisioning/mute-timings/{name}/export provisioning stable RouteExportMuteTiming +// swagger:route GET /v1/provisioning/mute-timings/{name}/export provisioning stable RouteExportMuteTiming // // Export a mute timing in provisioning format. // @@ -35,7 +35,7 @@ import ( // 200: AlertingFileExport // 403: PermissionDenied -// swagger:route POST /api/v1/provisioning/mute-timings provisioning stable RoutePostMuteTiming +// swagger:route POST /v1/provisioning/mute-timings provisioning stable RoutePostMuteTiming // // Create a new mute timing. // @@ -46,7 +46,7 @@ import ( // 201: MuteTimeInterval // 400: ValidationError -// swagger:route PUT /api/v1/provisioning/mute-timings/{name} provisioning stable RoutePutMuteTiming +// swagger:route PUT /v1/provisioning/mute-timings/{name} provisioning stable RoutePutMuteTiming // // Replace an existing mute timing. // @@ -57,7 +57,7 @@ import ( // 202: MuteTimeInterval // 400: ValidationError -// swagger:route DELETE /api/v1/provisioning/mute-timings/{name} provisioning stable RouteDeleteMuteTiming +// swagger:route DELETE /v1/provisioning/mute-timings/{name} provisioning stable RouteDeleteMuteTiming // // Delete a mute timing. // diff --git a/pkg/services/ngalert/api/tooling/definitions/provisioning_policies.go b/pkg/services/ngalert/api/tooling/definitions/provisioning_policies.go index 9da558cda88..7d4ab74d357 100644 --- a/pkg/services/ngalert/api/tooling/definitions/provisioning_policies.go +++ b/pkg/services/ngalert/api/tooling/definitions/provisioning_policies.go @@ -4,7 +4,7 @@ import ( "github.com/prometheus/alertmanager/config" ) -// swagger:route GET /api/v1/provisioning/policies provisioning stable RouteGetPolicyTree +// swagger:route GET /v1/provisioning/policies provisioning stable RouteGetPolicyTree // // Get the notification policy tree. // @@ -12,7 +12,7 @@ import ( // 200: Route // description: The currently active notification routing tree -// swagger:route PUT /api/v1/provisioning/policies provisioning stable RoutePutPolicyTree +// swagger:route PUT /v1/provisioning/policies provisioning stable RoutePutPolicyTree // // Sets the notification policy tree. // @@ -23,7 +23,7 @@ import ( // 202: Ack // 400: ValidationError -// swagger:route DELETE /api/v1/provisioning/policies provisioning stable RouteResetPolicyTree +// swagger:route DELETE /v1/provisioning/policies provisioning stable RouteResetPolicyTree // // Clears the notification policy tree. // @@ -33,7 +33,7 @@ import ( // Responses: // 202: Ack -// swagger:route GET /api/v1/provisioning/policies/export provisioning stable RouteGetPolicyTreeExport +// swagger:route GET /v1/provisioning/policies/export provisioning stable RouteGetPolicyTreeExport // // Export the notification policy tree in provisioning file format. // diff --git a/pkg/services/ngalert/api/tooling/definitions/provisioning_templates.go b/pkg/services/ngalert/api/tooling/definitions/provisioning_templates.go index 6184105bc93..b7779e22321 100644 --- a/pkg/services/ngalert/api/tooling/definitions/provisioning_templates.go +++ b/pkg/services/ngalert/api/tooling/definitions/provisioning_templates.go @@ -1,6 +1,6 @@ package definitions -// swagger:route GET /api/v1/provisioning/templates provisioning stable RouteGetTemplates +// swagger:route GET /v1/provisioning/templates provisioning stable RouteGetTemplates // // Get all notification templates. // @@ -8,7 +8,7 @@ package definitions // 200: NotificationTemplates // 404: description: Not found. -// swagger:route GET /api/v1/provisioning/templates/{name} provisioning stable RouteGetTemplate +// swagger:route GET /v1/provisioning/templates/{name} provisioning stable RouteGetTemplate // // Get a notification template. // @@ -16,7 +16,7 @@ package definitions // 200: NotificationTemplate // 404: description: Not found. -// swagger:route PUT /api/v1/provisioning/templates/{name} provisioning stable RoutePutTemplate +// swagger:route PUT /v1/provisioning/templates/{name} provisioning stable RoutePutTemplate // // Updates an existing notification template. // @@ -27,7 +27,7 @@ package definitions // 202: NotificationTemplate // 400: ValidationError -// swagger:route DELETE /api/v1/provisioning/templates/{name} provisioning stable RouteDeleteTemplate +// swagger:route DELETE /v1/provisioning/templates/{name} provisioning stable RouteDeleteTemplate // // Delete a template. // diff --git a/pkg/services/ngalert/api/tooling/definitions/ruler_state_history.go b/pkg/services/ngalert/api/tooling/definitions/ruler_state_history.go index 9d365659cc8..ae3aa956cd9 100644 --- a/pkg/services/ngalert/api/tooling/definitions/ruler_state_history.go +++ b/pkg/services/ngalert/api/tooling/definitions/ruler_state_history.go @@ -2,7 +2,7 @@ package definitions import "github.com/grafana/grafana-plugin-sdk-go/data" -// swagger:route GET /api/v1/rules/history history RouteGetStateHistory +// swagger:route GET /v1/rules/history history RouteGetStateHistory // // Query state history. // diff --git a/pkg/services/ngalert/api/tooling/definitions/testing.go b/pkg/services/ngalert/api/tooling/definitions/testing.go index 90c304434e1..2c228e94758 100644 --- a/pkg/services/ngalert/api/tooling/definitions/testing.go +++ b/pkg/services/ngalert/api/tooling/definitions/testing.go @@ -13,7 +13,7 @@ import ( "github.com/prometheus/prometheus/promql" ) -// swagger:route Post /api/v1/rule/test/grafana testing RouteTestRuleGrafanaConfig +// swagger:route Post /v1/rule/test/grafana testing RouteTestRuleGrafanaConfig // // Test a rule against Grafana ruler // @@ -28,7 +28,7 @@ import ( // 400: ValidationError // 404: NotFound -// swagger:route Post /api/v1/rule/test/{DatasourceUID} testing RouteTestRuleConfig +// swagger:route Post /v1/rule/test/{DatasourceUID} testing RouteTestRuleConfig // // Test a rule against external data source ruler // @@ -42,7 +42,7 @@ import ( // 200: TestRuleResponse // 404: NotFound -// swagger:route Post /api/v1/eval testing RouteEvalQueries +// swagger:route Post /v1/eval testing RouteEvalQueries // // Test rule // @@ -55,7 +55,7 @@ import ( // Responses: // 200: EvalQueriesResponse -// swagger:route Post /api/v1/rule/backtest testing BacktestConfig +// swagger:route Post /v1/rule/backtest testing BacktestConfig // // Test rule // diff --git a/pkg/services/ngalert/api/tooling/definitions/upgrade.go b/pkg/services/ngalert/api/tooling/definitions/upgrade.go index de89cb6e4bb..c8863ac3425 100644 --- a/pkg/services/ngalert/api/tooling/definitions/upgrade.go +++ b/pkg/services/ngalert/api/tooling/definitions/upgrade.go @@ -1,6 +1,6 @@ package definitions -// swagger:route GET /api/v1/upgrade/org upgrade RouteGetOrgUpgrade +// swagger:route GET /v1/upgrade/org upgrade RouteGetOrgUpgrade // // Get existing alerting upgrade for the current organization. // @@ -10,7 +10,7 @@ package definitions // Responses: // 200: OrgMigrationState -// swagger:route POST /api/v1/upgrade/org upgrade RoutePostUpgradeOrg +// swagger:route POST /v1/upgrade/org upgrade RoutePostUpgradeOrg // // Upgrade all legacy alerts for the current organization. // @@ -20,7 +20,7 @@ package definitions // Responses: // 200: OrgMigrationSummary -// swagger:route DELETE /api/v1/upgrade/org upgrade RouteDeleteOrgUpgrade +// swagger:route DELETE /v1/upgrade/org upgrade RouteDeleteOrgUpgrade // // Delete existing alerting upgrade for the current organization. // @@ -30,7 +30,7 @@ package definitions // Responses: // 200: Ack -// swagger:route POST /api/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID} upgrade RoutePostUpgradeAlert +// swagger:route POST /v1/upgrade/dashboards/{DashboardID}/panels/{PanelID} upgrade RoutePostUpgradeAlert // // Upgrade single legacy dashboard alert for the current organization. // @@ -40,7 +40,7 @@ package definitions // Responses: // 200: OrgMigrationSummary -// swagger:route POST /api/v1/upgrade/dashboards/{DashboardID} upgrade RoutePostUpgradeDashboard +// swagger:route POST /v1/upgrade/dashboards/{DashboardID} upgrade RoutePostUpgradeDashboard // // Upgrade all legacy dashboard alerts on a dashboard for the current organization. // @@ -50,7 +50,7 @@ package definitions // Responses: // 200: OrgMigrationSummary -// swagger:route POST /api/v1/upgrade/dashboards upgrade RoutePostUpgradeAllDashboards +// swagger:route POST /v1/upgrade/dashboards upgrade RoutePostUpgradeAllDashboards // // Upgrade all legacy dashboard alerts for the current organization. // @@ -60,7 +60,7 @@ package definitions // Responses: // 200: OrgMigrationSummary -// swagger:route POST /api/v1/upgrade/channels upgrade RoutePostUpgradeAllChannels +// swagger:route POST /v1/upgrade/channels upgrade RoutePostUpgradeAllChannels // // Upgrade all legacy notification channels for the current organization. // @@ -70,7 +70,7 @@ package definitions // Responses: // 200: OrgMigrationSummary -// swagger:route POST /api/v1/upgrade/channels/{ChannelID} upgrade RoutePostUpgradeChannel +// swagger:route POST /v1/upgrade/channels/{ChannelID} upgrade RoutePostUpgradeChannel // // Upgrade a single legacy notification channel for the current organization. // diff --git a/pkg/services/ngalert/api/tooling/post.json b/pkg/services/ngalert/api/tooling/post.json index d833b95d68c..662c0a6c36e 100644 --- a/pkg/services/ngalert/api/tooling/post.json +++ b/pkg/services/ngalert/api/tooling/post.json @@ -1,5 +1,5 @@ { - "basePath": "/api/v1", + "basePath": "/api", "consumes": [ "application/json" ], @@ -4172,7 +4172,6 @@ "type": "object" }, "URL": { - "description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use the EscapedPath method, which preserves\nthe original encoding of Path.\n\nThe RawPath field is an optional field which is only set when the default\nencoding of Path is different from the escaped path. See the EscapedPath method\nfor more details.\n\nURL's String method uses the EscapedPath method to obtain the path.", "properties": { "ForceQuery": { "type": "boolean" @@ -4208,7 +4207,7 @@ "$ref": "#/definitions/Userinfo" } }, - "title": "A URL represents a parsed URL (technically, a URI reference).", + "title": "URL is a custom URL type that allows validation at configuration load time.", "type": "object" }, "UpdateRuleGroupResponse": { @@ -4414,7 +4413,6 @@ "type": "object" }, "alertGroup": { - "description": "AlertGroup alert group", "properties": { "alerts": { "description": "alerts", @@ -4599,13 +4597,13 @@ "type": "object" }, "gettableAlerts": { - "description": "GettableAlerts gettable alerts", "items": { "$ref": "#/definitions/gettableAlert" }, "type": "array" }, "gettableSilence": { + "description": "GettableSilence gettable silence", "properties": { "comment": { "description": "comment", @@ -4842,7 +4840,6 @@ "type": "object" }, "receiver": { - "description": "Receiver receiver", "properties": { "active": { "description": "active", @@ -4962,7 +4959,7 @@ "version": "1.1.0" }, "paths": { - "/api/alertmanager/grafana/api/v2/alerts": { + "/alertmanager/grafana/api/v2/alerts": { "get": { "description": "get alertmanager alerts", "operationId": "RouteGetGrafanaAMAlerts", @@ -5023,7 +5020,7 @@ ] } }, - "/api/alertmanager/grafana/api/v2/alerts/groups": { + "/alertmanager/grafana/api/v2/alerts/groups": { "get": { "description": "get alertmanager alerts", "operationId": "RouteGetGrafanaAMAlertGroups", @@ -5084,7 +5081,7 @@ ] } }, - "/api/alertmanager/grafana/api/v2/silence/{SilenceId}": { + "/alertmanager/grafana/api/v2/silence/{SilenceId}": { "delete": { "description": "delete silence", "operationId": "RouteDeleteGrafanaSilence", @@ -5144,7 +5141,7 @@ ] } }, - "/api/alertmanager/grafana/api/v2/silences": { + "/alertmanager/grafana/api/v2/silences": { "get": { "description": "get silences", "operationId": "RouteGetGrafanaSilences", @@ -5207,7 +5204,7 @@ ] } }, - "/api/alertmanager/grafana/api/v2/status": { + "/alertmanager/grafana/api/v2/status": { "get": { "description": "get alertmanager status and configuration", "operationId": "RouteGetGrafanaAMStatus", @@ -5230,7 +5227,7 @@ ] } }, - "/api/alertmanager/grafana/config/api/v1/alerts": { + "/alertmanager/grafana/config/api/v1/alerts": { "delete": { "description": "deletes the Alerting config for a tenant", "operationId": "RouteDeleteGrafanaAlertingConfig", @@ -5304,7 +5301,7 @@ ] } }, - "/api/alertmanager/grafana/config/api/v1/receivers": { + "/alertmanager/grafana/config/api/v1/receivers": { "get": { "description": "Get a list of all receivers", "operationId": "RouteGetGrafanaReceivers", @@ -5318,7 +5315,7 @@ ] } }, - "/api/alertmanager/grafana/config/api/v1/receivers/test": { + "/alertmanager/grafana/config/api/v1/receivers/test": { "post": { "operationId": "RoutePostTestGrafanaReceivers", "parameters": [ @@ -5380,7 +5377,7 @@ ] } }, - "/api/alertmanager/grafana/config/api/v1/templates/test": { + "/alertmanager/grafana/config/api/v1/templates/test": { "post": { "operationId": "RoutePostTestGrafanaTemplates", "parameters": [ @@ -5427,7 +5424,7 @@ ] } }, - "/api/alertmanager/grafana/config/history": { + "/alertmanager/grafana/config/history": { "get": { "description": "gets Alerting configurations that were successfully applied in the past", "operationId": "RouteGetGrafanaAlertingConfigHistory", @@ -5450,7 +5447,7 @@ ] } }, - "/api/alertmanager/grafana/config/history/{id}/_activate": { + "/alertmanager/grafana/config/history/{id}/_activate": { "post": { "description": "revert Alerting configuration to the historical configuration specified by the given id", "operationId": "RoutePostGrafanaAlertingConfigHistoryActivate", @@ -5489,7 +5486,7 @@ ] } }, - "/api/alertmanager/{DatasourceUID}/api/v2/alerts": { + "/alertmanager/{DatasourceUID}/api/v2/alerts": { "get": { "description": "get alertmanager alerts", "operationId": "RouteGetAMAlerts", @@ -5609,7 +5606,7 @@ ] } }, - "/api/alertmanager/{DatasourceUID}/api/v2/alerts/groups": { + "/alertmanager/{DatasourceUID}/api/v2/alerts/groups": { "get": { "description": "get alertmanager alerts", "operationId": "RouteGetAMAlertGroups", @@ -5683,7 +5680,7 @@ ] } }, - "/api/alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId}": { + "/alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId}": { "delete": { "description": "delete silence", "operationId": "RouteDeleteSilence", @@ -5769,7 +5766,7 @@ ] } }, - "/api/alertmanager/{DatasourceUID}/api/v2/silences": { + "/alertmanager/{DatasourceUID}/api/v2/silences": { "get": { "description": "get silences", "operationId": "RouteGetSilences", @@ -5858,7 +5855,7 @@ ] } }, - "/api/alertmanager/{DatasourceUID}/api/v2/status": { + "/alertmanager/{DatasourceUID}/api/v2/status": { "get": { "description": "get alertmanager status and configuration", "operationId": "RouteGetAMStatus", @@ -5896,7 +5893,7 @@ ] } }, - "/api/alertmanager/{DatasourceUID}/config/api/v1/alerts": { + "/alertmanager/{DatasourceUID}/config/api/v1/alerts": { "delete": { "description": "deletes the Alerting config for a tenant", "operationId": "RouteDeleteAlertingConfig", @@ -6013,7 +6010,7 @@ ] } }, - "/api/prometheus/grafana/api/v1/alerts": { + "/prometheus/grafana/api/v1/alerts": { "get": { "description": "gets the current alerts", "operationId": "RouteGetGrafanaAlertStatuses", @@ -6039,7 +6036,7 @@ ] } }, - "/api/prometheus/grafana/api/v1/rules": { + "/prometheus/grafana/api/v1/rules": { "get": { "description": "gets the evaluation statuses of all rules", "operationId": "RouteGetGrafanaRuleStatuses", @@ -6078,7 +6075,7 @@ ] } }, - "/api/prometheus/{DatasourceUID}/api/v1/alerts": { + "/prometheus/{DatasourceUID}/api/v1/alerts": { "get": { "description": "gets the current alerts", "operationId": "RouteGetAlertStatuses", @@ -6110,7 +6107,7 @@ ] } }, - "/api/prometheus/{DatasourceUID}/api/v1/rules": { + "/prometheus/{DatasourceUID}/api/v1/rules": { "get": { "description": "gets the evaluation statuses of all rules", "operationId": "RouteGetRuleStatuses", @@ -6142,7 +6139,7 @@ ] } }, - "/api/ruler/grafana/api/v1/export/rules": { + "/ruler/grafana/api/v1/export/rules": { "get": { "consumes": [ "application/json", @@ -6209,7 +6206,7 @@ ] } }, - "/api/ruler/grafana/api/v1/rules": { + "/ruler/grafana/api/v1/rules": { "get": { "description": "List rule groups", "operationId": "RouteGetGrafanaRulesConfig", @@ -6248,7 +6245,7 @@ ] } }, - "/api/ruler/grafana/api/v1/rules/{Namespace}": { + "/ruler/grafana/api/v1/rules/{Namespace}": { "delete": { "description": "Delete namespace", "operationId": "RouteDeleteNamespaceGrafanaRulesConfig", @@ -6354,7 +6351,7 @@ ] } }, - "/api/ruler/grafana/api/v1/rules/{Namespace}/export": { + "/ruler/grafana/api/v1/rules/{Namespace}/export": { "post": { "consumes": [ "application/json", @@ -6414,7 +6411,7 @@ ] } }, - "/api/ruler/grafana/api/v1/rules/{Namespace}/{Groupname}": { + "/ruler/grafana/api/v1/rules/{Namespace}/{Groupname}": { "delete": { "description": "Delete rule group", "operationId": "RouteDeleteGrafanaRuleGroupConfig", @@ -6491,7 +6488,7 @@ ] } }, - "/api/ruler/{DatasourceUID}/api/v1/rules": { + "/ruler/{DatasourceUID}/api/v1/rules": { "get": { "description": "List rule groups", "operationId": "RouteGetRulesConfig", @@ -6543,7 +6540,7 @@ ] } }, - "/api/ruler/{DatasourceUID}/api/v1/rules/{Namespace}": { + "/ruler/{DatasourceUID}/api/v1/rules/{Namespace}": { "delete": { "description": "Delete namespace", "operationId": "RouteDeleteNamespaceRulesConfig", @@ -6688,7 +6685,7 @@ ] } }, - "/api/ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname}": { + "/ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname}": { "delete": { "description": "Delete rule group", "operationId": "RouteDeleteRuleGroupConfig", @@ -6791,7 +6788,7 @@ ] } }, - "/api/v1/eval": { + "/v1/eval": { "post": { "consumes": [ "application/json" @@ -6823,7 +6820,7 @@ ] } }, - "/api/v1/ngalert": { + "/v1/ngalert": { "get": { "description": "Get the status of the alerting engine", "operationId": "RouteGetStatus", @@ -6843,7 +6840,7 @@ ] } }, - "/api/v1/ngalert/admin_config": { + "/v1/ngalert/admin_config": { "delete": { "consumes": [ "application/json" @@ -6932,7 +6929,7 @@ ] } }, - "/api/v1/ngalert/alertmanagers": { + "/v1/ngalert/alertmanagers": { "get": { "operationId": "RouteGetAlertmanagers", "produces": [ @@ -6952,7 +6949,7 @@ ] } }, - "/api/v1/provisioning/alert-rules": { + "/v1/provisioning/alert-rules": { "get": { "operationId": "RouteGetAlertRules", "responses": { @@ -7007,7 +7004,7 @@ ] } }, - "/api/v1/provisioning/alert-rules/export": { + "/v1/provisioning/alert-rules/export": { "get": { "operationId": "RouteGetAlertRulesExport", "parameters": [ @@ -7064,7 +7061,7 @@ ] } }, - "/api/v1/provisioning/alert-rules/{UID}": { + "/v1/provisioning/alert-rules/{UID}": { "delete": { "operationId": "RouteDeleteAlertRule", "parameters": [ @@ -7164,7 +7161,7 @@ ] } }, - "/api/v1/provisioning/alert-rules/{UID}/export": { + "/v1/provisioning/alert-rules/{UID}/export": { "get": { "operationId": "RouteGetAlertRuleExport", "parameters": [ @@ -7212,7 +7209,7 @@ ] } }, - "/api/v1/provisioning/contact-points": { + "/v1/provisioning/contact-points": { "get": { "operationId": "RouteGetContactpoints", "parameters": [ @@ -7275,7 +7272,7 @@ ] } }, - "/api/v1/provisioning/contact-points/export": { + "/v1/provisioning/contact-points/export": { "get": { "operationId": "RouteGetContactpointsExport", "parameters": [ @@ -7327,7 +7324,7 @@ ] } }, - "/api/v1/provisioning/contact-points/{UID}": { + "/v1/provisioning/contact-points/{UID}": { "delete": { "consumes": [ "application/json" @@ -7398,7 +7395,7 @@ ] } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { "get": { "operationId": "RouteGetAlertRuleGroup", "parameters": [ @@ -7482,7 +7479,7 @@ ] } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { "get": { "operationId": "RouteGetAlertRuleGroupExport", "parameters": [ @@ -7535,7 +7532,7 @@ ] } }, - "/api/v1/provisioning/mute-timings": { + "/v1/provisioning/mute-timings": { "get": { "operationId": "RouteGetMuteTimings", "responses": { @@ -7590,7 +7587,7 @@ ] } }, - "/api/v1/provisioning/mute-timings/export": { + "/v1/provisioning/mute-timings/export": { "get": { "operationId": "RouteExportMuteTimings", "parameters": [ @@ -7629,7 +7626,7 @@ ] } }, - "/api/v1/provisioning/mute-timings/{name}": { + "/v1/provisioning/mute-timings/{name}": { "delete": { "operationId": "RouteDeleteMuteTiming", "parameters": [ @@ -7730,7 +7727,7 @@ ] } }, - "/api/v1/provisioning/mute-timings/{name}/export": { + "/v1/provisioning/mute-timings/{name}/export": { "get": { "operationId": "RouteExportMuteTiming", "parameters": [ @@ -7776,7 +7773,7 @@ ] } }, - "/api/v1/provisioning/policies": { + "/v1/provisioning/policies": { "delete": { "consumes": [ "application/json" @@ -7850,7 +7847,7 @@ ] } }, - "/api/v1/provisioning/policies/export": { + "/v1/provisioning/policies/export": { "get": { "operationId": "RouteGetPolicyTreeExport", "responses": { @@ -7873,7 +7870,7 @@ ] } }, - "/api/v1/provisioning/templates": { + "/v1/provisioning/templates": { "get": { "operationId": "RouteGetTemplates", "responses": { @@ -7893,7 +7890,7 @@ ] } }, - "/api/v1/provisioning/templates/{name}": { + "/v1/provisioning/templates/{name}": { "delete": { "operationId": "RouteDeleteTemplate", "parameters": [ @@ -7988,7 +7985,7 @@ ] } }, - "/api/v1/rule/backtest": { + "/v1/rule/backtest": { "post": { "consumes": [ "application/json" @@ -8020,7 +8017,7 @@ ] } }, - "/api/v1/rule/test/grafana": { + "/v1/rule/test/grafana": { "post": { "consumes": [ "application/json" @@ -8061,7 +8058,7 @@ ] } }, - "/api/v1/rule/test/{DatasourceUID}": { + "/v1/rule/test/{DatasourceUID}": { "post": { "consumes": [ "application/json" @@ -8106,7 +8103,7 @@ ] } }, - "/api/v1/rules/history": { + "/v1/rules/history": { "get": { "operationId": "RouteGetStateHistory", "produces": [ @@ -8123,7 +8120,7 @@ ] } }, - "/api/v1/upgrade/channels": { + "/v1/upgrade/channels": { "post": { "operationId": "RoutePostUpgradeAllChannels", "parameters": [ @@ -8152,7 +8149,7 @@ ] } }, - "/api/v1/upgrade/channels/{ChannelID}": { + "/v1/upgrade/channels/{ChannelID}": { "post": { "operationId": "RoutePostUpgradeChannel", "parameters": [ @@ -8181,7 +8178,7 @@ ] } }, - "/api/v1/upgrade/dashboards": { + "/v1/upgrade/dashboards": { "post": { "operationId": "RoutePostUpgradeAllDashboards", "produces": [ @@ -8201,7 +8198,7 @@ ] } }, - "/api/v1/upgrade/dashboards/{DashboardID}": { + "/v1/upgrade/dashboards/{DashboardID}": { "post": { "operationId": "RoutePostUpgradeDashboard", "parameters": [ @@ -8237,7 +8234,7 @@ ] } }, - "/api/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}": { + "/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}": { "post": { "operationId": "RoutePostUpgradeAlert", "parameters": [ @@ -8273,7 +8270,7 @@ ] } }, - "/api/v1/upgrade/org": { + "/v1/upgrade/org": { "delete": { "operationId": "RouteDeleteOrgUpgrade", "produces": [ diff --git a/pkg/services/ngalert/api/tooling/spec.json b/pkg/services/ngalert/api/tooling/spec.json index 907cd4e41ad..8905f106187 100644 --- a/pkg/services/ngalert/api/tooling/spec.json +++ b/pkg/services/ngalert/api/tooling/spec.json @@ -15,9 +15,9 @@ "title": "Grafana Alerting API.", "version": "1.1.0" }, - "basePath": "/api/v1", + "basePath": "/api", "paths": { - "/api/alertmanager/grafana/api/v2/alerts": { + "/alertmanager/grafana/api/v2/alerts": { "get": { "description": "get alertmanager alerts", "tags": [ @@ -78,7 +78,7 @@ } } }, - "/api/alertmanager/grafana/api/v2/alerts/groups": { + "/alertmanager/grafana/api/v2/alerts/groups": { "get": { "description": "get alertmanager alerts", "tags": [ @@ -139,7 +139,7 @@ } } }, - "/api/alertmanager/grafana/api/v2/silence/{SilenceId}": { + "/alertmanager/grafana/api/v2/silence/{SilenceId}": { "get": { "description": "get silence", "tags": [ @@ -199,7 +199,7 @@ } } }, - "/api/alertmanager/grafana/api/v2/silences": { + "/alertmanager/grafana/api/v2/silences": { "get": { "description": "get silences", "tags": [ @@ -262,7 +262,7 @@ } } }, - "/api/alertmanager/grafana/api/v2/status": { + "/alertmanager/grafana/api/v2/status": { "get": { "description": "get alertmanager status and configuration", "tags": [ @@ -285,7 +285,7 @@ } } }, - "/api/alertmanager/grafana/config/api/v1/alerts": { + "/alertmanager/grafana/config/api/v1/alerts": { "get": { "description": "gets an Alerting config", "tags": [ @@ -359,7 +359,7 @@ } } }, - "/api/alertmanager/grafana/config/api/v1/receivers": { + "/alertmanager/grafana/config/api/v1/receivers": { "get": { "description": "Get a list of all receivers", "tags": [ @@ -373,7 +373,7 @@ } } }, - "/api/alertmanager/grafana/config/api/v1/receivers/test": { + "/alertmanager/grafana/config/api/v1/receivers/test": { "post": { "tags": [ "alertmanager" @@ -435,7 +435,7 @@ } } }, - "/api/alertmanager/grafana/config/api/v1/templates/test": { + "/alertmanager/grafana/config/api/v1/templates/test": { "post": { "produces": [ "application/json" @@ -482,7 +482,7 @@ } } }, - "/api/alertmanager/grafana/config/history": { + "/alertmanager/grafana/config/history": { "get": { "description": "gets Alerting configurations that were successfully applied in the past", "tags": [ @@ -505,7 +505,7 @@ } } }, - "/api/alertmanager/grafana/config/history/{id}/_activate": { + "/alertmanager/grafana/config/history/{id}/_activate": { "post": { "description": "revert Alerting configuration to the historical configuration specified by the given id", "tags": [ @@ -544,7 +544,7 @@ } } }, - "/api/alertmanager/{DatasourceUID}/api/v2/alerts": { + "/alertmanager/{DatasourceUID}/api/v2/alerts": { "get": { "description": "get alertmanager alerts", "tags": [ @@ -664,7 +664,7 @@ } } }, - "/api/alertmanager/{DatasourceUID}/api/v2/alerts/groups": { + "/alertmanager/{DatasourceUID}/api/v2/alerts/groups": { "get": { "description": "get alertmanager alerts", "tags": [ @@ -738,7 +738,7 @@ } } }, - "/api/alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId}": { + "/alertmanager/{DatasourceUID}/api/v2/silence/{SilenceId}": { "get": { "description": "get silence", "tags": [ @@ -824,7 +824,7 @@ } } }, - "/api/alertmanager/{DatasourceUID}/api/v2/silences": { + "/alertmanager/{DatasourceUID}/api/v2/silences": { "get": { "description": "get silences", "tags": [ @@ -913,7 +913,7 @@ } } }, - "/api/alertmanager/{DatasourceUID}/api/v2/status": { + "/alertmanager/{DatasourceUID}/api/v2/status": { "get": { "description": "get alertmanager status and configuration", "tags": [ @@ -951,7 +951,7 @@ } } }, - "/api/alertmanager/{DatasourceUID}/config/api/v1/alerts": { + "/alertmanager/{DatasourceUID}/config/api/v1/alerts": { "get": { "description": "gets an Alerting config", "tags": [ @@ -1068,7 +1068,7 @@ } } }, - "/api/prometheus/grafana/api/v1/alerts": { + "/prometheus/grafana/api/v1/alerts": { "get": { "description": "gets the current alerts", "tags": [ @@ -1094,7 +1094,7 @@ } } }, - "/api/prometheus/grafana/api/v1/rules": { + "/prometheus/grafana/api/v1/rules": { "get": { "description": "gets the evaluation statuses of all rules", "tags": [ @@ -1133,7 +1133,7 @@ } } }, - "/api/prometheus/{DatasourceUID}/api/v1/alerts": { + "/prometheus/{DatasourceUID}/api/v1/alerts": { "get": { "description": "gets the current alerts", "tags": [ @@ -1165,7 +1165,7 @@ } } }, - "/api/prometheus/{DatasourceUID}/api/v1/rules": { + "/prometheus/{DatasourceUID}/api/v1/rules": { "get": { "description": "gets the evaluation statuses of all rules", "tags": [ @@ -1197,7 +1197,7 @@ } } }, - "/api/ruler/grafana/api/v1/export/rules": { + "/ruler/grafana/api/v1/export/rules": { "get": { "description": "List rules in provisioning format", "consumes": [ @@ -1264,7 +1264,7 @@ } } }, - "/api/ruler/grafana/api/v1/rules": { + "/ruler/grafana/api/v1/rules": { "get": { "description": "List rule groups", "produces": [ @@ -1303,7 +1303,7 @@ } } }, - "/api/ruler/grafana/api/v1/rules/{Namespace}": { + "/ruler/grafana/api/v1/rules/{Namespace}": { "get": { "description": "Get rule groups by namespace", "produces": [ @@ -1409,7 +1409,7 @@ } } }, - "/api/ruler/grafana/api/v1/rules/{Namespace}/export": { + "/ruler/grafana/api/v1/rules/{Namespace}/export": { "post": { "description": "Converts submitted rule group to provisioning format", "consumes": [ @@ -1469,7 +1469,7 @@ } } }, - "/api/ruler/grafana/api/v1/rules/{Namespace}/{Groupname}": { + "/ruler/grafana/api/v1/rules/{Namespace}/{Groupname}": { "get": { "description": "Get rule group", "produces": [ @@ -1546,7 +1546,7 @@ } } }, - "/api/ruler/{DatasourceUID}/api/v1/rules": { + "/ruler/{DatasourceUID}/api/v1/rules": { "get": { "description": "List rule groups", "produces": [ @@ -1598,7 +1598,7 @@ } } }, - "/api/ruler/{DatasourceUID}/api/v1/rules/{Namespace}": { + "/ruler/{DatasourceUID}/api/v1/rules/{Namespace}": { "get": { "description": "Get rule groups by namespace", "produces": [ @@ -1743,7 +1743,7 @@ } } }, - "/api/ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname}": { + "/ruler/{DatasourceUID}/api/v1/rules/{Namespace}/{Groupname}": { "get": { "description": "Get rule group", "produces": [ @@ -1846,7 +1846,7 @@ } } }, - "/api/v1/eval": { + "/v1/eval": { "post": { "description": "Test rule", "consumes": [ @@ -1878,7 +1878,7 @@ } } }, - "/api/v1/ngalert": { + "/v1/ngalert": { "get": { "description": "Get the status of the alerting engine", "produces": [ @@ -1898,7 +1898,7 @@ } } }, - "/api/v1/ngalert/admin_config": { + "/v1/ngalert/admin_config": { "get": { "produces": [ "application/json" @@ -1987,7 +1987,7 @@ } } }, - "/api/v1/ngalert/alertmanagers": { + "/v1/ngalert/alertmanagers": { "get": { "produces": [ "application/json" @@ -2007,7 +2007,7 @@ } } }, - "/api/v1/provisioning/alert-rules": { + "/v1/provisioning/alert-rules": { "get": { "tags": [ "provisioning", @@ -2064,7 +2064,7 @@ } } }, - "/api/v1/provisioning/alert-rules/export": { + "/v1/provisioning/alert-rules/export": { "get": { "tags": [ "provisioning", @@ -2122,7 +2122,7 @@ } } }, - "/api/v1/provisioning/alert-rules/{UID}": { + "/v1/provisioning/alert-rules/{UID}": { "get": { "tags": [ "provisioning", @@ -2225,7 +2225,7 @@ } } }, - "/api/v1/provisioning/alert-rules/{UID}/export": { + "/v1/provisioning/alert-rules/{UID}/export": { "get": { "produces": [ "application/json", @@ -2274,7 +2274,7 @@ } } }, - "/api/v1/provisioning/contact-points": { + "/v1/provisioning/contact-points": { "get": { "tags": [ "provisioning", @@ -2339,7 +2339,7 @@ } } }, - "/api/v1/provisioning/contact-points/export": { + "/v1/provisioning/contact-points/export": { "get": { "tags": [ "provisioning", @@ -2392,7 +2392,7 @@ } } }, - "/api/v1/provisioning/contact-points/{UID}": { + "/v1/provisioning/contact-points/{UID}": { "put": { "consumes": [ "application/json" @@ -2465,7 +2465,7 @@ } } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { "get": { "tags": [ "provisioning", @@ -2551,7 +2551,7 @@ } } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { "get": { "produces": [ "application/json", @@ -2605,7 +2605,7 @@ } } }, - "/api/v1/provisioning/mute-timings": { + "/v1/provisioning/mute-timings": { "get": { "tags": [ "provisioning", @@ -2662,7 +2662,7 @@ } } }, - "/api/v1/provisioning/mute-timings/export": { + "/v1/provisioning/mute-timings/export": { "get": { "tags": [ "provisioning", @@ -2702,7 +2702,7 @@ } } }, - "/api/v1/provisioning/mute-timings/{name}": { + "/v1/provisioning/mute-timings/{name}": { "get": { "tags": [ "provisioning", @@ -2806,7 +2806,7 @@ } } }, - "/api/v1/provisioning/mute-timings/{name}/export": { + "/v1/provisioning/mute-timings/{name}/export": { "get": { "tags": [ "provisioning", @@ -2853,7 +2853,7 @@ } } }, - "/api/v1/provisioning/policies": { + "/v1/provisioning/policies": { "get": { "tags": [ "provisioning", @@ -2930,7 +2930,7 @@ } } }, - "/api/v1/provisioning/policies/export": { + "/v1/provisioning/policies/export": { "get": { "tags": [ "provisioning", @@ -2954,7 +2954,7 @@ } } }, - "/api/v1/provisioning/templates": { + "/v1/provisioning/templates": { "get": { "tags": [ "provisioning", @@ -2975,7 +2975,7 @@ } } }, - "/api/v1/provisioning/templates/{name}": { + "/v1/provisioning/templates/{name}": { "get": { "tags": [ "provisioning", @@ -3073,7 +3073,7 @@ } } }, - "/api/v1/rule/backtest": { + "/v1/rule/backtest": { "post": { "description": "Test rule", "consumes": [ @@ -3105,7 +3105,7 @@ } } }, - "/api/v1/rule/test/grafana": { + "/v1/rule/test/grafana": { "post": { "description": "Test a rule against Grafana ruler", "consumes": [ @@ -3146,7 +3146,7 @@ } } }, - "/api/v1/rule/test/{DatasourceUID}": { + "/v1/rule/test/{DatasourceUID}": { "post": { "description": "Test a rule against external data source ruler", "consumes": [ @@ -3191,7 +3191,7 @@ } } }, - "/api/v1/rules/history": { + "/v1/rules/history": { "get": { "produces": [ "application/json" @@ -3208,7 +3208,7 @@ } } }, - "/api/v1/upgrade/channels": { + "/v1/upgrade/channels": { "post": { "produces": [ "application/json" @@ -3237,7 +3237,7 @@ } } }, - "/api/v1/upgrade/channels/{ChannelID}": { + "/v1/upgrade/channels/{ChannelID}": { "post": { "produces": [ "application/json" @@ -3266,7 +3266,7 @@ } } }, - "/api/v1/upgrade/dashboards": { + "/v1/upgrade/dashboards": { "post": { "produces": [ "application/json" @@ -3286,7 +3286,7 @@ } } }, - "/api/v1/upgrade/dashboards/{DashboardID}": { + "/v1/upgrade/dashboards/{DashboardID}": { "post": { "produces": [ "application/json" @@ -3322,7 +3322,7 @@ } } }, - "/api/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}": { + "/v1/upgrade/dashboards/{DashboardID}/panels/{PanelID}": { "post": { "produces": [ "application/json" @@ -3358,7 +3358,7 @@ } } }, - "/api/v1/upgrade/org": { + "/v1/upgrade/org": { "get": { "produces": [ "application/json" @@ -7597,9 +7597,8 @@ } }, "URL": { - "description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use the EscapedPath method, which preserves\nthe original encoding of Path.\n\nThe RawPath field is an optional field which is only set when the default\nencoding of Path is different from the escaped path. See the EscapedPath method\nfor more details.\n\nURL's String method uses the EscapedPath method to obtain the path.", "type": "object", - "title": "A URL represents a parsed URL (technically, a URI reference).", + "title": "URL is a custom URL type that allows validation at configuration load time.", "properties": { "ForceQuery": { "type": "boolean" @@ -7839,7 +7838,6 @@ } }, "alertGroup": { - "description": "AlertGroup alert group", "type": "object", "required": [ "alerts", @@ -8027,7 +8025,6 @@ "$ref": "#/definitions/gettableAlert" }, "gettableAlerts": { - "description": "GettableAlerts gettable alerts", "type": "array", "items": { "$ref": "#/definitions/gettableAlert" @@ -8035,6 +8032,7 @@ "$ref": "#/definitions/gettableAlerts" }, "gettableSilence": { + "description": "GettableSilence gettable silence", "type": "object", "required": [ "comment", @@ -8275,7 +8273,6 @@ "$ref": "#/definitions/postableSilence" }, "receiver": { - "description": "Receiver receiver", "type": "object", "required": [ "active", diff --git a/pkg/services/ngalert/api/tooling/swagger-codegen/templates/controller-api.mustache b/pkg/services/ngalert/api/tooling/swagger-codegen/templates/controller-api.mustache index b19a78ac650..f9902d265c7 100644 --- a/pkg/services/ngalert/api/tooling/swagger-codegen/templates/controller-api.mustache +++ b/pkg/services/ngalert/api/tooling/swagger-codegen/templates/controller-api.mustache @@ -36,13 +36,13 @@ func (f *{{classname}}Handler) {{nickname}}(ctx *contextmodel.ReqContext) respon func (api *API) Register{{classname}}Endpoints(srv {{classname}}, m *metrics.API) { api.RouteRegister.Group("", func(group routing.RouteRegister){ {{#operations}}{{#operation}} group.{{httpMethod}}( - toMacaronPath("{{{path}}}"), + toMacaronPath("/api{{{path}}}"), requestmeta.SetOwner(requestmeta.TeamAlerting), requestmeta.SetSLOGroup(requestmeta.SLOGroupHighSlow), - api.authorize(http.Method{{httpMethod}}, "{{{path}}}"), + api.authorize(http.Method{{httpMethod}}, "/api{{{path}}}"), metrics.Instrument( http.Method{{httpMethod}}, - "{{{path}}}", + "/api{{{path}}}", api.Hooks.Wrap(srv.{{nickname}}), m, ), diff --git a/public/api-enterprise-spec.json b/public/api-enterprise-spec.json index d5298a1bb02..3a1788e437e 100644 --- a/public/api-enterprise-spec.json +++ b/public/api-enterprise-spec.json @@ -4034,6 +4034,32 @@ } } }, + "DeviceSearchHitDTO": { + "type": "object", + "properties": { + "clientIp": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "deviceId": { + "type": "string" + }, + "lastSeenAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "userAgent": { + "type": "string" + } + } + }, "DsAccess": { "type": "string" }, @@ -6553,6 +6579,29 @@ } } }, + "SearchDeviceQueryResult": { + "type": "object", + "properties": { + "devices": { + "type": "array", + "items": { + "$ref": "#/definitions/DeviceSearchHitDTO" + } + }, + "page": { + "type": "integer", + "format": "int64" + }, + "perPage": { + "type": "integer", + "format": "int64" + }, + "totalCount": { + "type": "integer", + "format": "int64" + } + } + }, "SearchOrgServiceAccountsResult": { "description": "swagger: model", "type": "object", @@ -8523,6 +8572,12 @@ } } }, + "devicesSearchResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SearchDeviceQueryResult" + } + }, "folderResponse": { "description": "", "schema": { diff --git a/public/api-merged.json b/public/api-merged.json index c33da12a343..80265386248 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -2800,1062 +2800,993 @@ } } }, - "/api/v1/provisioning/alert-rules": { + "/auth/keys": { "get": { + "description": "Will return auth keys.\n\nDeprecated: true.\n\nDeprecated. Please use GET /api/serviceaccounts and GET /api/serviceaccounts/{id}/tokens instead\nsee https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", "tags": [ - "provisioning" + "api_keys" + ], + "summary": "Get auth keys.", + "operationId": "getAPIkeys", + "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Show expired keys", + "name": "includeExpired", + "in": "query" + } ], - "summary": "Get all the alert rules.", - "operationId": "RouteGetAlertRules", "responses": { "200": { - "description": "ProvisionedAlertRules", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRules" - } + "$ref": "#/responses/getAPIkeyResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "post": { - "consumes": [ - "application/json" - ], + "description": "Will return details of the created API key.", "tags": [ - "provisioning" + "api_keys" ], - "summary": "Create a new alert rule.", - "operationId": "RoutePostAlertRule", + "summary": "Creates an API key.", + "operationId": "addAPIkey", + "deprecated": true, "parameters": [ { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" + "$ref": "#/definitions/AddAPIKeyCommand" } - }, - { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" } ], "responses": { - "201": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "200": { + "$ref": "#/responses/postAPIkeyResponse" }, "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/alert-rules/export": { - "get": { + "/auth/keys/{id}": { + "delete": { + "description": "Deletes an API key.\nDeprecated. See: https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", "tags": [ - "provisioning" + "api_keys" ], - "summary": "Export all alert rules in provisioning file format.", - "operationId": "RouteGetAlertRulesExport", + "summary": "Delete API key.", + "operationId": "deleteAPIkey", + "deprecated": true, "parameters": [ { - "type": "boolean", - "default": false, - "description": "Whether to initiate a download of the file or not.", - "name": "download", - "in": "query" - }, - { - "type": "string", - "default": "yaml", - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "name": "format", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "description": "UIDs of folders from which to export rules", - "name": "folderUid", - "in": "query" - }, - { - "type": "string", - "description": "Name of group of rules to export. Must be specified only together with a single folder UID", - "name": "group", - "in": "query" - }, - { - "type": "string", - "description": "UID of alert rule to export. If specified, parameters folderUid and group must be empty.", - "name": "ruleUid", - "in": "query" + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "description": "AlertingFileExport", - "schema": { - "$ref": "#/definitions/AlertingFileExport" - } + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/alert-rules/{UID}": { + "/dashboard/snapshots": { "get": { "tags": [ - "provisioning" + "snapshots" ], - "summary": "Get a specific alert rule by UID.", - "operationId": "RouteGetAlertRule", + "summary": "List snapshots.", + "operationId": "searchDashboardSnapshots", "parameters": [ { "type": "string", - "description": "Alert rule UID", - "name": "UID", - "in": "path", - "required": true + "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": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "$ref": "#/responses/searchDashboardSnapshotsResponse" }, - "404": { - "description": " Not found." + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "put": { - "consumes": [ - "application/json" + } + }, + "/dashboards/calculate-diff": { + "post": { + "produces": [ + "application/json", + "text/html" ], "tags": [ - "provisioning" + "dashboards" ], - "summary": "Update an existing alert rule.", - "operationId": "RoutePutAlertRule", + "summary": "Perform diff on two dashboards.", + "operationId": "calculateDashboardDiff", "parameters": [ - { - "type": "string", - "description": "Alert rule UID", - "name": "UID", - "in": "path", - "required": true - }, { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" + "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" + } + } } - }, - { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" } ], "responses": { "200": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "$ref": "#/responses/calculateDashboardDiffResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "delete": { + } + }, + "/dashboards/db": { + "post": { + "description": "Creates a new dashboard or updates an existing dashboard.", "tags": [ - "provisioning" + "dashboards" ], - "summary": "Delete a specific alert rule by UID.", - "operationId": "RouteDeleteAlertRule", + "summary": "Create / Update dashboard", + "operationId": "postDashboard", "parameters": [ { - "type": "string", - "description": "Alert rule UID", - "name": "UID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SaveDashboardCommand" + } } ], "responses": { - "204": { - "description": " The alert rule was deleted successfully." + "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" } } } }, - "/api/v1/provisioning/alert-rules/{UID}/export": { + "/dashboards/home": { "get": { - "produces": [ - "application/json", - "application/yaml", - "text/yaml" - ], "tags": [ - "provisioning" - ], - "summary": "Export an alert rule in provisioning file format.", - "operationId": "RouteGetAlertRuleExport", - "parameters": [ - { - "type": "boolean", - "default": false, - "description": "Whether to initiate a download of the file or not.", - "name": "download", - "in": "query" - }, - { - "type": "string", - "default": "yaml", - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "name": "format", - "in": "query" - }, - { - "type": "string", - "description": "Alert rule UID", - "name": "UID", - "in": "path", - "required": true - } + "dashboards" ], + "summary": "Get home dashboard.", + "operationId": "getHomeDashboard", "responses": { "200": { - "description": "AlertingFileExport", - "schema": { - "$ref": "#/definitions/AlertingFileExport" - } + "$ref": "#/responses/getHomeDashboardResponse" }, - "404": { - "description": " Not found." + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/contact-points": { + "/dashboards/id/{DashboardID}/permissions": { "get": { + "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsListByUID) instead", "tags": [ - "provisioning" + "dashboard_permissions" ], - "summary": "Get all the contact points.", - "operationId": "RouteGetContactpoints", + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissionsListByID", + "deprecated": true, "parameters": [ { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" + "type": "integer", + "format": "int64", + "name": "DashboardID", + "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": "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": [ - "provisioning" + "dashboard_permissions" ], - "summary": "Create a contact point.", - "operationId": "RoutePostContactpoints", + "summary": "Updates permissions for a dashboard.", + "operationId": "updateDashboardPermissionsByID", + "deprecated": true, "parameters": [ { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" + "$ref": "#/definitions/UpdateDashboardACLCommand" } }, { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true } ], "responses": { - "202": { - "description": "EmbeddedContactPoint", - "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" - } + "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" } } } }, - "/api/v1/provisioning/contact-points/export": { - "get": { + "/dashboards/id/{DashboardID}/restore": { + "post": { + "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Export all contact points in provisioning file format.", - "operationId": "RouteGetContactpointsExport", + "summary": "Restore a dashboard to a given dashboard version.", + "operationId": "restoreDashboardVersionByID", + "deprecated": true, "parameters": [ { - "type": "boolean", - "default": false, - "description": "Whether to initiate a download of the file or not.", - "name": "download", - "in": "query" - }, - { - "type": "string", - "default": "yaml", - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "name": "format", - "in": "query" - }, - { - "type": "boolean", - "default": false, - "description": "Whether any contained secure settings should be decrypted or left redacted. Redacted settings will contain RedactedValue instead. Currently, only org admin can view decrypted secure settings.", - "name": "decrypt", - "in": "query" + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RestoreDashboardVersionCommand" + } }, { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true } ], "responses": { "200": { - "description": "AlertingFileExport", - "schema": { - "$ref": "#/definitions/AlertingFileExport" - } + "$ref": "#/responses/postDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, "403": { - "description": "PermissionDenied", - "schema": { - "$ref": "#/definitions/PermissionDenied" - } + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/contact-points/{UID}": { - "put": { - "consumes": [ - "application/json" - ], + "/dashboards/id/{DashboardID}/versions": { + "get": { + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Update an existing contact point.", - "operationId": "RoutePutContactpoint", + "summary": "Gets all existing versions for the dashboard.", + "operationId": "getDashboardVersionsByID", + "deprecated": true, "parameters": [ { - "type": "string", - "description": "UID is the contact point unique identifier", - "name": "UID", + "type": "integer", + "format": "int64", + "name": "DashboardID", "in": "path", "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionsResponse" }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" - } + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" - } - ], - "responses": { - "202": { - "description": "Ack", - "schema": { - "$ref": "#/definitions/Ack" - } + "403": { + "$ref": "#/responses/forbiddenError" }, - "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": { - "202": { - "description": " The contact point was deleted successfully." + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { "get": { + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Get a rule group.", - "operationId": "RouteGetAlertRuleGroup", + "summary": "Get a specific dashboard version.", + "operationId": "getDashboardVersionByID", + "deprecated": true, "parameters": [ { - "type": "string", - "name": "FolderUID", + "type": "integer", + "format": "int64", + "name": "DashboardID", "in": "path", "required": true }, { - "type": "string", - "name": "Group", + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", "in": "path", "required": true } ], "responses": { "200": { - "description": "AlertRuleGroup", - "schema": { - "$ref": "#/definitions/AlertRuleGroup" - } + "$ref": "#/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "put": { - "consumes": [ - "application/json" - ], + } + }, + "/dashboards/import": { + "post": { "tags": [ - "provisioning" + "dashboards" ], - "summary": "Update the interval of a rule group.", - "operationId": "RoutePutAlertRuleGroup", + "summary": "Import dashboard.", + "operationId": "importDashboard", "parameters": [ - { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" - }, - { - "type": "string", - "name": "FolderUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "Group", - "in": "path", - "required": true - }, { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/AlertRuleGroup" + "$ref": "#/definitions/ImportDashboardRequest" } } ], "responses": { "200": { - "description": "AlertRuleGroup", - "schema": { - "$ref": "#/definitions/AlertRuleGroup" - } + "$ref": "#/responses/importDashboardResponse" }, "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { + "/dashboards/public-dashboards": { "get": { - "produces": [ - "application/json", - "application/yaml", - "text/yaml" - ], + "description": "Get list of public dashboards", "tags": [ - "provisioning" + "dashboard_public" ], - "summary": "Export an alert rule group in provisioning file format.", - "operationId": "RouteGetAlertRuleGroupExport", - "parameters": [ - { - "type": "boolean", - "default": false, - "description": "Whether to initiate a download of the file or not.", - "name": "download", - "in": "query" + "operationId": "listPublicDashboards", + "responses": { + "200": { + "$ref": "#/responses/listPublicDashboardsResponse" }, - { - "type": "string", - "default": "yaml", - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "name": "format", - "in": "query" + "401": { + "$ref": "#/responses/unauthorisedPublicError" }, - { - "type": "string", - "name": "FolderUID", - "in": "path", - "required": true + "403": { + "$ref": "#/responses/forbiddenPublicError" }, - { - "type": "string", - "name": "Group", - "in": "path", - "required": true + "500": { + "$ref": "#/responses/internalServerPublicError" } + } + } + }, + "/dashboards/tags": { + "get": { + "tags": [ + "dashboards" ], + "summary": "Get all dashboards tags of an organisation.", + "operationId": "getDashboardTags", "responses": { "200": { - "description": "AlertingFileExport", - "schema": { - "$ref": "#/definitions/AlertingFileExport" - } + "$ref": "#/responses/getDashboardsTagsResponse" }, - "404": { - "description": " Not found." + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/mute-timings": { + "/dashboards/uid/{dashboardUid}/public-dashboards": { "get": { + "description": "Get public dashboard by dashboardUid", "tags": [ - "provisioning" + "dashboard_public" + ], + "operationId": "getPublicDashboard", + "parameters": [ + { + "type": "string", + "name": "dashboardUid", + "in": "path", + "required": true + } ], - "summary": "Get all the mute timings.", - "operationId": "RouteGetMuteTimings", "responses": { "200": { - "description": "MuteTimings", - "schema": { - "$ref": "#/definitions/MuteTimings" - } + "$ref": "#/responses/getPublicDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/responses/forbiddenPublicError" + }, + "404": { + "$ref": "#/responses/notFoundPublicError" + }, + "500": { + "$ref": "#/responses/internalServerPublicError" } } }, "post": { - "consumes": [ + "description": "Create public dashboard for a dashboard", + "produces": [ "application/json" ], "tags": [ - "provisioning" + "dashboard_public" ], - "summary": "Create a new mute timing.", - "operationId": "RoutePostMuteTiming", + "operationId": "createPublicDashboard", "parameters": [ - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } - }, { "type": "string", - "name": "X-Disable-Provenance", - "in": "header" - } - ], - "responses": { - "201": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "name": "dashboardUid", + "in": "path", + "required": true }, - "400": { - "description": "ValidationError", + { + "name": "Body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/ValidationError" + "$ref": "#/definitions/PublicDashboardDTO" } } - } - } - }, - "/api/v1/provisioning/mute-timings/export": { - "get": { - "tags": [ - "provisioning" - ], - "summary": "Export all mute timings in provisioning format.", - "operationId": "RouteExportMuteTimings", - "parameters": [ - { - "type": "boolean", - "default": false, - "description": "Whether to initiate a download of the file or not.", - "name": "download", - "in": "query" - }, - { - "type": "string", - "default": "yaml", - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "name": "format", - "in": "query" - } ], "responses": { "200": { - "description": "AlertingFileExport", - "schema": { - "$ref": "#/definitions/AlertingFileExport" - } + "$ref": "#/responses/createPublicDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/responses/unauthorisedPublicError" }, "403": { - "description": "PermissionDenied", - "schema": { - "$ref": "#/definitions/PermissionDenied" - } + "$ref": "#/responses/forbiddenPublicError" + }, + "500": { + "$ref": "#/responses/internalServerPublicError" } } } }, - "/api/v1/provisioning/mute-timings/{name}": { - "get": { + "/dashboards/uid/{dashboardUid}/public-dashboards/{uid}": { + "delete": { + "description": "Delete public dashboard for a dashboard", "tags": [ - "provisioning" + "dashboard_public" ], - "summary": "Get a mute timing.", - "operationId": "RouteGetMuteTiming", + "operationId": "deletePublicDashboard", "parameters": [ { "type": "string", - "description": "Mute timing name", - "name": "name", + "name": "dashboardUid", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "$ref": "#/responses/okResponse" }, - "404": { - "description": " Not found." + "400": { + "$ref": "#/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/responses/forbiddenPublicError" + }, + "500": { + "$ref": "#/responses/internalServerPublicError" } } }, - "put": { - "consumes": [ + "patch": { + "description": "Update public dashboard for a dashboard", + "produces": [ "application/json" ], "tags": [ - "provisioning" + "dashboard_public" ], - "summary": "Replace an existing mute timing.", - "operationId": "RoutePutMuteTiming", + "operationId": "updatePublicDashboard", "parameters": [ { "type": "string", - "description": "Mute timing name", - "name": "name", + "name": "dashboardUid", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", "in": "path", "required": true }, { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/MuteTimeInterval" + "$ref": "#/definitions/PublicDashboardDTO" } - }, - { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" } ], "responses": { - "202": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "200": { + "$ref": "#/responses/updatePublicDashboardResponse" }, "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "$ref": "#/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/responses/forbiddenPublicError" + }, + "500": { + "$ref": "#/responses/internalServerPublicError" } } - }, - "delete": { + } + }, + "/dashboards/uid/{uid}": { + "get": { + "description": "Will return the dashboard given the dashboard unique identifier (uid).", "tags": [ - "provisioning" + "dashboards" ], - "summary": "Delete a mute timing.", - "operationId": "RouteDeleteMuteTiming", + "summary": "Get dashboard by uid.", + "operationId": "getDashboardByUID", "parameters": [ { "type": "string", - "description": "Mute timing name", - "name": "name", + "name": "uid", "in": "path", "required": true } ], "responses": { - "204": { - "description": " The mute timing was deleted successfully." + "200": { + "$ref": "#/responses/dashboardResponse" }, - "409": { - "description": "GenericPublicError", - "schema": { - "$ref": "#/definitions/GenericPublicError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - } - }, - "/api/v1/provisioning/mute-timings/{name}/export": { - "get": { + }, + "delete": { + "description": "Will delete the dashboard given the specified unique identifier (uid).", "tags": [ - "provisioning" + "dashboards" ], - "summary": "Export a mute timing in provisioning format.", - "operationId": "RouteExportMuteTiming", + "summary": "Delete dashboard by uid.", + "operationId": "deleteDashboardByUID", "parameters": [ - { - "type": "boolean", - "default": false, - "description": "Whether to initiate a download of the file or not.", - "name": "download", - "in": "query" - }, { "type": "string", - "default": "yaml", - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "name": "format", - "in": "query" - }, - { - "type": "string", - "description": "Mute timing name", - "name": "name", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "AlertingFileExport", - "schema": { - "$ref": "#/definitions/AlertingFileExport" - } + "$ref": "#/responses/deleteDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, "403": { - "description": "PermissionDenied", - "schema": { - "$ref": "#/definitions/PermissionDenied" - } + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/policies": { + "/dashboards/uid/{uid}/permissions": { "get": { "tags": [ - "provisioning" + "dashboard_permissions" + ], + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissionsListByUID", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } ], - "summary": "Get the notification policy tree.", - "operationId": "RouteGetPolicyTree", "responses": { "200": { - "description": "Route", - "schema": { - "$ref": "#/definitions/Route" - } + "$ref": "#/responses/getDashboardPermissionsListResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, - "put": { - "consumes": [ - "application/json" - ], + "post": { + "description": "This operation will remove existing permissions if they’re not included in the request.", "tags": [ - "provisioning" + "dashboard_permissions" ], - "summary": "Sets the notification policy tree.", - "operationId": "RoutePutPolicyTree", + "summary": "Updates permissions for a dashboard.", + "operationId": "updateDashboardPermissionsByUID", "parameters": [ { - "description": "The new notification routing tree to use", "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/Route" + "$ref": "#/definitions/UpdateDashboardACLCommand" } }, { "type": "string", - "name": "X-Disable-Provenance", - "in": "header" + "name": "uid", + "in": "path", + "required": true } ], "responses": { - "202": { - "description": "Ack", - "schema": { - "$ref": "#/definitions/Ack" - } + "200": { + "$ref": "#/responses/okResponse" }, "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/policies/export": { - "get": { - "tags": [ - "provisioning" - ], - "summary": "Export the notification policy tree in provisioning file format.", - "operationId": "RouteGetPolicyTreeExport", - "responses": { - "200": { - "description": "AlertingFileExport", - "schema": { - "$ref": "#/definitions/AlertingFileExport" - } + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": "NotFound", - "schema": { - "$ref": "#/definitions/NotFound" - } + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/api/v1/provisioning/templates": { - "get": { + "/dashboards/uid/{uid}/restore": { + "post": { "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Get all notification templates.", - "operationId": "RouteGetTemplates", - "responses": { - "200": { - "description": "NotificationTemplates", + "summary": "Restore a dashboard to a given dashboard version using UID.", + "operationId": "restoreDashboardVersionByUID", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/NotificationTemplates" + "$ref": "#/definitions/RestoreDashboardVersionCommand" } }, - "404": { - "description": " Not found." - } - } - } - }, - "/api/v1/provisioning/templates/{name}": { - "get": { - "tags": [ - "provisioning" - ], - "summary": "Get a notification template.", - "operationId": "RouteGetTemplate", - "parameters": [ { "type": "string", - "description": "Template Name", - "name": "name", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "NotificationTemplate", - "schema": { - "$ref": "#/definitions/NotificationTemplate" - } + "$ref": "#/responses/postDashboardResponse" + }, + "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": { + "get": { "tags": [ - "provisioning" + "dashboard_versions" ], - "summary": "Updates an existing notification template.", - "operationId": "RoutePutTemplate", + "summary": "Gets all existing versions for the dashboard using UID.", + "operationId": "getDashboardVersionsByUID", "parameters": [ { "type": "string", - "description": "Template Name", - "name": "name", + "name": "uid", "in": "path", "required": true }, { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/NotificationTemplateContent" - } + "type": "integer", + "format": "int64", + "default": 0, + "description": "Maximum number of results to return", + "name": "limit", + "in": "query" }, { - "type": "string", - "name": "X-Disable-Provenance", - "in": "header" + "type": "integer", + "format": "int64", + "default": 0, + "description": "Version to start from when returning queries", + "name": "start", + "in": "query" } ], "responses": { - "202": { - "description": "NotificationTemplate", - "schema": { - "$ref": "#/definitions/NotificationTemplate" - } + "200": { + "$ref": "#/responses/dashboardVersionsResponse" }, - "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." + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/auth/keys": { + "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { "get": { - "description": "Will return auth keys.\n\nDeprecated: true.\n\nDeprecated. Please use GET /api/serviceaccounts and GET /api/serviceaccounts/{id}/tokens instead\nsee https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", "tags": [ - "api_keys" + "dashboard_versions" ], - "summary": "Get auth keys.", - "operationId": "getAPIkeys", + "summary": "Get a specific dashboard version using UID.", + "operationId": "getDashboardVersionByUID", "parameters": [ { - "type": "boolean", - "default": false, - "description": "Show expired keys", - "name": "includeExpired", - "in": "query" + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAPIkeyResponse" + "$ref": "#/responses/dashboardVersionResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3870,31 +3801,19 @@ "$ref": "#/responses/internalServerError" } } - }, - "post": { - "description": "Will return details of the created API key.", + } + }, + "/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": [ - "api_keys" - ], - "summary": "Creates an API key.", - "operationId": "addAPIkey", - "deprecated": true, - "parameters": [ - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddAPIKeyCommand" - } - } + "datasources" ], + "summary": "Get all data sources.", + "operationId": "getDataSources", "responses": { "200": { - "$ref": "#/responses/postAPIkeyResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getDataSourcesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3902,36 +3821,31 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/auth/keys/{id}": { - "delete": { - "description": "Deletes an API key.\nDeprecated. See: https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", + }, + "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": [ - "api_keys" + "datasources" ], - "summary": "Delete API key.", - "operationId": "deleteAPIkey", - "deprecated": true, + "summary": "Create a data source.", + "operationId": "addDataSource", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "id", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddDataSourceCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3939,8 +3853,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -3948,85 +3862,51 @@ } } }, - "/dashboard/snapshots": { + "/datasources/correlations": { "get": { "tags": [ - "snapshots" + "correlations" ], - "summary": "List snapshots.", - "operationId": "searchDashboardSnapshots", + "summary": "Gets all correlations.", + "operationId": "getCorrelations", "parameters": [ { - "type": "string", - "description": "Search Query", - "name": "query", + "maximum": 1000, + "type": "integer", + "format": "int64", + "default": 100, + "description": "Limit the maximum number of correlations to return per page", + "name": "limit", "in": "query" }, { "type": "integer", "format": "int64", - "default": 1000, - "description": "Limit the number of returned results", - "name": "limit", + "default": 1, + "description": "Page index for starting fetching correlations", + "name": "page", "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" - } - } - } + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "Source datasource UID filter to be applied to correlations", + "name": "sourceUID", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/calculateDashboardDiffResponse" + "$ref": "#/responses/getCorrelationsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4034,30 +3914,25 @@ } } }, - "/dashboards/db": { - "post": { - "description": "Creates a new dashboard or updates an existing dashboard.", + "/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": [ - "dashboards" + "datasources" ], - "summary": "Create / Update dashboard", - "operationId": "postDashboard", + "summary": "Get data source Id by Name.", + "operationId": "getDataSourceIdByName", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SaveDashboardCommand" - } + "type": "string", + "name": "name", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getDataSourceIDResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4068,59 +3943,61 @@ "404": { "$ref": "#/responses/notFoundError" }, - "412": { - "$ref": "#/responses/preconditionFailedError" - }, - "422": { - "$ref": "#/responses/unprocessableEntityError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/home": { + "/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": [ - "dashboards" + "datasources" + ], + "summary": "Get a single data source by Name.", + "operationId": "getDataSourceByName", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } ], - "summary": "Get home dashboard.", - "operationId": "getHomeDashboard", "responses": { "200": { - "$ref": "#/responses/getHomeDashboardResponse" + "$ref": "#/responses/getDataSourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/id/{DashboardID}/permissions": { - "get": { - "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsListByUID) instead", + }, + "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": [ - "dashboard_permissions" + "datasources" ], - "summary": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissionsListByID", - "deprecated": true, + "summary": "Delete an existing data source by name.", + "operationId": "deleteDataSourceByName", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsListResponse" + "$ref": "#/responses/deleteDataSourceByNameResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4135,35 +4012,33 @@ "$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.", + } + }, + "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "get": { + "description": "Proxies all calls to the actual data source.", "tags": [ - "dashboard_permissions" + "datasources" ], - "summary": "Updates permissions for a dashboard.", - "operationId": "updateDashboardPermissionsByID", - "deprecated": true, + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETByUIDcalls", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" - } + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true }, { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "description": "(empty)" }, "400": { "$ref": "#/responses/badRequestError" @@ -4181,37 +4056,43 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/id/{DashboardID}/restore": { + }, "post": { - "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", + "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": [ - "dashboard_versions" + "datasources" ], - "summary": "Restore a dashboard to a given dashboard version.", - "operationId": "restoreDashboardVersionByID", - "deprecated": true, + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTByUIDcalls", "parameters": [ { - "name": "Body", + "name": "DatasourceProxyParam", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/RestoreDashboardVersionCommand" - } + "schema": {} }, { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/postDashboardResponse" + "201": { + "description": "(empty)" + }, + "202": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4226,29 +4107,34 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/id/{DashboardID}/versions": { - "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", + }, + "delete": { + "description": "Proxies all calls to the actual data source.", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Gets all existing versions for the dashboard.", - "operationId": "getDashboardVersionsByID", - "deprecated": true, + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEByUIDcalls", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "uid", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/dashboardVersionsResponse" + "202": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4265,34 +4151,35 @@ } } }, - "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + "/datasources/proxy/{id}/{datasource_proxy_route}": { "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Get a specific dashboard version.", - "operationId": "getDashboardVersionByID", + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETcalls", "deprecated": true, "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": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4307,28 +4194,41 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/import": { + }, "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": [ - "dashboards" + "datasources" ], - "summary": "Import dashboard.", - "operationId": "importDashboard", + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTcalls", + "deprecated": true, "parameters": [ { - "name": "Body", + "name": "DatasourceProxyParam", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/ImportDashboardRequest" - } + "schema": {} + }, + { + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "id", + "in": "path", + "required": true } ], "responses": { - "200": { - "$ref": "#/responses/importDashboardResponse" + "201": { + "description": "(empty)" + }, + "202": { + "description": "(empty)" }, "400": { "$ref": "#/responses/badRequestError" @@ -4336,249 +4236,204 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "412": { - "$ref": "#/responses/preconditionFailedError" + "403": { + "$ref": "#/responses/forbiddenError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/public-dashboards": { - "get": { - "description": "Get list of public dashboards", + }, + "delete": { + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", "tags": [ - "dashboard_public" + "datasources" ], - "operationId": "listPublicDashboards", - "responses": { - "200": { - "$ref": "#/responses/listPublicDashboardsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedPublicError" - }, - "403": { - "$ref": "#/responses/forbiddenPublicError" + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEcalls", + "deprecated": true, + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true }, - "500": { - "$ref": "#/responses/internalServerPublicError" + { + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true } - } - } - }, - "/dashboards/tags": { - "get": { - "tags": [ - "dashboards" ], - "summary": "Get all dashboards tags of an organisation.", - "operationId": "getDashboardTags", "responses": { - "200": { - "$ref": "#/responses/getDashboardsTagsResponse" + "202": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{dashboardUid}/public-dashboards": { + "/datasources/uid/{sourceUID}/correlations": { "get": { - "description": "Get public dashboard by dashboardUid", "tags": [ - "dashboard_public" + "correlations" ], - "operationId": "getPublicDashboard", + "summary": "Gets all correlations originating from the given data source.", + "operationId": "getCorrelationsBySourceUID", "parameters": [ { "type": "string", - "name": "dashboardUid", + "name": "sourceUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getPublicDashboardResponse" - }, - "400": { - "$ref": "#/responses/badRequestPublicError" + "$ref": "#/responses/getCorrelationsBySourceUIDResponse" }, "401": { - "$ref": "#/responses/unauthorisedPublicError" - }, - "403": { - "$ref": "#/responses/forbiddenPublicError" + "$ref": "#/responses/unauthorisedError" }, "404": { - "$ref": "#/responses/notFoundPublicError" + "$ref": "#/responses/notFoundError" }, "500": { - "$ref": "#/responses/internalServerPublicError" + "$ref": "#/responses/internalServerError" } } }, "post": { - "description": "Create public dashboard for a dashboard", - "produces": [ - "application/json" - ], "tags": [ - "dashboard_public" + "correlations" ], - "operationId": "createPublicDashboard", + "summary": "Add correlation.", + "operationId": "createCorrelation", "parameters": [ { - "type": "string", - "name": "dashboardUid", - "in": "path", - "required": true - }, - { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PublicDashboardDTO" + "$ref": "#/definitions/CreateCorrelationCommand" } + }, + { + "type": "string", + "name": "sourceUID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/createPublicDashboardResponse" + "$ref": "#/responses/createCorrelationResponse" }, "400": { - "$ref": "#/responses/badRequestPublicError" + "$ref": "#/responses/badRequestError" }, "401": { - "$ref": "#/responses/unauthorisedPublicError" + "$ref": "#/responses/unauthorisedError" }, "403": { - "$ref": "#/responses/forbiddenPublicError" + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" }, "500": { - "$ref": "#/responses/internalServerPublicError" + "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{dashboardUid}/public-dashboards/{uid}": { - "delete": { - "description": "Delete public dashboard for a dashboard", + "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "get": { "tags": [ - "dashboard_public" + "correlations" ], - "operationId": "deletePublicDashboard", + "summary": "Gets a correlation.", + "operationId": "getCorrelation", "parameters": [ { "type": "string", - "name": "dashboardUid", + "name": "sourceUID", "in": "path", "required": true }, { "type": "string", - "name": "uid", + "name": "correlationUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestPublicError" + "$ref": "#/responses/getCorrelationResponse" }, "401": { - "$ref": "#/responses/unauthorisedPublicError" + "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenPublicError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { - "$ref": "#/responses/internalServerPublicError" + "$ref": "#/responses/internalServerError" } } }, "patch": { - "description": "Update public dashboard for a dashboard", - "produces": [ - "application/json" - ], "tags": [ - "dashboard_public" + "correlations" ], - "operationId": "updatePublicDashboard", + "summary": "Updates a correlation.", + "operationId": "updateCorrelation", "parameters": [ { "type": "string", - "name": "dashboardUid", + "name": "sourceUID", "in": "path", "required": true }, { "type": "string", - "name": "uid", + "name": "correlationUID", "in": "path", "required": true }, { - "name": "Body", + "name": "body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/PublicDashboardDTO" + "$ref": "#/definitions/UpdateCorrelationCommand" } } ], "responses": { "200": { - "$ref": "#/responses/updatePublicDashboardResponse" + "$ref": "#/responses/updateCorrelationResponse" }, "400": { - "$ref": "#/responses/badRequestPublicError" - }, - "401": { - "$ref": "#/responses/unauthorisedPublicError" - }, - "403": { - "$ref": "#/responses/forbiddenPublicError" - }, - "500": { - "$ref": "#/responses/internalServerPublicError" - } - } - } - }, - "/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" + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4593,14 +4448,16 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Will delete the dashboard given the specified unique identifier (uid).", + } + }, + "/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).", "tags": [ - "dashboards" + "datasources" ], - "summary": "Delete dashboard by uid.", - "operationId": "deleteDashboardByUID", + "summary": "Get a single data source by UID.", + "operationId": "getDataSourceByUID", "parameters": [ { "type": "string", @@ -4611,7 +4468,10 @@ ], "responses": { "200": { - "$ref": "#/responses/deleteDashboardResponse" + "$ref": "#/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4626,16 +4486,23 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/dashboards/uid/{uid}/permissions": { - "get": { + }, + "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": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissionsListByUID", + "summary": "Update an existing data source.", + "operationId": "updateDataSourceByUID", "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDataSourceCommand" + } + }, { "type": "string", "name": "uid", @@ -4645,7 +4512,7 @@ ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsListResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4653,30 +4520,19 @@ "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.", + "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": [ - "dashboard_permissions" + "datasources" ], - "summary": "Updates permissions for a dashboard.", - "operationId": "updateDashboardPermissionsByUID", + "summary": "Delete an existing data source by UID.", + "operationId": "deleteDataSourceByUID", "parameters": [ - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" - } - }, { "type": "string", "name": "uid", @@ -4688,9 +4544,6 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -4706,32 +4559,30 @@ } } }, - "/dashboards/uid/{uid}/restore": { - "post": { + "/datasources/uid/{uid}/correlations/{correlationUID}": { + "delete": { "tags": [ - "dashboard_versions" + "correlations" ], - "summary": "Restore a dashboard to a given dashboard version using UID.", - "operationId": "restoreDashboardVersionByUID", + "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": "string", - "name": "uid", + "name": "correlationUID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" + "$ref": "#/responses/deleteCorrelationResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4748,40 +4599,27 @@ } } }, - "/dashboards/uid/{uid}/versions": { + "/datasources/uid/{uid}/health": { "get": { "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 UID.", + "operationId": "checkDatasourceHealthWithUID", "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" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4789,27 +4627,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { + "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { "get": { "tags": [ - "dashboard_versions" + "datasources" ], - "summary": "Get a specific dashboard version using UID.", - "operationId": "getDashboardVersionByUID", + "summary": "Fetch data source resources.", + "operationId": "callDatasourceResourceWithUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardVersionID", + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true }, @@ -4822,7 +4656,10 @@ ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4839,17 +4676,29 @@ } } }, - "/datasources": { + "/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 scope: `datasources:*`.", + "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 all data sources.", - "operationId": "getDataSources", + "summary": "Get a single data source by Id.", + "operationId": "getDataSourceByID", + "deprecated": true, + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getDataSourcesResponse" + "$ref": "#/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4857,26 +4706,36 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "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`", + "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" ], - "summary": "Create a data source.", - "operationId": "addDataSource", + "summary": "Update an existing data source by its sequential ID.", + "operationId": "updateDataSourceByID", + "deprecated": true, "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddDataSourceCommand" + "$ref": "#/definitions/UpdateDataSourceCommand" } + }, + { + "type": "string", + "name": "id", + "in": "path", + "required": true } ], "responses": { @@ -4889,58 +4748,37 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/correlations": { - "get": { + }, + "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": [ - "correlations" + "datasources" ], - "summary": "Gets all correlations.", - "operationId": "getCorrelations", + "summary": "Delete an existing data source by id.", + "operationId": "deleteDataSourceByID", + "deprecated": true, "parameters": [ { - "maximum": 1000, - "type": "integer", - "format": "int64", - "default": 100, - "description": "Limit the maximum number of correlations to return per page", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 1, - "description": "Page index for starting fetching correlations", - "name": "page", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "Source datasource UID filter to be applied to correlations", - "name": "sourceUID", - "in": "query" + "type": "string", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getCorrelationsResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "404": { "$ref": "#/responses/notFoundError" }, @@ -4950,25 +4788,29 @@ } } }, - "/datasources/id/{name}": { + "/datasources/{id}/health": { "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": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", "tags": [ "datasources" ], - "summary": "Get data source Id by Name.", - "operationId": "getDataSourceIdByName", + "summary": "Sends a health check request to the plugin datasource identified by the ID.", + "operationId": "checkDatasourceHealthByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "name", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceIDResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4976,34 +4818,41 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/datasources/name/{name}": { + "/datasources/{id}/resources/{datasource_proxy_route}": { "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": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", "tags": [ "datasources" ], - "summary": "Get a single data source by Name.", - "operationId": "getDataSourceByName", + "summary": "Fetch data source resources by Id.", + "operationId": "callDatasourceResourceByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "name", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5011,29 +4860,42 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "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).", + } + }, + "/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`.", "tags": [ - "datasources" + "ds" ], - "summary": "Delete an existing data source by name.", - "operationId": "deleteDataSourceByName", + "summary": "DataSource query metrics with expressions.", + "operationId": "queryMetricsWithExpressions", "parameters": [ { - "type": "string", - "name": "name", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MetricRequest" + } } ], "responses": { "200": { - "$ref": "#/responses/deleteDataSourceByNameResponse" + "$ref": "#/responses/queryMetricsWithExpressionsRespons" + }, + "207": { + "$ref": "#/responses/queryMetricsWithExpressionsRespons" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5041,43 +4903,47 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "/folders": { "get": { - "description": "Proxies all calls to the actual data source.", + "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID\nand returns the immediate subfolders that the authenticated user has permission to view.\nIf the parameter is not supplied then it returns immediate subfolders under the root\nthat the authenticated user has permission to view.", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETByUIDcalls", + "summary": "Get all folders.", + "operationId": "getFolders", "parameters": [ { - "type": "string", - "name": "datasource_proxy_route", - "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" }, { "type": "string", - "name": "uid", - "in": "path", - "required": true + "description": "The parent folder UID", + "name": "parentUid", + "in": "query" } ], "responses": { "200": { - "description": "(empty)" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getFoldersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5085,47 +4951,31 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "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", + "description": "If nested folders are enabled then it additionally expects the parent folder UID.", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTByUIDcalls", + "summary": "Create folder.", + "operationId": "createFolder", "parameters": [ { - "name": "DatasourceProxyParam", + "name": "body", "in": "body", "required": true, - "schema": {} - }, - { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "uid", - "in": "path", - "required": true + "schema": { + "$ref": "#/definitions/CreateFolderCommand" + } } ], "responses": { - "201": { - "description": "(empty)" - }, - "202": { - "description": "(empty)" + "200": { + "$ref": "#/responses/folderResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5136,41 +4986,36 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Proxies all calls to the actual data source.", + } + }, + "/folders/id/{folder_id}": { + "get": { + "description": "Returns the folder identified by id. This is deprecated.\nPlease refer to [updated API](#/folders/getFolderByUID) instead", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEByUIDcalls", + "summary": "Get folder by id.", + "operationId": "getFolderByID", + "deprecated": true, "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "datasource_proxy_route", + "type": "integer", + "format": "int64", + "name": "folder_id", "in": "path", "required": true } ], "responses": { - "202": { - "description": "(empty)" - }, - "400": { - "$ref": "#/responses/badRequestError" + "200": { + "$ref": "#/responses/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5187,35 +5032,24 @@ } } }, - "/datasources/proxy/{id}/{datasource_proxy_route}": { + "/folders/{folder_uid}": { "get": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETcalls", - "deprecated": true, + "summary": "Get folder by uid.", + "operationId": "getFolderByUID", "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/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5231,40 +5065,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\n\nPlease refer to [updated API](#/datasources/datasourceProxyPOSTByUIDcalls) instead", + "put": { "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTcalls", - "deprecated": true, + "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": "id", - "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" @@ -5278,36 +5104,39 @@ "404": { "$ref": "#/responses/notFoundError" }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "delete": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", + "description": "Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted.\nIf nested folders are enabled then it also deletes all the subfolders.", "tags": [ - "datasources" + "folders" ], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEcalls", - "deprecated": true, + "summary": "Delete folder.", + "operationId": "deleteFolder", "parameters": [ { "type": "string", - "name": "id", + "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" @@ -5327,28 +5156,31 @@ } } }, - "/datasources/uid/{sourceUID}/correlations": { + "/folders/{folder_uid}/counts": { "get": { "tags": [ - "correlations" + "folders" ], - "summary": "Gets all correlations originating from the given data source.", - "operationId": "getCorrelationsBySourceUID", + "summary": "Gets the count of each descendant of a folder by kind. The folder is identified by UID.", + "operationId": "getFolderDescendantCounts", "parameters": [ { "type": "string", - "name": "sourceUID", + "name": "folder_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getCorrelationsBySourceUIDResponse" + "$ref": "#/responses/getFolderDescendantCountsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "404": { "$ref": "#/responses/notFoundError" }, @@ -5356,35 +5188,34 @@ "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/folders/{folder_uid}/move": { "post": { "tags": [ - "correlations" + "folders" ], - "summary": "Add correlation.", - "operationId": "createCorrelation", + "summary": "Move folder.", + "operationId": "moveFolder", "parameters": [ + { + "type": "string", + "name": "folder_uid", + "in": "path", + "required": true + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateCorrelationCommand" + "$ref": "#/definitions/MoveFolderCommand" } - }, - { - "type": "string", - "name": "sourceUID", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/createCorrelationResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5401,34 +5232,31 @@ } } }, - "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "/folders/{folder_uid}/permissions": { "get": { "tags": [ - "correlations" + "folder_permissions" ], - "summary": "Gets a correlation.", - "operationId": "getCorrelation", + "summary": "Gets all existing permissions for the folder with the given `uid`.", + "operationId": "getFolderPermissionList", "parameters": [ { "type": "string", - "name": "sourceUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", + "name": "folder_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getCorrelationResponse" + "$ref": "#/responses/getFolderPermissionListResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "404": { "$ref": "#/responses/notFoundError" }, @@ -5437,39 +5265,31 @@ } } }, - "patch": { + "post": { "tags": [ - "correlations" + "folder_permissions" ], - "summary": "Updates a correlation.", - "operationId": "updateCorrelation", + "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", + "operationId": "updateFolderPermissions", "parameters": [ { "type": "string", - "name": "sourceUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", + "name": "folder_uid", "in": "path", "required": true }, { - "name": "body", + "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/UpdateCorrelationCommand" + "$ref": "#/definitions/UpdateDashboardACLCommand" } } ], "responses": { "200": { - "$ref": "#/responses/updateCorrelationResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5486,139 +5306,112 @@ } } }, - "/datasources/uid/{uid}": { + "/library-elements": { "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).", + "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": "Get a single data source by UID.", - "operationId": "getDataSourceByUID", + "summary": "Get all library elements.", + "operationId": "getLibraryElements", "parameters": [ { "type": "string", - "name": "uid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/getDataSourceResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "description": "Part of the name or description searched for.", + "name": "searchString", + "in": "query" }, - "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" }, - "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:uid:*` and `datasources:uid:1` (single data source).", - "tags": [ - "datasources" - ], - "summary": "Update an existing data source.", - "operationId": "updateDataSourceByUID", - "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDataSourceCommand" - } + "type": "string", + "description": "Element UID to exclude from search results.", + "name": "excludeUid", + "in": "query" }, { "type": "string", - "name": "uid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "description": "A comma separated list of folder ID(s) to filter the elements by.", + "name": "folderFilter", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "type": "integer", + "format": "int64", + "default": 100, + "description": "The number of results per page.", + "name": "perPage", + "in": "query" }, - "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 + "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/okResponse" + "$ref": "#/responses/getLibraryElementsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/uid/{uid}/correlations/{correlationUID}": { - "delete": { + }, + "post": { + "description": "Creates a new library element.", "tags": [ - "correlations" + "library_elements" ], - "summary": "Delete a correlation.", - "operationId": "deleteCorrelation", + "summary": "Create library element.", + "operationId": "createLibraryElement", "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "correlationUID", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateLibraryElementCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/deleteCorrelationResponse" + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5635,33 +5428,31 @@ } } }, - "/datasources/uid/{uid}/health": { + "/library-elements/name/{library_element_name}": { "get": { + "description": "Returns a library element with the given name.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Sends a health check request to the plugin datasource identified by the UID.", - "operationId": "checkDatasourceHealthWithUID", + "summary": "Get library element by name.", + "operationId": "getLibraryElementByName", "parameters": [ { "type": "string", - "name": "uid", + "name": "library_element_name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getLibraryElementArrayResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -5669,33 +5460,25 @@ } } }, - "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { + "/library-elements/{library_element_uid}": { "get": { + "description": "Returns a library element with the given UID.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Fetch data source resources.", - "operationId": "callDatasourceResourceWithUID", + "summary": "Get library element by UID.", + "operationId": "getLibraryElementByUID", "parameters": [ { "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "uid", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getLibraryElementResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5710,28 +5493,25 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/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", + }, + "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 Id.", - "operationId": "getDataSourceByID", - "deprecated": true, + "summary": "Delete library element.", + "operationId": "deleteLibraryElementByUID", "parameters": [ { "type": "string", - "name": "id", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDataSourceResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5750,33 +5530,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:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/updateDataSourceByUID) instead", + "patch": { + "description": "Updates an existing library element identified by uid.", "tags": [ - "datasources" + "library_elements" ], - "summary": "Update an existing data source by its sequential ID.", - "operationId": "updateDataSourceByID", - "deprecated": true, + "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": "id", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5784,30 +5566,37 @@ "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:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/deleteDataSourceByUID) instead", + } + }, + "/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 id.", - "operationId": "deleteDataSourceByID", - "deprecated": true, + "summary": "Get library element connections.", + "operationId": "getLibraryElementConnections", "parameters": [ { "type": "string", - "name": "id", + "name": "library_element_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getLibraryElementConnectionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5824,68 +5613,140 @@ } } }, - "/datasources/{id}/health": { + "/licensing/check": { "get": { - "description": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", "tags": [ - "datasources" + "licensing", + "enterprise" ], - "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 + "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", + "deprecated": true, "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/datasources/{id}/resources/{datasource_proxy_route}": { + "/licensing/custom-permissions-csv": { "get": { - "description": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", + "description": "You need to have a permission with action `licensing.reports:read`.", + "produces": [ + "text/csv" + ], "tags": [ - "datasources" + "licensing", + "enterprise" ], - "summary": "Fetch data source resources by Id.", - "operationId": "callDatasourceResourceByID", + "summary": "Get custom permissions report in CSV format.", + "operationId": "getCustomPermissionsCSV", "deprecated": true, - "parameters": [ - { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true + "responses": { + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/refresh-stats": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Refresh license stats.", + "operationId": "refreshLicenseStats", + "responses": { + "200": { + "$ref": "#/responses/refreshLicenseStatsResponse" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Get license token.", + "operationId": "getLicenseToken", + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + } + } + }, + "post": { + "description": "You need to have a permission with action `licensing:update`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Create license token.", + "operationId": "postLicenseToken", + "parameters": [ { - "type": "string", - "name": "id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getLicenseTokenResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + } + } + }, + "delete": { + "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", + "tags": [ + "licensing", + "enterprise" + ], + "summary": "Remove license from database.", + "operationId": "deleteLicenseToken", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5896,8 +5757,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "422": { + "$ref": "#/responses/unprocessableEntityError" }, "500": { "$ref": "#/responses/internalServerError" @@ -5905,81 +5766,69 @@ } } }, - "/ds/query": { + "/licensing/token/renew": { "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`.", + "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": [ - "ds" + "licensing", + "enterprise" ], - "summary": "DataSource query metrics with expressions.", - "operationId": "queryMetricsWithExpressions", + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/MetricRequest" + "type": "object" } } ], "responses": { "200": { - "$ref": "#/responses/queryMetricsWithExpressionsRespons" - }, - "207": { - "$ref": "#/responses/queryMetricsWithExpressionsRespons" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/postRenewLicenseTokenResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "404": { + "$ref": "#/responses/notFoundError" } } } }, - "/folders": { + "/logout/saml": { "get": { - "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID\nand returns the immediate subfolders that the authenticated user has permission to view.\nIf the parameter is not supplied then it returns immediate subfolders under the root\nthat the authenticated user has permission to view.", "tags": [ - "folders" + "saml", + "enterprise" ], - "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" + "summary": "GetLogout initiates single logout process.", + "operationId": "getSAMLLogout", + "responses": { + "302": { + "description": "(empty)" }, - { - "type": "integer", - "format": "int64", - "default": 1, - "description": "Page index for starting fetching folders", - "name": "page", - "in": "query" + "404": { + "$ref": "#/responses/notFoundError" }, - { - "type": "string", - "description": "The parent folder UID", - "name": "parentUid", - "in": "query" + "500": { + "$ref": "#/responses/internalServerError" } + } + } + }, + "/org": { + "get": { + "tags": [ + "org" ], + "summary": "Get current Organization.", + "operationId": "getCurrentOrg", "responses": { "200": { - "$ref": "#/responses/getFoldersResponse" + "$ref": "#/responses/getCurrentOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5992,26 +5841,25 @@ } } }, - "post": { - "description": "If nested folders are enabled then it additionally expects the parent folder UID.", + "put": { "tags": [ - "folders" + "org" ], - "summary": "Create folder.", - "operationId": "createFolder", + "summary": "Update current Organization.", + "operationId": "updateCurrentOrg", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateFolderCommand" + "$ref": "#/definitions/UpdateOrgForm" } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6022,36 +5870,35 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/folders/id/{folder_id}": { - "get": { - "description": "Returns the folder identified by id. This is deprecated.\nPlease refer to [updated API](#/folders/getFolderByUID) instead", + "/org/address": { + "put": { "tags": [ - "folders" + "org" ], - "summary": "Get folder by id.", - "operationId": "getFolderByID", - "deprecated": true, + "summary": "Update current Organization's address.", + "operationId": "updateCurrentOrgAddress", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "folder_id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6059,33 +5906,22 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/folders/{folder_uid}": { + "/org/invites": { "get": { "tags": [ - "folders" - ], - "summary": "Get folder by uid.", - "operationId": "getFolderByUID", - "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - } + "org_invites" ], + "summary": "Get pending invites.", + "operationId": "getPendingOrgInvites", "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/getPendingOrgInvitesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6093,40 +5929,30 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "put": { + "post": { "tags": [ - "folders" + "org_invites" ], - "summary": "Update folder.", - "operationId": "updateFolder", + "summary": "Add invite.", + "operationId": "addOrgInvite", "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/AddInviteForm" } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6137,45 +5963,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "409": { - "$ref": "#/responses/conflictError" + "412": { + "$ref": "#/responses/SMTPNotEnabledError" }, "500": { "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/org/invites/{invitation_code}/revoke": { "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.\nIf nested folders are enabled then it also deletes all the subfolders.", "tags": [ - "folders" + "org_invites" ], - "summary": "Delete folder.", - "operationId": "deleteFolder", + "summary": "Revoke invite.", + "operationId": "revokeInvite", "parameters": [ { "type": "string", - "name": "folder_uid", + "name": "invitation_code", "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": { "200": { - "$ref": "#/responses/deleteFolderResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6192,24 +6006,16 @@ } } }, - "/folders/{folder_uid}/counts": { + "/org/preferences": { "get": { "tags": [ - "folders" - ], - "summary": "Gets the count of each descendant of a folder by kind. The folder is identified by UID.", - "operationId": "getFolderDescendantCounts", - "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - } + "org_preferences" ], + "summary": "Get Current Org Prefs.", + "operationId": "getOrgPreferences", "responses": { "200": { - "$ref": "#/responses/getFolderDescendantCountsResponse" + "$ref": "#/responses/getPreferencesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6217,41 +6023,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/folders/{folder_uid}/move": { - "post": { + }, + "put": { "tags": [ - "folders" + "org_preferences" ], - "summary": "Move folder.", - "operationId": "moveFolder", + "summary": "Update Current Org Prefs.", + "operationId": "updateOrgPreferences", "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/MoveFolderCommand" + "$ref": "#/definitions/UpdatePrefsCmd" } } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6259,33 +6057,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/folders/{folder_uid}/permissions": { - "get": { + }, + "patch": { "tags": [ - "folder_permissions" + "org_preferences" ], - "summary": "Gets all existing permissions for the folder with the given `uid`.", - "operationId": "getFolderPermissionList", + "summary": "Patch Current Org Prefs.", + "operationId": "patchOrgPreferences", "parameters": [ { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchPrefsCmd" + } } ], "responses": { "200": { - "$ref": "#/responses/getFolderPermissionListResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6293,39 +6091,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "post": { + } + }, + "/org/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": [ - "folder_permissions" - ], - "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", - "operationId": "updateFolderPermissions", - "parameters": [ - { - "type": "string", - "name": "folder_uid", - "in": "path", - "required": true - }, - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDashboardACLCommand" - } - } + "getCurrentOrg" ], + "summary": "Fetch Organization quota.", + "operationId": "getCurrentOrgQuota", "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQuotaResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6342,112 +6124,49 @@ } } }, - "/library-elements": { + "/org/users": { "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. 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": [ - "library_elements" - ], - "summary": "Get all library elements.", - "operationId": "getLibraryElements", - "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", - "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" - } + "org" ], + "summary": "Get all users within the current organization.", + "operationId": "getOrgUsersForCurrentOrg", "responses": { "200": { - "$ref": "#/responses/getLibraryElementsResponse" + "$ref": "#/responses/getOrgUsersForCurrentOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { - "description": "Creates a new library element.", + "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": [ - "library_elements" + "org" ], - "summary": "Create library element.", - "operationId": "createLibraryElement", + "summary": "Add a new user to the current organization.", + "operationId": "addOrgUserToCurrentOrg", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateLibraryElementCommand" + "$ref": "#/definitions/AddOrgUserCommand" } } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6455,66 +6174,36 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/library-elements/name/{library_element_name}": { + "/org/users/lookup": { "get": { - "description": "Returns a library element with the given name.", + "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 library element by name.", - "operationId": "getLibraryElementByName", + "summary": "Get all users within the current organization (lookup)", + "operationId": "getOrgUsersForCurrentOrgLookup", "parameters": [ { "type": "string", - "name": "library_element_name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/getLibraryElementArrayResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "name": "query", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/library-elements/{library_element_uid}": { - "get": { - "description": "Returns a library element with the given UID.", - "tags": [ - "library_elements" - ], - "summary": "Get library element by UID.", - "operationId": "getLibraryElementByUID", - "parameters": [ { - "type": "string", - "name": "library_element_uid", - "in": "path", - "required": true + "type": "integer", + "format": "int64", + "name": "limit", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/getOrgUsersForCurrentOrgLookupResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6522,25 +6211,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/org/users/{user_id}": { "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.", + "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": "Delete library element.", - "operationId": "deleteLibraryElementByUID", + "summary": "Delete user in current organization.", + "operationId": "removeOrgUserForCurrentOrg", "parameters": [ { - "type": "string", - "name": "library_element_uid", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } @@ -6558,40 +6247,38 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "patch": { - "description": "Updates an existing library element identified by uid.", + "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": "Update library element.", - "operationId": "updateLibraryElement", + "summary": "Updates the given user.", + "operationId": "updateOrgUserForCurrentOrg", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PatchLibraryElementCommand" + "$ref": "#/definitions/UpdateOrgUserCommand" } }, { - "type": "string", - "name": "library_element_uid", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6602,37 +6289,55 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "412": { - "$ref": "#/responses/preconditionFailedError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/library-elements/{library_element_uid}/connections/": { + "/orgs": { "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": "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/getLibraryElementConnectionsResponse" + "$ref": "#/responses/searchOrgsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6640,79 +6345,79 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/licensing/check": { - "get": { + }, + "post": { + "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", "tags": [ - "licensing", - "enterprise" + "orgs" ], - "summary": "Check license availability.", - "operationId": "getStatus", - "responses": { - "200": { - "$ref": "#/responses/getStatusResponse" + "summary": "Create Organization.", + "operationId": "createOrg", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrgCommand" + } } - } - } - }, - "/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", - "deprecated": true, "responses": { + "200": { + "$ref": "#/responses/createOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/licensing/custom-permissions-csv": { + "/orgs/name/{org_name}": { "get": { - "description": "You need to have a permission with action `licensing.reports:read`.", - "produces": [ - "text/csv" + "security": [ + { + "basic": [] + } ], "tags": [ - "licensing", - "enterprise" + "orgs" ], - "summary": "Get custom permissions report in CSV format.", - "operationId": "getCustomPermissionsCSV", - "deprecated": true, - "responses": { - "500": { - "$ref": "#/responses/internalServerError" + "summary": "Get Organization by ID.", + "operationId": "getOrgByName", + "parameters": [ + { + "type": "string", + "name": "org_name", + "in": "path", + "required": true } - } - } - }, - "/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" + "$ref": "#/responses/getOrgByNameResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" @@ -6720,69 +6425,73 @@ } } }, - "/licensing/token": { + "/orgs/{org_id}": { "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" + "security": [ + { + "basic": [] } - } - }, - "post": { - "description": "You need to have a permission with action `licensing:update`.", + ], "tags": [ - "licensing", - "enterprise" + "orgs" ], - "summary": "Create license token.", - "operationId": "postLicenseToken", + "summary": "Get Organization by ID.", + "operationId": "getOrgByID", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DeleteTokenCommand" - } + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLicenseTokenResponse" + "$ref": "#/responses/getOrgByIDResponse" }, - "400": { - "$ref": "#/responses/badRequestError" + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, - "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`.", + "put": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "licensing", - "enterprise" + "orgs" ], - "summary": "Remove license from database.", - "operationId": "deleteLicenseToken", + "summary": "Update Organization.", + "operationId": "updateOrg", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DeleteTokenCommand" + "$ref": "#/definitions/UpdateOrgForm" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { - "202": { - "$ref": "#/responses/acceptedResponse" + "200": { + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6793,58 +6502,43 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/licensing/token/renew": { - "post": { - "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + }, + "delete": { + "security": [ + { + "basic": [] + } + ], "tags": [ - "licensing", - "enterprise" + "orgs" ], - "summary": "Manually force license refresh.", - "operationId": "postRenewLicenseToken", + "summary": "Delete Organization.", + "operationId": "deleteOrgByID", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/postRenewLicenseTokenResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" - } - } - } - }, - "/logout/saml": { - "get": { - "tags": [ - "saml", - "enterprise" - ], - "summary": "GetLogout initiates single logout process.", - "operationId": "getSAMLLogout", - "responses": { - "302": { - "description": "(empty)" + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { "$ref": "#/responses/notFoundError" @@ -6855,16 +6549,36 @@ } } }, - "/org": { - "get": { + "/orgs/{org_id}/address": { + "put": { "tags": [ - "org" + "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 current Organization.", - "operationId": "getCurrentOrg", "responses": { "200": { - "$ref": "#/responses/getCurrentOrgResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6876,29 +6590,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" @@ -6906,58 +6619,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/UpdateQuotaCmd" } + }, + { + "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" @@ -6971,61 +6721,70 @@ } }, "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": { - "delete": { + "/orgs/{org_id}/users/search": { + "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": "Revoke invite.", - "operationId": "revokeInvite", + "summary": "Search Users in Organization.", + "operationId": "searchOrgUsers", "parameters": [ { - "type": "string", - "name": "invitation_code", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/searchOrgUsersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7033,25 +6792,42 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/preferences": { - "get": { + "/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": "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 + } ], - "summary": "Get Current Org Prefs.", - "operationId": "getOrgPreferences", "responses": { "200": { - "$ref": "#/responses/getPreferencesResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7064,20 +6840,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": { @@ -7097,29 +6888,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" @@ -7127,23 +6946,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/quotas": { + "/playlists/{uid}": { "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": [ - "getCurrentOrg" + "playlists" + ], + "summary": "Get playlist.", + "operationId": "getPlaylist", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } ], - "summary": "Fetch Organization quota.", - "operationId": "getCurrentOrgQuota", "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" + "$ref": "#/responses/getPlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7158,19 +6987,32 @@ "$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:*`.", + }, + "put": { "tags": [ - "org" + "playlists" + ], + "summary": "Update playlist.", + "operationId": "updatePlaylist", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePlaylistCommand" + } + }, + { + "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/updatePlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7178,26 +7020,26 @@ "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:*`.", + "delete": { "tags": [ - "org" + "playlists" ], - "summary": "Add a new user to the current organization.", - "operationId": "addOrgUserToCurrentOrg", + "summary": "Delete playlist.", + "operationId": "deletePlaylist", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddOrgUserCommand" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { @@ -7210,36 +7052,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/users/lookup": { + "/playlists/{uid}/items": { "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 playlist items.", + "operationId": "getPlaylistItems", "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/getPlaylistItemsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7247,325 +7086,359 @@ "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:*`.", + "/public/dashboards/{accessToken}": { + "get": { + "description": "Get public dashboard for view", "tags": [ - "org" + "dashboard_public" ], - "summary": "Delete user in current organization.", - "operationId": "removeOrgUserForCurrentOrg", + "operationId": "viewPublicDashboard", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "name": "accessToken", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/viewPublicDashboardResponse" }, "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/badRequestPublicError" }, "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/unauthorisedPublicError" }, "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/forbiddenPublicError" + }, + "404": { + "$ref": "#/responses/notFoundPublicError" }, "500": { - "$ref": "#/responses/internalServerError" + "$ref": "#/responses/internalServerPublicError" } } - }, - "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" - ], - "summary": "Updates the given user.", - "operationId": "updateOrgUserForCurrentOrg", + } + }, + "/public/dashboards/{accessToken}/annotations": { + "get": { + "description": "Get annotations for a public dashboard", + "tags": [ + "dashboard_public" + ], + "operationId": "getPublicAnnotations", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgUserCommand" - } + "type": "string", + "name": "accessToken", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getPublicAnnotationsResponse" + }, + "400": { + "$ref": "#/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/responses/forbiddenPublicError" + }, + "404": { + "$ref": "#/responses/notFoundPublicError" + }, + "500": { + "$ref": "#/responses/internalServerPublicError" + } + } + } + }, + "/public/dashboards/{accessToken}/panels/{panelId}/query": { + "post": { + "description": "Get results for a given panel on a public dashboard", + "tags": [ + "dashboard_public" + ], + "operationId": "queryPublicDashboard", + "parameters": [ + { + "type": "string", + "name": "accessToken", + "in": "path", + "required": true }, { "type": "integer", "format": "int64", - "name": "user_id", + "name": "panelId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/queryPublicDashboardResponse" }, "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/badRequestPublicError" }, "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/unauthorisedPublicError" }, "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/forbiddenPublicError" + }, + "404": { + "$ref": "#/responses/notFoundPublicError" }, "500": { - "$ref": "#/responses/internalServerError" + "$ref": "#/responses/internalServerPublicError" } } } }, - "/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" - }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/name/{org_name}": { - "get": { - "security": [ - { - "basic": [] - } - ], + "/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": "Get Organization by ID.", - "operationId": "getOrgByName", + "summary": "Add star to query in query history.", + "operationId": "starQuery", "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": [] - } - ], + }, + "delete": { + "description": "Removes star from query in query history as specified by the UID.", "tags": [ - "orgs" + "query_history" ], - "summary": "Get Organization by ID.", - "operationId": "getOrgByID", + "summary": "Remove star to query in query history.", + "operationId": "unstarQuery", "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/getQueryHistoryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "put": { - "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": "Update Organization.", - "operationId": "updateOrg", + "summary": "Delete query in query history.", + "operationId": "deleteQuery", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgForm" - } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "name": "query_history_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getQueryHistoryDeleteQueryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "delete": { - "security": [ - { - "basic": [] - } - ], + "patch": { + "description": "Updates comment for query in query history as specified by the UID.", "tags": [ - "orgs" + "query_history" ], - "summary": "Delete Organization.", - "operationId": "deleteOrgByID", + "summary": "Update comment for query in query history.", + "operationId": "patchQueryComment", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "name": "query_history_uid", "in": "path", "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -7573,6 +7446,27 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules": { + "get": { + "tags": [ + "recording_rules", + "enterprise" + ], + "summary": "Lists all rules in the database: active or deleted.", + "operationId": "listRecordingRules", + "responses": { + "200": { + "$ref": "#/responses/listRecordingRulesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, "403": { "$ref": "#/responses/forbiddenError" }, @@ -7583,38 +7477,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" @@ -7622,32 +7505,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" @@ -7664,40 +7549,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/UpdateQuotaCmd" + "$ref": "#/definitions/RecordingRuleJSON" } - }, - { - "type": "string", - "name": "quota_target", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { @@ -7713,37 +7580,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" @@ -7751,38 +7607,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" @@ -7790,37 +7643,27 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs/{org_id}/users/search": { - "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:*`.", + }, + "delete": { "tags": [ - "orgs" - ], - "summary": "Search Users in Organization.", - "operationId": "searchOrgUsers", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - } + "recording_rules", + "enterprise" ], + "summary": "Delete the remote write target.", + "operationId": "deleteRecordingRuleWriteTarget", "responses": { "200": { - "$ref": "#/responses/searchOrgUsersResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7828,32 +7671,28 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}/users/{user_id}": { + "/recording-rules/{recordingRuleID}": { "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" + "recording_rules", + "enterprise" ], - "summary": "Delete user in current organization.", - "operationId": "removeOrgUser", + "summary": "Delete removes the rule from the registry and stops it.", + "operationId": "deleteRecordingRule", "parameters": [ { "type": "integer", "format": "int64", - "name": "org_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", + "name": "recordingRuleID", "in": "path", "required": true } @@ -7862,57 +7701,33 @@ "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:*`.", + } + }, + "/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": [ - "orgs" - ], - "summary": "Update Users in Organization.", - "operationId": "updateOrgUser", - "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", - "in": "path", - "required": true - } + "reports", + "enterprise" ], + "summary": "List reports.", + "operationId": "getReports", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getReportsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7924,57 +7739,31 @@ "$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" - } - } }, "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/CreateOrUpdateReportConfig" } } ], "responses": { "200": { - "$ref": "#/responses/createPlaylistResponse" + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7991,24 +7780,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/ReportEmail" + } } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8023,98 +7819,155 @@ "$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" + }, + { + "type": "string", + "name": "title", + "in": "query" + }, + { + "type": "string", + "name": "scaleFactor", + "in": "query" + }, + { + "type": "string", + "name": "includeTables", + "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}/items": { + "/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" - ], - "summary": "Get playlist items.", - "operationId": "getPlaylistItems", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - } + "reports", + "enterprise" ], + "summary": "Get settings.", + "operationId": "getReportSettings", "responses": { "200": { - "$ref": "#/responses/getPlaylistItemsResponse" + "$ref": "#/responses/getReportSettingsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8122,236 +7975,194 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/public/dashboards/{accessToken}": { - "get": { - "description": "Get public dashboard for view", + }, + "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": [ - "dashboard_public" + "reports", + "enterprise" ], - "operationId": "viewPublicDashboard", + "summary": "Save settings.", + "operationId": "saveReportSettings", "parameters": [ { - "type": "string", - "name": "accessToken", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportSettings" + } } ], "responses": { "200": { - "$ref": "#/responses/viewPublicDashboardResponse" + "$ref": "#/responses/okResponse" }, "400": { - "$ref": "#/responses/badRequestPublicError" + "$ref": "#/responses/badRequestError" }, "401": { - "$ref": "#/responses/unauthorisedPublicError" + "$ref": "#/responses/unauthorisedError" }, "403": { - "$ref": "#/responses/forbiddenPublicError" - }, - "404": { - "$ref": "#/responses/notFoundPublicError" + "$ref": "#/responses/forbiddenError" }, "500": { - "$ref": "#/responses/internalServerPublicError" + "$ref": "#/responses/internalServerError" } } } }, - "/public/dashboards/{accessToken}/annotations": { - "get": { - "description": "Get annotations for a public dashboard", + "/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": [ - "dashboard_public" + "reports", + "enterprise" ], - "operationId": "getPublicAnnotations", + "summary": "Send test report via email.", + "operationId": "sendTestEmail", "parameters": [ { - "type": "string", - "name": "accessToken", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateReportConfig" + } } ], "responses": { "200": { - "$ref": "#/responses/getPublicAnnotationsResponse" + "$ref": "#/responses/okResponse" }, "400": { - "$ref": "#/responses/badRequestPublicError" + "$ref": "#/responses/badRequestError" }, "401": { - "$ref": "#/responses/unauthorisedPublicError" + "$ref": "#/responses/unauthorisedError" }, "403": { - "$ref": "#/responses/forbiddenPublicError" + "$ref": "#/responses/forbiddenError" }, "404": { - "$ref": "#/responses/notFoundPublicError" + "$ref": "#/responses/notFoundError" }, "500": { - "$ref": "#/responses/internalServerPublicError" + "$ref": "#/responses/internalServerError" } } } }, - "/public/dashboards/{accessToken}/panels/{panelId}/query": { - "post": { - "description": "Get results for a given panel on a public dashboard", + "/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": [ - "dashboard_public" + "reports", + "enterprise" ], - "operationId": "queryPublicDashboard", + "summary": "Get a report.", + "operationId": "getReport", "parameters": [ - { - "type": "string", - "name": "accessToken", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "name": "panelId", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/queryPublicDashboardResponse" + "$ref": "#/responses/getReportResponse" }, "400": { - "$ref": "#/responses/badRequestPublicError" + "$ref": "#/responses/badRequestError" }, "401": { - "$ref": "#/responses/unauthorisedPublicError" + "$ref": "#/responses/unauthorisedError" }, "403": { - "$ref": "#/responses/forbiddenPublicError" + "$ref": "#/responses/forbiddenError" }, "404": { - "$ref": "#/responses/notFoundPublicError" + "$ref": "#/responses/notFoundError" }, "500": { - "$ref": "#/responses/internalServerPublicError" + "$ref": "#/responses/internalServerError" } } - } - }, - "/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.", + }, + "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": "Query history search.", - "operationId": "searchQueries", + "summary": "Update a report.", + "operationId": "updateReport", "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" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateReportConfig" + } }, { "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/okResponse" + }, + "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.", + "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": "Add query to query history.", - "operationId": "createQuery", + "summary": "Delete a report.", + "operationId": "deleteReport", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateQueryInQueryHistoryCommand" - } + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -8359,146 +8170,265 @@ "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.", + } + }, + "/saml/metadata": { + "get": { + "produces": [ + "application/xml;application/samlmetadata+xml" + ], "tags": [ - "query_history" + "saml", + "enterprise" ], - "summary": "Remove star to query in query history.", - "operationId": "unstarQuery", - "parameters": [ - { - "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "operationId": "getMetadata", + "responses": { + "200": { + "$ref": "#/responses/contentResponse" } + } + } + }, + "/saml/slo": { + "get": { + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "tags": [ + "saml", + "enterprise" ], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "getSLO", "responses": { - "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "302": { + "description": "(empty)" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "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.", + }, + "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": "Delete query in query history.", - "operationId": "deleteQuery", + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", "parameters": [ { "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true + "name": "SAMLRequest", + "in": "query" + }, + { + "type": "string", + "name": "SAMLResponse", + "in": "query" } ], "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.", + } + }, + "/search": { + "get": { "tags": [ - "query_history" + "search" ], - "summary": "Update comment for query in query history.", - "operationId": "patchQueryComment", + "operationId": "search", "parameters": [ { "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true + "description": "Search Query", + "name": "query", + "in": "query" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" - } + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "List of tags to search for", + "name": "tag", + "in": "query" + }, + { + "enum": [ + "dash-folder", + "dash-db" + ], + "type": "string", + "description": "Type to search for, dash-folder or dash-db", + "name": "type", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "List of dashboard id’s to search for\nThis is deprecated: users should use the `dashboardUIDs` query parameter instead", + "name": "dashboardIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of dashboard uid’s to search for", + "name": "dashboardUIDs", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "List of folder id’s to search in for dashboards\nIf it's `0` then it will query for the top level folders\nThis is deprecated: users should use the `folderUIDs` query parameter instead", + "name": "folderIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of folder UID’s to search in for dashboards\nIf it's an empty string then it will query for the top level folders", + "name": "folderUIDs", + "in": "query" + }, + { + "type": "boolean", + "description": "Flag indicating if only starred Dashboards should be returned", + "name": "starred", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Limit the number of returned results (max 5000)", + "name": "limit", + "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. Only available in Grafana v6.2+.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "Edit", + "View" + ], + "type": "string", + "default": "View", + "description": "Set to `Edit` to return dashboards/folders that the user can edit", + "name": "permission", + "in": "query" + }, + { + "enum": [ + "alpha-asc", + "alpha-desc" + ], + "type": "string", + "default": "alpha-asc", + "description": "Sort method; for listing all the possible sort methods use the search sorting endpoint.", + "name": "sort", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/searchResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/recording-rules": { - "get": { + }, + "post": { + "produces": [ + "application/json" + ], "tags": [ - "recording_rules", - "enterprise" + "devices" ], - "summary": "Lists all rules in the database: active or deleted.", - "operationId": "listRecordingRules", + "summary": "Lists all devices within the last 30 days", + "operationId": "SearchDevices", "responses": { "200": { - "$ref": "#/responses/listRecordingRulesResponse" + "$ref": "#/responses/devicesSearchResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8513,62 +8443,48 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { + } + }, + "/search/sorting": { + "get": { "tags": [ - "recording_rules", - "enterprise" - ], - "summary": "Update the active status of a rule.", - "operationId": "updateRecordingRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RecordingRuleJSON" - } - } + "search" ], + "summary": "List search sorting options.", + "operationId": "listSortOptions", "responses": { "200": { - "$ref": "#/responses/recordingRuleResponse" + "$ref": "#/responses/listSortOptionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/serviceaccounts": { "post": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:*`\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" ], - "summary": "Create a recording rule that is then registered and started.", - "operationId": "createRecordingRule", + "summary": "Create service account", + "operationId": "createServiceAccount", "parameters": [ { - "name": "body", + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/RecordingRuleJSON" + "$ref": "#/definitions/CreateServiceAccountForm" } } ], "responses": { - "200": { - "$ref": "#/responses/recordingRuleResponse" + "201": { + "$ref": "#/responses/createServiceAccountResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8576,66 +8492,55 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/recording-rules/test": { - "post": { + "/serviceaccounts/search": { + "get": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:*`", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" ], - "summary": "Test a recording rule.", - "operationId": "testCreateRecordingRule", + "summary": "Search service accounts with paging", + "operationId": "searchOrgServiceAccountsWithPaging", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RecordingRuleJSON" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "type": "boolean", + "name": "Disabled", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "type": "boolean", + "name": "expiredTokens", + "in": "query" }, - "404": { - "$ref": "#/responses/notFoundError" + { + "type": "string", + "description": "It will return results where the query value is contained in one of the name.\nQuery values with spaces need to be URL encoded.", + "name": "query", + "in": "query" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + { + "type": "integer", + "format": "int64", + "description": "The default value is 1000.", + "name": "perpage", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" + { + "type": "integer", + "format": "int64", + "description": "The default value is 1.", + "name": "page", + "in": "query" } - } - } - }, - "/recording-rules/writer": { - "get": { - "tags": [ - "recording_rules", - "enterprise" ], - "summary": "Return the prometheus remote write target.", - "operationId": "getRecordingRuleWriteTarget", "responses": { "200": { - "$ref": "#/responses/recordingRuleWriteTargetResponse" + "$ref": "#/responses/searchOrgServiceAccountsWithPagingResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8643,35 +8548,35 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "post": { - "description": "It returns a 422 if there is not an existing prometheus data source configured.", + } + }, + "/serviceaccounts/{serviceAccountId}": { + "get": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:id:1` (single service account)", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" ], - "summary": "Create a remote write target.", - "operationId": "createRecordingRuleWriteTarget", + "summary": "Get single serviceaccount by Id", + "operationId": "retrieveServiceAccount", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" - } + "type": "integer", + "format": "int64", + "name": "serviceAccountId", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/recordingRuleWriteTargetResponse" + "$ref": "#/responses/retrieveServiceAccountResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8682,60 +8587,74 @@ "404": { "$ref": "#/responses/notFoundError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "delete": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:delete` scope: `serviceaccounts:id:1` (single service account)", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" + ], + "summary": "Delete service account", + "operationId": "deleteServiceAccount", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "serviceAccountId", + "in": "path", + "required": true + } ], - "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" } } - } - }, - "/recording-rules/{recordingRuleID}": { - "delete": { + }, + "patch": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" ], - "summary": "Delete removes the rule from the registry and stops it.", - "operationId": "deleteRecordingRule", + "summary": "Update service account", + "operationId": "updateServiceAccount", "parameters": [ { "type": "integer", "format": "int64", - "name": "recordingRuleID", + "name": "serviceAccountId", "in": "path", "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/UpdateServiceAccountForm" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/updateServiceAccountResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8752,18 +8671,29 @@ } } }, - "/reports": { + "/serviceaccounts/{serviceAccountId}/tokens": { "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:*`.", + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `global:serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", "tags": [ - "reports", - "enterprise" + "service_accounts" + ], + "summary": "Get service account tokens", + "operationId": "listTokens", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "serviceAccountId", + "in": "path", + "required": true + } ], - "summary": "List reports.", - "operationId": "getReports", "responses": { "200": { - "$ref": "#/responses/getReportsResponse" + "$ref": "#/responses/listTokensResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8777,26 +8707,31 @@ } }, "post": { - "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", "tags": [ - "reports", - "enterprise" + "service_accounts" ], - "summary": "Create a report.", - "operationId": "createReport", + "summary": "CreateNewToken adds a token to a service account", + "operationId": "createToken", "parameters": [ { - "name": "body", + "type": "integer", + "format": "int64", + "name": "serviceAccountId", + "in": "path", + "required": true + }, + { + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/CreateOrUpdateReportConfig" + "$ref": "#/definitions/AddServiceAccountTokenCommand" } } ], "responses": { "200": { - "$ref": "#/responses/createReportResponse" + "$ref": "#/responses/createTokenResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -8810,46 +8745,8 @@ "404": { "$ref": "#/responses/notFoundError" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/reports/email": { - "post": { - "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", - "tags": [ - "reports", - "enterprise" - ], - "summary": "Send a report.", - "operationId": "sendReport", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ReportEmail" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -8857,68 +8754,33 @@ } } }, - "/reports/render/pdf/{dashboardID}": { - "get": { - "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", - "produces": [ - "application/pdf" - ], + "/serviceaccounts/{serviceAccountId}/tokens/{tokenId}": { + "delete": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", "tags": [ - "reports", - "enterprise" + "service_accounts" ], - "summary": "Render report for dashboard.", - "operationId": "renderReportPDF", - "deprecated": true, + "summary": "DeleteToken deletes service account tokens", + "operationId": "deleteToken", "parameters": [ { "type": "integer", "format": "int64", - "name": "DashboardID", + "name": "tokenId", "in": "path", "required": true }, { "type": "integer", "format": "int64", - "name": "dashboardID", + "name": "serviceAccountId", "in": "path", "required": true - }, - { - "type": "string", - "name": "title", - "in": "query" - }, - { - "type": "string", - "name": "variables", - "in": "query" - }, - { - "type": "string", - "name": "from", - "in": "query" - }, - { - "type": "string", - "name": "to", - "in": "query" - }, - { - "type": "string", - "name": "orientation", - "in": "query" - }, - { - "type": "string", - "name": "layout", - "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/contentResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -8926,65 +8788,29 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/reports/render/pdfs": { + "/signing-keys/keys": { "get": { - "description": "Available to all users and with a valid license.", - "produces": [ - "application/pdf" - ], + "description": "Required permissions\nNone", "tags": [ - "reports", - "enterprise" - ], - "summary": "Render report for multiple dashboards.", - "operationId": "renderReportPDFs", - "parameters": [ - { - "type": "string", - "name": "dashboardID", - "in": "query" - }, - { - "type": "string", - "name": "orientation", - "in": "query" - }, - { - "type": "string", - "name": "layout", - "in": "query" - }, - { - "type": "string", - "name": "title", - "in": "query" - }, - { - "type": "string", - "name": "scaleFactor", - "in": "query" - }, - { - "type": "string", - "name": "includeTables", - "in": "query" - } + "signing_keys" ], + "summary": "Get JSON Web Key Set (JWKS) with all the keys that can be used to verify tokens (public keys)", + "operationId": "retrieveJWKS", "responses": { "200": { - "$ref": "#/responses/contentResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/jwksResponse" }, "500": { "$ref": "#/responses/internalServerError" @@ -8992,54 +8818,44 @@ } } }, - "/reports/settings": { + "/snapshot/shared-options": { "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" + "snapshots" ], - "summary": "Get settings.", - "operationId": "getReportSettings", + "summary": "Get snapshot sharing settings.", + "operationId": "getSharingOptions", "responses": { "200": { - "$ref": "#/responses/getReportSettingsResponse" + "$ref": "#/responses/getSharingOptionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/snapshots": { "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.", + "description": "Snapshot public mode should be enabled or authentication is required.", "tags": [ - "reports", - "enterprise" + "snapshots" ], - "summary": "Save settings.", - "operationId": "saveReportSettings", + "summary": "When creating a snapshot using the API, you have to provide the full dashboard payload including the snapshot data. This endpoint is designed for the Grafana UI.", + "operationId": "createDashboardSnapshot", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ReportSettings" + "$ref": "#/definitions/CreateDashboardSnapshotCommand" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createDashboardSnapshotResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9053,32 +8869,26 @@ } } }, - "/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`.", + "/snapshots-delete/{deleteKey}": { + "get": { + "description": "Snapshot public mode should be enabled or authentication is required.", "tags": [ - "reports", - "enterprise" + "snapshots" ], - "summary": "Send test report via email.", - "operationId": "sendTestEmail", + "summary": "Delete Snapshot by deleteKey.", + "operationId": "deleteDashboardSnapshotByDeleteKey", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateOrUpdateReportConfig" - } + "type": "string", + "name": "deleteKey", + "in": "path", + "required": true } ], "responses": { "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -9094,37 +8904,28 @@ } } }, - "/reports/{id}": { + "/snapshots/{key}": { "get": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", "tags": [ - "reports", - "enterprise" + "snapshots" ], - "summary": "Get a report.", - "operationId": "getReport", + "summary": "Get Snapshot by Key.", + "operationId": "getDashboardSnapshot", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "id", + "type": "string", + "name": "key", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getReportResponse" + "$ref": "#/responses/getDashboardSnapshotResponse" }, "400": { "$ref": "#/responses/badRequestError" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "404": { "$ref": "#/responses/notFoundError" }, @@ -9133,27 +8934,16 @@ } } }, - "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`.", + "delete": { "tags": [ - "reports", - "enterprise" + "snapshots" ], - "summary": "Update a report.", - "operationId": "updateReport", + "summary": "Delete Snapshot by Key.", + "operationId": "deleteDashboardSnapshot", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateOrUpdateReportConfig" - } - }, - { - "type": "integer", - "format": "int64", - "name": "id", + "type": "string", + "name": "key", "in": "path", "required": true } @@ -9162,8 +8952,31 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/stats": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "devices" + ], + "summary": "Lists all devices within the last 30 days", + "operationId": "listDevices", + "responses": { + "200": { + "$ref": "#/responses/devicesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9178,30 +8991,28 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", + } + }, + "/teams": { + "post": { "tags": [ - "reports", - "enterprise" + "teams" ], - "summary": "Delete a report.", - "operationId": "deleteReport", + "summary": "Add Team.", + "operationId": "createTeam", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateTeamCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createTeamResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9209,8 +9020,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -9218,24 +9029,47 @@ } } }, - "/saml/acs": { - "post": { + "/teams/search": { + "get": { "tags": [ - "saml", - "enterprise" + "teams" ], - "summary": "It performs Assertion Consumer Service (ACS).", - "operationId": "postACS", + "summary": "Team Search With Paging.", + "operationId": "searchTeams", "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": "RelayState", + "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": { - "302": { - "description": "(empty)" + "200": { + "$ref": "#/responses/searchTeamsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" @@ -9246,225 +9080,225 @@ } } }, - "/saml/metadata": { + "/teams/{teamId}/groups": { "get": { - "produces": [ - "application/xml;application/samlmetadata+xml" - ], "tags": [ - "saml", + "sync_team_groups", "enterprise" ], - "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", - "operationId": "getMetadata", + "summary": "Get External Groups.", + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/contentResponse" + "$ref": "#/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - } - }, - "/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.", + }, + "post": { "tags": [ - "saml", + "sync_team_groups", "enterprise" ], - "summary": "It performs Single Logout (SLO) callback.", - "operationId": "getSLO", + "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": { - "302": { - "description": "(empty)" + "200": { + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "delete": { "tags": [ - "saml", + "sync_team_groups", "enterprise" ], - "summary": "It performs Single Logout (SLO) callback.", - "operationId": "postSLO", + "summary": "Remove External Group.", + "operationId": "removeTeamGroupApiQuery", "parameters": [ { "type": "string", - "name": "SAMLRequest", + "name": "groupId", "in": "query" }, { - "type": "string", - "name": "SAMLResponse", - "in": "query" + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], "responses": { - "302": { - "description": "(empty)" + "200": { + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/search": { + "/teams/{team_id}": { "get": { "tags": [ - "search" + "teams" ], - "operationId": "search", + "summary": "Get Team By ID.", + "operationId": "getTeamByID", "parameters": [ { "type": "string", - "description": "Search Query", - "name": "query", - "in": "query" + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamByIDResponse" }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "List of tags to search for", - "name": "tag", - "in": "query" + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "enum": [ - "dash-folder", - "dash-db" - ], - "type": "string", - "description": "Type to search for, dash-folder or dash-db", - "name": "type", - "in": "query" + "403": { + "$ref": "#/responses/forbiddenError" }, - { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "List of dashboard id’s to search for\nThis is deprecated: users should use the `dashboardUIDs` query parameter instead", - "name": "dashboardIds", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of dashboard uid’s to search for", - "name": "dashboardUIDs", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "List of folder id’s to search in for dashboards\nIf it's `0` then it will query for the top level folders\nThis is deprecated: users should use the `folderUIDs` query parameter instead", - "name": "folderIds", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of folder UID’s to search in for dashboards\nIf it's an empty string then it will query for the top level folders", - "name": "folderUIDs", - "in": "query" - }, - { - "type": "boolean", - "description": "Flag indicating if only starred Dashboards should be returned", - "name": "starred", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "Limit the number of returned results (max 5000)", - "name": "limit", - "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. Only available in Grafana v6.2+.", - "name": "page", - "in": "query" + "404": { + "$ref": "#/responses/notFoundError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": [ + "teams" + ], + "summary": "Update Team.", + "operationId": "updateTeam", + "parameters": [ { - "enum": [ - "Edit", - "View" - ], - "type": "string", - "default": "View", - "description": "Set to `Edit` to return dashboards/folders that the user can edit", - "name": "permission", - "in": "query" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTeamCommand" + } }, { - "enum": [ - "alpha-asc", - "alpha-desc" - ], "type": "string", - "default": "alpha-asc", - "description": "Sort method; for listing all the possible sort methods use the search sorting endpoint.", - "name": "sort", - "in": "query" + "name": "team_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/searchResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "produces": [ - "application/json" - ], + "delete": { "tags": [ - "devices" + "teams" + ], + "summary": "Delete Team By ID.", + "operationId": "deleteTeamByID", + "parameters": [ + { + "type": "string", + "name": "team_id", + "in": "path", + "required": true + } ], - "summary": "Lists all devices within the last 30 days", - "operationId": "SearchDevices", "responses": { "200": { - "$ref": "#/responses/devicesSearchResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9481,46 +9315,64 @@ } } }, - "/search/sorting": { + "/teams/{team_id}/members": { "get": { "tags": [ - "search" + "teams" + ], + "summary": "Get Team Members.", + "operationId": "getTeamMembers", + "parameters": [ + { + "type": "string", + "name": "team_id", + "in": "path", + "required": true + } ], - "summary": "List search sorting options.", - "operationId": "listSortOptions", "responses": { "200": { - "$ref": "#/responses/listSortOptionsResponse" + "$ref": "#/responses/getTeamMembersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - } - }, - "/serviceaccounts": { + }, "post": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:*`\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", "tags": [ - "service_accounts" + "teams" ], - "summary": "Create service account", - "operationId": "createServiceAccount", + "summary": "Add Team Member.", + "operationId": "addTeamMember", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/CreateServiceAccountForm" + "$ref": "#/definitions/AddTeamMemberCommand" } + }, + { + "type": "string", + "name": "team_id", + "in": "path", + "required": true } ], "responses": { - "201": { - "$ref": "#/responses/createServiceAccountResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "200": { + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9528,55 +9380,48 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/serviceaccounts/search": { - "get": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:*`", + "/teams/{team_id}/members/{user_id}": { + "put": { "tags": [ - "service_accounts" + "teams" ], - "summary": "Search service accounts with paging", - "operationId": "searchOrgServiceAccountsWithPaging", + "summary": "Update Team Member.", + "operationId": "updateTeamMember", "parameters": [ { - "type": "boolean", - "name": "Disabled", - "in": "query" - }, - { - "type": "boolean", - "name": "expiredTokens", - "in": "query" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTeamMemberCommand" + } }, { "type": "string", - "description": "It will return results where the query value is contained in one of the name.\nQuery values with spaces need to be URL encoded.", - "name": "query", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "The default value is 1000.", - "name": "perpage", - "in": "query" + "name": "team_id", + "in": "path", + "required": true }, { "type": "integer", "format": "int64", - "description": "The default value is 1.", - "name": "page", - "in": "query" + "name": "user_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/searchOrgServiceAccountsWithPagingResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9584,35 +9429,38 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/serviceaccounts/{serviceAccountId}": { - "get": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:id:1` (single service account)", + }, + "delete": { "tags": [ - "service_accounts" + "teams" ], - "summary": "Get single serviceaccount by Id", - "operationId": "retrieveServiceAccount", + "summary": "Remove Member From Team.", + "operationId": "removeTeamMember", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", + "type": "string", + "name": "team_id", "in": "path", "required": true - } + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true + } ], "responses": { "200": { - "$ref": "#/responses/retrieveServiceAccountResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9627,67 +9475,60 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:delete` scope: `serviceaccounts:id:1` (single service account)", + } + }, + "/teams/{team_id}/preferences": { + "get": { "tags": [ - "service_accounts" + "teams" ], - "summary": "Delete service account", - "operationId": "deleteServiceAccount", + "summary": "Get Team Preferences.", + "operationId": "getTeamPreferences", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", + "type": "string", + "name": "team_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getPreferencesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", + "put": { "tags": [ - "service_accounts" + "teams" ], - "summary": "Update service account", - "operationId": "updateServiceAccount", + "summary": "Update Team Preferences.", + "operationId": "updateTeamPreferences", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", + "type": "string", + "name": "team_id", "in": "path", "required": true }, { - "name": "Body", + "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/UpdateServiceAccountForm" + "$ref": "#/definitions/UpdatePrefsCmd" } } ], "responses": { "200": { - "$ref": "#/responses/updateServiceAccountResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -9695,41 +9536,22 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/serviceaccounts/{serviceAccountId}/tokens": { + "/user": { "get": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `global:serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", + "description": "Get (current authenticated user)", "tags": [ - "service_accounts" - ], - "summary": "Get service account tokens", - "operationId": "listTokens", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", - "in": "path", - "required": true - } + "signed_in_user" ], + "operationId": "getSignedInUser", "responses": { "200": { - "$ref": "#/responses/listTokensResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/userResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9737,40 +9559,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", + "put": { "tags": [ - "service_accounts" + "signed_in_user" ], - "summary": "CreateNewToken adds a token to a service account", - "operationId": "createToken", + "summary": "Update signed in User.", + "operationId": "updateSignedInUser", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", - "in": "path", - "required": true - }, - { - "name": "Body", + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/AddServiceAccountTokenCommand" + "$ref": "#/definitions/UpdateUserCommand" } } ], "responses": { "200": { - "$ref": "#/responses/createTokenResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9778,48 +9594,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/serviceaccounts/{serviceAccountId}/tokens/{tokenId}": { - "delete": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", + "/user/auth-tokens": { + "get": { + "description": "Return a list of all auth tokens (devices) that the actual user currently have logged in from.", "tags": [ - "service_accounts" - ], - "summary": "DeleteToken deletes service account tokens", - "operationId": "deleteToken", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "tokenId", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", - "in": "path", - "required": true - } + "signed_in_user" ], + "summary": "Auth tokens of the actual User.", + "operationId": "getUserAuthTokens", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getUserAuthTokensResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9827,71 +9618,53 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/signing-keys/keys": { - "get": { - "description": "Required permissions\nNone", - "tags": [ - "signing_keys" - ], - "summary": "Get JSON Web Key Set (JWKS) with all the keys that can be used to verify tokens (public keys)", - "operationId": "retrieveJWKS", - "responses": { - "200": { - "$ref": "#/responses/jwksResponse" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/snapshot/shared-options": { + "/user/helpflags/clear": { "get": { "tags": [ - "snapshots" + "signed_in_user" ], - "summary": "Get snapshot sharing settings.", - "operationId": "getSharingOptions", + "summary": "Clear user help flag.", + "operationId": "clearHelpFlags", "responses": { "200": { - "$ref": "#/responses/getSharingOptionsResponse" + "$ref": "#/responses/helpFlagResponse" }, "401": { "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/snapshots": { - "post": { - "description": "Snapshot public mode should be enabled or authentication is required.", + "/user/helpflags/{flag_id}": { + "put": { "tags": [ - "snapshots" + "signed_in_user" ], - "summary": "When creating a snapshot using the API, you have to provide the full dashboard payload including the snapshot data. This endpoint is designed for the Grafana UI.", - "operationId": "createDashboardSnapshot", + "summary": "Set user help flag.", + "operationId": "setHelpFlag", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateDashboardSnapshotCommand" - } + "type": "string", + "name": "flag_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/createDashboardSnapshotResponse" + "$ref": "#/responses/helpFlagResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9905,25 +9678,22 @@ } } }, - "/snapshots-delete/{deleteKey}": { + "/user/orgs": { "get": { - "description": "Snapshot public mode should be enabled or authentication is required.", - "tags": [ - "snapshots" - ], - "summary": "Delete Snapshot by deleteKey.", - "operationId": "deleteDashboardSnapshotByDeleteKey", - "parameters": [ + "security": [ { - "type": "string", - "name": "deleteKey", - "in": "path", - "required": true + "basic": [] } ], + "description": "Return a list of all organizations of the current user.", + "tags": [ + "signed_in_user" + ], + "summary": "Organizations of the actual User.", + "operationId": "getSignedInUserOrgList", "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getSignedInUserOrgListResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9931,68 +9701,131 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/snapshots/{key}": { - "get": { + "/user/password": { + "put": { + "security": [ + { + "basic": [] + } + ], + "description": "Changes the password for the user.", "tags": [ - "snapshots" + "signed_in_user" ], - "summary": "Get Snapshot by Key.", - "operationId": "getDashboardSnapshot", + "summary": "Change Password.", + "operationId": "changeUserPassword", "parameters": [ { - "type": "string", - "name": "key", - "in": "path", - "required": true + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ChangeUserPasswordCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/getDashboardSnapshotResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" }, - "404": { - "$ref": "#/responses/notFoundError" + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/preferences": { + "get": { + "tags": [ + "user_preferences" + ], + "summary": "Get user preferences.", + "operationId": "getUserPreferences", + "responses": { + "200": { + "$ref": "#/responses/getPreferencesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "delete": { + "put": { + "description": "Omitting a key (`theme`, `homeDashboardId`, `timezone`) will cause the current value to be replaced with the system default value.", "tags": [ - "snapshots" + "user_preferences" ], - "summary": "Delete Snapshot by Key.", - "operationId": "deleteDashboardSnapshot", + "summary": "Update user preferences.", + "operationId": "updateUserPreferences", "parameters": [ { - "type": "string", - "name": "key", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } } ], "responses": { "200": { "$ref": "#/responses/okResponse" }, - "403": { - "$ref": "#/responses/forbiddenError" + "400": { + "$ref": "#/responses/badRequestError" }, - "404": { - "$ref": "#/responses/notFoundError" + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "patch": { + "tags": [ + "user_preferences" + ], + "summary": "Patch user preferences.", + "operationId": "patchUserPreferences", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchPrefsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, "500": { "$ref": "#/responses/internalServerError" @@ -10000,19 +9833,16 @@ } } }, - "/stats": { + "/user/quotas": { "get": { - "produces": [ - "application/json" - ], "tags": [ - "devices" + "signed_in_user" ], - "summary": "Lists all devices within the last 30 days", - "operationId": "listDevices", + "summary": "Fetch user quota.", + "operationId": "getUserQuotas", "responses": { "200": { - "$ref": "#/responses/devicesResponse" + "$ref": "#/responses/getQuotaResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10029,26 +9859,30 @@ } } }, - "/teams": { + "/user/revoke-auth-token": { "post": { + "description": "Revokes the given auth token (device) for the actual user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.", "tags": [ - "teams" + "signed_in_user" ], - "summary": "Add Team.", - "operationId": "createTeam", + "summary": "Revoke an auth token of the actual User.", + "operationId": "revokeUserAuthToken", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateTeamCommand" + "$ref": "#/definitions/RevokeAuthTokenCmd" } } ], "responses": { "200": { - "$ref": "#/responses/createTeamResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10056,53 +9890,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams/search": { - "get": { + "/user/stars/dashboard/uid/{dashboard_uid}": { + "post": { + "description": "Stars the given Dashboard for the actual user.", "tags": [ - "teams" + "signed_in_user" ], - "summary": "Team Search With Paging.", - "operationId": "searchTeams", + "summary": "Star a dashboard.", + "operationId": "starDashboardByUID", "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": "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" + "name": "dashboard_uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/searchTeamsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10114,28 +9929,25 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/teams/{teamId}/groups": { - "get": { + }, + "delete": { + "description": "Deletes the starring of the given Dashboard for the actual user.", "tags": [ - "sync_team_groups", - "enterprise" + "signed_in_user" ], - "summary": "Get External Groups.", - "operationId": "getTeamGroupsApi", + "summary": "Unstar a dashboard.", + "operationId": "unstarDashboardByUID", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "teamId", + "type": "string", + "name": "dashboard_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getTeamGroupsApiResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -10146,34 +9958,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/user/stars/dashboard/{dashboard_id}": { "post": { + "description": "Stars the given Dashboard for the actual user.", "tags": [ - "sync_team_groups", - "enterprise" + "signed_in_user" ], - "summary": "Add External Group.", - "operationId": "addTeamGroupApi", + "summary": "Star a dashboard.", + "operationId": "starDashboard", + "deprecated": true, "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TeamGroupMapping" - } - }, - { - "type": "integer", - "format": "int64", - "name": "teamId", + "type": "string", + "name": "dashboard_id", "in": "path", "required": true } @@ -10191,31 +9994,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "delete": { + "description": "Deletes the starring of the given Dashboard for the actual user.", "tags": [ - "sync_team_groups", - "enterprise" + "signed_in_user" ], - "summary": "Remove External Group.", - "operationId": "removeTeamGroupApiQuery", + "summary": "Unstar a dashboard.", + "operationId": "unstarDashboard", + "deprecated": true, "parameters": [ { "type": "string", - "name": "groupId", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "name": "teamId", + "name": "dashboard_id", "in": "path", "required": true } @@ -10233,33 +10028,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams/{team_id}": { + "/user/teams": { "get": { + "description": "Return a list of all teams that the current user is member of.", "tags": [ - "teams" - ], - "summary": "Get Team By ID.", - "operationId": "getTeamByID", - "parameters": [ - { - "type": "string", - "name": "team_id", - "in": "path", - "required": true - } + "signed_in_user" ], + "summary": "Teams that the actual User is member of.", + "operationId": "getSignedInUserTeamList", "responses": { "200": { - "$ref": "#/responses/getTeamByIDResponse" + "$ref": "#/responses/getSignedInUserTeamListResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10267,32 +10052,25 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "put": { + } + }, + "/user/using/{org_id}": { + "post": { + "description": "Switch user context to the given organization.", "tags": [ - "teams" + "signed_in_user" ], - "summary": "Update Team.", - "operationId": "updateTeam", + "summary": "Switch user context for signed in user.", + "operationId": "userSetUsingOrg", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateTeamCommand" - } - }, - { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } @@ -10301,40 +10079,50 @@ "200": { "$ref": "#/responses/okResponse" }, + "400": { + "$ref": "#/responses/badRequestError" + }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { + } + }, + "/users": { + "get": { + "description": "Returns all users that the authenticated user has permission to view, admin permission required.", "tags": [ - "teams" + "users" ], - "summary": "Delete Team By ID.", - "operationId": "deleteTeamByID", + "summary": "Get users.", + "operationId": "searchUsers", "parameters": [ { - "type": "string", - "name": "team_id", - "in": "path", - "required": true + "type": "integer", + "format": "int64", + "default": 1000, + "description": "Limit the maximum number of users to return per page", + "name": "perpage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "description": "Page index for starting fetching users", + "name": "page", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/searchUsersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10342,33 +10130,31 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams/{team_id}/members": { + "/users/lookup": { "get": { "tags": [ - "teams" + "users" ], - "summary": "Get Team Members.", - "operationId": "getTeamMembers", + "summary": "Get user by login or email.", + "operationId": "getUserByLoginOrEmail", "parameters": [ { "type": "string", - "name": "team_id", - "in": "path", + "description": "loginOrEmail of the user", + "name": "loginOrEmail", + "in": "query", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getTeamMembersResponse" + "$ref": "#/responses/userResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10383,32 +10169,18 @@ "$ref": "#/responses/internalServerError" } } - }, - "post": { + } + }, + "/users/search": { + "get": { "tags": [ - "teams" - ], - "summary": "Add Team Member.", - "operationId": "addTeamMember", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddTeamMemberCommand" - } - }, - { - "type": "string", - "name": "team_id", - "in": "path", - "required": true - } + "users" ], + "summary": "Get users with paging.", + "operationId": "searchUsersWithPaging", "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/searchUsersWithPagingResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10425,28 +10197,14 @@ } } }, - "/teams/{team_id}/members/{user_id}": { - "put": { + "/users/{user_id}": { + "get": { "tags": [ - "teams" + "users" ], - "summary": "Update Team Member.", - "operationId": "updateTeamMember", + "summary": "Get user by id.", + "operationId": "getUserByID", "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateTeamMemberCommand" - } - }, - { - "type": "string", - "name": "team_id", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", @@ -10457,7 +10215,7 @@ ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/userResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10473,18 +10231,22 @@ } } }, - "delete": { + "put": { + "description": "Update the user identified by id.", "tags": [ - "teams" + "users" ], - "summary": "Remove Member From Team.", - "operationId": "removeTeamMember", + "summary": "Update user.", + "operationId": "updateUser", "parameters": [ { - "type": "string", - "name": "team_id", - "in": "path", - "required": true + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserCommand" + } }, { "type": "integer", @@ -10513,81 +10275,62 @@ } } }, - "/teams/{team_id}/preferences": { + "/users/{user_id}/orgs": { "get": { + "description": "Get organizations for user identified by id.", "tags": [ - "teams" + "users" ], - "summary": "Get Team Preferences.", - "operationId": "getTeamPreferences", + "summary": "Get organizations for user.", + "operationId": "getUserOrgList", "parameters": [ { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getPreferencesResponse" + "$ref": "#/responses/getUserOrgListResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "put": { + } + }, + "/users/{user_id}/teams": { + "get": { + "description": "Get teams for user identified by id.", "tags": [ - "teams" + "users" ], - "summary": "Update Team Preferences.", - "operationId": "updateTeamPreferences", + "summary": "Get teams for user.", + "operationId": "getUserTeams", "parameters": [ { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePrefsCmd" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "500": { - "$ref": "#/responses/internalServerError" } - } - } - }, - "/user": { - "get": { - "description": "Get (current authenticated user)", - "tags": [ - "signed_in_user" ], - "operationId": "getSignedInUser", "responses": { "200": { - "$ref": "#/responses/userResponse" + "$ref": "#/responses/getUserTeamsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -10602,783 +10345,1040 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { + } + }, + "/v1/provisioning/alert-rules": { + "get": { "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Update signed in User.", - "operationId": "updateSignedInUser", + "summary": "Get all the alert rules.", + "operationId": "RouteGetAlertRules", + "responses": { + "200": { + "description": "ProvisionedAlertRules", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRules" + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "provisioning" + ], + "summary": "Create a new alert rule.", + "operationId": "RoutePostAlertRule", "parameters": [ { - "description": "To change the email, name, login, theme, provide another one.", - "name": "body", + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/UpdateUserCommand" + "$ref": "#/definitions/ProvisionedAlertRule" } + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "201": { + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } } }, - "/user/auth-tokens": { + "/v1/provisioning/alert-rules/export": { "get": { - "description": "Return a list of all auth tokens (devices) that the actual user currently have logged in from.", "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Auth tokens of the actual User.", - "operationId": "getUserAuthTokens", - "responses": { - "200": { - "$ref": "#/responses/getUserAuthTokensResponse" + "summary": "Export all alert rules in provisioning file format.", + "operationId": "RouteGetAlertRulesExport", + "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Whether to initiate a download of the file or not.", + "name": "download", + "in": "query" }, - "401": { - "$ref": "#/responses/unauthorisedError" + { + "type": "string", + "default": "yaml", + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "name": "format", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "type": "array", + "items": { + "type": "string" + }, + "description": "UIDs of folders from which to export rules", + "name": "folderUid", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" + { + "type": "string", + "description": "Name of group of rules to export. Must be specified only together with a single folder UID", + "name": "group", + "in": "query" + }, + { + "type": "string", + "description": "UID of alert rule to export. If specified, parameters folderUid and group must be empty.", + "name": "ruleUid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "AlertingFileExport", + "schema": { + "$ref": "#/definitions/AlertingFileExport" + } + }, + "404": { + "description": " Not found." } } } }, - "/user/helpflags/clear": { + "/v1/provisioning/alert-rules/{UID}": { "get": { "tags": [ - "signed_in_user" + "provisioning" + ], + "summary": "Get a specific alert rule by UID.", + "operationId": "RouteGetAlertRule", + "parameters": [ + { + "type": "string", + "description": "Alert rule UID", + "name": "UID", + "in": "path", + "required": true + } ], - "summary": "Clear user help flag.", - "operationId": "clearHelpFlags", "responses": { "200": { - "$ref": "#/responses/helpFlagResponse" + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } }, - "401": { - "$ref": "#/responses/unauthorisedError" + "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 }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } }, - "500": { - "$ref": "#/responses/internalServerError" + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" + } + ], + "responses": { + "200": { + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "tags": [ + "provisioning" + ], + "summary": "Delete a specific alert rule by UID.", + "operationId": "RouteDeleteAlertRule", + "parameters": [ + { + "type": "string", + "description": "Alert rule UID", + "name": "UID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" + } + ], + "responses": { + "204": { + "description": " The alert rule was deleted successfully." } } } }, - "/user/helpflags/{flag_id}": { - "put": { + "/v1/provisioning/alert-rules/{UID}/export": { + "get": { + "produces": [ + "application/json", + "application/yaml", + "text/yaml" + ], "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Set user help flag.", - "operationId": "setHelpFlag", + "summary": "Export an alert rule in provisioning file format.", + "operationId": "RouteGetAlertRuleExport", "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Whether to initiate a download of the file or not.", + "name": "download", + "in": "query" + }, { "type": "string", - "name": "flag_id", + "default": "yaml", + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "name": "format", + "in": "query" + }, + { + "type": "string", + "description": "Alert rule UID", + "name": "UID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/helpFlagResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "AlertingFileExport", + "schema": { + "$ref": "#/definitions/AlertingFileExport" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "404": { + "description": " Not found." } } } }, - "/user/orgs": { + "/v1/provisioning/contact-points": { "get": { - "security": [ + "tags": [ + "provisioning" + ], + "summary": "Get all the contact points.", + "operationId": "RouteGetContactpoints", + "parameters": [ { - "basic": [] + "type": "string", + "description": "Filter by name", + "name": "name", + "in": "query" } ], - "description": "Return a list of all organizations of the current user.", + "responses": { + "200": { + "description": "ContactPoints", + "schema": { + "$ref": "#/definitions/ContactPoints" + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], "tags": [ - "signed_in_user" + "provisioning" + ], + "summary": "Create a contact point.", + "operationId": "RoutePostContactpoints", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/EmbeddedContactPoint" + } + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" + } ], - "summary": "Organizations of the actual User.", - "operationId": "getSignedInUserOrgList", "responses": { - "200": { - "$ref": "#/responses/getSignedInUserOrgListResponse" + "202": { + "description": "EmbeddedContactPoint", + "schema": { + "$ref": "#/definitions/EmbeddedContactPoint" + } }, - "401": { - "$ref": "#/responses/unauthorisedError" + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/v1/provisioning/contact-points/export": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Export all contact points in provisioning file format.", + "operationId": "RouteGetContactpointsExport", + "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Whether to initiate a download of the file or not.", + "name": "download", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "type": "string", + "default": "yaml", + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "name": "format", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" + { + "type": "boolean", + "default": false, + "description": "Whether any contained secure settings should be decrypted or left redacted. Redacted settings will contain RedactedValue instead. Currently, only org admin can view decrypted secure settings.", + "name": "decrypt", + "in": "query" + }, + { + "type": "string", + "description": "Filter by name", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "AlertingFileExport", + "schema": { + "$ref": "#/definitions/AlertingFileExport" + } + }, + "403": { + "description": "PermissionDenied", + "schema": { + "$ref": "#/definitions/PermissionDenied" + } } } } }, - "/user/password": { + "/v1/provisioning/contact-points/{UID}": { "put": { - "security": [ - { - "basic": [] - } + "consumes": [ + "application/json" ], - "description": "Changes the password for the user.", "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Change Password.", - "operationId": "changeUserPassword", + "summary": "Update an existing contact point.", + "operationId": "RoutePutContactpoint", "parameters": [ { - "description": "To change the email, name, login, theme, provide another one.", - "name": "body", + "type": "string", + "description": "UID is the contact point unique identifier", + "name": "UID", + "in": "path", + "required": true + }, + { + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/ChangeUserPasswordCommand" + "$ref": "#/definitions/EmbeddedContactPoint" + } + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" + } + ], + "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": { - "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "202": { + "description": " The contact point was deleted successfully." } } } }, - "/user/preferences": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { "get": { "tags": [ - "user_preferences" + "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 + } ], - "summary": "Get user preferences.", - "operationId": "getUserPreferences", "responses": { "200": { - "$ref": "#/responses/getPreferencesResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "description": "AlertRuleGroup", + "schema": { + "$ref": "#/definitions/AlertRuleGroup" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "404": { + "description": " Not found." } } }, "put": { - "description": "Omitting a key (`theme`, `homeDashboardId`, `timezone`) will cause the current value to be replaced with the system default value.", + "consumes": [ + "application/json" + ], "tags": [ - "user_preferences" + "provisioning" ], - "summary": "Update user preferences.", - "operationId": "updateUserPreferences", + "summary": "Update the interval of a rule group.", + "operationId": "RoutePutAlertRuleGroup", "parameters": [ { - "name": "body", + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" + }, + { + "type": "string", + "name": "FolderUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Group", + "in": "path", + "required": true + }, + { + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/UpdatePrefsCmd" + "$ref": "#/definitions/AlertRuleGroup" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "description": "AlertRuleGroup", + "schema": { + "$ref": "#/definitions/AlertRuleGroup" + } }, "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } - }, - "patch": { + } + }, + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { + "get": { + "produces": [ + "application/json", + "application/yaml", + "text/yaml" + ], "tags": [ - "user_preferences" + "provisioning" ], - "summary": "Patch user preferences.", - "operationId": "patchUserPreferences", + "summary": "Export an alert rule group in provisioning file format.", + "operationId": "RouteGetAlertRuleGroupExport", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchPrefsCmd" - } + "type": "boolean", + "default": false, + "description": "Whether to initiate a download of the file or not.", + "name": "download", + "in": "query" + }, + { + "type": "string", + "default": "yaml", + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "name": "format", + "in": "query" + }, + { + "type": "string", + "name": "FolderUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Group", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "description": "AlertingFileExport", + "schema": { + "$ref": "#/definitions/AlertingFileExport" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "404": { + "description": " Not found." } } } }, - "/user/quotas": { + "/v1/provisioning/mute-timings": { "get": { "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Fetch user quota.", - "operationId": "getUserQuotas", + "summary": "Get all the mute timings.", + "operationId": "RouteGetMuteTimings", "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "MuteTimings", + "schema": { + "$ref": "#/definitions/MuteTimings" + } } } - } - }, - "/user/revoke-auth-token": { + }, "post": { - "description": "Revokes the given auth token (device) for the actual user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.", + "consumes": [ + "application/json" + ], "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Revoke an auth token of the actual User.", - "operationId": "revokeUserAuthToken", + "summary": "Create a new mute timing.", + "operationId": "RoutePostMuteTiming", "parameters": [ { - "name": "body", + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/RevokeAuthTokenCmd" + "$ref": "#/definitions/MuteTimeInterval" } + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "201": { + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } }, "400": { - "$ref": "#/responses/badRequestError" + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/v1/provisioning/mute-timings/export": { + "get": { + "tags": [ + "provisioning" + ], + "summary": "Export all mute timings in provisioning format.", + "operationId": "RouteExportMuteTimings", + "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Whether to initiate a download of the file or not.", + "name": "download", + "in": "query" }, - "401": { - "$ref": "#/responses/unauthorisedError" + { + "type": "string", + "default": "yaml", + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "name": "format", + "in": "query" + } + ], + "responses": { + "200": { + "description": "AlertingFileExport", + "schema": { + "$ref": "#/definitions/AlertingFileExport" + } }, "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "PermissionDenied", + "schema": { + "$ref": "#/definitions/PermissionDenied" + } } } } }, - "/user/stars/dashboard/uid/{dashboard_uid}": { - "post": { - "description": "Stars the given Dashboard for the actual user.", + "/v1/provisioning/mute-timings/{name}": { + "get": { "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Star a dashboard.", - "operationId": "starDashboardByUID", + "summary": "Get a mute timing.", + "operationId": "RouteGetMuteTiming", "parameters": [ { "type": "string", - "name": "dashboard_uid", + "description": "Mute timing name", + "name": "name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "404": { + "description": " Not found." } } }, - "delete": { - "description": "Deletes the starring of the given Dashboard for the actual user.", + "put": { + "consumes": [ + "application/json" + ], "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Unstar a dashboard.", - "operationId": "unstarDashboardByUID", + "summary": "Replace an existing mute timing.", + "operationId": "RoutePutMuteTiming", "parameters": [ { "type": "string", - "name": "dashboard_uid", + "description": "Mute timing name", + "name": "name", "in": "path", "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/user/stars/dashboard/{dashboard_id}": { - "post": { - "description": "Stars the given Dashboard for the actual user.", - "tags": [ - "signed_in_user" - ], - "summary": "Star a dashboard.", - "operationId": "starDashboard", - "deprecated": true, - "parameters": [ { "type": "string", - "name": "dashboard_id", - "in": "path", - "required": true + "name": "X-Disable-Provenance", + "in": "header" } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "202": { + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } }, "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } }, "delete": { - "description": "Deletes the starring of the given Dashboard for the actual user.", "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Unstar a dashboard.", - "operationId": "unstarDashboard", - "deprecated": true, + "summary": "Delete a mute timing.", + "operationId": "RouteDeleteMuteTiming", "parameters": [ { "type": "string", - "name": "dashboard_id", + "description": "Mute timing name", + "name": "name", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "204": { + "description": " The mute timing was deleted successfully." }, - "500": { - "$ref": "#/responses/internalServerError" + "409": { + "description": "GenericPublicError", + "schema": { + "$ref": "#/definitions/GenericPublicError" + } } } } }, - "/user/teams": { + "/v1/provisioning/mute-timings/{name}/export": { "get": { - "description": "Return a list of all teams that the current user is member of.", "tags": [ - "signed_in_user" + "provisioning" ], - "summary": "Teams that the actual User is member of.", - "operationId": "getSignedInUserTeamList", - "responses": { - "200": { - "$ref": "#/responses/getSignedInUserTeamListResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "summary": "Export a mute timing in provisioning format.", + "operationId": "RouteExportMuteTiming", + "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Whether to initiate a download of the file or not.", + "name": "download", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "type": "string", + "default": "yaml", + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "name": "format", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/user/using/{org_id}": { - "post": { - "description": "Switch user context to the given organization.", - "tags": [ - "signed_in_user" - ], - "summary": "Switch user context for signed in user.", - "operationId": "userSetUsingOrg", - "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "description": "Mute timing name", + "name": "name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "description": "AlertingFileExport", + "schema": { + "$ref": "#/definitions/AlertingFileExport" + } }, "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "PermissionDenied", + "schema": { + "$ref": "#/definitions/PermissionDenied" + } } } } }, - "/users": { + "/v1/provisioning/policies": { "get": { - "description": "Returns all users that the authenticated user has permission to view, admin permission required.", "tags": [ - "users" + "provisioning" ], - "summary": "Get users.", - "operationId": "searchUsers", + "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": [ { - "type": "integer", - "format": "int64", - "default": 1000, - "description": "Limit the maximum number of users to return per page", - "name": "perpage", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 1, - "description": "Page index for starting fetching users", - "name": "page", - "in": "query" + "description": "The new notification routing tree to use", + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/Route" + } + }, + { + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" } ], "responses": { - "200": { - "$ref": "#/responses/searchUsersResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "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" + } } } } }, - "/users/lookup": { + "/v1/provisioning/policies/export": { "get": { "tags": [ - "users" - ], - "summary": "Get user by login or email.", - "operationId": "getUserByLoginOrEmail", - "parameters": [ - { - "type": "string", - "description": "loginOrEmail of the user", - "name": "loginOrEmail", - "in": "query", - "required": true - } + "provisioning" ], + "summary": "Export the notification policy tree in provisioning file format.", + "operationId": "RouteGetPolicyTreeExport", "responses": { "200": { - "$ref": "#/responses/userResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "AlertingFileExport", + "schema": { + "$ref": "#/definitions/AlertingFileExport" + } }, "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "NotFound", + "schema": { + "$ref": "#/definitions/NotFound" + } } } } }, - "/users/search": { + "/v1/provisioning/templates": { "get": { "tags": [ - "users" + "provisioning" ], - "summary": "Get users with paging.", - "operationId": "searchUsersWithPaging", + "summary": "Get all notification templates.", + "operationId": "RouteGetTemplates", "responses": { "200": { - "$ref": "#/responses/searchUsersWithPagingResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "NotificationTemplates", + "schema": { + "$ref": "#/definitions/NotificationTemplates" + } }, "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": " Not found." } } } }, - "/users/{user_id}": { + "/v1/provisioning/templates/{name}": { "get": { "tags": [ - "users" + "provisioning" ], - "summary": "Get user by id.", - "operationId": "getUserByID", + "summary": "Get a notification template.", + "operationId": "RouteGetTemplate", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "description": "Template Name", + "name": "name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/userResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "NotificationTemplate", + "schema": { + "$ref": "#/definitions/NotificationTemplate" + } }, "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": " Not found." } } }, "put": { - "description": "Update the user identified by id.", + "consumes": [ + "application/json" + ], "tags": [ - "users" + "provisioning" ], - "summary": "Update user.", - "operationId": "updateUser", + "summary": "Updates an existing notification template.", + "operationId": "RoutePutTemplate", "parameters": [ { - "description": "To change the email, name, login, theme, provide another one.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateUserCommand" - } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "description": "Template Name", + "name": "name", "in": "path", "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/NotificationTemplateContent" + } }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/users/{user_id}/orgs": { - "get": { - "description": "Get organizations for user identified by id.", - "tags": [ - "users" - ], - "summary": "Get organizations for user.", - "operationId": "getUserOrgList", - "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true + "type": "string", + "name": "X-Disable-Provenance", + "in": "header" } ], "responses": { - "200": { - "$ref": "#/responses/getUserOrgListResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "202": { + "description": "NotificationTemplate", + "schema": { + "$ref": "#/definitions/NotificationTemplate" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } - } - }, - "/users/{user_id}/teams": { - "get": { - "description": "Get teams for user identified by id.", + }, + "delete": { "tags": [ - "users" + "provisioning" ], - "summary": "Get teams for user.", - "operationId": "getUserTeams", + "summary": "Delete a template.", + "operationId": "RouteDeleteTemplate", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", + "type": "string", + "description": "Template Name", + "name": "name", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/getUserTeamsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "204": { + "description": " The template was deleted successfully." } } } @@ -21454,7 +21454,6 @@ } }, "alertGroup": { - "description": "AlertGroup alert group", "type": "object", "required": [ "alerts", @@ -21478,6 +21477,7 @@ } }, "alertGroups": { + "description": "AlertGroups alert groups", "type": "array", "items": { "$ref": "#/definitions/alertGroup" @@ -21610,6 +21610,7 @@ } }, "gettableAlert": { + "description": "GettableAlert gettable alert", "type": "object", "required": [ "labels", @@ -21665,7 +21666,6 @@ } }, "gettableAlerts": { - "description": "GettableAlerts gettable alerts", "type": "array", "items": { "$ref": "#/definitions/gettableAlert" @@ -21720,13 +21720,13 @@ } }, "gettableSilences": { - "description": "GettableSilences gettable silences", "type": "array", "items": { "$ref": "#/definitions/gettableSilence" } }, "integration": { + "description": "Integration integration", "type": "object", "required": [ "name", @@ -21936,6 +21936,7 @@ } }, "receiver": { + "description": "Receiver receiver", "type": "object", "required": [ "active", diff --git a/public/openapi3.json b/public/openapi3.json index d35b174e8d7..cdf54d231db 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -11966,7 +11966,6 @@ "type": "object" }, "alertGroup": { - "description": "AlertGroup alert group", "properties": { "alerts": { "description": "alerts", @@ -11990,6 +11989,7 @@ "type": "object" }, "alertGroups": { + "description": "AlertGroups alert groups", "items": { "$ref": "#/components/schemas/alertGroup" }, @@ -12122,6 +12122,7 @@ "type": "object" }, "gettableAlert": { + "description": "GettableAlert gettable alert", "properties": { "annotations": { "$ref": "#/components/schemas/labelSet" @@ -12177,7 +12178,6 @@ "type": "object" }, "gettableAlerts": { - "description": "GettableAlerts gettable alerts", "items": { "$ref": "#/components/schemas/gettableAlert" }, @@ -12232,13 +12232,13 @@ "type": "object" }, "gettableSilences": { - "description": "GettableSilences gettable silences", "items": { "$ref": "#/components/schemas/gettableSilence" }, "type": "array" }, "integration": { + "description": "Integration integration", "properties": { "lastNotifyAttempt": { "description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time", @@ -12448,6 +12448,7 @@ "type": "object" }, "receiver": { + "description": "Receiver receiver", "properties": { "active": { "description": "active", @@ -15657,369 +15658,327 @@ ] } }, - "/api/v1/provisioning/alert-rules": { + "/auth/keys": { "get": { - "operationId": "RouteGetAlertRules", + "description": "Will return auth keys.\n\nDeprecated: true.\n\nDeprecated. Please use GET /api/serviceaccounts and GET /api/serviceaccounts/{id}/tokens instead\nsee https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", + "operationId": "getAPIkeys", + "parameters": [ + { + "description": "Show expired keys", + "in": "query", + "name": "includeExpired", + "schema": { + "default": false, + "type": "boolean" + } + } + ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProvisionedAlertRules" - } - } - }, - "description": "ProvisionedAlertRules" + "$ref": "#/components/responses/getAPIkeyResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all the alert rules.", + "summary": "Get auth keys.", "tags": [ - "provisioning" + "api_keys" ] }, "post": { - "operationId": "RoutePostAlertRule", - "parameters": [ - { - "in": "header", - "name": "X-Disable-Provenance", - "schema": { - "type": "string" - } - } - ], + "deprecated": true, + "description": "Will return details of the created API key.", + "operationId": "addAPIkey", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProvisionedAlertRule" + "$ref": "#/components/schemas/AddAPIKeyCommand" } } }, + "required": true, "x-originalParamName": "Body" }, "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProvisionedAlertRule" - } - } - }, - "description": "ProvisionedAlertRule" + "200": { + "$ref": "#/components/responses/postAPIkeyResponse" }, "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "409": { + "$ref": "#/components/responses/conflictError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create a new alert rule.", + "summary": "Creates an API key.", "tags": [ - "provisioning" + "api_keys" ] } }, - "/api/v1/provisioning/alert-rules/export": { - "get": { - "operationId": "RouteGetAlertRulesExport", + "/auth/keys/{id}": { + "delete": { + "deprecated": true, + "description": "Deletes an API key.\nDeprecated. See: https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", + "operationId": "deleteAPIkey", "parameters": [ { - "description": "Whether to initiate a download of the file or not.", - "in": "query", - "name": "download", - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "in": "query", - "name": "format", - "schema": { - "default": "yaml", - "type": "string" - } - }, - { - "description": "UIDs of folders from which to export rules", - "in": "query", - "name": "folderUid", - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - { - "description": "Name of group of rules to export. Must be specified only together with a single folder UID", - "in": "query", - "name": "group", - "schema": { - "type": "string" - } - }, - { - "description": "UID of alert rule to export. If specified, parameters folderUid and group must be empty.", - "in": "query", - "name": "ruleUid", + "in": "path", + "name": "id", + "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - } - }, - "description": "AlertingFileExport" + "$ref": "#/components/responses/okResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Export all alert rules in provisioning file format.", + "summary": "Delete API key.", "tags": [ - "provisioning" + "api_keys" ] } }, - "/api/v1/provisioning/alert-rules/{UID}": { - "delete": { - "operationId": "RouteDeleteAlertRule", + "/dashboard/snapshots": { + "get": { + "operationId": "searchDashboardSnapshots", "parameters": [ { - "description": "Alert rule UID", - "in": "path", - "name": "UID", - "required": true, + "description": "Search Query", + "in": "query", + "name": "query", "schema": { "type": "string" } }, { - "in": "header", - "name": "X-Disable-Provenance", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": " The alert rule was deleted successfully." - } - }, - "summary": "Delete a specific alert rule by UID.", - "tags": [ - "provisioning" - ] - }, - "get": { - "operationId": "RouteGetAlertRule", - "parameters": [ - { - "description": "Alert rule UID", - "in": "path", - "name": "UID", - "required": true, + "description": "Limit the number of returned results", + "in": "query", + "name": "limit", "schema": { - "type": "string" + "default": 1000, + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProvisionedAlertRule" - } - } - }, - "description": "ProvisionedAlertRule" + "$ref": "#/components/responses/searchDashboardSnapshotsResponse" }, - "404": { - "description": " Not found." + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a specific alert rule by UID.", + "summary": "List snapshots.", "tags": [ - "provisioning" + "snapshots" ] - }, - "put": { - "operationId": "RoutePutAlertRule", - "parameters": [ - { - "description": "Alert rule UID", - "in": "path", - "name": "UID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "header", - "name": "X-Disable-Provenance", - "schema": { - "type": "string" - } - } - ], + } + }, + "/dashboards/calculate-diff": { + "post": { + "operationId": "calculateDashboardDiff", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProvisionedAlertRule" + "properties": { + "base": { + "$ref": "#/components/schemas/CalculateDiffTarget" + }, + "diffType": { + "description": "The type of diff to return\nDescription:\n`basic`\n`json`", + "enum": [ + "basic", + "json" + ], + "type": "string" + }, + "new": { + "$ref": "#/components/schemas/CalculateDiffTarget" + } + }, + "type": "object" } } }, + "required": true, "x-originalParamName": "Body" }, "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProvisionedAlertRule" - } - } - }, - "description": "ProvisionedAlertRule" + "$ref": "#/components/responses/calculateDashboardDiffResponse" }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update an existing alert rule.", + "summary": "Perform diff on two dashboards.", "tags": [ - "provisioning" + "dashboards" ] } }, - "/api/v1/provisioning/alert-rules/{UID}/export": { - "get": { - "operationId": "RouteGetAlertRuleExport", - "parameters": [ - { - "description": "Whether to initiate a download of the file or not.", - "in": "query", - "name": "download", - "schema": { - "default": false, - "type": "boolean" + "/dashboards/db": { + "post": { + "description": "Creates a new dashboard or updates an existing dashboard.", + "operationId": "postDashboard", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SaveDashboardCommand" + } } }, - { - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "in": "query", - "name": "format", - "schema": { - "default": "yaml", - "type": "string" - } + "required": true, + "x-originalParamName": "Body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/postDashboardResponse" }, - { - "description": "Alert rule UID", - "in": "path", - "name": "UID", - "required": true, - "schema": { - "type": "string" - } + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "412": { + "$ref": "#/components/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } - ], + }, + "summary": "Create / Update dashboard", + "tags": [ + "dashboards" + ] + } + }, + "/dashboards/home": { + "get": { + "operationId": "getHomeDashboard", "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - }, - "text/yaml": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - } - }, - "description": "AlertingFileExport" + "$ref": "#/components/responses/getHomeDashboardResponse" }, - "404": { - "description": " Not found." + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Export an alert rule in provisioning file format.", + "summary": "Get home dashboard.", "tags": [ - "provisioning" + "dashboards" ] } }, - "/api/v1/provisioning/contact-points": { + "/dashboards/id/{DashboardID}/permissions": { "get": { - "operationId": "RouteGetContactpoints", + "deprecated": true, + "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsListByUID) instead", + "operationId": "getDashboardPermissionsListByID", "parameters": [ { - "description": "Filter by name", - "in": "query", - "name": "name", + "in": "path", + "name": "DashboardID", + "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ContactPoints" - } - } - }, - "description": "ContactPoints" + "$ref": "#/components/responses/getDashboardPermissionsListResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all the contact points.", + "summary": "Gets all existing permissions for the given dashboard.", "tags": [ - "provisioning" + "dashboard_permissions" ] }, "post": { - "operationId": "RoutePostContactpoints", + "deprecated": true, + "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.", + "operationId": "updateDashboardPermissionsByID", "parameters": [ { - "in": "header", - "name": "X-Disable-Provenance", + "in": "path", + "name": "DashboardID", + "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], @@ -16027,205 +15986,267 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmbeddedContactPoint" + "$ref": "#/components/schemas/UpdateDashboardACLCommand" } } }, + "required": true, "x-originalParamName": "Body" }, "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmbeddedContactPoint" - } - } - }, - "description": "EmbeddedContactPoint" + "200": { + "$ref": "#/components/responses/okResponse" }, "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create a contact point.", + "summary": "Updates permissions for a dashboard.", "tags": [ - "provisioning" + "dashboard_permissions" ] } }, - "/api/v1/provisioning/contact-points/export": { - "get": { - "operationId": "RouteGetContactpointsExport", + "/dashboards/id/{DashboardID}/restore": { + "post": { + "deprecated": true, + "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", + "operationId": "restoreDashboardVersionByID", "parameters": [ { - "description": "Whether to initiate a download of the file or not.", - "in": "query", - "name": "download", + "in": "path", + "name": "DashboardID", + "required": true, "schema": { - "default": false, - "type": "boolean" - } - }, - { - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "in": "query", - "name": "format", - "schema": { - "default": "yaml", - "type": "string" - } - }, - { - "description": "Whether any contained secure settings should be decrypted or left redacted. Redacted settings will contain RedactedValue instead. Currently, only org admin can view decrypted secure settings.", - "in": "query", - "name": "decrypt", - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "description": "Filter by name", - "in": "query", - "name": "name", - "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestoreDashboardVersionCommand" + } + } + }, + "required": true, + "x-originalParamName": "Body" + }, "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - } - }, - "description": "AlertingFileExport" + "$ref": "#/components/responses/postDashboardResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" }, "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionDenied" - } - } - }, - "description": "PermissionDenied" + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Export all contact points in provisioning file format.", + "summary": "Restore a dashboard to a given dashboard version.", "tags": [ - "provisioning" + "dashboard_versions" ] } }, - "/api/v1/provisioning/contact-points/{UID}": { - "delete": { - "operationId": "RouteDeleteContactpoints", + "/dashboards/id/{DashboardID}/versions": { + "get": { + "deprecated": true, + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", + "operationId": "getDashboardVersionsByID", "parameters": [ { - "description": "UID is the contact point unique identifier", "in": "path", - "name": "UID", + "name": "DashboardID", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { - "202": { - "description": " The contact point was deleted successfully." + "200": { + "$ref": "#/components/responses/dashboardVersionsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete a contact point.", + "summary": "Gets all existing versions for the dashboard.", "tags": [ - "provisioning" + "dashboard_versions" ] - }, - "put": { - "operationId": "RoutePutContactpoint", + } + }, + "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + "get": { + "deprecated": true, + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", + "operationId": "getDashboardVersionByID", "parameters": [ { - "description": "UID is the contact point unique identifier", "in": "path", - "name": "UID", + "name": "DashboardID", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } }, { - "in": "header", - "name": "X-Disable-Provenance", + "in": "path", + "name": "DashboardVersionID", + "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], + "responses": { + "200": { + "$ref": "#/components/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get a specific dashboard version.", + "tags": [ + "dashboard_versions" + ] + } + }, + "/dashboards/import": { + "post": { + "operationId": "importDashboard", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmbeddedContactPoint" + "$ref": "#/components/schemas/ImportDashboardRequest" } } }, + "required": true, "x-originalParamName": "Body" }, "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Ack" - } - } - }, - "description": "Ack" + "200": { + "$ref": "#/components/responses/importDashboardResponse" }, "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "412": { + "$ref": "#/components/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update an existing contact point.", + "summary": "Import dashboard.", "tags": [ - "provisioning" + "dashboards" ] } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "/dashboards/public-dashboards": { "get": { - "operationId": "RouteGetAlertRuleGroup", - "parameters": [ - { - "in": "path", - "name": "FolderUID", - "required": true, - "schema": { - "type": "string" - } + "description": "Get list of public dashboards", + "operationId": "listPublicDashboards", + "responses": { + "200": { + "$ref": "#/components/responses/listPublicDashboardsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/components/responses/forbiddenPublicError" + }, + "500": { + "$ref": "#/components/responses/internalServerPublicError" + } + }, + "tags": [ + "dashboard_public" + ] + } + }, + "/dashboards/tags": { + "get": { + "operationId": "getDashboardTags", + "responses": { + "200": { + "$ref": "#/components/responses/getDashboardsTagsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get all dashboards tags of an organisation.", + "tags": [ + "dashboards" + ] + } + }, + "/dashboards/uid/{dashboardUid}/public-dashboards": { + "get": { + "description": "Get public dashboard by dashboardUid", + "operationId": "getPublicDashboard", + "parameters": [ { "in": "path", - "name": "Group", + "name": "dashboardUid", "required": true, "schema": { "type": "string" @@ -16234,45 +16255,35 @@ ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertRuleGroup" - } - } - }, - "description": "AlertRuleGroup" + "$ref": "#/components/responses/getPublicDashboardResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/components/responses/forbiddenPublicError" }, "404": { - "description": " Not found." + "$ref": "#/components/responses/notFoundPublicError" + }, + "500": { + "$ref": "#/components/responses/internalServerPublicError" } }, - "summary": "Get a rule group.", "tags": [ - "provisioning" + "dashboard_public" ] }, - "put": { - "operationId": "RoutePutAlertRuleGroup", + "post": { + "description": "Create public dashboard for a dashboard", + "operationId": "createPublicDashboard", "parameters": [ - { - "in": "header", - "name": "X-Disable-Provenance", - "schema": { - "type": "string" - } - }, { "in": "path", - "name": "FolderUID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "Group", + "name": "dashboardUid", "required": true, "schema": { "type": "string" @@ -16283,65 +16294,43 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertRuleGroup" + "$ref": "#/components/schemas/PublicDashboardDTO" } } }, + "required": true, "x-originalParamName": "Body" }, "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertRuleGroup" - } - } - }, - "description": "AlertRuleGroup" + "$ref": "#/components/responses/createPublicDashboardResponse" }, "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "$ref": "#/components/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/components/responses/forbiddenPublicError" + }, + "500": { + "$ref": "#/components/responses/internalServerPublicError" } }, - "summary": "Update the interval of a rule group.", "tags": [ - "provisioning" + "dashboard_public" ] } }, - "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { - "get": { - "operationId": "RouteGetAlertRuleGroupExport", + "/dashboards/uid/{dashboardUid}/public-dashboards/{uid}": { + "delete": { + "description": "Delete public dashboard for a dashboard", + "operationId": "deletePublicDashboard", "parameters": [ - { - "description": "Whether to initiate a download of the file or not.", - "in": "query", - "name": "download", - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "in": "query", - "name": "format", - "schema": { - "default": "yaml", - "type": "string" - } - }, { "in": "path", - "name": "FolderUID", + "name": "dashboardUid", "required": true, "schema": { "type": "string" @@ -16349,7 +16338,7 @@ }, { "in": "path", - "name": "Group", + "name": "uid", "required": true, "schema": { "type": "string" @@ -16358,61 +16347,41 @@ ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - }, - "text/yaml": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - } - }, - "description": "AlertingFileExport" + "$ref": "#/components/responses/okResponse" }, - "404": { - "description": " Not found." - } - }, - "summary": "Export an alert rule group in provisioning file format.", - "tags": [ - "provisioning" - ] - } - }, - "/api/v1/provisioning/mute-timings": { - "get": { - "operationId": "RouteGetMuteTimings", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MuteTimings" - } - } - }, - "description": "MuteTimings" + "400": { + "$ref": "#/components/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/components/responses/forbiddenPublicError" + }, + "500": { + "$ref": "#/components/responses/internalServerPublicError" } }, - "summary": "Get all the mute timings.", "tags": [ - "provisioning" + "dashboard_public" ] }, - "post": { - "operationId": "RoutePostMuteTiming", + "patch": { + "description": "Update public dashboard for a dashboard", + "operationId": "updatePublicDashboard", "parameters": [ { - "in": "header", - "name": "X-Disable-Provenance", + "in": "path", + "name": "dashboardUid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "uid", + "required": true, "schema": { "type": "string" } @@ -16422,99 +16391,78 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MuteTimeInterval" + "$ref": "#/components/schemas/PublicDashboardDTO" } } }, + "required": true, "x-originalParamName": "Body" }, "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MuteTimeInterval" - } - } - }, - "description": "MuteTimeInterval" + "200": { + "$ref": "#/components/responses/updatePublicDashboardResponse" }, "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "$ref": "#/components/responses/badRequestPublicError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedPublicError" + }, + "403": { + "$ref": "#/components/responses/forbiddenPublicError" + }, + "500": { + "$ref": "#/components/responses/internalServerPublicError" } }, - "summary": "Create a new mute timing.", "tags": [ - "provisioning" + "dashboard_public" ] } }, - "/api/v1/provisioning/mute-timings/export": { - "get": { - "operationId": "RouteExportMuteTimings", + "/dashboards/uid/{uid}": { + "delete": { + "description": "Will delete the dashboard given the specified unique identifier (uid).", + "operationId": "deleteDashboardByUID", "parameters": [ { - "description": "Whether to initiate a download of the file or not.", - "in": "query", - "name": "download", - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", - "in": "query", - "name": "format", + "in": "path", + "name": "uid", + "required": true, "schema": { - "default": "yaml", "type": "string" } } ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - } - }, - "description": "AlertingFileExport" + "$ref": "#/components/responses/deleteDashboardResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" }, "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionDenied" - } - } - }, - "description": "PermissionDenied" - } - }, - "summary": "Export all mute timings in provisioning format.", + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Delete dashboard by uid.", "tags": [ - "provisioning" + "dashboards" ] - } - }, - "/api/v1/provisioning/mute-timings/{name}": { - "delete": { - "operationId": "RouteDeleteMuteTiming", + }, + "get": { + "description": "Will return the dashboard given the dashboard unique identifier (uid).", + "operationId": "getDashboardByUID", "parameters": [ { - "description": "Mute timing name", "in": "path", - "name": "name", + "name": "uid", "required": true, "schema": { "type": "string" @@ -16522,32 +16470,35 @@ } ], "responses": { - "204": { - "description": " The mute timing was deleted successfully." + "200": { + "$ref": "#/components/responses/dashboardResponse" }, - "409": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenericPublicError" - } - } - }, - "description": "GenericPublicError" + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete a mute timing.", + "summary": "Get dashboard by uid.", "tags": [ - "provisioning" + "dashboards" ] - }, + } + }, + "/dashboards/uid/{uid}/permissions": { "get": { - "operationId": "RouteGetMuteTiming", + "operationId": "getDashboardPermissionsListByUID", "parameters": [ { - "description": "Mute timing name", "in": "path", - "name": "name", + "name": "uid", "required": true, "schema": { "type": "string" @@ -16556,39 +16507,84 @@ ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MuteTimeInterval" - } - } - }, - "description": "MuteTimeInterval" + "$ref": "#/components/responses/getDashboardPermissionsListResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a mute timing.", + "summary": "Gets all existing permissions for the given dashboard.", "tags": [ - "provisioning" + "dashboard_permissions" ] }, - "put": { - "operationId": "RoutePutMuteTiming", + "post": { + "description": "This operation will remove existing permissions if they’re not included in the request.", + "operationId": "updateDashboardPermissionsByUID", "parameters": [ { - "description": "Mute timing name", "in": "path", - "name": "name", + "name": "uid", "required": true, "schema": { "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateDashboardACLCommand" + } + } + }, + "required": true, + "x-originalParamName": "Body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Updates permissions for a dashboard.", + "tags": [ + "dashboard_permissions" + ] + } + }, + "/dashboards/uid/{uid}/restore": { + "post": { + "operationId": "restoreDashboardVersionByUID", + "parameters": [ { - "in": "header", - "name": "X-Disable-Provenance", + "in": "path", + "name": "uid", + "required": true, "schema": { "type": "string" } @@ -16598,250 +16594,297 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MuteTimeInterval" + "$ref": "#/components/schemas/RestoreDashboardVersionCommand" } } }, + "required": true, "x-originalParamName": "Body" }, "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MuteTimeInterval" - } - } - }, - "description": "MuteTimeInterval" + "200": { + "$ref": "#/components/responses/postDashboardResponse" }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Replace an existing mute timing.", + "summary": "Restore a dashboard to a given dashboard version using UID.", "tags": [ - "provisioning" + "dashboard_versions" ] } }, - "/api/v1/provisioning/mute-timings/{name}/export": { + "/dashboards/uid/{uid}/versions": { "get": { - "operationId": "RouteExportMuteTiming", + "operationId": "getDashboardVersionsByUID", "parameters": [ { - "description": "Whether to initiate a download of the file or not.", - "in": "query", - "name": "download", + "in": "path", + "name": "uid", + "required": true, "schema": { - "default": false, - "type": "boolean" + "type": "string" } }, { - "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "description": "Maximum number of results to return", "in": "query", - "name": "format", + "name": "limit", "schema": { - "default": "yaml", - "type": "string" + "default": 0, + "format": "int64", + "type": "integer" } }, { - "description": "Mute timing name", - "in": "path", - "name": "name", - "required": true, + "description": "Version to start from when returning queries", + "in": "query", + "name": "start", "schema": { - "type": "string" + "default": 0, + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - } - }, - "description": "AlertingFileExport" + "$ref": "#/components/responses/dashboardVersionsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" }, "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionDenied" - } - } - }, - "description": "PermissionDenied" + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Export a mute timing in provisioning format.", + "summary": "Gets all existing versions for the dashboard using UID.", "tags": [ - "provisioning" + "dashboard_versions" ] } }, - "/api/v1/provisioning/policies": { - "delete": { - "operationId": "RouteResetPolicyTree", - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Ack" - } - } - }, - "description": "Ack" - } - }, - "summary": "Clears the notification policy tree.", - "tags": [ - "provisioning" + "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { + "get": { + "operationId": "getDashboardVersionByUID", + "parameters": [ + { + "in": "path", + "name": "DashboardVersionID", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "in": "path", + "name": "uid", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get a specific dashboard version using UID.", + "tags": [ + "dashboard_versions" ] - }, + } + }, + "/datasources": { "get": { - "operationId": "RouteGetPolicyTree", + "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:*`.", + "operationId": "getDataSources", "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Route" - } - } - }, - "description": "Route" + "$ref": "#/components/responses/getDataSourcesResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get the notification policy tree.", + "summary": "Get all data sources.", "tags": [ - "provisioning" + "datasources" ] }, - "put": { - "operationId": "RoutePutPolicyTree", - "parameters": [ - { - "in": "header", - "name": "X-Disable-Provenance", - "schema": { - "type": "string" - } - } - ], + "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`", + "operationId": "addDataSource", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Route" + "$ref": "#/components/schemas/AddDataSourceCommand" } } }, - "description": "The new notification routing tree to use", + "required": true, "x-originalParamName": "Body" }, "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Ack" - } - } - }, - "description": "Ack" + "200": { + "$ref": "#/components/responses/createOrUpdateDatasourceResponse" }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "409": { + "$ref": "#/components/responses/conflictError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Sets the notification policy tree.", + "summary": "Create a data source.", "tags": [ - "provisioning" + "datasources" ] } }, - "/api/v1/provisioning/policies/export": { + "/datasources/correlations": { "get": { - "operationId": "RouteGetPolicyTreeExport", + "operationId": "getCorrelations", + "parameters": [ + { + "description": "Limit the maximum number of correlations to return per page", + "in": "query", + "name": "limit", + "schema": { + "default": 100, + "format": "int64", + "maximum": 1000, + "type": "integer" + } + }, + { + "description": "Page index for starting fetching correlations", + "in": "query", + "name": "page", + "schema": { + "default": 1, + "format": "int64", + "type": "integer" + } + }, + { + "description": "Source datasource UID filter to be applied to correlations", + "in": "query", + "name": "sourceUID", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertingFileExport" - } - } - }, - "description": "AlertingFileExport" + "$ref": "#/components/responses/getCorrelationsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" }, "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFound" - } - } - }, - "description": "NotFound" + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Export the notification policy tree in provisioning file format.", + "summary": "Gets all correlations.", "tags": [ - "provisioning" + "correlations" ] } }, - "/api/v1/provisioning/templates": { + "/datasources/id/{name}": { "get": { - "operationId": "RouteGetTemplates", + "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).", + "operationId": "getDataSourceIdByName", + "parameters": [ + { + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationTemplates" - } - } - }, - "description": "NotificationTemplates" + "$ref": "#/components/responses/getDataSourceIDResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all notification templates.", + "summary": "Get data source Id by Name.", "tags": [ - "provisioning" + "datasources" ] } }, - "/api/v1/provisioning/templates/{name}": { + "/datasources/name/{name}": { "delete": { - "operationId": "RouteDeleteTemplate", + "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).", + "operationId": "deleteDataSourceByName", "parameters": [ { - "description": "Template Name", "in": "path", "name": "name", "required": true, @@ -16851,20 +16894,32 @@ } ], "responses": { - "204": { - "description": " The template was deleted successfully." + "200": { + "$ref": "#/components/responses/deleteDataSourceByNameResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete a template.", + "summary": "Delete an existing data source by name.", "tags": [ - "provisioning" + "datasources" ] }, "get": { - "operationId": "RouteGetTemplate", + "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).", + "operationId": "getDataSourceByName", "parameters": [ { - "description": "Template Name", "in": "path", "name": "name", "required": true, @@ -16875,100 +16930,98 @@ ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationTemplate" - } - } - }, - "description": "NotificationTemplate" + "$ref": "#/components/responses/getDataSourceResponse" }, - "404": { - "description": " Not found." + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a notification template.", + "summary": "Get a single data source by Name.", "tags": [ - "provisioning" + "datasources" ] - }, - "put": { - "operationId": "RoutePutTemplate", + } + }, + "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "delete": { + "description": "Proxies all calls to the actual data source.", + "operationId": "datasourceProxyDELETEByUIDcalls", "parameters": [ { - "description": "Template Name", "in": "path", - "name": "name", + "name": "uid", "required": true, "schema": { "type": "string" } }, { - "in": "header", - "name": "X-Disable-Provenance", + "in": "path", + "name": "datasource_proxy_route", + "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationTemplateContent" - } - } - }, - "x-originalParamName": "Body" - }, "responses": { "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationTemplate" - } - } - }, - "description": "NotificationTemplate" + "description": "(empty)" }, "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - }, - "description": "ValidationError" + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "Updates an existing notification template.", + "summary": "Data source proxy DELETE calls.", "tags": [ - "provisioning" + "datasources" ] - } - }, - "/auth/keys": { + }, "get": { - "description": "Will return auth keys.\n\nDeprecated: true.\n\nDeprecated. Please use GET /api/serviceaccounts and GET /api/serviceaccounts/{id}/tokens instead\nsee https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", - "operationId": "getAPIkeys", + "description": "Proxies all calls to the actual data source.", + "operationId": "datasourceProxyGETByUIDcalls", "parameters": [ { - "description": "Show expired keys", - "in": "query", - "name": "includeExpired", + "in": "path", + "name": "datasource_proxy_route", + "required": true, "schema": { - "default": false, - "type": "boolean" + "type": "string" + } + }, + { + "in": "path", + "name": "uid", + "required": true, + "schema": { + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/getAPIkeyResponse" + "description": "(empty)" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -16983,29 +17036,47 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get auth keys.", + "summary": "Data source proxy GET calls.", "tags": [ - "api_keys" + "datasources" ] }, "post": { - "deprecated": true, - "description": "Will return details of the created API key.", - "operationId": "addAPIkey", + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", + "operationId": "datasourceProxyPOSTByUIDcalls", + "parameters": [ + { + "in": "path", + "name": "datasource_proxy_route", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "uid", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/AddAPIKeyCommand" - } + "schema": {} } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "DatasourceProxyParam" }, "responses": { - "200": { - "$ref": "#/components/responses/postAPIkeyResponse" + "201": { + "description": "(empty)" + }, + "202": { + "description": "(empty)" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -17016,38 +17087,48 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "409": { - "$ref": "#/components/responses/conflictError" + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Creates an API key.", + "summary": "Data source proxy POST calls.", "tags": [ - "api_keys" + "datasources" ] } }, - "/auth/keys/{id}": { + "/datasources/proxy/{id}/{datasource_proxy_route}": { "delete": { "deprecated": true, - "description": "Deletes an API key.\nDeprecated. See: https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-the-api.", - "operationId": "deleteAPIkey", + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", + "operationId": "datasourceProxyDELETEcalls", "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" + } + }, + { + "in": "path", + "name": "datasource_proxy_route", + "required": true, + "schema": { + "type": "string" } } ], "responses": { - "200": { - "$ref": "#/components/responses/okResponse" + "202": { + "description": "(empty)" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17062,117 +17143,95 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete API key.", + "summary": "Data source proxy DELETE calls.", "tags": [ - "api_keys" + "datasources" ] - } - }, - "/dashboard/snapshots": { + }, "get": { - "operationId": "searchDashboardSnapshots", + "deprecated": true, + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", + "operationId": "datasourceProxyGETcalls", "parameters": [ { - "description": "Search Query", - "in": "query", - "name": "query", + "in": "path", + "name": "datasource_proxy_route", + "required": true, "schema": { "type": "string" } }, { - "description": "Limit the number of returned results", - "in": "query", - "name": "limit", + "in": "path", + "name": "id", + "required": true, "schema": { - "default": 1000, - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/searchDashboardSnapshotsResponse" + "description": "(empty)" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "List snapshots.", + "summary": "Data source proxy GET calls.", "tags": [ - "snapshots" + "datasources" ] - } - }, - "/dashboards/calculate-diff": { + }, "post": { - "operationId": "calculateDashboardDiff", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "base": { - "$ref": "#/components/schemas/CalculateDiffTarget" - }, - "diffType": { - "description": "The type of diff to return\nDescription:\n`basic`\n`json`", - "enum": [ - "basic", - "json" - ], - "type": "string" - }, - "new": { - "$ref": "#/components/schemas/CalculateDiffTarget" - } - }, - "type": "object" - } + "deprecated": true, + "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", + "operationId": "datasourceProxyPOSTcalls", + "parameters": [ + { + "in": "path", + "name": "datasource_proxy_route", + "required": true, + "schema": { + "type": "string" } }, - "required": true, - "x-originalParamName": "Body" - }, - "responses": { - "200": { - "$ref": "#/components/responses/calculateDashboardDiffResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } } - }, - "summary": "Perform diff on two dashboards.", - "tags": [ - "dashboards" - ] - } - }, - "/dashboards/db": { - "post": { - "description": "Creates a new dashboard or updates an existing dashboard.", - "operationId": "postDashboard", + ], "requestBody": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/SaveDashboardCommand" - } + "schema": {} } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "DatasourceProxyParam" }, "responses": { - "200": { - "$ref": "#/components/responses/postDashboardResponse" + "201": { + "description": "(empty)" + }, + "202": { + "description": "(empty)" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -17186,68 +17245,36 @@ "404": { "$ref": "#/components/responses/notFoundError" }, - "412": { - "$ref": "#/components/responses/preconditionFailedError" - }, - "422": { - "$ref": "#/components/responses/unprocessableEntityError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Create / Update dashboard", - "tags": [ - "dashboards" - ] - } - }, - "/dashboards/home": { - "get": { - "operationId": "getHomeDashboard", - "responses": { - "200": { - "$ref": "#/components/responses/getHomeDashboardResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get home dashboard.", + "summary": "Data source proxy POST calls.", "tags": [ - "dashboards" + "datasources" ] } }, - "/dashboards/id/{DashboardID}/permissions": { + "/datasources/uid/{sourceUID}/correlations": { "get": { - "deprecated": true, - "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsListByUID) instead", - "operationId": "getDashboardPermissionsListByID", + "operationId": "getCorrelationsBySourceUID", "parameters": [ { "in": "path", - "name": "DashboardID", + "name": "sourceUID", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/getDashboardPermissionsListResponse" + "$ref": "#/components/responses/getCorrelationsBySourceUIDResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "404": { "$ref": "#/components/responses/notFoundError" }, @@ -17255,23 +17282,20 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets all existing permissions for the given dashboard.", + "summary": "Gets all correlations originating from the given data source.", "tags": [ - "dashboard_permissions" + "correlations" ] }, "post": { - "deprecated": true, - "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.", - "operationId": "updateDashboardPermissionsByID", + "operationId": "createCorrelation", "parameters": [ { "in": "path", - "name": "DashboardID", + "name": "sourceUID", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], @@ -17279,16 +17303,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateDashboardACLCommand" + "$ref": "#/components/schemas/CreateCorrelationCommand" } } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/createCorrelationResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -17306,25 +17330,69 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Updates permissions for a dashboard.", + "summary": "Add correlation.", "tags": [ - "dashboard_permissions" + "correlations" ] } }, - "/dashboards/id/{DashboardID}/restore": { - "post": { - "deprecated": true, - "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", - "operationId": "restoreDashboardVersionByID", + "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + "get": { + "operationId": "getCorrelation", "parameters": [ { "in": "path", - "name": "DashboardID", + "name": "sourceUID", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" + } + }, + { + "in": "path", + "name": "correlationUID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getCorrelationResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Gets a correlation.", + "tags": [ + "correlations" + ] + }, + "patch": { + "operationId": "updateCorrelation", + "parameters": [ + { + "in": "path", + "name": "sourceUID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "correlationUID", + "required": true, + "schema": { + "type": "string" } } ], @@ -17332,16 +17400,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestoreDashboardVersionCommand" + "$ref": "#/components/schemas/UpdateCorrelationCommand" } } }, - "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/postDashboardResponse" + "$ref": "#/components/responses/updateCorrelationResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17356,31 +17426,29 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Restore a dashboard to a given dashboard version.", + "summary": "Updates a correlation.", "tags": [ - "dashboard_versions" + "correlations" ] } }, - "/dashboards/id/{DashboardID}/versions": { - "get": { - "deprecated": true, - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", - "operationId": "getDashboardVersionsByID", + "/datasources/uid/{uid}": { + "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).", + "operationId": "deleteDataSourceByUID", "parameters": [ { "in": "path", - "name": "DashboardID", + "name": "uid", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/dashboardVersionsResponse" + "$ref": "#/components/responses/okResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17395,40 +17463,30 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets all existing versions for the dashboard.", + "summary": "Delete an existing data source by UID.", "tags": [ - "dashboard_versions" + "datasources" ] - } - }, - "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + }, "get": { - "deprecated": true, - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", - "operationId": "getDashboardVersionByID", + "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).", + "operationId": "getDataSourceByUID", "parameters": [ { "in": "path", - "name": "DashboardID", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - }, - { - "in": "path", - "name": "DashboardVersionID", + "name": "uid", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/dashboardVersionResponse" + "$ref": "#/components/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17443,20 +17501,29 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a specific dashboard version.", + "summary": "Get a single data source by UID.", "tags": [ - "dashboard_versions" + "datasources" ] - } - }, - "/dashboards/import": { - "post": { - "operationId": "importDashboard", + }, + "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).", + "operationId": "updateDataSourceByUID", + "parameters": [ + { + "in": "path", + "name": "uid", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImportDashboardRequest" + "$ref": "#/components/schemas/UpdateDataSourceCommand" } } }, @@ -17465,170 +17532,72 @@ }, "responses": { "200": { - "$ref": "#/components/responses/importDashboardResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "412": { - "$ref": "#/components/responses/preconditionFailedError" - }, - "422": { - "$ref": "#/components/responses/unprocessableEntityError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Import dashboard.", - "tags": [ - "dashboards" - ] - } - }, - "/dashboards/public-dashboards": { - "get": { - "description": "Get list of public dashboards", - "operationId": "listPublicDashboards", - "responses": { - "200": { - "$ref": "#/components/responses/listPublicDashboardsResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedPublicError" - }, "403": { - "$ref": "#/components/responses/forbiddenPublicError" - }, - "500": { - "$ref": "#/components/responses/internalServerPublicError" - } - }, - "tags": [ - "dashboard_public" - ] - } - }, - "/dashboards/tags": { - "get": { - "operationId": "getDashboardTags", - "responses": { - "200": { - "$ref": "#/components/responses/getDashboardsTagsResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "$ref": "#/components/responses/forbiddenError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all dashboards tags of an organisation.", + "summary": "Update an existing data source.", "tags": [ - "dashboards" + "datasources" ] } }, - "/dashboards/uid/{dashboardUid}/public-dashboards": { - "get": { - "description": "Get public dashboard by dashboardUid", - "operationId": "getPublicDashboard", + "/datasources/uid/{uid}/correlations/{correlationUID}": { + "delete": { + "operationId": "deleteCorrelation", "parameters": [ { "in": "path", - "name": "dashboardUid", + "name": "uid", "required": true, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/getPublicDashboardResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestPublicError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedPublicError" - }, - "403": { - "$ref": "#/components/responses/forbiddenPublicError" - }, - "404": { - "$ref": "#/components/responses/notFoundPublicError" }, - "500": { - "$ref": "#/components/responses/internalServerPublicError" - } - }, - "tags": [ - "dashboard_public" - ] - }, - "post": { - "description": "Create public dashboard for a dashboard", - "operationId": "createPublicDashboard", - "parameters": [ { "in": "path", - "name": "dashboardUid", + "name": "correlationUID", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PublicDashboardDTO" - } - } - }, - "required": true, - "x-originalParamName": "Body" - }, "responses": { "200": { - "$ref": "#/components/responses/createPublicDashboardResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestPublicError" + "$ref": "#/components/responses/deleteCorrelationResponse" }, "401": { - "$ref": "#/components/responses/unauthorisedPublicError" + "$ref": "#/components/responses/unauthorisedError" }, "403": { - "$ref": "#/components/responses/forbiddenPublicError" + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { - "$ref": "#/components/responses/internalServerPublicError" + "$ref": "#/components/responses/internalServerError" } }, + "summary": "Delete a correlation.", "tags": [ - "dashboard_public" + "correlations" ] } }, - "/dashboards/uid/{dashboardUid}/public-dashboards/{uid}": { - "delete": { - "description": "Delete public dashboard for a dashboard", - "operationId": "deletePublicDashboard", + "/datasources/uid/{uid}/health": { + "get": { + "operationId": "checkDatasourceHealthWithUID", "parameters": [ - { - "in": "path", - "name": "dashboardUid", - "required": true, - "schema": { - "type": "string" - } - }, { "in": "path", "name": "uid", @@ -17643,29 +17612,31 @@ "$ref": "#/components/responses/okResponse" }, "400": { - "$ref": "#/components/responses/badRequestPublicError" + "$ref": "#/components/responses/badRequestError" }, "401": { - "$ref": "#/components/responses/unauthorisedPublicError" + "$ref": "#/components/responses/unauthorisedError" }, "403": { - "$ref": "#/components/responses/forbiddenPublicError" + "$ref": "#/components/responses/forbiddenError" }, "500": { - "$ref": "#/components/responses/internalServerPublicError" + "$ref": "#/components/responses/internalServerError" } }, + "summary": "Sends a health check request to the plugin datasource identified by the UID.", "tags": [ - "dashboard_public" + "datasources" ] - }, - "patch": { - "description": "Update public dashboard for a dashboard", - "operationId": "updatePublicDashboard", + } + }, + "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { + "get": { + "operationId": "callDatasourceResourceWithUID", "parameters": [ { "in": "path", - "name": "dashboardUid", + "name": "datasource_proxy_route", "required": true, "schema": { "type": "string" @@ -17680,47 +17651,41 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PublicDashboardDTO" - } - } - }, - "required": true, - "x-originalParamName": "Body" - }, "responses": { "200": { - "$ref": "#/components/responses/updatePublicDashboardResponse" + "$ref": "#/components/responses/okResponse" }, "400": { - "$ref": "#/components/responses/badRequestPublicError" + "$ref": "#/components/responses/badRequestError" }, "401": { - "$ref": "#/components/responses/unauthorisedPublicError" + "$ref": "#/components/responses/unauthorisedError" }, "403": { - "$ref": "#/components/responses/forbiddenPublicError" + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { - "$ref": "#/components/responses/internalServerPublicError" + "$ref": "#/components/responses/internalServerError" } }, + "summary": "Fetch data source resources.", "tags": [ - "dashboard_public" + "datasources" ] } }, - "/dashboards/uid/{uid}": { + "/datasources/{id}": { "delete": { - "description": "Will delete the dashboard given the specified unique identifier (uid).", - "operationId": "deleteDashboardByUID", + "deprecated": true, + "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", + "operationId": "deleteDataSourceByID", "parameters": [ { "in": "path", - "name": "uid", + "name": "id", "required": true, "schema": { "type": "string" @@ -17729,7 +17694,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/deleteDashboardResponse" + "$ref": "#/components/responses/okResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17744,18 +17709,19 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete dashboard by uid.", + "summary": "Delete an existing data source by id.", "tags": [ - "dashboards" + "datasources" ] }, "get": { - "description": "Will return the dashboard given the dashboard unique identifier (uid).", - "operationId": "getDashboardByUID", + "deprecated": true, + "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", + "operationId": "getDataSourceByID", "parameters": [ { "in": "path", - "name": "uid", + "name": "id", "required": true, "schema": { "type": "string" @@ -17764,7 +17730,10 @@ ], "responses": { "200": { - "$ref": "#/components/responses/dashboardResponse" + "$ref": "#/components/responses/getDataSourceResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17779,54 +17748,19 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get dashboard by uid.", + "summary": "Get a single data source by Id.", "tags": [ - "dashboards" + "datasources" ] - } - }, - "/dashboards/uid/{uid}/permissions": { - "get": { - "operationId": "getDashboardPermissionsListByUID", + }, + "put": { + "deprecated": true, + "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", + "operationId": "updateDataSourceByID", "parameters": [ { "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/getDashboardPermissionsListResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Gets all existing permissions for the given dashboard.", - "tags": [ - "dashboard_permissions" - ] - }, - "post": { - "description": "This operation will remove existing permissions if they’re not included in the request.", - "operationId": "updateDashboardPermissionsByUID", - "parameters": [ - { - "in": "path", - "name": "uid", + "name": "id", "required": true, "schema": { "type": "string" @@ -17837,7 +17771,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateDashboardACLCommand" + "$ref": "#/components/schemas/UpdateDataSourceCommand" } } }, @@ -17846,10 +17780,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17857,46 +17788,37 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Updates permissions for a dashboard.", + "summary": "Update an existing data source by its sequential ID.", "tags": [ - "dashboard_permissions" + "datasources" ] } }, - "/dashboards/uid/{uid}/restore": { - "post": { - "operationId": "restoreDashboardVersionByUID", + "/datasources/{id}/health": { + "get": { + "deprecated": true, + "description": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", + "operationId": "checkDatasourceHealthByID", "parameters": [ { "in": "path", - "name": "uid", + "name": "id", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestoreDashboardVersionCommand" - } - } - }, - "required": true, - "x-originalParamName": "Body" - }, "responses": { "200": { - "$ref": "#/components/responses/postDashboardResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17904,55 +17826,45 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Restore a dashboard to a given dashboard version using UID.", + "summary": "Sends a health check request to the plugin datasource identified by the ID.", "tags": [ - "dashboard_versions" + "datasources" ] } }, - "/dashboards/uid/{uid}/versions": { + "/datasources/{id}/resources/{datasource_proxy_route}": { "get": { - "operationId": "getDashboardVersionsByUID", + "deprecated": true, + "description": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", + "operationId": "callDatasourceResourceByID", "parameters": [ { "in": "path", - "name": "uid", + "name": "datasource_proxy_route", "required": true, "schema": { "type": "string" } }, { - "description": "Maximum number of results to return", - "in": "query", - "name": "limit", - "schema": { - "default": 0, - "format": "int64", - "type": "integer" - } - }, - { - "description": "Version to start from when returning queries", - "in": "query", - "name": "start", + "in": "path", + "name": "id", + "required": true, "schema": { - "default": 0, - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/dashboardVersionsResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -17967,37 +17879,36 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets all existing versions for the dashboard using UID.", + "summary": "Fetch data source resources by Id.", "tags": [ - "dashboard_versions" + "datasources" ] } }, - "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { - "get": { - "operationId": "getDashboardVersionByUID", - "parameters": [ - { - "in": "path", - "name": "DashboardVersionID", - "required": true, - "schema": { - "format": "int64", - "type": "integer" + "/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`.", + "operationId": "queryMetricsWithExpressions", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricRequest" + } } }, - { - "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" - } - } - ], + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/dashboardVersionResponse" + "$ref": "#/components/responses/queryMetricsWithExpressionsRespons" + }, + "207": { + "$ref": "#/components/responses/queryMetricsWithExpressionsRespons" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18005,26 +17916,53 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a specific dashboard version using UID.", + "summary": "DataSource query metrics with expressions.", "tags": [ - "dashboard_versions" + "ds" ] } }, - "/datasources": { + "/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 scope: `datasources:*`.", - "operationId": "getDataSources", + "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID\nand returns the immediate subfolders that the authenticated user has permission to view.\nIf the parameter is not supplied then it returns immediate subfolders under the root\nthat the authenticated user has permission to view.", + "operationId": "getFolders", + "parameters": [ + { + "description": "Limit the maximum number of folders to return", + "in": "query", + "name": "limit", + "schema": { + "default": 1000, + "format": "int64", + "type": "integer" + } + }, + { + "description": "Page index for starting fetching folders", + "in": "query", + "name": "page", + "schema": { + "default": 1, + "format": "int64", + "type": "integer" + } + }, + { + "description": "The parent folder UID", + "in": "query", + "name": "parentUid", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "$ref": "#/components/responses/getDataSourcesResponse" + "$ref": "#/components/responses/getFoldersResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18036,28 +17974,31 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all data sources.", + "summary": "Get all folders.", "tags": [ - "datasources" + "folders" ] }, "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`", - "operationId": "addDataSource", + "description": "If nested folders are enabled then it additionally expects the parent folder UID.", + "operationId": "createFolder", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddDataSourceCommand" + "$ref": "#/components/schemas/CreateFolderCommand" } } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/createOrUpdateDatasourceResponse" + "$ref": "#/components/responses/folderResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18072,56 +18013,87 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create a data source.", + "summary": "Create folder.", "tags": [ - "datasources" + "folders" ] } }, - "/datasources/correlations": { + "/folders/id/{folder_id}": { "get": { - "operationId": "getCorrelations", + "deprecated": true, + "description": "Returns the folder identified by id. This is deprecated.\nPlease refer to [updated API](#/folders/getFolderByUID) instead", + "operationId": "getFolderByID", "parameters": [ { - "description": "Limit the maximum number of correlations to return per page", - "in": "query", - "name": "limit", + "in": "path", + "name": "folder_id", + "required": true, "schema": { - "default": 100, "format": "int64", - "maximum": 1000, "type": "integer" } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/folderResponse" }, - { - "description": "Page index for starting fetching correlations", - "in": "query", - "name": "page", - "schema": { - "default": 1, - "format": "int64", - "type": "integer" - } + "401": { + "$ref": "#/components/responses/unauthorisedError" }, - { - "description": "Source datasource UID filter to be applied to correlations", - "in": "query", - "name": "sourceUID", + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get folder by id.", + "tags": [ + "folders" + ] + } + }, + "/folders/{folder_uid}": { + "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.\nIf nested folders are enabled then it also deletes all the subfolders.", + "operationId": "deleteFolder", + "parameters": [ + { + "in": "path", + "name": "folder_uid", + "required": true, "schema": { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" + } + }, + { + "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.", + "in": "query", + "name": "forceDeleteRules", + "schema": { + "default": false, + "type": "boolean" } } ], "responses": { "200": { - "$ref": "#/components/responses/getCorrelationsResponse" + "$ref": "#/components/responses/deleteFolderResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, "404": { "$ref": "#/components/responses/notFoundError" }, @@ -18129,20 +18101,17 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets all correlations.", + "summary": "Delete folder.", "tags": [ - "correlations" + "folders" ] - } - }, - "/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).", - "operationId": "getDataSourceIdByName", + "operationId": "getFolderByUID", "parameters": [ { "in": "path", - "name": "name", + "name": "folder_uid", "required": true, "schema": { "type": "string" @@ -18151,7 +18120,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getDataSourceIDResponse" + "$ref": "#/components/responses/folderResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18166,29 +18135,41 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get data source Id by Name.", + "summary": "Get folder by uid.", "tags": [ - "datasources" + "folders" ] - } - }, - "/datasources/name/{name}": { - "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).", - "operationId": "deleteDataSourceByName", + }, + "put": { + "operationId": "updateFolder", "parameters": [ { "in": "path", - "name": "name", + "name": "folder_uid", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateFolderCommand" + } + } + }, + "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`.", + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/deleteDataSourceByNameResponse" + "$ref": "#/components/responses/folderResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18199,22 +18180,26 @@ "404": { "$ref": "#/components/responses/notFoundError" }, + "409": { + "$ref": "#/components/responses/conflictError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete an existing data source by name.", + "summary": "Update folder.", "tags": [ - "datasources" + "folders" ] - }, + } + }, + "/folders/{folder_uid}/counts": { "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).", - "operationId": "getDataSourceByName", + "operationId": "getFolderDescendantCounts", "parameters": [ { "in": "path", - "name": "name", + "name": "folder_uid", "required": true, "schema": { "type": "string" @@ -18223,7 +18208,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getDataSourceResponse" + "$ref": "#/components/responses/getFolderDescendantCountsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18231,44 +18216,46 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a single data source by Name.", + "summary": "Gets the count of each descendant of a folder by kind. The folder is identified by UID.", "tags": [ - "datasources" + "folders" ] } }, - "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { - "delete": { - "description": "Proxies all calls to the actual data source.", - "operationId": "datasourceProxyDELETEByUIDcalls", + "/folders/{folder_uid}/move": { + "post": { + "operationId": "moveFolder", "parameters": [ { "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "datasource_proxy_route", + "name": "folder_uid", "required": true, "schema": { "type": "string" } } ], - "responses": { - "202": { - "description": "(empty)" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MoveFolderCommand" + } + } }, - "400": { - "$ref": "#/components/responses/badRequestError" + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/folderResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18283,26 +18270,19 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Data source proxy DELETE calls.", + "summary": "Move folder.", "tags": [ - "datasources" + "folders" ] - }, + } + }, + "/folders/{folder_uid}/permissions": { "get": { - "description": "Proxies all calls to the actual data source.", - "operationId": "datasourceProxyGETByUIDcalls", + "operationId": "getFolderPermissionList", "parameters": [ { "in": "path", - "name": "datasource_proxy_route", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "uid", + "name": "folder_uid", "required": true, "schema": { "type": "string" @@ -18311,10 +18291,7 @@ ], "responses": { "200": { - "description": "(empty)" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getFolderPermissionListResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18329,26 +18306,17 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Data source proxy GET calls.", + "summary": "Gets all existing permissions for the folder with the given `uid`.", "tags": [ - "datasources" + "folder_permissions" ] }, "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", - "operationId": "datasourceProxyPOSTByUIDcalls", + "operationId": "updateFolderPermissions", "parameters": [ { "in": "path", - "name": "datasource_proxy_route", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "uid", + "name": "folder_uid", "required": true, "schema": { "type": "string" @@ -18358,21 +18326,17 @@ "requestBody": { "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/UpdateDashboardACLCommand" + } } }, "required": true, - "x-originalParamName": "DatasourceProxyParam" + "x-originalParamName": "Body" }, "responses": { - "201": { - "description": "(empty)" - }, - "202": { - "description": "(empty)" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "200": { + "$ref": "#/components/responses/okResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18387,144 +18351,128 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Data source proxy POST calls.", + "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", "tags": [ - "datasources" + "folder_permissions" ] } }, - "/datasources/proxy/{id}/{datasource_proxy_route}": { - "delete": { - "deprecated": true, - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", - "operationId": "datasourceProxyDELETEcalls", + "/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.", + "operationId": "getLibraryElements", "parameters": [ { - "in": "path", - "name": "id", - "required": true, + "description": "Part of the name or description searched for.", + "in": "query", + "name": "searchString", "schema": { "type": "string" } }, { - "in": "path", - "name": "datasource_proxy_route", - "required": true, + "description": "Kind of element to search for.", + "in": "query", + "name": "kind", "schema": { - "type": "string" + "enum": [ + 1, + 2 + ], + "format": "int64", + "type": "integer" } - } - ], - "responses": { - "202": { - "description": "(empty)" - }, - "400": { - "$ref": "#/components/responses/badRequestError" }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + { + "description": "Sort order of elements.", + "in": "query", + "name": "sortDirection", + "schema": { + "enum": [ + "alpha-asc", + "alpha-desc" + ], + "type": "string" + } }, - "404": { - "$ref": "#/components/responses/notFoundError" + { + "description": "A comma separated list of types to filter the elements by", + "in": "query", + "name": "typeFilter", + "schema": { + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Data source proxy DELETE calls.", - "tags": [ - "datasources" - ] - }, - "get": { - "deprecated": true, - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", - "operationId": "datasourceProxyGETcalls", - "parameters": [ { - "in": "path", - "name": "datasource_proxy_route", - "required": true, + "description": "Element UID to exclude from search results.", + "in": "query", + "name": "excludeUid", "schema": { "type": "string" } }, { - "in": "path", - "name": "id", - "required": true, + "description": "A comma separated list of folder ID(s) to filter the elements by.", + "in": "query", + "name": "folderFilter", "schema": { "type": "string" } + }, + { + "description": "The number of results per page.", + "in": "query", + "name": "perPage", + "schema": { + "default": 100, + "format": "int64", + "type": "integer" + } + }, + { + "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", + "in": "query", + "name": "page", + "schema": { + "default": 1, + "format": "int64", + "type": "integer" + } } ], "responses": { "200": { - "description": "(empty)" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getLibraryElementsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Data source proxy GET calls.", + "summary": "Get all library elements.", "tags": [ - "datasources" + "library_elements" ] }, "post": { - "deprecated": true, - "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", - "operationId": "datasourceProxyPOSTcalls", - "parameters": [ - { - "in": "path", - "name": "datasource_proxy_route", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], + "description": "Creates a new library element.", + "operationId": "createLibraryElement", "requestBody": { "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/CreateLibraryElementCommand" + } } }, "required": true, - "x-originalParamName": "DatasourceProxyParam" + "x-originalParamName": "body" }, "responses": { - "201": { - "description": "(empty)" - }, - "202": { - "description": "(empty)" + "200": { + "$ref": "#/components/responses/getLibraryElementResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -18542,19 +18490,20 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Data source proxy POST calls.", + "summary": "Create library element.", "tags": [ - "datasources" + "library_elements" ] } }, - "/datasources/uid/{sourceUID}/correlations": { + "/library-elements/name/{library_element_name}": { "get": { - "operationId": "getCorrelationsBySourceUID", + "description": "Returns a library element with the given name.", + "operationId": "getLibraryElementByName", "parameters": [ { "in": "path", - "name": "sourceUID", + "name": "library_element_name", "required": true, "schema": { "type": "string" @@ -18563,7 +18512,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getCorrelationsBySourceUIDResponse" + "$ref": "#/components/responses/getLibraryElementArrayResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18575,37 +18524,29 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets all correlations originating from the given data source.", + "summary": "Get library element by name.", "tags": [ - "correlations" + "library_elements" ] - }, - "post": { - "operationId": "createCorrelation", + } + }, + "/library-elements/{library_element_uid}": { + "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.", + "operationId": "deleteLibraryElementByUID", "parameters": [ { "in": "path", - "name": "sourceUID", + "name": "library_element_uid", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateCorrelationCommand" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, "responses": { "200": { - "$ref": "#/components/responses/createCorrelationResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -18623,27 +18564,18 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add correlation.", + "summary": "Delete library element.", "tags": [ - "correlations" + "library_elements" ] - } - }, - "/datasources/uid/{sourceUID}/correlations/{correlationUID}": { + }, "get": { - "operationId": "getCorrelation", + "description": "Returns a library element with the given UID.", + "operationId": "getLibraryElementByUID", "parameters": [ { "in": "path", - "name": "sourceUID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "correlationUID", + "name": "library_element_uid", "required": true, "schema": { "type": "string" @@ -18652,11 +18584,14 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getCorrelationResponse" + "$ref": "#/components/responses/getLibraryElementResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, "404": { "$ref": "#/components/responses/notFoundError" }, @@ -18664,25 +18599,18 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets a correlation.", + "summary": "Get library element by UID.", "tags": [ - "correlations" + "library_elements" ] }, "patch": { - "operationId": "updateCorrelation", + "description": "Updates an existing library element identified by uid.", + "operationId": "updateLibraryElement", "parameters": [ { "in": "path", - "name": "sourceUID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "correlationUID", + "name": "library_element_uid", "required": true, "schema": { "type": "string" @@ -18693,15 +18621,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateCorrelationCommand" + "$ref": "#/components/schemas/PatchLibraryElementCommand" } } }, + "required": true, "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/updateCorrelationResponse" + "$ref": "#/components/responses/getLibraryElementResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -18715,24 +18644,27 @@ "404": { "$ref": "#/components/responses/notFoundError" }, + "412": { + "$ref": "#/components/responses/preconditionFailedError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Updates a correlation.", + "summary": "Update library element.", "tags": [ - "correlations" + "library_elements" ] } }, - "/datasources/uid/{uid}": { - "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).", - "operationId": "deleteDataSourceByUID", + "/library-elements/{library_element_uid}/connections/": { + "get": { + "description": "Returns a list of connections for a library element based on the UID specified.", + "operationId": "getLibraryElementConnections", "parameters": [ { "in": "path", - "name": "uid", + "name": "library_element_uid", "required": true, "schema": { "type": "string" @@ -18741,7 +18673,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/getLibraryElementConnectionsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18756,76 +18688,101 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete an existing data source by UID.", + "summary": "Get library element connections.", "tags": [ - "datasources" + "library_elements" ] - }, + } + }, + "/licensing/check": { "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).", - "operationId": "getDataSourceByUID", - "parameters": [ - { - "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" - } - } - ], + "operationId": "getStatus", "responses": { "200": { - "$ref": "#/components/responses/getDataSourceResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, + "$ref": "#/components/responses/getStatusResponse" + } + }, + "summary": "Check license availability.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/custom-permissions": { + "get": { + "deprecated": true, + "description": "You need to have a permission with action `licensing.reports:read`.", + "operationId": "getCustomPermissionsReport", + "responses": { "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a single data source by UID.", + "summary": "Get custom permissions report.", "tags": [ - "datasources" + "licensing", + "enterprise" ] - }, - "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).", - "operationId": "updateDataSourceByUID", - "parameters": [ - { - "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" - } + } + }, + "/licensing/custom-permissions-csv": { + "get": { + "deprecated": true, + "description": "You need to have a permission with action `licensing.reports:read`.", + "operationId": "getCustomPermissionsCSV", + "responses": { + "500": { + "$ref": "#/components/responses/internalServerError" } - ], + }, + "summary": "Get custom permissions report in CSV format.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/refresh-stats": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "operationId": "refreshLicenseStats", + "responses": { + "200": { + "$ref": "#/components/responses/refreshLicenseStatsResponse" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Refresh license stats.", + "tags": [ + "licensing", + "enterprise" + ] + } + }, + "/licensing/token": { + "delete": { + "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", + "operationId": "deleteLicenseToken", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateDataSourceCommand" + "$ref": "#/components/schemas/DeleteTokenCommand" } } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "body" }, "responses": { - "200": { - "$ref": "#/components/responses/createOrUpdateDatasourceResponse" + "202": { + "$ref": "#/components/responses/acceptedResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18833,123 +18790,122 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update an existing data source.", + "summary": "Remove license from database.", "tags": [ - "datasources" + "licensing", + "enterprise" + ] + }, + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "operationId": "getLicenseToken", + "responses": { + "200": { + "$ref": "#/components/responses/getLicenseTokenResponse" + } + }, + "summary": "Get license token.", + "tags": [ + "licensing", + "enterprise" + ] + }, + "post": { + "description": "You need to have a permission with action `licensing:update`.", + "operationId": "postLicenseToken", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTokenCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/getLicenseTokenResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + } + }, + "summary": "Create license token.", + "tags": [ + "licensing", + "enterprise" ] } }, - "/datasources/uid/{uid}/correlations/{correlationUID}": { - "delete": { - "operationId": "deleteCorrelation", - "parameters": [ - { - "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" + "/licensing/token/renew": { + "post": { + "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + "operationId": "postRenewLicenseToken", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + } } }, - { - "in": "path", - "name": "correlationUID", - "required": true, - "schema": { - "type": "string" - } - } - ], + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/deleteCorrelationResponse" + "$ref": "#/components/responses/postRenewLicenseTokenResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "404": { "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete a correlation.", + "summary": "Manually force license refresh.", "tags": [ - "correlations" + "licensing", + "enterprise" ] } }, - "/datasources/uid/{uid}/health": { + "/logout/saml": { "get": { - "operationId": "checkDatasourceHealthWithUID", - "parameters": [ - { - "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" - } - } - ], + "operationId": "getSAMLLogout", "responses": { - "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "302": { + "description": "(empty)" }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Sends a health check request to the plugin datasource identified by the UID.", + "summary": "GetLogout initiates single logout process.", "tags": [ - "datasources" + "saml", + "enterprise" ] } }, - "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { + "/org": { "get": { - "operationId": "callDatasourceResourceWithUID", - "parameters": [ - { - "in": "path", - "name": "datasource_proxy_route", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "uid", - "required": true, - "schema": { - "type": "string" - } - } - ], + "operationId": "getCurrentOrg", "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getCurrentOrgResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -18957,73 +18913,68 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Fetch data source resources.", + "summary": "Get current Organization.", "tags": [ - "datasources" + "org" ] - } - }, - "/datasources/{id}": { - "delete": { - "deprecated": true, - "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", - "operationId": "deleteDataSourceByID", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" + }, + "put": { + "operationId": "updateCurrentOrg", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrgForm" + } } - } - ], + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { "$ref": "#/components/responses/okResponse" }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, "401": { "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete an existing data source by id.", + "summary": "Update current Organization.", "tags": [ - "datasources" + "org" ] - }, - "get": { - "deprecated": true, - "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", - "operationId": "getDataSourceByID", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" + } + }, + "/org/address": { + "put": { + "operationId": "updateCurrentOrgAddress", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrgAddressForm" + } } - } - ], + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/getDataSourceResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -19034,46 +18985,57 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Update current Organization's address.", + "tags": [ + "org" + ] + } + }, + "/org/invites": { + "get": { + "operationId": "getPendingOrgInvites", + "responses": { + "200": { + "$ref": "#/components/responses/getPendingOrgInvitesResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a single data source by Id.", + "summary": "Get pending invites.", "tags": [ - "datasources" + "org_invites" ] }, - "put": { - "deprecated": true, - "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", - "operationId": "updateDataSourceByID", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], + "post": { + "operationId": "addOrgInvite", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateDataSourceCommand" + "$ref": "#/components/schemas/AddInviteForm" } } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/createOrUpdateDatasourceResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19081,25 +19043,26 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "412": { + "$ref": "#/components/responses/SMTPNotEnabledError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update an existing data source by its sequential ID.", + "summary": "Add invite.", "tags": [ - "datasources" + "org_invites" ] } }, - "/datasources/{id}/health": { - "get": { - "deprecated": true, - "description": "Please refer to [updated API](#/datasources/checkDatasourceHealthWithUID) instead", - "operationId": "checkDatasourceHealthByID", + "/org/invites/{invitation_code}/revoke": { + "delete": { + "operationId": "revokeInvite", "parameters": [ { "in": "path", - "name": "id", + "name": "invitation_code", "required": true, "schema": { "type": "string" @@ -19110,54 +19073,31 @@ "200": { "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, "401": { "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Sends a health check request to the plugin datasource identified by the ID.", + "summary": "Revoke invite.", "tags": [ - "datasources" + "org_invites" ] } }, - "/datasources/{id}/resources/{datasource_proxy_route}": { + "/org/preferences": { "get": { - "deprecated": true, - "description": "Please refer to [updated API](#/datasources/callDatasourceResourceWithUID) instead", - "operationId": "callDatasourceResourceByID", - "parameters": [ - { - "in": "path", - "name": "datasource_proxy_route", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], + "operationId": "getOrgPreferences", "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getPreferencesResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19165,28 +19105,22 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Fetch data source resources by Id.", + "summary": "Get Current Org Prefs.", "tags": [ - "datasources" + "org_preferences" ] - } - }, - "/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`.", - "operationId": "queryMetricsWithExpressions", + }, + "patch": { + "operationId": "patchOrgPreferences", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MetricRequest" + "$ref": "#/components/schemas/PatchPrefsCmd" } } }, @@ -19195,10 +19129,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/queryMetricsWithExpressionsRespons" - }, - "207": { - "$ref": "#/components/responses/queryMetricsWithExpressionsRespons" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -19213,49 +19144,30 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "DataSource query metrics with expressions.", + "summary": "Patch Current Org Prefs.", "tags": [ - "ds" + "org_preferences" ] - } - }, - "/folders": { - "get": { - "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID\nand returns the immediate subfolders that the authenticated user has permission to view.\nIf the parameter is not supplied then it returns immediate subfolders under the root\nthat the authenticated user has permission to view.", - "operationId": "getFolders", - "parameters": [ - { - "description": "Limit the maximum number of folders to return", - "in": "query", - "name": "limit", - "schema": { - "default": 1000, - "format": "int64", - "type": "integer" - } - }, - { - "description": "Page index for starting fetching folders", - "in": "query", - "name": "page", - "schema": { - "default": 1, - "format": "int64", - "type": "integer" + }, + "put": { + "operationId": "updateOrgPreferences", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePrefsCmd" + } } }, - { - "description": "The parent folder UID", - "in": "query", - "name": "parentUid", - "schema": { - "type": "string" - } - } - ], + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/getFoldersResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19267,31 +19179,19 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all folders.", + "summary": "Update Current Org Prefs.", "tags": [ - "folders" + "org_preferences" ] - }, - "post": { - "description": "If nested folders are enabled then it additionally expects the parent folder UID.", - "operationId": "createFolder", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateFolderCommand" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, + } + }, + "/org/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).", + "operationId": "getCurrentOrgQuota", "responses": { "200": { - "$ref": "#/components/responses/folderResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getQuotaResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19299,38 +19199,26 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "409": { - "$ref": "#/components/responses/conflictError" + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create folder.", + "summary": "Fetch Organization quota.", "tags": [ - "folders" + "getCurrentOrg" ] } }, - "/folders/id/{folder_id}": { + "/org/users": { "get": { - "deprecated": true, - "description": "Returns the folder identified by id. This is deprecated.\nPlease refer to [updated API](#/folders/getFolderByUID) instead", - "operationId": "getFolderByID", - "parameters": [ - { - "in": "path", - "name": "folder_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "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:*`.", + "operationId": "getOrgUsersForCurrentOrg", "responses": { "200": { - "$ref": "#/components/responses/folderResponse" + "$ref": "#/components/responses/getOrgUsersForCurrentOrgResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19338,48 +19226,73 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get all users within the current organization.", + "tags": [ + "org" + ] + }, + "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:*`.", + "operationId": "addOrgUserToCurrentOrg", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddOrgUserCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get folder by id.", + "summary": "Add a new user to the current organization.", "tags": [ - "folders" + "org" ] } }, - "/folders/{folder_uid}": { - "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.\nIf nested folders are enabled then it also deletes all the subfolders.", - "operationId": "deleteFolder", + "/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.", + "operationId": "getOrgUsersForCurrentOrgLookup", "parameters": [ { - "in": "path", - "name": "folder_uid", - "required": true, + "in": "query", + "name": "query", "schema": { "type": "string" } }, { - "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.", "in": "query", - "name": "forceDeleteRules", + "name": "limit", "schema": { - "default": false, - "type": "boolean" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/deleteFolderResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getOrgUsersForCurrentOrgLookupResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19387,33 +19300,37 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete folder.", + "summary": "Get all users within the current organization (lookup)", "tags": [ - "folders" + "org" ] - }, - "get": { - "operationId": "getFolderByUID", + } + }, + "/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:*`.", + "operationId": "removeOrgUserForCurrentOrg", "parameters": [ { "in": "path", - "name": "folder_uid", + "name": "user_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/folderResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19421,27 +19338,26 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get folder by uid.", + "summary": "Delete user in current organization.", "tags": [ - "folders" + "org" ] }, - "put": { - "operationId": "updateFolder", + "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:*`.", + "operationId": "updateOrgUserForCurrentOrg", "parameters": [ { "in": "path", - "name": "folder_uid", + "name": "user_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], @@ -19449,17 +19365,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateFolderCommand" + "$ref": "#/components/schemas/UpdateOrgUserCommand" } } }, - "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`.", "required": true, "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/folderResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -19470,30 +19385,50 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "409": { - "$ref": "#/components/responses/conflictError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update folder.", + "summary": "Updates the given user.", "tags": [ - "folders" + "org" ] } }, - "/folders/{folder_uid}/counts": { + "/orgs": { "get": { - "operationId": "getFolderDescendantCounts", + "operationId": "searchOrgs", "parameters": [ { - "in": "path", - "name": "folder_uid", - "required": true, + "in": "query", + "name": "page", + "schema": { + "default": 1, + "format": "int64", + "type": "integer" + } + }, + { + "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.", + "in": "query", + "name": "perpage", + "schema": { + "default": 1000, + "format": "int64", + "type": "integer" + } + }, + { + "in": "query", + "name": "name", + "schema": { + "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.", + "in": "query", + "name": "query", "schema": { "type": "string" } @@ -19501,7 +19436,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getFolderDescendantCountsResponse" + "$ref": "#/components/responses/searchOrgsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19509,37 +19444,31 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" + "409": { + "$ref": "#/components/responses/conflictError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets the count of each descendant of a folder by kind. The folder is identified by UID.", - "tags": [ - "folders" - ] - } - }, - "/folders/{folder_uid}/move": { - "post": { - "operationId": "moveFolder", - "parameters": [ + "security": [ { - "in": "path", - "name": "folder_uid", - "required": true, - "schema": { - "type": "string" - } + "basic": [] } ], + "summary": "Search all Organizations.", + "tags": [ + "orgs" + ] + }, + "post": { + "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", + "operationId": "createOrg", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MoveFolderCommand" + "$ref": "#/components/schemas/CreateOrgCommand" } } }, @@ -19548,7 +19477,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/folderResponse" + "$ref": "#/components/responses/createOrgResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19556,26 +19485,26 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" + "409": { + "$ref": "#/components/responses/conflictError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Move folder.", + "summary": "Create Organization.", "tags": [ - "folders" + "orgs" ] } }, - "/folders/{folder_uid}/permissions": { + "/orgs/name/{org_name}": { "get": { - "operationId": "getFolderPermissionList", + "operationId": "getOrgByName", "parameters": [ { "in": "path", - "name": "folder_uid", + "name": "org_name", "required": true, "schema": { "type": "string" @@ -19584,7 +19513,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getFolderPermissionListResponse" + "$ref": "#/components/responses/getOrgByNameResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19592,45 +19521,42 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Gets all existing permissions for the folder with the given `uid`.", + "security": [ + { + "basic": [] + } + ], + "summary": "Get Organization by ID.", "tags": [ - "folder_permissions" + "orgs" ] - }, - "post": { - "operationId": "updateFolderPermissions", + } + }, + "/orgs/{org_id}": { + "delete": { + "operationId": "deleteOrgByID", "parameters": [ { "in": "path", - "name": "folder_uid", + "name": "org_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateDashboardACLCommand" - } - } - }, - "required": true, - "x-originalParamName": "Body" - }, "responses": { "200": { "$ref": "#/components/responses/okResponse" }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -19644,90 +19570,24 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.", + "security": [ + { + "basic": [] + } + ], + "summary": "Delete Organization.", "tags": [ - "folder_permissions" + "orgs" ] - } - }, - "/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.", - "operationId": "getLibraryElements", + "operationId": "getOrgByID", "parameters": [ { - "description": "Part of the name or description searched for.", - "in": "query", - "name": "searchString", - "schema": { - "type": "string" - } - }, - { - "description": "Kind of element to search for.", - "in": "query", - "name": "kind", - "schema": { - "enum": [ - 1, - 2 - ], - "format": "int64", - "type": "integer" - } - }, - { - "description": "Sort order of elements.", - "in": "query", - "name": "sortDirection", - "schema": { - "enum": [ - "alpha-asc", - "alpha-desc" - ], - "type": "string" - } - }, - { - "description": "A comma separated list of types to filter the elements by", - "in": "query", - "name": "typeFilter", - "schema": { - "type": "string" - } - }, - { - "description": "Element UID to exclude from search results.", - "in": "query", - "name": "excludeUid", - "schema": { - "type": "string" - } - }, - { - "description": "A comma separated list of folder ID(s) to filter the elements by.", - "in": "query", - "name": "folderFilter", - "schema": { - "type": "string" - } - }, - { - "description": "The number of results per page.", - "in": "query", - "name": "perPage", - "schema": { - "default": 100, - "format": "int64", - "type": "integer" - } - }, - { - "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", - "in": "query", - "name": "page", + "in": "path", + "name": "org_id", + "required": true, "schema": { - "default": 1, "format": "int64", "type": "integer" } @@ -19735,28 +19595,46 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getLibraryElementsResponse" + "$ref": "#/components/responses/getOrgByIDResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all library elements.", + "security": [ + { + "basic": [] + } + ], + "summary": "Get Organization by ID.", "tags": [ - "library_elements" + "orgs" ] }, - "post": { - "description": "Creates a new library element.", - "operationId": "createLibraryElement", + "put": { + "operationId": "updateOrg", + "parameters": [ + { + "in": "path", + "name": "org_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateLibraryElementCommand" + "$ref": "#/components/schemas/UpdateOrgForm" } } }, @@ -19765,7 +19643,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/getLibraryElementResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -19776,73 +19654,87 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create library element.", + "security": [ + { + "basic": [] + } + ], + "summary": "Update Organization.", "tags": [ - "library_elements" + "orgs" ] } }, - "/library-elements/name/{library_element_name}": { - "get": { - "description": "Returns a library element with the given name.", - "operationId": "getLibraryElementByName", + "/orgs/{org_id}/address": { + "put": { + "operationId": "updateOrgAddress", "parameters": [ { "in": "path", - "name": "library_element_name", + "name": "org_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrgAddressForm" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/getLibraryElementArrayResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "404": { - "$ref": "#/components/responses/notFoundError" + "403": { + "$ref": "#/components/responses/forbiddenError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get library element by name.", + "summary": "Update Organization's address.", "tags": [ - "library_elements" + "orgs" ] } }, - "/library-elements/{library_element_uid}": { - "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.", - "operationId": "deleteLibraryElementByUID", + "/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).", + "operationId": "getOrgQuota", "parameters": [ { "in": "path", - "name": "library_element_uid", + "name": "org_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getQuotaResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19857,27 +19749,49 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete library element.", + "summary": "Fetch Organization quota.", "tags": [ - "library_elements" + "orgs" ] - }, - "get": { - "description": "Returns a library element with the given UID.", - "operationId": "getLibraryElementByUID", + } + }, + "/orgs/{org_id}/quotas/{quota_target}": { + "put": { + "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).", + "operationId": "updateOrgQuota", "parameters": [ { "in": "path", - "name": "library_element_uid", + "name": "quota_target", "required": true, "schema": { "type": "string" } + }, + { + "in": "path", + "name": "org_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateQuotaCmd" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/getLibraryElementResponse" + "$ref": "#/components/responses/okResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19892,21 +19806,67 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get library element by UID.", + "security": [ + { + "basic": [] + } + ], + "summary": "Update user quota.", "tags": [ - "library_elements" + "orgs" + ] + } + }, + "/orgs/{org_id}/users": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", + "operationId": "getOrgUsers", + "parameters": [ + { + "in": "path", + "name": "org_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getOrgUsersResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "security": [ + { + "basic": [] + } + ], + "summary": "Get Users in Organization.", + "tags": [ + "orgs" ] }, - "patch": { - "description": "Updates an existing library element identified by uid.", - "operationId": "updateLibraryElement", + "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:*`.", + "operationId": "addOrgUser", "parameters": [ { "in": "path", - "name": "library_element_uid", + "name": "org_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], @@ -19914,7 +19874,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchLibraryElementCommand" + "$ref": "#/components/schemas/AddOrgUserCommand" } } }, @@ -19923,10 +19883,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/getLibraryElementResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/okResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19934,39 +19891,34 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "412": { - "$ref": "#/components/responses/preconditionFailedError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update library element.", + "summary": "Add a new user to the current organization.", "tags": [ - "library_elements" + "orgs" ] } }, - "/library-elements/{library_element_uid}/connections/": { + "/orgs/{org_id}/users/search": { "get": { - "description": "Returns a list of connections for a library element based on the UID specified.", - "operationId": "getLibraryElementConnections", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", + "operationId": "searchOrgUsers", "parameters": [ { "in": "path", - "name": "library_element_uid", + "name": "org_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/getLibraryElementConnectionsResponse" + "$ref": "#/components/responses/searchOrgUsersResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -19974,96 +19926,95 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get library element connections.", - "tags": [ - "library_elements" - ] - } - }, - "/licensing/check": { - "get": { - "operationId": "getStatus", - "responses": { - "200": { - "$ref": "#/components/responses/getStatusResponse" - } - }, - "summary": "Check license availability.", - "tags": [ - "licensing", - "enterprise" - ] - } - }, - "/licensing/custom-permissions": { - "get": { - "deprecated": true, - "description": "You need to have a permission with action `licensing.reports:read`.", - "operationId": "getCustomPermissionsReport", - "responses": { - "500": { - "$ref": "#/components/responses/internalServerError" + "security": [ + { + "basic": [] } - }, - "summary": "Get custom permissions report.", + ], + "summary": "Search Users in Organization.", "tags": [ - "licensing", - "enterprise" + "orgs" ] } }, - "/licensing/custom-permissions-csv": { - "get": { - "deprecated": true, - "description": "You need to have a permission with action `licensing.reports:read`.", - "operationId": "getCustomPermissionsCSV", - "responses": { - "500": { - "$ref": "#/components/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:*`.", + "operationId": "removeOrgUser", + "parameters": [ + { + "in": "path", + "name": "org_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } } - }, - "summary": "Get custom permissions report in CSV format.", - "tags": [ - "licensing", - "enterprise" - ] - } - }, - "/licensing/refresh-stats": { - "get": { - "description": "You need to have a permission with action `licensing:read`.", - "operationId": "refreshLicenseStats", + ], "responses": { "200": { - "$ref": "#/components/responses/refreshLicenseStatsResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Refresh license stats.", + "summary": "Delete user in current organization.", "tags": [ - "licensing", - "enterprise" + "orgs" ] - } - }, - "/licensing/token": { - "delete": { - "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", - "operationId": "deleteLicenseToken", + }, + "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:*`.", + "operationId": "updateOrgUser", + "parameters": [ + { + "in": "path", + "name": "org_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteTokenCommand" + "$ref": "#/components/schemas/UpdateOrgUserCommand" } } }, @@ -20071,8 +20022,8 @@ "x-originalParamName": "body" }, "responses": { - "202": { - "$ref": "#/components/responses/acceptedResponse" + "200": { + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -20083,157 +20034,66 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "422": { - "$ref": "#/components/responses/unprocessableEntityError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Remove license from database.", + "summary": "Update Users in Organization.", "tags": [ - "licensing", - "enterprise" - ] - }, - "get": { - "description": "You need to have a permission with action `licensing:read`.", - "operationId": "getLicenseToken", - "responses": { - "200": { - "$ref": "#/components/responses/getLicenseTokenResponse" - } - }, - "summary": "Get license token.", - "tags": [ - "licensing", - "enterprise" - ] - }, - "post": { - "description": "You need to have a permission with action `licensing:update`.", - "operationId": "postLicenseToken", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteTokenCommand" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, - "responses": { - "200": { - "$ref": "#/components/responses/getLicenseTokenResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - } - }, - "summary": "Create license token.", - "tags": [ - "licensing", - "enterprise" - ] - } - }, - "/licensing/token/renew": { - "post": { - "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", - "operationId": "postRenewLicenseToken", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, - "responses": { - "200": { - "$ref": "#/components/responses/postRenewLicenseTokenResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - } - }, - "summary": "Manually force license refresh.", - "tags": [ - "licensing", - "enterprise" + "orgs" ] } }, - "/logout/saml": { + "/playlists": { "get": { - "operationId": "getSAMLLogout", - "responses": { - "302": { - "description": "(empty)" - }, - "404": { - "$ref": "#/components/responses/notFoundError" + "operationId": "searchPlaylists", + "parameters": [ + { + "in": "query", + "name": "query", + "schema": { + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/internalServerError" + { + "description": "in:limit", + "in": "query", + "name": "limit", + "schema": { + "format": "int64", + "type": "integer" + } } - }, - "summary": "GetLogout initiates single logout process.", - "tags": [ - "saml", - "enterprise" - ] - } - }, - "/org": { - "get": { - "operationId": "getCurrentOrg", + ], "responses": { "200": { - "$ref": "#/components/responses/getCurrentOrgResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "$ref": "#/components/responses/searchPlaylistsResponse" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get current Organization.", + "summary": "Get playlists.", "tags": [ - "org" + "playlists" ] }, - "put": { - "operationId": "updateCurrentOrg", + "post": { + "operationId": "createPlaylist", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateOrgForm" + "$ref": "#/components/schemas/CreatePlaylistCommand" } } }, "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/createPlaylistResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20241,59 +20101,69 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update current Organization.", + "summary": "Create playlist.", "tags": [ - "org" + "playlists" ] } }, - "/org/address": { - "put": { - "operationId": "updateCurrentOrgAddress", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateOrgAddressForm" - } + "/playlists/{uid}": { + "delete": { + "operationId": "deletePlaylist", + "parameters": [ + { + "in": "path", + "name": "uid", + "required": true, + "schema": { + "type": "string" } - }, - "required": true, - "x-originalParamName": "body" - }, + } + ], "responses": { "200": { "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, "401": { "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update current Organization's address.", + "summary": "Delete playlist.", "tags": [ - "org" + "playlists" ] - } - }, - "/org/invites": { + }, "get": { - "operationId": "getPendingOrgInvites", + "operationId": "getPlaylist", + "parameters": [ + { + "in": "path", + "name": "uid", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "$ref": "#/components/responses/getPendingOrgInvitesResponse" + "$ref": "#/components/responses/getPlaylistResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20301,34 +20171,44 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get pending invites.", + "summary": "Get playlist.", "tags": [ - "org_invites" + "playlists" ] }, - "post": { - "operationId": "addOrgInvite", + "put": { + "operationId": "updatePlaylist", + "parameters": [ + { + "in": "path", + "name": "uid", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddInviteForm" + "$ref": "#/components/schemas/UpdatePlaylistCommand" } } }, "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/updatePlaylistResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20336,26 +20216,26 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "412": { - "$ref": "#/components/responses/SMTPNotEnabledError" + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add invite.", + "summary": "Update playlist.", "tags": [ - "org_invites" + "playlists" ] } }, - "/org/invites/{invitation_code}/revoke": { - "delete": { - "operationId": "revokeInvite", + "/playlists/{uid}/items": { + "get": { + "operationId": "getPlaylistItems", "parameters": [ { "in": "path", - "name": "invitation_code", + "name": "uid", "required": true, "schema": { "type": "string" @@ -20364,7 +20244,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/getPlaylistItemsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20379,163 +20259,244 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Revoke invite.", + "summary": "Get playlist items.", "tags": [ - "org_invites" + "playlists" ] } }, - "/org/preferences": { + "/public/dashboards/{accessToken}": { "get": { - "operationId": "getOrgPreferences", - "responses": { + "description": "Get public dashboard for view", + "operationId": "viewPublicDashboard", + "parameters": [ + { + "in": "path", + "name": "accessToken", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { "200": { - "$ref": "#/components/responses/getPreferencesResponse" + "$ref": "#/components/responses/viewPublicDashboardResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestPublicError" }, "401": { - "$ref": "#/components/responses/unauthorisedError" + "$ref": "#/components/responses/unauthorisedPublicError" }, "403": { - "$ref": "#/components/responses/forbiddenError" + "$ref": "#/components/responses/forbiddenPublicError" + }, + "404": { + "$ref": "#/components/responses/notFoundPublicError" }, "500": { - "$ref": "#/components/responses/internalServerError" + "$ref": "#/components/responses/internalServerPublicError" } }, - "summary": "Get Current Org Prefs.", "tags": [ - "org_preferences" + "dashboard_public" ] - }, - "patch": { - "operationId": "patchOrgPreferences", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PatchPrefsCmd" - } + } + }, + "/public/dashboards/{accessToken}/annotations": { + "get": { + "description": "Get annotations for a public dashboard", + "operationId": "getPublicAnnotations", + "parameters": [ + { + "in": "path", + "name": "accessToken", + "required": true, + "schema": { + "type": "string" } - }, - "required": true, - "x-originalParamName": "body" - }, + } + ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/getPublicAnnotationsResponse" }, "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/badRequestPublicError" }, "401": { - "$ref": "#/components/responses/unauthorisedError" + "$ref": "#/components/responses/unauthorisedPublicError" }, "403": { - "$ref": "#/components/responses/forbiddenError" + "$ref": "#/components/responses/forbiddenPublicError" + }, + "404": { + "$ref": "#/components/responses/notFoundPublicError" }, "500": { - "$ref": "#/components/responses/internalServerError" + "$ref": "#/components/responses/internalServerPublicError" } }, - "summary": "Patch Current Org Prefs.", "tags": [ - "org_preferences" + "dashboard_public" ] - }, - "put": { - "operationId": "updateOrgPreferences", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdatePrefsCmd" - } + } + }, + "/public/dashboards/{accessToken}/panels/{panelId}/query": { + "post": { + "description": "Get results for a given panel on a public dashboard", + "operationId": "queryPublicDashboard", + "parameters": [ + { + "in": "path", + "name": "accessToken", + "required": true, + "schema": { + "type": "string" } }, - "required": true, - "x-originalParamName": "body" - }, + { + "in": "path", + "name": "panelId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/queryPublicDashboardResponse" }, "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/badRequestPublicError" }, "401": { - "$ref": "#/components/responses/unauthorisedError" + "$ref": "#/components/responses/unauthorisedPublicError" }, "403": { - "$ref": "#/components/responses/forbiddenError" + "$ref": "#/components/responses/forbiddenPublicError" + }, + "404": { + "$ref": "#/components/responses/notFoundPublicError" }, "500": { - "$ref": "#/components/responses/internalServerError" + "$ref": "#/components/responses/internalServerPublicError" } }, - "summary": "Update Current Org Prefs.", "tags": [ - "org_preferences" + "dashboard_public" ] } }, - "/org/quotas": { + "/query-history": { "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).", - "operationId": "getCurrentOrgQuota", - "responses": { - "200": { - "$ref": "#/components/responses/getQuotaResponse" + "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.", + "operationId": "searchQueries", + "parameters": [ + { + "description": "List of data source UIDs to search for", + "in": "query", + "name": "datasourceUid", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + { + "description": "Text inside query or comments that is searched for", + "in": "query", + "name": "searchString", + "schema": { + "type": "string" + } }, - "403": { - "$ref": "#/components/responses/forbiddenError" + { + "description": "Flag indicating if only starred queries should be returned", + "in": "query", + "name": "onlyStarred", + "schema": { + "type": "boolean" + } }, - "404": { - "$ref": "#/components/responses/notFoundError" + { + "description": "Sort method", + "in": "query", + "name": "sort", + "schema": { + "default": "time-desc", + "enum": [ + "time-desc", + "time-asc" + ], + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/internalServerError" + { + "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", + "in": "query", + "name": "page", + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "description": "Limit the number of returned results", + "in": "query", + "name": "limit", + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "description": "From range for the query history search", + "in": "query", + "name": "from", + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "description": "To range for the query history search", + "in": "query", + "name": "to", + "schema": { + "format": "int64", + "type": "integer" + } } - }, - "summary": "Fetch Organization quota.", - "tags": [ - "getCurrentOrg" - ] - } - }, - "/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:*`.", - "operationId": "getOrgUsersForCurrentOrg", + ], "responses": { "200": { - "$ref": "#/components/responses/getOrgUsersForCurrentOrgResponse" + "$ref": "#/components/responses/getQueryHistorySearchResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all users within the current organization.", + "summary": "Query history search.", "tags": [ - "org" + "query_history" ] }, "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:*`.", - "operationId": "addOrgUserToCurrentOrg", + "description": "Adds new query to query history.", + "operationId": "createQuery", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddOrgUserCommand" + "$ref": "#/components/schemas/CreateQueryInQueryHistoryCommand" } } }, @@ -20544,113 +20505,124 @@ }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/getQueryHistoryResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add a new user to the current organization.", + "summary": "Add query to query history.", "tags": [ - "org" + "query_history" ] } }, - "/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.", - "operationId": "getOrgUsersForCurrentOrgLookup", + "/query-history/star/{query_history_uid}": { + "delete": { + "description": "Removes star from query in query history as specified by the UID.", + "operationId": "unstarQuery", "parameters": [ { - "in": "query", - "name": "query", + "in": "path", + "name": "query_history_uid", + "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getQueryHistoryResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Remove star to query in query history.", + "tags": [ + "query_history" + ] + }, + "post": { + "description": "Adds star to query in query history as specified by the UID.", + "operationId": "starQuery", + "parameters": [ { - "in": "query", - "name": "limit", + "in": "path", + "name": "query_history_uid", + "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/getOrgUsersForCurrentOrgLookupResponse" + "$ref": "#/components/responses/getQueryHistoryResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get all users within the current organization (lookup)", + "summary": "Add star to query in query history.", "tags": [ - "org" + "query_history" ] } }, - "/org/users/{user_id}": { + "/query-history/{query_history_uid}": { "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:*`.", - "operationId": "removeOrgUserForCurrentOrg", + "description": "Deletes an existing query in query history as specified by the UID. This operation cannot be reverted.", + "operationId": "deleteQuery", "parameters": [ { "in": "path", - "name": "user_id", + "name": "query_history_uid", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getQueryHistoryDeleteQueryResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete user in current organization.", + "summary": "Delete query in query history.", "tags": [ - "org" + "query_history" ] }, "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:*`.", - "operationId": "updateOrgUserForCurrentOrg", + "description": "Updates comment for query in query history as specified by the UID.", + "operationId": "patchQueryComment", "parameters": [ { "in": "path", - "name": "user_id", + "name": "query_history_uid", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], @@ -20658,7 +20630,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateOrgUserCommand" + "$ref": "#/components/schemas/PatchQueryCommentInQueryHistoryCommand" } } }, @@ -20667,7 +20639,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/getQueryHistoryResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -20675,61 +20647,58 @@ "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Updates the given user.", + "summary": "Update comment for query in query history.", "tags": [ - "org" + "query_history" ] } }, - "/orgs": { + "/recording-rules": { "get": { - "operationId": "searchOrgs", - "parameters": [ - { - "in": "query", - "name": "page", - "schema": { - "default": 1, - "format": "int64", - "type": "integer" - } + "operationId": "listRecordingRules", + "responses": { + "200": { + "$ref": "#/components/responses/listRecordingRulesResponse" }, - { - "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.", - "in": "query", - "name": "perpage", - "schema": { - "default": 1000, - "format": "int64", - "type": "integer" - } + "401": { + "$ref": "#/components/responses/unauthorisedError" }, - { - "in": "query", - "name": "name", - "schema": { - "type": "string" - } + "403": { + "$ref": "#/components/responses/forbiddenError" }, - { - "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.", - "in": "query", - "name": "query", - "schema": { - "type": "string" - } + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } - ], + }, + "summary": "Lists all rules in the database: active or deleted.", + "tags": [ + "recording_rules", + "enterprise" + ] + }, + "post": { + "operationId": "createRecordingRule", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordingRuleJSON" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/searchOrgsResponse" + "$ref": "#/components/responses/recordingRuleResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20737,31 +20706,26 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "409": { - "$ref": "#/components/responses/conflictError" + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Search all Organizations.", + "summary": "Create a recording rule that is then registered and started.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ] }, - "post": { - "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", - "operationId": "createOrg", + "put": { + "operationId": "updateRecordingRule", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateOrgCommand" + "$ref": "#/components/schemas/RecordingRuleJSON" } } }, @@ -20770,7 +20734,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/createOrgResponse" + "$ref": "#/components/responses/recordingRuleResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20778,35 +20742,37 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "409": { - "$ref": "#/components/responses/conflictError" + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create Organization.", + "summary": "Update the active status of a rule.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ] } }, - "/orgs/name/{org_name}": { - "get": { - "operationId": "getOrgByName", - "parameters": [ - { - "in": "path", - "name": "org_name", - "required": true, - "schema": { - "type": "string" + "/recording-rules/test": { + "post": { + "operationId": "testCreateRecordingRule", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordingRuleJSON" + } } - } - ], + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/getOrgByNameResponse" + "$ref": "#/components/responses/okResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20814,42 +20780,30 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Get Organization by ID.", + "summary": "Test a recording rule.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ] } }, - "/orgs/{org_id}": { + "/recording-rules/writer": { "delete": { - "operationId": "deleteOrgByID", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "operationId": "deleteRecordingRuleWriteTarget", "responses": { "200": { "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -20863,32 +20817,17 @@ "$ref": "#/components/responses/internalServerError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Delete Organization.", + "summary": "Delete the remote write target.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ] }, "get": { - "operationId": "getOrgByID", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "operationId": "getRecordingRuleWriteTarget", "responses": { "200": { - "$ref": "#/components/responses/getOrgByIDResponse" + "$ref": "#/components/responses/recordingRuleWriteTargetResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20896,38 +20835,27 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Get Organization by ID.", + "summary": "Return the prometheus remote write target.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ] }, - "put": { - "operationId": "updateOrg", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "post": { + "description": "It returns a 422 if there is not an existing prometheus data source configured.", + "operationId": "createRecordingRuleWriteTarget", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateOrgForm" + "$ref": "#/components/schemas/PrometheusRemoteWriteTargetJSON" } } }, @@ -20936,10 +20864,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/recordingRuleWriteTargetResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -20947,28 +20872,30 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Update Organization.", + "summary": "Create a remote write target.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ] } }, - "/orgs/{org_id}/address": { - "put": { - "operationId": "updateOrgAddress", + "/recording-rules/{recordingRuleID}": { + "delete": { + "operationId": "deleteRecordingRule", "parameters": [ { "in": "path", - "name": "org_id", + "name": "recordingRuleID", "required": true, "schema": { "format": "int64", @@ -20976,58 +20903,37 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateOrgAddressForm" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, "responses": { "200": { "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, "401": { "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update Organization's address.", + "summary": "Delete removes the rule from the registry and stops it.", "tags": [ - "orgs" + "recording_rules", + "enterprise" ] } }, - "/orgs/{org_id}/quotas": { + "/reports": { "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).", - "operationId": "getOrgQuota", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", + "operationId": "getReports", "responses": { "200": { - "$ref": "#/components/responses/getQuotaResponse" + "$ref": "#/components/responses/getReportsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -21035,47 +20941,24 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Fetch Organization quota.", + "summary": "List reports.", "tags": [ - "orgs" + "reports", + "enterprise" ] - } - }, - "/orgs/{org_id}/quotas/{quota_target}": { - "put": { - "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).", - "operationId": "updateOrgQuota", - "parameters": [ - { - "in": "path", - "name": "quota_target", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + }, + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "operationId": "createReport", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateQuotaCmd" + "$ref": "#/components/schemas/CreateOrUpdateReportConfig" } } }, @@ -21084,7 +20967,10 @@ }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/createReportResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -21099,75 +20985,22 @@ "$ref": "#/components/responses/internalServerError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Update user quota.", + "summary": "Create a report.", "tags": [ - "orgs" + "reports", + "enterprise" ] } }, - "/orgs/{org_id}/users": { - "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", - "operationId": "getOrgUsers", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/getOrgUsersResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "security": [ - { - "basic": [] - } - ], - "summary": "Get Users in Organization.", - "tags": [ - "orgs" - ] - }, + "/reports/email": { "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:*`.", - "operationId": "addOrgUser", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", + "operationId": "sendReport", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddOrgUserCommand" + "$ref": "#/components/schemas/ReportEmail" } } }, @@ -21178,89 +21011,168 @@ "200": { "$ref": "#/components/responses/okResponse" }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, "401": { "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add a new user to the current organization.", + "summary": "Send a report.", "tags": [ - "orgs" + "reports", + "enterprise" ] } }, - "/orgs/{org_id}/users/search": { + "/reports/render/pdf/{dashboardID}": { "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", - "operationId": "searchOrgUsers", + "deprecated": true, + "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", + "operationId": "renderReportPDF", "parameters": [ { "in": "path", - "name": "org_id", + "name": "DashboardID", "required": true, "schema": { "format": "int64", "type": "integer" } - } + }, + { + "in": "path", + "name": "dashboardID", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "in": "query", + "name": "title", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "variables", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "from", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "orientation", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "layout", + "schema": { + "type": "string" + } + } ], "responses": { "200": { - "$ref": "#/components/responses/searchOrgUsersResponse" + "$ref": "#/components/responses/contentResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Search Users in Organization.", + "summary": "Render report for dashboard.", "tags": [ - "orgs" + "reports", + "enterprise" ] } }, - "/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:*`.", - "operationId": "removeOrgUser", + "/reports/render/pdfs": { + "get": { + "description": "Available to all users and with a valid license.", + "operationId": "renderReportPDFs", "parameters": [ { - "in": "path", - "name": "org_id", - "required": true, + "in": "query", + "name": "dashboardID", "schema": { - "format": "int64", - "type": "integer" + "type": "string" } }, { - "in": "path", - "name": "user_id", - "required": true, + "in": "query", + "name": "orientation", "schema": { - "format": "int64", - "type": "integer" + "type": "string" + } + }, + { + "in": "query", + "name": "layout", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "title", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "scaleFactor", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "includeTables", + "schema": { + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/contentResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -21268,6 +21180,28 @@ "401": { "$ref": "#/components/responses/unauthorisedError" }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Render report for multiple dashboards.", + "tags": [ + "reports", + "enterprise" + ] + } + }, + "/reports/settings": { + "get": { + "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.settings:read`x.", + "operationId": "getReportSettings", + "responses": { + "200": { + "$ref": "#/components/responses/getReportSettingsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, "403": { "$ref": "#/components/responses/forbiddenError" }, @@ -21275,39 +21209,20 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete user in current organization.", + "summary": "Get settings.", "tags": [ - "orgs" + "reports", + "enterprise" ] }, - "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:*`.", - "operationId": "updateOrgUser", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - }, - { - "in": "path", - "name": "user_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "post": { + "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.settings:write`xx.", + "operationId": "saveReportSettings", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateOrgUserCommand" + "$ref": "#/components/schemas/ReportSettings" } } }, @@ -21331,62 +21246,34 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update Users in Organization.", + "summary": "Save settings.", "tags": [ - "orgs" + "reports", + "enterprise" ] } }, - "/playlists": { - "get": { - "operationId": "searchPlaylists", - "parameters": [ - { - "in": "query", - "name": "query", - "schema": { - "type": "string" - } - }, - { - "description": "in:limit", - "in": "query", - "name": "limit", - "schema": { - "format": "int64", - "type": "integer" - } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/searchPlaylistsResponse" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Get playlists.", - "tags": [ - "playlists" - ] - }, + "/reports/test-email": { "post": { - "operationId": "createPlaylist", + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", + "operationId": "sendTestEmail", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreatePlaylistCommand" + "$ref": "#/components/schemas/CreateOrUpdateReportConfig" } } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/createPlaylistResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -21401,22 +21288,25 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create playlist.", + "summary": "Send test report via email.", "tags": [ - "playlists" + "reports", + "enterprise" ] } }, - "/playlists/{uid}": { + "/reports/{id}": { "delete": { - "operationId": "deletePlaylist", + "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", + "operationId": "deleteReport", "parameters": [ { "in": "path", - "name": "uid", + "name": "id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], @@ -21424,6 +21314,9 @@ "200": { "$ref": "#/components/responses/okResponse" }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -21437,26 +21330,32 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete playlist.", + "summary": "Delete a report.", "tags": [ - "playlists" + "reports", + "enterprise" ] }, "get": { - "operationId": "getPlaylist", - "parameters": [ + "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", + "operationId": "getReport", + "parameters": [ { "in": "path", - "name": "uid", + "name": "id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/getPlaylistResponse" + "$ref": "#/components/responses/getReportResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -21471,20 +21370,23 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get playlist.", + "summary": "Get a report.", "tags": [ - "playlists" + "reports", + "enterprise" ] }, "put": { - "operationId": "updatePlaylist", + "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", + "operationId": "updateReport", "parameters": [ { "in": "path", - "name": "uid", + "name": "id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], @@ -21492,16 +21394,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdatePlaylistCommand" + "$ref": "#/components/schemas/CreateOrUpdateReportConfig" } } }, "required": true, - "x-originalParamName": "Body" + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/updatePlaylistResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -21516,183 +21421,138 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update playlist.", + "summary": "Update a report.", "tags": [ - "playlists" + "reports", + "enterprise" ] } }, - "/playlists/{uid}/items": { - "get": { - "operationId": "getPlaylistItems", + "/saml/acs": { + "post": { + "operationId": "postACS", "parameters": [ { - "in": "path", - "name": "uid", - "required": true, + "in": "query", + "name": "RelayState", "schema": { "type": "string" } } ], "responses": { - "200": { - "$ref": "#/components/responses/getPlaylistItemsResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "302": { + "description": "(empty)" }, "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get playlist items.", + "summary": "It performs Assertion Consumer Service (ACS).", "tags": [ - "playlists" + "saml", + "enterprise" ] } }, - "/public/dashboards/{accessToken}": { + "/saml/metadata": { "get": { - "description": "Get public dashboard for view", - "operationId": "viewPublicDashboard", - "parameters": [ - { - "in": "path", - "name": "accessToken", - "required": true, - "schema": { - "type": "string" - } - } - ], + "operationId": "getMetadata", "responses": { "200": { - "$ref": "#/components/responses/viewPublicDashboardResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestPublicError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedPublicError" - }, - "403": { - "$ref": "#/components/responses/forbiddenPublicError" - }, - "404": { - "$ref": "#/components/responses/notFoundPublicError" - }, - "500": { - "$ref": "#/components/responses/internalServerPublicError" + "$ref": "#/components/responses/contentResponse" } }, + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", "tags": [ - "dashboard_public" + "saml", + "enterprise" ] } }, - "/public/dashboards/{accessToken}/annotations": { + "/saml/slo": { "get": { - "description": "Get annotations for a public dashboard", - "operationId": "getPublicAnnotations", - "parameters": [ - { - "in": "path", - "name": "accessToken", - "required": true, - "schema": { - "type": "string" - } - } - ], + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "operationId": "getSLO", "responses": { - "200": { - "$ref": "#/components/responses/getPublicAnnotationsResponse" + "302": { + "description": "(empty)" }, "400": { - "$ref": "#/components/responses/badRequestPublicError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedPublicError" + "$ref": "#/components/responses/badRequestError" }, "403": { - "$ref": "#/components/responses/forbiddenPublicError" - }, - "404": { - "$ref": "#/components/responses/notFoundPublicError" + "$ref": "#/components/responses/forbiddenError" }, "500": { - "$ref": "#/components/responses/internalServerPublicError" + "$ref": "#/components/responses/internalServerError" } }, + "summary": "It performs Single Logout (SLO) callback.", "tags": [ - "dashboard_public" + "saml", + "enterprise" ] - } - }, - "/public/dashboards/{accessToken}/panels/{panelId}/query": { + }, "post": { - "description": "Get results for a given panel on a public dashboard", - "operationId": "queryPublicDashboard", + "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", + "operationId": "postSLO", "parameters": [ { - "in": "path", - "name": "accessToken", - "required": true, + "in": "query", + "name": "SAMLRequest", "schema": { "type": "string" } }, { - "in": "path", - "name": "panelId", - "required": true, + "in": "query", + "name": "SAMLResponse", "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { - "200": { - "$ref": "#/components/responses/queryPublicDashboardResponse" + "302": { + "description": "(empty)" }, "400": { - "$ref": "#/components/responses/badRequestPublicError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedPublicError" + "$ref": "#/components/responses/badRequestError" }, "403": { - "$ref": "#/components/responses/forbiddenPublicError" - }, - "404": { - "$ref": "#/components/responses/notFoundPublicError" + "$ref": "#/components/responses/forbiddenError" }, "500": { - "$ref": "#/components/responses/internalServerPublicError" + "$ref": "#/components/responses/internalServerError" } }, + "summary": "It performs Single Logout (SLO) callback.", "tags": [ - "dashboard_public" + "saml", + "enterprise" ] } }, - "/query-history": { + "/search": { "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.", - "operationId": "searchQueries", + "operationId": "search", "parameters": [ { - "description": "List of data source UIDs to search for", + "description": "Search Query", "in": "query", - "name": "datasourceUid", + "name": "query", + "schema": { + "type": "string" + } + }, + { + "description": "List of tags to search for", + "in": "query", + "name": "tag", "schema": { "items": { "type": "string" @@ -21701,104 +21561,193 @@ } }, { - "description": "Text inside query or comments that is searched for", + "description": "Type to search for, dash-folder or dash-db", "in": "query", - "name": "searchString", + "name": "type", "schema": { + "enum": [ + "dash-folder", + "dash-db" + ], "type": "string" } }, { - "description": "Flag indicating if only starred queries should be returned", + "description": "List of dashboard id’s to search for\nThis is deprecated: users should use the `dashboardUIDs` query parameter instead", "in": "query", - "name": "onlyStarred", + "name": "dashboardIds", "schema": { - "type": "boolean" + "items": { + "format": "int64", + "type": "integer" + }, + "type": "array" } }, { - "description": "Sort method", + "description": "List of dashboard uid’s to search for", "in": "query", - "name": "sort", + "name": "dashboardUIDs", "schema": { - "default": "time-desc", - "enum": [ - "time-desc", - "time-asc" - ], - "type": "string" + "items": { + "type": "string" + }, + "type": "array" } }, { - "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", + "description": "List of folder id’s to search in for dashboards\nIf it's `0` then it will query for the top level folders\nThis is deprecated: users should use the `folderUIDs` query parameter instead", "in": "query", - "name": "page", + "name": "folderIds", "schema": { - "format": "int64", - "type": "integer" + "items": { + "format": "int64", + "type": "integer" + }, + "type": "array" } }, { - "description": "Limit the number of returned results", + "description": "List of folder UID’s to search in for dashboards\nIf it's an empty string then it will query for the top level folders", "in": "query", - "name": "limit", + "name": "folderUIDs", "schema": { - "format": "int64", - "type": "integer" + "items": { + "type": "string" + }, + "type": "array" } }, { - "description": "From range for the query history search", + "description": "Flag indicating if only starred Dashboards should be returned", "in": "query", - "name": "from", + "name": "starred", "schema": { - "format": "int64", - "type": "integer" + "type": "boolean" } }, { - "description": "To range for the query history search", + "description": "Limit the number of returned results (max 5000)", "in": "query", - "name": "to", + "name": "limit", + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size. Only available in Grafana v6.2+.", + "in": "query", + "name": "page", "schema": { "format": "int64", "type": "integer" } + }, + { + "description": "Set to `Edit` to return dashboards/folders that the user can edit", + "in": "query", + "name": "permission", + "schema": { + "default": "View", + "enum": [ + "Edit", + "View" + ], + "type": "string" + } + }, + { + "description": "Sort method; for listing all the possible sort methods use the search sorting endpoint.", + "in": "query", + "name": "sort", + "schema": { + "default": "alpha-asc", + "enum": [ + "alpha-asc", + "alpha-desc" + ], + "type": "string" + } } ], "responses": { "200": { - "$ref": "#/components/responses/getQueryHistorySearchResponse" + "$ref": "#/components/responses/searchResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "422": { + "$ref": "#/components/responses/unprocessableEntityError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Query history search.", "tags": [ - "query_history" + "search" ] }, "post": { - "description": "Adds new query to query history.", - "operationId": "createQuery", + "operationId": "SearchDevices", + "responses": { + "200": { + "$ref": "#/components/responses/devicesSearchResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Lists all devices within the last 30 days", + "tags": [ + "devices" + ] + } + }, + "/search/sorting": { + "get": { + "operationId": "listSortOptions", + "responses": { + "200": { + "$ref": "#/components/responses/listSortOptionsResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + } + }, + "summary": "List search sorting options.", + "tags": [ + "search" + ] + } + }, + "/serviceaccounts": { + "post": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:*`\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", + "operationId": "createServiceAccount", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateQueryInQueryHistoryCommand" + "$ref": "#/components/schemas/CreateServiceAccountForm" } } }, - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { - "200": { - "$ref": "#/components/responses/getQueryHistoryResponse" + "201": { + "$ref": "#/components/responses/createServiceAccountResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -21806,116 +21755,172 @@ "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add query to query history.", + "summary": "Create service account", "tags": [ - "query_history" + "service_accounts" ] } }, - "/query-history/star/{query_history_uid}": { - "delete": { - "description": "Removes star from query in query history as specified by the UID.", - "operationId": "unstarQuery", + "/serviceaccounts/search": { + "get": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:*`", + "operationId": "searchOrgServiceAccountsWithPaging", "parameters": [ { - "in": "path", - "name": "query_history_uid", - "required": true, + "in": "query", + "name": "Disabled", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "expiredTokens", + "schema": { + "type": "boolean" + } + }, + { + "description": "It will return results where the query value is contained in one of the name.\nQuery values with spaces need to be URL encoded.", + "in": "query", + "name": "query", "schema": { "type": "string" } + }, + { + "description": "The default value is 1000.", + "in": "query", + "name": "perpage", + "schema": { + "format": "int64", + "type": "integer" + } + }, + { + "description": "The default value is 1.", + "in": "query", + "name": "page", + "schema": { + "format": "int64", + "type": "integer" + } } ], "responses": { "200": { - "$ref": "#/components/responses/getQueryHistoryResponse" + "$ref": "#/components/responses/searchOrgServiceAccountsWithPagingResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Remove star to query in query history.", + "summary": "Search service accounts with paging", "tags": [ - "query_history" + "service_accounts" ] - }, - "post": { - "description": "Adds star to query in query history as specified by the UID.", - "operationId": "starQuery", + } + }, + "/serviceaccounts/{serviceAccountId}": { + "delete": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:delete` scope: `serviceaccounts:id:1` (single service account)", + "operationId": "deleteServiceAccount", "parameters": [ { "in": "path", - "name": "query_history_uid", + "name": "serviceAccountId", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/getQueryHistoryResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add star to query in query history.", + "summary": "Delete service account", "tags": [ - "query_history" + "service_accounts" ] - } - }, - "/query-history/{query_history_uid}": { - "delete": { - "description": "Deletes an existing query in query history as specified by the UID. This operation cannot be reverted.", - "operationId": "deleteQuery", + }, + "get": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:id:1` (single service account)", + "operationId": "retrieveServiceAccount", "parameters": [ { "in": "path", - "name": "query_history_uid", + "name": "serviceAccountId", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/getQueryHistoryDeleteQueryResponse" + "$ref": "#/components/responses/retrieveServiceAccountResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete query in query history.", + "summary": "Get single serviceaccount by Id", "tags": [ - "query_history" + "service_accounts" ] }, "patch": { - "description": "Updates comment for query in query history as specified by the UID.", - "operationId": "patchQueryComment", + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", + "operationId": "updateServiceAccount", "parameters": [ { "in": "path", - "name": "query_history_uid", + "name": "serviceAccountId", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], @@ -21923,16 +21928,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchQueryCommentInQueryHistoryCommand" + "$ref": "#/components/schemas/UpdateServiceAccountForm" } } }, - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { "200": { - "$ref": "#/components/responses/getQueryHistoryResponse" + "$ref": "#/components/responses/updateServiceAccountResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -21940,58 +21944,43 @@ "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update comment for query in query history.", + "summary": "Update service account", "tags": [ - "query_history" + "service_accounts" ] } }, - "/recording-rules": { + "/serviceaccounts/{serviceAccountId}/tokens": { "get": { - "operationId": "listRecordingRules", - "responses": { - "200": { - "$ref": "#/components/responses/listRecordingRulesResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Lists all rules in the database: active or deleted.", - "tags": [ - "recording_rules", - "enterprise" - ] - }, - "post": { - "operationId": "createRecordingRule", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecordingRuleJSON" - } + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `global:serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", + "operationId": "listTokens", + "parameters": [ + { + "in": "path", + "name": "serviceAccountId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" } - }, - "required": true, - "x-originalParamName": "body" - }, + } + ], "responses": { "200": { - "$ref": "#/components/responses/recordingRuleResponse" + "$ref": "#/components/responses/listTokensResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -21999,35 +21988,45 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create a recording rule that is then registered and started.", + "summary": "Get service account tokens", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" ] }, - "put": { - "operationId": "updateRecordingRule", + "post": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", + "operationId": "createToken", + "parameters": [ + { + "in": "path", + "name": "serviceAccountId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RecordingRuleJSON" + "$ref": "#/components/schemas/AddServiceAccountTokenCommand" } } }, - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { "200": { - "$ref": "#/components/responses/recordingRuleResponse" + "$ref": "#/components/responses/createTokenResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -22038,35 +22037,50 @@ "404": { "$ref": "#/components/responses/notFoundError" }, + "409": { + "$ref": "#/components/responses/conflictError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update the active status of a rule.", + "summary": "CreateNewToken adds a token to a service account", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" ] } }, - "/recording-rules/test": { - "post": { - "operationId": "testCreateRecordingRule", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecordingRuleJSON" - } + "/serviceaccounts/{serviceAccountId}/tokens/{tokenId}": { + "delete": { + "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", + "operationId": "deleteToken", + "parameters": [ + { + "in": "path", + "name": "tokenId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" } }, - "required": true, - "x-originalParamName": "body" - }, + { + "in": "path", + "name": "serviceAccountId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "responses": { "200": { "$ref": "#/components/responses/okResponse" }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -22076,79 +22090,60 @@ "404": { "$ref": "#/components/responses/notFoundError" }, - "422": { - "$ref": "#/components/responses/unprocessableEntityError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Test a recording rule.", + "summary": "DeleteToken deletes service account tokens", "tags": [ - "recording_rules", - "enterprise" + "service_accounts" ] } }, - "/recording-rules/writer": { - "delete": { - "operationId": "deleteRecordingRuleWriteTarget", + "/signing-keys/keys": { + "get": { + "description": "Required permissions\nNone", + "operationId": "retrieveJWKS", "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" + "$ref": "#/components/responses/jwksResponse" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete the remote write target.", + "summary": "Get JSON Web Key Set (JWKS) with all the keys that can be used to verify tokens (public keys)", "tags": [ - "recording_rules", - "enterprise" + "signing_keys" ] - }, + } + }, + "/snapshot/shared-options": { "get": { - "operationId": "getRecordingRuleWriteTarget", + "operationId": "getSharingOptions", "responses": { "200": { - "$ref": "#/components/responses/recordingRuleWriteTargetResponse" + "$ref": "#/components/responses/getSharingOptionsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" } }, - "summary": "Return the prometheus remote write target.", + "summary": "Get snapshot sharing settings.", "tags": [ - "recording_rules", - "enterprise" + "snapshots" ] - }, + } + }, + "/snapshots": { "post": { - "description": "It returns a 422 if there is not an existing prometheus data source configured.", - "operationId": "createRecordingRuleWriteTarget", + "description": "Snapshot public mode should be enabled or authentication is required.", + "operationId": "createDashboardSnapshot", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PrometheusRemoteWriteTargetJSON" + "$ref": "#/components/schemas/CreateDashboardSnapshotCommand" } } }, @@ -22157,7 +22152,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/recordingRuleWriteTargetResponse" + "$ref": "#/components/responses/createDashboardSnapshotResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -22165,34 +22160,27 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "422": { - "$ref": "#/components/responses/unprocessableEntityError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create a remote write target.", + "summary": "When creating a snapshot using the API, you have to provide the full dashboard payload including the snapshot data. This endpoint is designed for the Grafana UI.", "tags": [ - "recording_rules", - "enterprise" + "snapshots" ] } }, - "/recording-rules/{recordingRuleID}": { - "delete": { - "operationId": "deleteRecordingRule", + "/snapshots-delete/{deleteKey}": { + "get": { + "description": "Snapshot public mode should be enabled or authentication is required.", + "operationId": "deleteDashboardSnapshotByDeleteKey", "parameters": [ { "in": "path", - "name": "recordingRuleID", + "name": "deleteKey", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], @@ -22213,58 +22201,83 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete removes the rule from the registry and stops it.", + "summary": "Delete Snapshot by deleteKey.", "tags": [ - "recording_rules", - "enterprise" + "snapshots" ] } }, - "/reports": { - "get": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", - "operationId": "getReports", + "/snapshots/{key}": { + "delete": { + "operationId": "deleteDashboardSnapshot", + "parameters": [ + { + "in": "path", + "name": "key", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "$ref": "#/components/responses/getReportsResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "$ref": "#/components/responses/okResponse" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "List reports.", + "summary": "Delete Snapshot by Key.", "tags": [ - "reports", - "enterprise" + "snapshots" ] }, - "post": { - "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", - "operationId": "createReport", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOrUpdateReportConfig" - } + "get": { + "operationId": "getDashboardSnapshot", + "parameters": [ + { + "in": "path", + "name": "key", + "required": true, + "schema": { + "type": "string" } - }, - "required": true, - "x-originalParamName": "body" - }, + } + ], "responses": { "200": { - "$ref": "#/components/responses/createReportResponse" + "$ref": "#/components/responses/getDashboardSnapshotResponse" }, "400": { "$ref": "#/components/responses/badRequestError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get Snapshot by Key.", + "tags": [ + "snapshots" + ] + } + }, + "/stats": { + "get": { + "operationId": "listDevices", + "responses": { + "200": { + "$ref": "#/components/responses/devicesResponse" + }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -22278,22 +22291,20 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create a report.", + "summary": "Lists all devices within the last 30 days", "tags": [ - "reports", - "enterprise" + "devices" ] } }, - "/reports/email": { + "/teams": { "post": { - "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", - "operationId": "sendReport", + "operationId": "createTeam", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReportEmail" + "$ref": "#/components/schemas/CreateTeamCommand" } } }, @@ -22302,10 +22313,7 @@ }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/createTeamResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -22313,82 +22321,53 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" + "409": { + "$ref": "#/components/responses/conflictError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Send a report.", + "summary": "Add Team.", "tags": [ - "reports", - "enterprise" + "teams" ] } }, - "/reports/render/pdf/{dashboardID}": { + "/teams/search": { "get": { - "deprecated": true, - "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", - "operationId": "renderReportPDF", + "operationId": "searchTeams", "parameters": [ { - "in": "path", - "name": "DashboardID", - "required": true, + "in": "query", + "name": "page", "schema": { + "default": 1, "format": "int64", "type": "integer" } }, { - "in": "path", - "name": "dashboardID", - "required": true, + "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.", + "in": "query", + "name": "perpage", "schema": { + "default": 1000, "format": "int64", "type": "integer" } }, { "in": "query", - "name": "title", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "variables", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "from", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "to", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "orientation", + "name": "name", "schema": { "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.", "in": "query", - "name": "layout", + "name": "query", "schema": { "type": "string" } @@ -22396,76 +22375,48 @@ ], "responses": { "200": { - "$ref": "#/components/responses/contentResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/searchTeamsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Render report for dashboard.", + "summary": "Team Search With Paging.", "tags": [ - "reports", - "enterprise" + "teams" ] } }, - "/reports/render/pdfs": { - "get": { - "description": "Available to all users and with a valid license.", - "operationId": "renderReportPDFs", + "/teams/{teamId}/groups": { + "delete": { + "operationId": "removeTeamGroupApiQuery", "parameters": [ { "in": "query", - "name": "dashboardID", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "orientation", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "layout", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "title", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "scaleFactor", + "name": "groupId", "schema": { "type": "string" } }, { - "in": "query", - "name": "includeTables", + "in": "path", + "name": "teamId", + "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/contentResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -22473,24 +22424,41 @@ "401": { "$ref": "#/components/responses/unauthorisedError" }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Render report for multiple dashboards.", + "summary": "Remove External Group.", "tags": [ - "reports", + "sync_team_groups", "enterprise" ] - } - }, - "/reports/settings": { + }, "get": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.settings:read`x.", - "operationId": "getReportSettings", + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "responses": { "200": { - "$ref": "#/components/responses/getReportSettingsResponse" + "$ref": "#/components/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -22498,24 +22466,37 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get settings.", + "summary": "Get External Groups.", "tags": [ - "reports", + "sync_team_groups", "enterprise" ] }, "post": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.settings:write`xx.", - "operationId": "saveReportSettings", + "operationId": "addTeamGroupApi", + "parameters": [ + { + "in": "path", + "name": "teamId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReportSettings" + "$ref": "#/components/schemas/TeamGroupMapping" } } }, @@ -22535,71 +22516,30 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Save settings.", + "summary": "Add External Group.", "tags": [ - "reports", + "sync_team_groups", "enterprise" ] } }, - "/reports/test-email": { - "post": { - "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", - "operationId": "sendTestEmail", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOrUpdateReportConfig" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, - "responses": { - "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Send test report via email.", - "tags": [ - "reports", - "enterprise" - ] - } - }, - "/reports/{id}": { + "/teams/{team_id}": { "delete": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", - "operationId": "deleteReport", + "operationId": "deleteTeamByID", "parameters": [ { "in": "path", - "name": "id", + "name": "team_id", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], @@ -22607,9 +22547,6 @@ "200": { "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -22623,32 +22560,26 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete a report.", + "summary": "Delete Team By ID.", "tags": [ - "reports", - "enterprise" + "teams" ] }, "get": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", - "operationId": "getReport", + "operationId": "getTeamByID", "parameters": [ { "in": "path", - "name": "id", + "name": "team_id", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/getReportResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getTeamByIDResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -22663,23 +22594,20 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get a report.", + "summary": "Get Team By ID.", "tags": [ - "reports", - "enterprise" + "teams" ] }, "put": { - "description": "Available to org admins only and with a valid or expired license.\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", - "operationId": "updateReport", + "operationId": "updateTeam", "parameters": [ { "in": "path", - "name": "id", + "name": "team_id", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], @@ -22687,7 +22615,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateOrUpdateReportConfig" + "$ref": "#/components/schemas/UpdateTeamCommand" } } }, @@ -22698,9 +22626,6 @@ "200": { "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -22710,283 +22635,313 @@ "404": { "$ref": "#/components/responses/notFoundError" }, + "409": { + "$ref": "#/components/responses/conflictError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update a report.", + "summary": "Update Team.", "tags": [ - "reports", - "enterprise" + "teams" ] } }, - "/saml/acs": { - "post": { - "operationId": "postACS", + "/teams/{team_id}/members": { + "get": { + "operationId": "getTeamMembers", "parameters": [ { - "in": "query", - "name": "RelayState", + "in": "path", + "name": "team_id", + "required": true, "schema": { "type": "string" } } ], "responses": { - "302": { - "description": "(empty)" + "200": { + "$ref": "#/components/responses/getTeamMembersResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "It performs Assertion Consumer Service (ACS).", + "summary": "Get Team Members.", "tags": [ - "saml", - "enterprise" + "teams" ] - } - }, - "/saml/metadata": { - "get": { - "operationId": "getMetadata", + }, + "post": { + "operationId": "addTeamMember", + "parameters": [ + { + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddTeamMemberCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/contentResponse" + "$ref": "#/components/responses/okResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "summary": "Add Team Member.", "tags": [ - "saml", - "enterprise" + "teams" ] } }, - "/saml/slo": { - "get": { - "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", - "operationId": "getSLO", + "/teams/{team_id}/members/{user_id}": { + "delete": { + "operationId": "removeTeamMember", + "parameters": [ + { + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "responses": { - "302": { - "description": "(empty)" + "200": { + "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" + "401": { + "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "It performs Single Logout (SLO) callback.", + "summary": "Remove Member From Team.", "tags": [ - "saml", - "enterprise" + "teams" ] }, - "post": { - "description": "There might be two possible requests:\n1. Logout response (callback) when Grafana initiates single logout and IdP returns response to logout request.\n2. Logout request when another SP initiates single logout and IdP sends logout request to the Grafana,\nor in case of IdP-initiated logout.", - "operationId": "postSLO", + "put": { + "operationId": "updateTeamMember", "parameters": [ { - "in": "query", - "name": "SAMLRequest", + "in": "path", + "name": "team_id", + "required": true, "schema": { "type": "string" } }, { - "in": "query", - "name": "SAMLResponse", + "in": "path", + "name": "user_id", + "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTeamMemberCommand" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { - "302": { - "description": "(empty)" + "200": { + "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" + "401": { + "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "It performs Single Logout (SLO) callback.", + "summary": "Update Team Member.", "tags": [ - "saml", - "enterprise" + "teams" ] } }, - "/search": { + "/teams/{team_id}/preferences": { "get": { - "operationId": "search", + "operationId": "getTeamPreferences", "parameters": [ { - "description": "Search Query", - "in": "query", - "name": "query", + "in": "path", + "name": "team_id", + "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/getPreferencesResponse" }, - { - "description": "List of tags to search for", - "in": "query", - "name": "tag", - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - { - "description": "Type to search for, dash-folder or dash-db", - "in": "query", - "name": "type", - "schema": { - "enum": [ - "dash-folder", - "dash-db" - ], - "type": "string" - } - }, - { - "description": "List of dashboard id’s to search for\nThis is deprecated: users should use the `dashboardUIDs` query parameter instead", - "in": "query", - "name": "dashboardIds", - "schema": { - "items": { - "format": "int64", - "type": "integer" - }, - "type": "array" - } - }, - { - "description": "List of dashboard uid’s to search for", - "in": "query", - "name": "dashboardUIDs", - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - { - "description": "List of folder id’s to search in for dashboards\nIf it's `0` then it will query for the top level folders\nThis is deprecated: users should use the `folderUIDs` query parameter instead", - "in": "query", - "name": "folderIds", - "schema": { - "items": { - "format": "int64", - "type": "integer" - }, - "type": "array" - } + "401": { + "$ref": "#/components/responses/unauthorisedError" }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get Team Preferences.", + "tags": [ + "teams" + ] + }, + "put": { + "operationId": "updateTeamPreferences", + "parameters": [ { - "description": "List of folder UID’s to search in for dashboards\nIf it's an empty string then it will query for the top level folders", - "in": "query", - "name": "folderUIDs", + "in": "path", + "name": "team_id", + "required": true, "schema": { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" } - }, - { - "description": "Flag indicating if only starred Dashboards should be returned", - "in": "query", - "name": "starred", - "schema": { - "type": "boolean" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePrefsCmd" + } } }, - { - "description": "Limit the number of returned results (max 5000)", - "in": "query", - "name": "limit", - "schema": { - "format": "int64", - "type": "integer" - } + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/okResponse" }, - { - "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size. Only available in Grafana v6.2+.", - "in": "query", - "name": "page", - "schema": { - "format": "int64", - "type": "integer" - } + "400": { + "$ref": "#/components/responses/badRequestError" }, - { - "description": "Set to `Edit` to return dashboards/folders that the user can edit", - "in": "query", - "name": "permission", - "schema": { - "default": "View", - "enum": [ - "Edit", - "View" - ], - "type": "string" - } + "401": { + "$ref": "#/components/responses/unauthorisedError" }, - { - "description": "Sort method; for listing all the possible sort methods use the search sorting endpoint.", - "in": "query", - "name": "sort", - "schema": { - "default": "alpha-asc", - "enum": [ - "alpha-asc", - "alpha-desc" - ], - "type": "string" - } + "500": { + "$ref": "#/components/responses/internalServerError" } - ], + }, + "summary": "Update Team Preferences.", + "tags": [ + "teams" + ] + } + }, + "/user": { + "get": { + "description": "Get (current authenticated user)", + "operationId": "getSignedInUser", "responses": { "200": { - "$ref": "#/components/responses/searchResponse" + "$ref": "#/components/responses/userResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" }, - "422": { - "$ref": "#/components/responses/unprocessableEntityError" + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, "tags": [ - "search" + "signed_in_user" ] }, - "post": { - "operationId": "SearchDevices", + "put": { + "operationId": "updateSignedInUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateUserCommand" + } + } + }, + "description": "To change the email, name, login, theme, provide another one.", + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/devicesSearchResponse" + "$ref": "#/components/responses/okResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -22994,56 +22949,46 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Lists all devices within the last 30 days", + "summary": "Update signed in User.", "tags": [ - "devices" + "signed_in_user" ] } }, - "/search/sorting": { + "/user/auth-tokens": { "get": { - "operationId": "listSortOptions", + "description": "Return a list of all auth tokens (devices) that the actual user currently have logged in from.", + "operationId": "getUserAuthTokens", "responses": { "200": { - "$ref": "#/components/responses/listSortOptionsResponse" + "$ref": "#/components/responses/getUserAuthTokensResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } }, - "summary": "List search sorting options.", + "summary": "Auth tokens of the actual User.", "tags": [ - "search" + "signed_in_user" ] } }, - "/serviceaccounts": { - "post": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:*`\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", - "operationId": "createServiceAccount", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateServiceAccountForm" - } - } - }, - "x-originalParamName": "Body" - }, + "/user/helpflags/clear": { + "get": { + "operationId": "clearHelpFlags", "responses": { - "201": { - "$ref": "#/components/responses/createServiceAccountResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "200": { + "$ref": "#/components/responses/helpFlagResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23055,61 +23000,28 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Create service account", + "summary": "Clear user help flag.", "tags": [ - "service_accounts" + "signed_in_user" ] } }, - "/serviceaccounts/search": { - "get": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:*`", - "operationId": "searchOrgServiceAccountsWithPaging", + "/user/helpflags/{flag_id}": { + "put": { + "operationId": "setHelpFlag", "parameters": [ { - "in": "query", - "name": "Disabled", - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "expiredTokens", - "schema": { - "type": "boolean" - } - }, - { - "description": "It will return results where the query value is contained in one of the name.\nQuery values with spaces need to be URL encoded.", - "in": "query", - "name": "query", + "in": "path", + "name": "flag_id", + "required": true, "schema": { "type": "string" } - }, - { - "description": "The default value is 1000.", - "in": "query", - "name": "perpage", - "schema": { - "format": "int64", - "type": "integer" - } - }, - { - "description": "The default value is 1.", - "in": "query", - "name": "page", - "schema": { - "format": "int64", - "type": "integer" - } } ], "responses": { "200": { - "$ref": "#/components/responses/searchOrgServiceAccountsWithPagingResponse" + "$ref": "#/components/responses/helpFlagResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23121,27 +23033,57 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Search service accounts with paging", + "summary": "Set user help flag.", "tags": [ - "service_accounts" + "signed_in_user" ] } }, - "/serviceaccounts/{serviceAccountId}": { - "delete": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:delete` scope: `serviceaccounts:id:1` (single service account)", - "operationId": "deleteServiceAccount", - "parameters": [ + "/user/orgs": { + "get": { + "description": "Return a list of all organizations of the current user.", + "operationId": "getSignedInUserOrgList", + "responses": { + "200": { + "$ref": "#/components/responses/getSignedInUserOrgListResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "security": [ { - "in": "path", - "name": "serviceAccountId", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } + "basic": [] } ], + "summary": "Organizations of the actual User.", + "tags": [ + "signed_in_user" + ] + } + }, + "/user/password": { + "put": { + "description": "Changes the password for the user.", + "operationId": "changeUserPassword", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeUserPasswordCommand" + } + } + }, + "description": "To change the email, name, login, theme, provide another one.", + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { "$ref": "#/components/responses/okResponse" @@ -23159,28 +23101,52 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete service account", + "security": [ + { + "basic": [] + } + ], + "summary": "Change Password.", "tags": [ - "service_accounts" + "signed_in_user" ] - }, + } + }, + "/user/preferences": { "get": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `serviceaccounts:id:1` (single service account)", - "operationId": "retrieveServiceAccount", - "parameters": [ - { - "in": "path", - "name": "serviceAccountId", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } + "operationId": "getUserPreferences", + "responses": { + "200": { + "$ref": "#/components/responses/getPreferencesResponse" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" } - ], + }, + "summary": "Get user preferences.", + "tags": [ + "user_preferences" + ] + }, + "patch": { + "operationId": "patchUserPreferences", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchPrefsCmd" + } + } + }, + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { - "$ref": "#/components/responses/retrieveServiceAccountResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -23188,48 +23154,32 @@ "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get single serviceaccount by Id", + "summary": "Patch user preferences.", "tags": [ - "service_accounts" + "user_preferences" ] }, - "patch": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", - "operationId": "updateServiceAccount", - "parameters": [ - { - "in": "path", - "name": "serviceAccountId", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "put": { + "description": "Omitting a key (`theme`, `homeDashboardId`, `timezone`) will cause the current value to be replaced with the system default value.", + "operationId": "updateUserPreferences", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateServiceAccountForm" + "$ref": "#/components/schemas/UpdatePrefsCmd" } } }, - "x-originalParamName": "Body" + "required": true, + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/updateServiceAccountResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -23237,43 +23187,22 @@ "401": { "$ref": "#/components/responses/unauthorisedError" }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Update service account", + "summary": "Update user preferences.", "tags": [ - "service_accounts" + "user_preferences" ] } }, - "/serviceaccounts/{serviceAccountId}/tokens": { + "/user/quotas": { "get": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:read` scope: `global:serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", - "operationId": "listTokens", - "parameters": [ - { - "in": "path", - "name": "serviceAccountId", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "operationId": "getUserQuotas", "responses": { "200": { - "$ref": "#/components/responses/listTokensResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/getQuotaResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23281,42 +23210,37 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get service account tokens", + "summary": "Fetch user quota.", "tags": [ - "service_accounts" + "signed_in_user" ] - }, + } + }, + "/user/revoke-auth-token": { "post": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)", - "operationId": "createToken", - "parameters": [ - { - "in": "path", - "name": "serviceAccountId", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + "description": "Revokes the given auth token (device) for the actual user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.", + "operationId": "revokeUserAuthToken", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddServiceAccountTokenCommand" + "$ref": "#/components/schemas/RevokeAuthTokenCmd" } } }, - "x-originalParamName": "Body" + "required": true, + "x-originalParamName": "body" }, "responses": { "200": { - "$ref": "#/components/responses/createTokenResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" @@ -23327,43 +23251,27 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "409": { - "$ref": "#/components/responses/conflictError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "CreateNewToken adds a token to a service account", + "summary": "Revoke an auth token of the actual User.", "tags": [ - "service_accounts" + "signed_in_user" ] } }, - "/serviceaccounts/{serviceAccountId}/tokens/{tokenId}": { + "/user/stars/dashboard/uid/{dashboard_uid}": { "delete": { - "description": "Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):\naction: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)\n\nRequires basic authentication and that the authenticated user is a Grafana Admin.", - "operationId": "deleteToken", + "description": "Deletes the starring of the given Dashboard for the actual user.", + "operationId": "unstarDashboardByUID", "parameters": [ { "in": "path", - "name": "tokenId", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - }, - { - "in": "path", - "name": "serviceAccountId", + "name": "dashboard_uid", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], @@ -23380,97 +23288,22 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "DeleteToken deletes service account tokens", - "tags": [ - "service_accounts" - ] - } - }, - "/signing-keys/keys": { - "get": { - "description": "Required permissions\nNone", - "operationId": "retrieveJWKS", - "responses": { - "200": { - "$ref": "#/components/responses/jwksResponse" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get JSON Web Key Set (JWKS) with all the keys that can be used to verify tokens (public keys)", - "tags": [ - "signing_keys" - ] - } - }, - "/snapshot/shared-options": { - "get": { - "operationId": "getSharingOptions", - "responses": { - "200": { - "$ref": "#/components/responses/getSharingOptionsResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - } - }, - "summary": "Get snapshot sharing settings.", + "summary": "Unstar a dashboard.", "tags": [ - "snapshots" + "signed_in_user" ] - } - }, - "/snapshots": { + }, "post": { - "description": "Snapshot public mode should be enabled or authentication is required.", - "operationId": "createDashboardSnapshot", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateDashboardSnapshotCommand" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, - "responses": { - "200": { - "$ref": "#/components/responses/createDashboardSnapshotResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "When creating a snapshot using the API, you have to provide the full dashboard payload including the snapshot data. This endpoint is designed for the Grafana UI.", - "tags": [ - "snapshots" - ] - } - }, - "/snapshots-delete/{deleteKey}": { - "get": { - "description": "Snapshot public mode should be enabled or authentication is required.", - "operationId": "deleteDashboardSnapshotByDeleteKey", + "description": "Stars the given Dashboard for the actual user.", + "operationId": "starDashboardByUID", "parameters": [ { "in": "path", - "name": "deleteKey", + "name": "dashboard_uid", "required": true, "schema": { "type": "string" @@ -23481,32 +23314,34 @@ "200": { "$ref": "#/components/responses/okResponse" }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, "401": { "$ref": "#/components/responses/unauthorisedError" }, "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete Snapshot by deleteKey.", + "summary": "Star a dashboard.", "tags": [ - "snapshots" + "signed_in_user" ] } }, - "/snapshots/{key}": { + "/user/stars/dashboard/{dashboard_id}": { "delete": { - "operationId": "deleteDashboardSnapshot", + "deprecated": true, + "description": "Deletes the starring of the given Dashboard for the actual user.", + "operationId": "unstarDashboard", "parameters": [ { "in": "path", - "name": "key", + "name": "dashboard_id", "required": true, "schema": { "type": "string" @@ -23517,27 +23352,32 @@ "200": { "$ref": "#/components/responses/okResponse" }, + "400": { + "$ref": "#/components/responses/badRequestError" + }, + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete Snapshot by Key.", + "summary": "Unstar a dashboard.", "tags": [ - "snapshots" + "signed_in_user" ] }, - "get": { - "operationId": "getDashboardSnapshot", + "post": { + "deprecated": true, + "description": "Stars the given Dashboard for the actual user.", + "operationId": "starDashboard", "parameters": [ { "in": "path", - "name": "key", + "name": "dashboard_id", "required": true, "schema": { "type": "string" @@ -23546,30 +23386,34 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getDashboardSnapshotResponse" + "$ref": "#/components/responses/okResponse" }, "400": { "$ref": "#/components/responses/badRequestError" }, - "404": { - "$ref": "#/components/responses/notFoundError" + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get Snapshot by Key.", + "summary": "Star a dashboard.", "tags": [ - "snapshots" + "signed_in_user" ] } }, - "/stats": { + "/user/teams": { "get": { - "operationId": "listDevices", + "description": "Return a list of all teams that the current user is member of.", + "operationId": "getSignedInUserTeamList", "responses": { "200": { - "$ref": "#/components/responses/devicesResponse" + "$ref": "#/components/responses/getSignedInUserTeamListResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23577,36 +23421,37 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Lists all devices within the last 30 days", + "summary": "Teams that the actual User is member of.", "tags": [ - "devices" + "signed_in_user" ] } }, - "/teams": { + "/user/using/{org_id}": { "post": { - "operationId": "createTeam", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTeamCommand" - } + "description": "Switch user context to the given organization.", + "operationId": "userSetUsingOrg", + "parameters": [ + { + "in": "path", + "name": "org_id", + "required": true, + "schema": { + "format": "int64", + "type": "integer" } - }, - "required": true, - "x-originalParamName": "body" - }, + } + ], "responses": { "200": { - "$ref": "#/components/responses/createTeamResponse" + "$ref": "#/components/responses/okResponse" + }, + "400": { + "$ref": "#/components/responses/badRequestError" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23614,34 +23459,23 @@ "403": { "$ref": "#/components/responses/forbiddenError" }, - "409": { - "$ref": "#/components/responses/conflictError" - }, "500": { "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add Team.", + "summary": "Switch user context for signed in user.", "tags": [ - "teams" + "signed_in_user" ] } }, - "/teams/search": { + "/users": { "get": { - "operationId": "searchTeams", + "description": "Returns all users that the authenticated user has permission to view, admin permission required.", + "operationId": "searchUsers", "parameters": [ { - "in": "query", - "name": "page", - "schema": { - "default": 1, - "format": "int64", - "type": "integer" - } - }, - { - "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.", + "description": "Limit the maximum number of users to return per page", "in": "query", "name": "perpage", "schema": { @@ -23651,24 +23485,19 @@ } }, { + "description": "Page index for starting fetching users", "in": "query", - "name": "name", - "schema": { - "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.", - "in": "query", - "name": "query", + "name": "page", "schema": { - "type": "string" + "default": 1, + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/searchTeamsResponse" + "$ref": "#/components/responses/searchUsersResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23680,39 +23509,55 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Team Search With Paging.", + "summary": "Get users.", "tags": [ - "teams" + "users" ] } }, - "/teams/{teamId}/groups": { - "delete": { - "operationId": "removeTeamGroupApiQuery", + "/users/lookup": { + "get": { + "operationId": "getUserByLoginOrEmail", "parameters": [ { + "description": "loginOrEmail of the user", "in": "query", - "name": "groupId", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "teamId", + "name": "loginOrEmail", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/userResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" + "401": { + "$ref": "#/components/responses/unauthorisedError" + }, + "403": { + "$ref": "#/components/responses/forbiddenError" + }, + "404": { + "$ref": "#/components/responses/notFoundError" + }, + "500": { + "$ref": "#/components/responses/internalServerError" + } + }, + "summary": "Get user by login or email.", + "tags": [ + "users" + ] + } + }, + "/users/search": { + "get": { + "operationId": "searchUsersWithPaging", + "responses": { + "200": { + "$ref": "#/components/responses/searchUsersWithPagingResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23727,18 +23572,19 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Remove External Group.", + "summary": "Get users with paging.", "tags": [ - "sync_team_groups", - "enterprise" + "users" ] - }, + } + }, + "/users/{user_id}": { "get": { - "operationId": "getTeamGroupsApi", + "operationId": "getUserByID", "parameters": [ { "in": "path", - "name": "teamId", + "name": "user_id", "required": true, "schema": { "format": "int64", @@ -23748,10 +23594,7 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getTeamGroupsApiResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" + "$ref": "#/components/responses/userResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23766,18 +23609,18 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get External Groups.", + "summary": "Get user by id.", "tags": [ - "sync_team_groups", - "enterprise" + "users" ] }, - "post": { - "operationId": "addTeamGroupApi", + "put": { + "description": "Update the user identified by id.", + "operationId": "updateUser", "parameters": [ { "in": "path", - "name": "teamId", + "name": "user_id", "required": true, "schema": { "format": "int64", @@ -23789,10 +23632,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamGroupMapping" + "$ref": "#/components/schemas/UpdateUserCommand" } } }, + "description": "To change the email, name, login, theme, provide another one.", "required": true, "x-originalParamName": "body" }, @@ -23800,9 +23644,6 @@ "200": { "$ref": "#/components/responses/okResponse" }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, "401": { "$ref": "#/components/responses/unauthorisedError" }, @@ -23816,29 +23657,30 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Add External Group.", + "summary": "Update user.", "tags": [ - "sync_team_groups", - "enterprise" + "users" ] } }, - "/teams/{team_id}": { - "delete": { - "operationId": "deleteTeamByID", + "/users/{user_id}/orgs": { + "get": { + "description": "Get organizations for user identified by id.", + "operationId": "getUserOrgList", "parameters": [ { "in": "path", - "name": "team_id", + "name": "user_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "$ref": "#/components/responses/getUserOrgListResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23853,26 +23695,30 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Delete Team By ID.", + "summary": "Get organizations for user.", "tags": [ - "teams" + "users" ] - }, + } + }, + "/users/{user_id}/teams": { "get": { - "operationId": "getTeamByID", + "description": "Get teams for user identified by id.", + "operationId": "getUserTeams", "parameters": [ { "in": "path", - "name": "team_id", + "name": "user_id", "required": true, "schema": { - "type": "string" + "format": "int64", + "type": "integer" } } ], "responses": { "200": { - "$ref": "#/components/responses/getTeamByIDResponse" + "$ref": "#/components/responses/getUserTeamsResponse" }, "401": { "$ref": "#/components/responses/unauthorisedError" @@ -23887,18 +23733,38 @@ "$ref": "#/components/responses/internalServerError" } }, - "summary": "Get Team By ID.", + "summary": "Get teams for user.", "tags": [ - "teams" + "users" + ] + } + }, + "/v1/provisioning/alert-rules": { + "get": { + "operationId": "RouteGetAlertRules", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProvisionedAlertRules" + } + } + }, + "description": "ProvisionedAlertRules" + } + }, + "summary": "Get all the alert rules.", + "tags": [ + "provisioning" ] }, - "put": { - "operationId": "updateTeam", + "post": { + "operationId": "RoutePostAlertRule", "parameters": [ { - "in": "path", - "name": "team_id", - "required": true, + "in": "header", + "name": "X-Disable-Provenance", "schema": { "type": "string" } @@ -23908,182 +23774,192 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateTeamCommand" + "$ref": "#/components/schemas/ProvisionedAlertRule" } } }, - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { - "200": { - "$ref": "#/components/responses/okResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "409": { - "$ref": "#/components/responses/conflictError" + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProvisionedAlertRule" + } + } + }, + "description": "ProvisionedAlertRule" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Update Team.", + "summary": "Create a new alert rule.", "tags": [ - "teams" + "provisioning" ] } }, - "/teams/{team_id}/members": { + "/v1/provisioning/alert-rules/export": { "get": { - "operationId": "getTeamMembers", + "operationId": "RouteGetAlertRulesExport", "parameters": [ { - "in": "path", - "name": "team_id", - "required": true, + "description": "Whether to initiate a download of the file or not.", + "in": "query", + "name": "download", "schema": { - "type": "string" + "default": false, + "type": "boolean" } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/getTeamMembersResponse" }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + { + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "in": "query", + "name": "format", + "schema": { + "default": "yaml", + "type": "string" + } }, - "403": { - "$ref": "#/components/responses/forbiddenError" + { + "description": "UIDs of folders from which to export rules", + "in": "query", + "name": "folderUid", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } }, - "404": { - "$ref": "#/components/responses/notFoundError" + { + "description": "Name of group of rules to export. Must be specified only together with a single folder UID", + "in": "query", + "name": "group", + "schema": { + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Get Team Members.", - "tags": [ - "teams" - ] - }, - "post": { - "operationId": "addTeamMember", - "parameters": [ { - "in": "path", - "name": "team_id", - "required": true, + "description": "UID of alert rule to export. If specified, parameters folderUid and group must be empty.", + "in": "query", + "name": "ruleUid", "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddTeamMemberCommand" - } - } - }, - "required": true, - "x-originalParamName": "body" - }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + } + }, + "description": "AlertingFileExport" }, "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "description": " Not found." } }, - "summary": "Add Team Member.", + "summary": "Export all alert rules in provisioning file format.", "tags": [ - "teams" + "provisioning" ] } }, - "/teams/{team_id}/members/{user_id}": { + "/v1/provisioning/alert-rules/{UID}": { "delete": { - "operationId": "removeTeamMember", + "operationId": "RouteDeleteAlertRule", "parameters": [ { + "description": "Alert rule UID", "in": "path", - "name": "team_id", + "name": "UID", "required": true, "schema": { "type": "string" } }, { + "in": "header", + "name": "X-Disable-Provenance", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": " The alert rule was deleted successfully." + } + }, + "summary": "Delete a specific alert rule by UID.", + "tags": [ + "provisioning" + ] + }, + "get": { + "operationId": "RouteGetAlertRule", + "parameters": [ + { + "description": "Alert rule UID", "in": "path", - "name": "user_id", + "name": "UID", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProvisionedAlertRule" + } + } + }, + "description": "ProvisionedAlertRule" }, "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "description": " Not found." } }, - "summary": "Remove Member From Team.", + "summary": "Get a specific alert rule by UID.", "tags": [ - "teams" + "provisioning" ] }, "put": { - "operationId": "updateTeamMember", + "operationId": "RoutePutAlertRule", "parameters": [ { + "description": "Alert rule UID", "in": "path", - "name": "team_id", + "name": "UID", "required": true, "schema": { "type": "string" } }, { - "in": "path", - "name": "user_id", - "required": true, + "in": "header", + "name": "X-Disable-Provenance", "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], @@ -24091,43 +23967,66 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateTeamMemberCommand" + "$ref": "#/components/schemas/ProvisionedAlertRule" } } }, - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProvisionedAlertRule" + } + } + }, + "description": "ProvisionedAlertRule" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Update Team Member.", + "summary": "Update an existing alert rule.", "tags": [ - "teams" + "provisioning" ] } }, - "/teams/{team_id}/preferences": { + "/v1/provisioning/alert-rules/{UID}/export": { "get": { - "operationId": "getTeamPreferences", + "operationId": "RouteGetAlertRuleExport", "parameters": [ { + "description": "Whether to initiate a download of the file or not.", + "in": "query", + "name": "download", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "in": "query", + "name": "format", + "schema": { + "default": "yaml", + "type": "string" + } + }, + { + "description": "Alert rule UID", "in": "path", - "name": "team_id", + "name": "UID", "required": true, "schema": { "type": "string" @@ -24136,27 +24035,71 @@ ], "responses": { "200": { - "$ref": "#/components/responses/getPreferencesResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + }, + "text/yaml": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + } + }, + "description": "AlertingFileExport" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "404": { + "description": " Not found." } }, - "summary": "Get Team Preferences.", + "summary": "Export an alert rule in provisioning file format.", "tags": [ - "teams" + "provisioning" + ] + } + }, + "/v1/provisioning/contact-points": { + "get": { + "operationId": "RouteGetContactpoints", + "parameters": [ + { + "description": "Filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContactPoints" + } + } + }, + "description": "ContactPoints" + } + }, + "summary": "Get all the contact points.", + "tags": [ + "provisioning" ] }, - "put": { - "operationId": "updateTeamPreferences", + "post": { + "operationId": "RoutePostContactpoints", "parameters": [ { - "in": "path", - "name": "team_id", - "required": true, + "in": "header", + "name": "X-Disable-Provenance", "schema": { "type": "string" } @@ -24166,146 +24109,205 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdatePrefsCmd" + "$ref": "#/components/schemas/EmbeddedContactPoint" } } }, - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { - "200": { - "$ref": "#/components/responses/okResponse" + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmbeddedContactPoint" + } + } + }, + "description": "EmbeddedContactPoint" }, "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Update Team Preferences.", + "summary": "Create a contact point.", "tags": [ - "teams" + "provisioning" ] } }, - "/user": { + "/v1/provisioning/contact-points/export": { "get": { - "description": "Get (current authenticated user)", - "operationId": "getSignedInUser", - "responses": { - "200": { - "$ref": "#/components/responses/userResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "operationId": "RouteGetContactpointsExport", + "parameters": [ + { + "description": "Whether to initiate a download of the file or not.", + "in": "query", + "name": "download", + "schema": { + "default": false, + "type": "boolean" + } }, - "404": { - "$ref": "#/components/responses/notFoundError" + { + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "in": "query", + "name": "format", + "schema": { + "default": "yaml", + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "tags": [ - "signed_in_user" - ] - }, - "put": { - "operationId": "updateSignedInUser", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateUserCommand" - } + { + "description": "Whether any contained secure settings should be decrypted or left redacted. Redacted settings will contain RedactedValue instead. Currently, only org admin can view decrypted secure settings.", + "in": "query", + "name": "decrypt", + "schema": { + "default": false, + "type": "boolean" } }, - "description": "To change the email, name, login, theme, provide another one.", - "required": true, - "x-originalParamName": "body" - }, + { + "description": "Filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + } + }, + "description": "AlertingFileExport" }, "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDenied" + } + } + }, + "description": "PermissionDenied" } }, - "summary": "Update signed in User.", + "summary": "Export all contact points in provisioning file format.", "tags": [ - "signed_in_user" + "provisioning" ] } }, - "/user/auth-tokens": { - "get": { - "description": "Return a list of all auth tokens (devices) that the actual user currently have logged in from.", - "operationId": "getUserAuthTokens", + "/v1/provisioning/contact-points/{UID}": { + "delete": { + "operationId": "RouteDeleteContactpoints", + "parameters": [ + { + "description": "UID is the contact point unique identifier", + "in": "path", + "name": "UID", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { - "200": { - "$ref": "#/components/responses/getUserAuthTokensResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "202": { + "description": " The contact point was deleted successfully." } }, - "summary": "Auth tokens of the actual User.", + "summary": "Delete a contact point.", "tags": [ - "signed_in_user" + "provisioning" ] - } - }, - "/user/helpflags/clear": { - "get": { - "operationId": "clearHelpFlags", - "responses": { - "200": { - "$ref": "#/components/responses/helpFlagResponse" + }, + "put": { + "operationId": "RoutePutContactpoint", + "parameters": [ + { + "description": "UID is the contact point unique identifier", + "in": "path", + "name": "UID", + "required": true, + "schema": { + "type": "string" + } }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + { + "in": "header", + "name": "X-Disable-Provenance", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmbeddedContactPoint" + } + } }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "x-originalParamName": "Body" + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ack" + } + } + }, + "description": "Ack" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Clear user help flag.", + "summary": "Update an existing contact point.", "tags": [ - "signed_in_user" + "provisioning" ] } }, - "/user/helpflags/{flag_id}": { - "put": { - "operationId": "setHelpFlag", + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { + "get": { + "operationId": "RouteGetAlertRuleGroup", "parameters": [ { "in": "path", - "name": "flag_id", + "name": "FolderUID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "Group", "required": true, "schema": { "type": "string" @@ -24314,254 +24316,287 @@ ], "responses": { "200": { - "$ref": "#/components/responses/helpFlagResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertRuleGroup" + } + } + }, + "description": "AlertRuleGroup" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "404": { + "description": " Not found." } }, - "summary": "Set user help flag.", + "summary": "Get a rule group.", "tags": [ - "signed_in_user" + "provisioning" ] - } - }, - "/user/orgs": { - "get": { - "description": "Return a list of all organizations of the current user.", - "operationId": "getSignedInUserOrgList", - "responses": { - "200": { - "$ref": "#/components/responses/getSignedInUserOrgListResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + }, + "put": { + "operationId": "RoutePutAlertRuleGroup", + "parameters": [ + { + "in": "header", + "name": "X-Disable-Provenance", + "schema": { + "type": "string" + } }, - "403": { - "$ref": "#/components/responses/forbiddenError" + { + "in": "path", + "name": "FolderUID", + "required": true, + "schema": { + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "security": [ { - "basic": [] + "in": "path", + "name": "Group", + "required": true, + "schema": { + "type": "string" + } } ], - "summary": "Organizations of the actual User.", - "tags": [ - "signed_in_user" - ] - } - }, - "/user/password": { - "put": { - "description": "Changes the password for the user.", - "operationId": "changeUserPassword", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChangeUserPasswordCommand" + "$ref": "#/components/schemas/AlertRuleGroup" } } }, - "description": "To change the email, name, login, theme, provide another one.", - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertRuleGroup" + } + } + }, + "description": "AlertRuleGroup" }, "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "security": [ - { - "basic": [] - } - ], - "summary": "Change Password.", + "summary": "Update the interval of a rule group.", "tags": [ - "signed_in_user" + "provisioning" ] } }, - "/user/preferences": { + "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}/export": { "get": { - "operationId": "getUserPreferences", - "responses": { - "200": { - "$ref": "#/components/responses/getPreferencesResponse" + "operationId": "RouteGetAlertRuleGroupExport", + "parameters": [ + { + "description": "Whether to initiate a download of the file or not.", + "in": "query", + "name": "download", + "schema": { + "default": false, + "type": "boolean" + } }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + { + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "in": "query", + "name": "format", + "schema": { + "default": "yaml", + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/internalServerError" + { + "in": "path", + "name": "FolderUID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "Group", + "required": true, + "schema": { + "type": "string" + } } - }, - "summary": "Get user preferences.", - "tags": [ - "user_preferences" - ] - }, - "patch": { - "operationId": "patchUserPreferences", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PatchPrefsCmd" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + }, + "text/yaml": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } } - } + }, + "description": "AlertingFileExport" }, - "required": true, - "x-originalParamName": "body" + "404": { + "description": " Not found." + } }, + "summary": "Export an alert rule group in provisioning file format.", + "tags": [ + "provisioning" + ] + } + }, + "/v1/provisioning/mute-timings": { + "get": { + "operationId": "RouteGetMuteTimings", "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MuteTimings" + } + } + }, + "description": "MuteTimings" } }, - "summary": "Patch user preferences.", + "summary": "Get all the mute timings.", "tags": [ - "user_preferences" + "provisioning" ] }, - "put": { - "description": "Omitting a key (`theme`, `homeDashboardId`, `timezone`) will cause the current value to be replaced with the system default value.", - "operationId": "updateUserPreferences", + "post": { + "operationId": "RoutePostMuteTiming", + "parameters": [ + { + "in": "header", + "name": "X-Disable-Provenance", + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdatePrefsCmd" + "$ref": "#/components/schemas/MuteTimeInterval" } } }, - "required": true, - "x-originalParamName": "body" + "x-originalParamName": "Body" }, "responses": { - "200": { - "$ref": "#/components/responses/okResponse" + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MuteTimeInterval" + } + } + }, + "description": "MuteTimeInterval" }, "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Update user preferences.", + "summary": "Create a new mute timing.", "tags": [ - "user_preferences" + "provisioning" ] } }, - "/user/quotas": { + "/v1/provisioning/mute-timings/export": { "get": { - "operationId": "getUserQuotas", - "responses": { - "200": { - "$ref": "#/components/responses/getQuotaResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Fetch user quota.", - "tags": [ - "signed_in_user" - ] - } - }, - "/user/revoke-auth-token": { - "post": { - "description": "Revokes the given auth token (device) for the actual user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.", - "operationId": "revokeUserAuthToken", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RevokeAuthTokenCmd" - } + "operationId": "RouteExportMuteTimings", + "parameters": [ + { + "description": "Whether to initiate a download of the file or not.", + "in": "query", + "name": "download", + "schema": { + "default": false, + "type": "boolean" } }, - "required": true, - "x-originalParamName": "body" - }, + { + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "in": "query", + "name": "format", + "schema": { + "default": "yaml", + "type": "string" + } + } + ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + } + }, + "description": "AlertingFileExport" }, "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDenied" + } + } + }, + "description": "PermissionDenied" } }, - "summary": "Revoke an auth token of the actual User.", + "summary": "Export all mute timings in provisioning format.", "tags": [ - "signed_in_user" + "provisioning" ] } }, - "/user/stars/dashboard/uid/{dashboard_uid}": { + "/v1/provisioning/mute-timings/{name}": { "delete": { - "description": "Deletes the starring of the given Dashboard for the actual user.", - "operationId": "unstarDashboardByUID", + "operationId": "RouteDeleteMuteTiming", "parameters": [ { + "description": "Mute timing name", "in": "path", - "name": "dashboard_uid", + "name": "name", "required": true, "schema": { "type": "string" @@ -24569,34 +24604,32 @@ } ], "responses": { - "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "204": { + "description": " The mute timing was deleted successfully." }, - "500": { - "$ref": "#/components/responses/internalServerError" + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenericPublicError" + } + } + }, + "description": "GenericPublicError" } }, - "summary": "Unstar a dashboard.", + "summary": "Delete a mute timing.", "tags": [ - "signed_in_user" + "provisioning" ] }, - "post": { - "description": "Stars the given Dashboard for the actual user.", - "operationId": "starDashboardByUID", + "get": { + "operationId": "RouteGetMuteTiming", "parameters": [ { + "description": "Mute timing name", "in": "path", - "name": "dashboard_uid", + "name": "name", "required": true, "schema": { "type": "string" @@ -24605,72 +24638,108 @@ ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MuteTimeInterval" + } + } + }, + "description": "MuteTimeInterval" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "404": { + "description": " Not found." } }, - "summary": "Star a dashboard.", + "summary": "Get a mute timing.", "tags": [ - "signed_in_user" - ] - } - }, - "/user/stars/dashboard/{dashboard_id}": { - "delete": { - "deprecated": true, - "description": "Deletes the starring of the given Dashboard for the actual user.", - "operationId": "unstarDashboard", + "provisioning" + ] + }, + "put": { + "operationId": "RoutePutMuteTiming", "parameters": [ { + "description": "Mute timing name", "in": "path", - "name": "dashboard_id", + "name": "name", "required": true, "schema": { "type": "string" } + }, + { + "in": "header", + "name": "X-Disable-Provenance", + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MuteTimeInterval" + } + } + }, + "x-originalParamName": "Body" + }, "responses": { - "200": { - "$ref": "#/components/responses/okResponse" + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MuteTimeInterval" + } + } + }, + "description": "MuteTimeInterval" }, "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Unstar a dashboard.", + "summary": "Replace an existing mute timing.", "tags": [ - "signed_in_user" + "provisioning" ] - }, - "post": { - "deprecated": true, - "description": "Stars the given Dashboard for the actual user.", - "operationId": "starDashboard", + } + }, + "/v1/provisioning/mute-timings/{name}/export": { + "get": { + "operationId": "RouteExportMuteTiming", "parameters": [ { + "description": "Whether to initiate a download of the file or not.", + "in": "query", + "name": "download", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence.", + "in": "query", + "name": "format", + "schema": { + "default": "yaml", + "type": "string" + } + }, + { + "description": "Mute timing name", "in": "path", - "name": "dashboard_id", + "name": "name", "required": true, "schema": { "type": "string" @@ -24679,356 +24748,288 @@ ], "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + } + }, + "description": "AlertingFileExport" }, "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDenied" + } + } + }, + "description": "PermissionDenied" } }, - "summary": "Star a dashboard.", + "summary": "Export a mute timing in provisioning format.", "tags": [ - "signed_in_user" + "provisioning" ] } }, - "/user/teams": { - "get": { - "description": "Return a list of all teams that the current user is member of.", - "operationId": "getSignedInUserTeamList", + "/v1/provisioning/policies": { + "delete": { + "operationId": "RouteResetPolicyTree", "responses": { - "200": { - "$ref": "#/components/responses/getSignedInUserTeamListResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ack" + } + } + }, + "description": "Ack" } }, - "summary": "Teams that the actual User is member of.", + "summary": "Clears the notification policy tree.", "tags": [ - "signed_in_user" + "provisioning" ] - } - }, - "/user/using/{org_id}": { - "post": { - "description": "Switch user context to the given organization.", - "operationId": "userSetUsingOrg", - "parameters": [ - { - "in": "path", - "name": "org_id", - "required": true, - "schema": { - "format": "int64", - "type": "integer" - } - } - ], + }, + "get": { + "operationId": "RouteGetPolicyTree", "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "400": { - "$ref": "#/components/responses/badRequestError" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Route" + } + } + }, + "description": "Route" } }, - "summary": "Switch user context for signed in user.", + "summary": "Get the notification policy tree.", "tags": [ - "signed_in_user" + "provisioning" ] - } - }, - "/users": { - "get": { - "description": "Returns all users that the authenticated user has permission to view, admin permission required.", - "operationId": "searchUsers", + }, + "put": { + "operationId": "RoutePutPolicyTree", "parameters": [ { - "description": "Limit the maximum number of users to return per page", - "in": "query", - "name": "perpage", - "schema": { - "default": 1000, - "format": "int64", - "type": "integer" - } - }, - { - "description": "Page index for starting fetching users", - "in": "query", - "name": "page", + "in": "header", + "name": "X-Disable-Provenance", "schema": { - "default": 1, - "format": "int64", - "type": "integer" + "type": "string" } } ], - "responses": { - "200": { - "$ref": "#/components/responses/searchUsersResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Route" + } + } }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "description": "The new notification routing tree to use", + "x-originalParamName": "Body" + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ack" + } + } + }, + "description": "Ack" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Get users.", + "summary": "Sets the notification policy tree.", "tags": [ - "users" + "provisioning" ] } }, - "/users/lookup": { + "/v1/provisioning/policies/export": { "get": { - "operationId": "getUserByLoginOrEmail", - "parameters": [ - { - "description": "loginOrEmail of the user", - "in": "query", - "name": "loginOrEmail", - "required": true, - "schema": { - "type": "string" - } - } - ], + "operationId": "RouteGetPolicyTreeExport", "responses": { "200": { - "$ref": "#/components/responses/userResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertingFileExport" + } + } + }, + "description": "AlertingFileExport" }, "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFound" + } + } + }, + "description": "NotFound" } }, - "summary": "Get user by login or email.", + "summary": "Export the notification policy tree in provisioning file format.", "tags": [ - "users" + "provisioning" ] } }, - "/users/search": { + "/v1/provisioning/templates": { "get": { - "operationId": "searchUsersWithPaging", + "operationId": "RouteGetTemplates", "responses": { "200": { - "$ref": "#/components/responses/searchUsersWithPagingResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTemplates" + } + } + }, + "description": "NotificationTemplates" }, "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "description": " Not found." } }, - "summary": "Get users with paging.", + "summary": "Get all notification templates.", "tags": [ - "users" + "provisioning" ] } }, - "/users/{user_id}": { - "get": { - "operationId": "getUserByID", + "/v1/provisioning/templates/{name}": { + "delete": { + "operationId": "RouteDeleteTemplate", "parameters": [ { + "description": "Template Name", "in": "path", - "name": "user_id", + "name": "name", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], "responses": { - "200": { - "$ref": "#/components/responses/userResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "204": { + "description": " The template was deleted successfully." } }, - "summary": "Get user by id.", + "summary": "Delete a template.", "tags": [ - "users" + "provisioning" ] }, - "put": { - "description": "Update the user identified by id.", - "operationId": "updateUser", + "get": { + "operationId": "RouteGetTemplate", "parameters": [ { + "description": "Template Name", "in": "path", - "name": "user_id", + "name": "name", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateUserCommand" - } - } - }, - "description": "To change the email, name, login, theme, provide another one.", - "required": true, - "x-originalParamName": "body" - }, "responses": { "200": { - "$ref": "#/components/responses/okResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTemplate" + } + } + }, + "description": "NotificationTemplate" }, "404": { - "$ref": "#/components/responses/notFoundError" - }, - "500": { - "$ref": "#/components/responses/internalServerError" + "description": " Not found." } }, - "summary": "Update user.", + "summary": "Get a notification template.", "tags": [ - "users" + "provisioning" ] - } - }, - "/users/{user_id}/orgs": { - "get": { - "description": "Get organizations for user identified by id.", - "operationId": "getUserOrgList", + }, + "put": { + "operationId": "RoutePutTemplate", "parameters": [ { + "description": "Template Name", "in": "path", - "name": "user_id", + "name": "name", "required": true, "schema": { - "format": "int64", - "type": "integer" + "type": "string" } - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/getUserOrgListResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" - }, - "404": { - "$ref": "#/components/responses/notFoundError" }, - "500": { - "$ref": "#/components/responses/internalServerError" - } - }, - "summary": "Get organizations for user.", - "tags": [ - "users" - ] - } - }, - "/users/{user_id}/teams": { - "get": { - "description": "Get teams for user identified by id.", - "operationId": "getUserTeams", - "parameters": [ { - "in": "path", - "name": "user_id", - "required": true, + "in": "header", + "name": "X-Disable-Provenance", "schema": { - "format": "int64", - "type": "integer" + "type": "string" } } ], - "responses": { - "200": { - "$ref": "#/components/responses/getUserTeamsResponse" - }, - "401": { - "$ref": "#/components/responses/unauthorisedError" - }, - "403": { - "$ref": "#/components/responses/forbiddenError" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTemplateContent" + } + } }, - "404": { - "$ref": "#/components/responses/notFoundError" + "x-originalParamName": "Body" + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTemplate" + } + } + }, + "description": "NotificationTemplate" }, - "500": { - "$ref": "#/components/responses/internalServerError" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationError" + } + } + }, + "description": "ValidationError" } }, - "summary": "Get teams for user.", + "summary": "Updates an existing notification template.", "tags": [ - "users" + "provisioning" ] } },