From f7c5eceb2141ce4b6e7f68e17e3c72c7e8a05b2d Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> Date: Wed, 20 Jul 2022 16:09:42 +0300 Subject: [PATCH] Chore: Update to the latest grafana-plugin-sdk-go and more swagger fixes (#52445) * Fix get legacy alert response * Swagger: Fix get folder by UID response * Fix conflicting swagger model Alert Reanme legacy alerting swagger model to LegacyAlert to differentiate it from the prometheus Alert * Bump grafana-plugin-sdk-go * Fix get folder response * Use go-swagger command for merging the specifications and remove merge_specs script --- Makefile | 5 +- go.mod | 2 +- go.sum | 2 + pkg/api/docs/definitions/folder.go | 2 +- pkg/api/docs/definitions/legacy_alerting.go | 2 +- pkg/api/docs/definitions/teams.go | 2 +- pkg/api/docs/merge/merge_specs.go | 147 - pkg/models/alert.go | 1 + public/api-merged.json | 7010 ++++++++++--------- public/api-spec.json | 199 +- 10 files changed, 3663 insertions(+), 3709 deletions(-) delete mode 100644 pkg/api/docs/merge/merge_specs.go diff --git a/Makefile b/Makefile index 1279a7ae45c..9b6f63cada1 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,9 @@ NGALERT_SPEC_TARGET = pkg/services/ngalert/api/tooling/api.json $(NGALERT_SPEC_TARGET): +$(MAKE) -C pkg/services/ngalert/api/tooling api.json -$(MERGED_SPEC_TARGET): $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) ## Merge generated and ngalert API specs - go run pkg/api/docs/merge/merge_specs.go -o=$(MERGED_SPEC_TARGET) $(<) $(NGALERT_SPEC_TARGET) +$(MERGED_SPEC_TARGET): $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) $(SWAGGER) ## Merge generated and ngalert API specs + # known conflicts DsPermissionType, AddApiKeyCommand, Json, Duration (identical models referenced by both specs) + $(SWAGGER) mixin $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) --ignore-conflicts -o $(MERGED_SPEC_TARGET) --swagger-api-spec: $(API_DEFINITION_FILES) $(SWAGGER) ## Generate API Swagger specification SWAGGER_GENERATE_EXTENSION=false $(SWAGGER) generate spec -m -w pkg/server -o public/api-spec.json \ diff --git a/go.mod b/go.mod index 35ad2f3d040..22207b9a3db 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( github.com/grafana/cuetsy v0.0.3 github.com/grafana/grafana-aws-sdk v0.10.7 github.com/grafana/grafana-azure-sdk-go v1.3.0 - github.com/grafana/grafana-plugin-sdk-go v0.138.0 + github.com/grafana/grafana-plugin-sdk-go v0.139.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/hashicorp/go-hclog v1.0.0 github.com/hashicorp/go-plugin v1.4.3 diff --git a/go.sum b/go.sum index 94fa610c55f..6a54f0b2011 100644 --- a/go.sum +++ b/go.sum @@ -1345,6 +1345,8 @@ github.com/grafana/grafana-google-sdk-go v0.0.0-20211104130251-b190293eaf58/go.m github.com/grafana/grafana-plugin-sdk-go v0.114.0/go.mod h1:D7x3ah+1d4phNXpbnOaxa/osSaZlwh9/ZUnGGzegRbk= github.com/grafana/grafana-plugin-sdk-go v0.138.0 h1:uJWNwHL4RoQF3axoi3RDSwoNu/KHy5F+5dnrK0fx5yc= github.com/grafana/grafana-plugin-sdk-go v0.138.0/go.mod h1:Y+Ps2sesZ62AyCnX+hzrYnyDQYe/ZZl+A8yKLOBm12c= +github.com/grafana/grafana-plugin-sdk-go v0.139.0 h1:2RQKM2QpSaWTtaGN6sK+R7LO7zykOeTYF0QkAMA7JsI= +github.com/grafana/grafana-plugin-sdk-go v0.139.0/go.mod h1:Y+Ps2sesZ62AyCnX+hzrYnyDQYe/ZZl+A8yKLOBm12c= github.com/grafana/saml v0.0.0-20211007135653-aed1b2edd86b h1:YiSGp34F4V0G08HHx1cJBf2GVgwYAkXQjzuVs1t8jYk= github.com/grafana/saml v0.0.0-20211007135653-aed1b2edd86b/go.mod h1:q83kyQoMD0vhy+RzFLlbw0UgHJ6TAihQpuXvdFmm4s4= github.com/grafana/thema v0.0.0-20220523183731-72aebd14e751 h1:5PpsfN52XA0hxOjD/qQ0QNiEkp9Y9Tb+yz/Hj9fyL4M= diff --git a/pkg/api/docs/definitions/folder.go b/pkg/api/docs/definitions/folder.go index f6fcf6a7b19..3ffbde3474f 100644 --- a/pkg/api/docs/definitions/folder.go +++ b/pkg/api/docs/definitions/folder.go @@ -22,7 +22,7 @@ import ( // Get folder by uid. // // Responses: -// 200: +// 200: folderResponse // 401: unauthorisedError // 403: forbiddenError // 404: notFoundError diff --git a/pkg/api/docs/definitions/legacy_alerting.go b/pkg/api/docs/definitions/legacy_alerting.go index d591de78f12..06a8bd2d5b1 100644 --- a/pkg/api/docs/definitions/legacy_alerting.go +++ b/pkg/api/docs/definitions/legacy_alerting.go @@ -148,7 +148,7 @@ type GetAlertsResponse struct { type GetAlertResponse struct { // The response message // in: body - Body []*models.Alert `json:"body"` + Body *models.Alert `json:"body"` } // swagger:response pauseAlertResponse diff --git a/pkg/api/docs/definitions/teams.go b/pkg/api/docs/definitions/teams.go index 00e0a2f467f..73224e73848 100644 --- a/pkg/api/docs/definitions/teams.go +++ b/pkg/api/docs/definitions/teams.go @@ -65,7 +65,7 @@ import ( // Get Team Members. // // Responses: -// 200: okResponse +// 200: getTeamMembersResponse // 401: unauthorisedError // 403: forbiddenError // 404: notFoundError diff --git a/pkg/api/docs/merge/merge_specs.go b/pkg/api/docs/merge/merge_specs.go deleted file mode 100644 index de0e366e5e7..00000000000 --- a/pkg/api/docs/merge/merge_specs.go +++ /dev/null @@ -1,147 +0,0 @@ -package main - -import ( - "bytes" - _ "embed" - "encoding/json" - "flag" - "fmt" - "io/ioutil" - "os" - "reflect" - "strings" - - "github.com/go-openapi/loads" - "github.com/go-openapi/spec" -) - -func mergeVectors(a, b []string) []string { - for _, p := range b { - exist := false - for _, op := range a { - if op == p { - exist = true - break - } - } - if !exist { - a = append(a, p) - } - } - return a -} - -func compareDefinition(a, b spec.Schema) bool { - return reflect.DeepEqual(a.Type, b.Type) && a.Format == b.Format && reflect.DeepEqual(a.Properties, b.Properties) -} - -// mergeSpecs merges OSS API spec with one or more other OpenAPI specs -func mergeSpecs(output string, sources ...string) error { - if len(sources) < 2 { - return fmt.Errorf("no APIs to merge") - } - - f, err := os.Open(sources[0]) - if err != nil { - return err - } - - specData, err := ioutil.ReadAll(f) - if err != nil { - return err - } - - var specOSS spec.Swagger - if err := json.Unmarshal(specData, &specOSS); err != nil { - return fmt.Errorf("failed to unmarshal original spec: %w", err) - } - - for _, s := range sources[1:] { - additionalSpec, err := loads.JSONSpec(s) - if err != nil { - return fmt.Errorf("failed to load spec from: %s: %w", s, err) - } - - // Merge consumes - specOSS.SwaggerProps.Consumes = mergeVectors(specOSS.SwaggerProps.Consumes, additionalSpec.OrigSpec().Consumes) - - // Merge produces - specOSS.SwaggerProps.Produces = mergeVectors(specOSS.SwaggerProps.Produces, additionalSpec.OrigSpec().Produces) - - // Merge schemes - specOSS.SwaggerProps.Schemes = mergeVectors(specOSS.SwaggerProps.Schemes, additionalSpec.OrigSpec().Schemes) - - //TODO: When there are conflict between definitions, we need to error out, but here we need to fix the existing conflict first - // there are false positives, we will have to fix those by regenerate alerting api spec - for k, ad := range additionalSpec.OrigSpec().SwaggerProps.Definitions { - if ossd, exists := specOSS.SwaggerProps.Definitions[k]; exists { - if !compareDefinition(ad, ossd) { - fmt.Printf("the definition of %s differs in specs!\n", k) - } - } - specOSS.SwaggerProps.Definitions[k] = ad - } - - for k, ar := range additionalSpec.OrigSpec().SwaggerProps.Responses { - if ossr, exists := specOSS.SwaggerProps.Responses[k]; exists { - if !reflect.DeepEqual(ar, ossr) { - fmt.Printf("the definition of response %s differs in specs!\n", k) - } - } - specOSS.SwaggerProps.Responses[k] = ar - } - - for k, p := range additionalSpec.OrigSpec().SwaggerProps.Parameters { - specOSS.SwaggerProps.Parameters[k] = p - } - - paths := additionalSpec.OrigSpec().SwaggerProps.Paths - if paths != nil { - for k, pi := range paths.Paths { - kk := strings.TrimPrefix(k, specOSS.BasePath) // remove base path if exists - if specOSS.SwaggerProps.Paths == nil { - specOSS.SwaggerProps.Paths = &spec.Paths{ - Paths: make(map[string]spec.PathItem), - } - } - specOSS.SwaggerProps.Paths.Paths[kk] = pi - } - } - - specOSS.SwaggerProps.Tags = append(specOSS.SwaggerProps.Tags, additionalSpec.OrigSpec().SwaggerProps.Tags...) - } - - // write result to file - newSpec, err := specOSS.MarshalJSON() - if err != nil { - return fmt.Errorf("failed to marshal result spec: %w", err) - } - - var prettyJSON bytes.Buffer - err = json.Indent(&prettyJSON, newSpec, "", "\t") - if err != nil { - return fmt.Errorf("failed to intend new spec: %w", err) - } - - f, err = os.Create(output) - if err != nil { - return fmt.Errorf("failed to create file for new spec: %w", err) - } - - _, err = f.Write(prettyJSON.Bytes()) - if err != nil { - return fmt.Errorf("failed to write new spec: %w", err) - } - - // validate result - return nil -} - -func main() { - output := flag.String("o", "../../../swagger-ui/merged.json", "the output path") - flag.Parse() - err := mergeSpecs(*output, flag.Args()...) - if err != nil { - fmt.Printf("something went wrong: %s\n", err.Error()) - } -} diff --git a/pkg/models/alert.go b/pkg/models/alert.go index 013abe82932..898f343dcb5 100644 --- a/pkg/models/alert.go +++ b/pkg/models/alert.go @@ -63,6 +63,7 @@ func (s ExecutionErrorOption) ToAlertState() AlertStateType { return AlertStateType(s) } +// swagger:model LegacyAlert type Alert struct { Id int64 Version int64 diff --git a/public/api-merged.json b/public/api-merged.json index 246dc26eb01..5d22cbe015a 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -2331,625 +2331,605 @@ } } }, - "/auth/keys": { + "/api/v1/provisioning/alert-rules": { + "post": { + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Create a new alert rule.", + "operationId": "RoutePostAlertRule", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + } + ], + "responses": { + "201": { + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/api/v1/provisioning/alert-rules/{UID}": { "get": { - "description": "Will return auth keys.", - "tags": ["api_keys"], - "summary": "Get auth keys.", - "operationId": "getAPIkeys", + "tags": ["provisioning"], + "summary": "Get a specific alert rule by UID.", + "operationId": "RouteGetAlertRule", "parameters": [ { - "type": "boolean", - "default": false, - "description": "Show expired keys", - "name": "includeExpired", - "in": "query" + "type": "string", + "description": "Alert rule UID", + "name": "UID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getAPIkeyResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } }, "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": " Not found." } } }, - "post": { - "description": "Will return details of the created API key", - "tags": ["api_keys"], - "summary": "Creates an API key.", - "operationId": "addAPIkey", + "put": { + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Update an existing alert rule.", + "operationId": "RoutePutAlertRule", "parameters": [ + { + "type": "string", + "description": "Alert rule UID", + "name": "UID", + "in": "path", + "required": true + }, { "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/AddApiKeyCommand" + "$ref": "#/definitions/ProvisionedAlertRule" } } ], "responses": { "200": { - "$ref": "#/responses/postAPIkeyResponse" + "description": "ProvisionedAlertRule", + "schema": { + "$ref": "#/definitions/ProvisionedAlertRule" + } }, "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "409": { - "$ref": "#/responses/conflictError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } - } - }, - "/auth/keys/{id}": { + }, "delete": { - "tags": ["api_keys"], - "summary": "Delete API key.", - "operationId": "deleteAPIkey", + "tags": ["provisioning"], + "summary": "Delete a specific alert rule by UID.", + "operationId": "RouteDeleteAlertRule", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "id", + "type": "string", + "description": "Alert rule UID", + "name": "UID", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "204": { + "description": " The alert rule was deleted successfully." } } } }, - "/dashboard/snapshots": { + "/api/v1/provisioning/contact-points": { "get": { - "tags": ["snapshots"], - "summary": "List snapshots.", - "operationId": "getSnapshots", + "tags": ["provisioning"], + "summary": "Get all the contact points.", + "operationId": "RouteGetContactpoints", "parameters": [ { "type": "string", - "description": "Search Query", - "name": "query", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 1000, - "description": "Limit the number of returned results", - "name": "limit", + "description": "Filter by name", + "name": "name", "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getSnapshotsResponse" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "ContactPoints", + "schema": { + "$ref": "#/definitions/ContactPoints" + } } } - } - }, - "/dashboards/calculate-diff": { + }, "post": { - "produces": ["application/json", "text/html"], - "tags": ["dashboards"], - "summary": "Perform diff on two dashboards.", - "operationId": "calcDashboardDiff", + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Create a contact point.", + "operationId": "RoutePostContactpoints", "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" - } - } + "$ref": "#/definitions/EmbeddedContactPoint" } } ], "responses": { - "200": { - "$ref": "#/responses/dashboardDiffResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "202": { + "description": "EmbeddedContactPoint", + "schema": { + "$ref": "#/definitions/EmbeddedContactPoint" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } } }, - "/dashboards/db": { - "post": { - "description": "Creates a new dashboard or updates an existing dashboard.", - "tags": ["dashboards"], - "summary": "Create / Update dashboard", - "operationId": "postDashboard", + "/api/v1/provisioning/contact-points/{UID}": { + "put": { + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Update an existing contact point.", + "operationId": "RoutePutContactpoint", "parameters": [ + { + "type": "string", + "description": "UID is the contact point unique identifier", + "name": "UID", + "in": "path", + "required": true + }, { "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/SaveDashboardCommand" + "$ref": "#/definitions/EmbeddedContactPoint" } } ], "responses": { - "200": { - "$ref": "#/responses/postDashboardResponse" + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } }, "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" + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } - } - }, - "/dashboards/home": { - "get": { - "tags": ["dashboards"], - "summary": "Get home dashboard.", - "operationId": "getHomeDashboard", + }, + "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/getHomeDashboardResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "204": { + "description": " The contact point was deleted successfully." } } } }, - "/dashboards/id/{DashboardID}/permissions": { + "/api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { "get": { - "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsWithUid) instead", - "tags": ["dashboard_permissions"], - "summary": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissions", - "deprecated": true, + "tags": ["provisioning"], + "summary": "Get a rule group.", + "operationId": "RouteGetAlertRuleGroup", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "FolderUID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Group", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "AlertRuleGroup", + "schema": { + "$ref": "#/definitions/AlertRuleGroup" + } }, "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": " Not found." } } }, - "post": { - "description": "Please refer to [updated API](#/dashboard_permissions/postDashboardPermissionsWithUid) instead\n\nThis operation will remove existing permissions if they’re not included in the request.", - "tags": ["dashboard_permissions"], - "summary": "Updates permissions for a dashboard.", - "operationId": "postDashboardPermissions", - "deprecated": true, + "put": { + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Update the interval of a rule group.", + "operationId": "RoutePutAlertRuleGroup", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDashboardAclCommand" - } + "type": "string", + "name": "FolderUID", + "in": "path", + "required": true }, { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "Group", "in": "path", "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/AlertRuleGroupMetadata" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "description": "AlertRuleGroupMetadata", + "schema": { + "$ref": "#/definitions/AlertRuleGroupMetadata" + } }, "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } } }, - "/dashboards/id/{DashboardID}/restore": { + "/api/v1/provisioning/mute-timings": { + "get": { + "tags": ["provisioning"], + "summary": "Get all the mute timings.", + "operationId": "RouteGetMuteTimings", + "responses": { + "200": { + "description": "MuteTimings", + "schema": { + "$ref": "#/definitions/MuteTimings" + } + } + } + }, "post": { - "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", - "tags": ["dashboard_versions"], - "summary": "Restore a dashboard to a given dashboard version.", - "operationId": "restoreDashboardVersion", - "deprecated": true, + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Create a new mute timing.", + "operationId": "RoutePostMuteTiming", "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "DashboardID", - "in": "path", - "required": true - }, { "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/RestoreDashboardVersionCommand" + "$ref": "#/definitions/MuteTimeInterval" } } ], "responses": { - "200": { - "$ref": "#/responses/postDashboardResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "201": { + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } } }, - "/dashboards/id/{DashboardID}/versions": { + "/api/v1/provisioning/mute-timings/{name}": { "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", - "tags": ["dashboard_versions"], - "summary": "Gets all existing versions for the dashboard.", - "operationId": "getDashboardVersions", - "deprecated": true, + "tags": ["provisioning"], + "summary": "Get a mute timing.", + "operationId": "RouteGetMuteTiming", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "description": "Mute timing name", + "name": "name", "in": "path", "required": true - }, - { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Maximum number of results to return", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Version to start from when returning queries", - "name": "start", - "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } }, "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "description": " Not found." } } - } - }, - "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { - "get": { - "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", - "tags": ["dashboard_versions"], - "summary": "Get a specific dashboard version.", - "operationId": "getDashboardVersion", - "deprecated": true, + }, + "put": { + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Replace an existing mute timing.", + "operationId": "RoutePutMuteTiming", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "description": "Mute timing name", + "name": "name", "in": "path", "required": true }, { - "type": "integer", - "format": "int64", - "name": "DashboardVersionID", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "description": "MuteTimeInterval", + "schema": { + "$ref": "#/definitions/MuteTimeInterval" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "tags": ["provisioning"], + "summary": "Delete a mute timing.", + "operationId": "RouteDeleteMuteTiming", + "parameters": [ + { + "type": "string", + "description": "Mute timing name", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": " The mute timing was deleted successfully." } } } }, - "/dashboards/import": { - "post": { - "tags": ["dashboards"], - "summary": "Import dashboard.", - "operationId": "importDashboard", + "/api/v1/provisioning/policies": { + "get": { + "tags": ["provisioning"], + "summary": "Get the notification policy tree.", + "operationId": "RouteGetPolicyTree", + "responses": { + "200": { + "description": "Route", + "schema": { + "$ref": "#/definitions/Route" + } + } + } + }, + "put": { + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Sets the notification policy tree.", + "operationId": "RoutePutPolicyTree", "parameters": [ { + "description": "The new notification routing tree to use", "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/ImportDashboardRequest" + "$ref": "#/definitions/Route" } } ], "responses": { - "200": { - "$ref": "#/responses/importDashboardResponse" + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } }, "400": { - "$ref": "#/responses/badRequestError" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "412": { - "$ref": "#/responses/preconditionFailedError" - }, - "422": { - "$ref": "#/responses/unprocessableEntityError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "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" + } } } } }, - "/dashboards/tags": { + "/api/v1/provisioning/templates": { "get": { - "tags": ["dashboards"], - "summary": "Get all dashboards tags of an organisation.", - "operationId": "getDashboardTags", + "tags": ["provisioning"], + "summary": "Get all message templates.", + "operationId": "RouteGetTemplates", "responses": { "200": { - "$ref": "#/responses/dashboardsTagsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "description": "MessageTemplates", + "schema": { + "$ref": "#/definitions/MessageTemplates" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "404": { + "description": " Not found." } } } }, - "/dashboards/trim": { - "post": { - "tags": ["dashboards"], - "summary": "Trim defaults from dashboard.", - "operationId": "trimDashboard", + "/api/v1/provisioning/templates/{name}": { + "get": { + "tags": ["provisioning"], + "summary": "Get a message template.", + "operationId": "RouteGetTemplate", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/TrimDashboardCommand" - } + "type": "string", + "description": "Template Name", + "name": "name", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/trimDashboardResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "description": "MessageTemplate", + "schema": { + "$ref": "#/definitions/MessageTemplate" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "404": { + "description": " Not found." } } - } - }, - "/dashboards/uid/{uid}": { - "get": { - "description": "Will return the dashboard given the dashboard unique identifier (uid).", - "tags": ["dashboards"], - "summary": "Get dashboard by uid.", - "operationId": "getDashboardByUID", + }, + "put": { + "consumes": ["application/json"], + "tags": ["provisioning"], + "summary": "Updates an existing template.", + "operationId": "RoutePutTemplate", "parameters": [ { "type": "string", - "name": "uid", + "description": "Template Name", + "name": "name", "in": "path", "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/MessageTemplateContent" + } } ], "responses": { - "200": { - "$ref": "#/responses/dashboardResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "202": { + "description": "MessageTemplate", + "schema": { + "$ref": "#/definitions/MessageTemplate" + } }, - "500": { - "$ref": "#/responses/internalServerError" + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } } } }, "delete": { - "description": "Will delete the dashboard given the specified unique identifier (uid).", - "tags": ["dashboards"], - "summary": "Delete dashboard by uid.", - "operationId": "deleteDashboardByUID", + "tags": ["provisioning"], + "summary": "Delete a template.", + "operationId": "RouteDeleteTemplate", "parameters": [ { "type": "string", - "name": "uid", + "description": "Template Name", + "name": "name", "in": "path", "required": true } ], + "responses": { + "204": { + "description": " The template was deleted successfully." + } + } + } + }, + "/auth/keys": { + "get": { + "description": "Will return auth keys.", + "tags": ["api_keys"], + "summary": "Get auth keys.", + "operationId": "getAPIkeys", + "parameters": [ + { + "type": "boolean", + "default": false, + "description": "Show expired keys", + "name": "includeExpired", + "in": "query" + } + ], "responses": { "200": { - "$ref": "#/responses/deleteDashboardResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/dashboards/uid/{uid}/permissions": { - "get": { - "tags": ["dashboard_permissions"], - "summary": "Gets all existing permissions for the given dashboard.", - "operationId": "getDashboardPermissionsWithUid", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/getDashboardPermissionsResponse" + "$ref": "#/responses/getAPIkeyResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -2966,29 +2946,23 @@ } }, "post": { - "description": "This operation will remove existing permissions if they’re not included in the request.", - "tags": ["dashboard_permissions"], - "summary": "Updates permissions for a dashboard.", - "operationId": "postDashboardPermissionsWithUid", + "description": "Will return details of the created API key", + "tags": ["api_keys"], + "summary": "Creates an API key.", + "operationId": "addAPIkey", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardAclCommand" + "$ref": "#/definitions/AddApiKeyCommand" } - }, - { - "type": "string", - "name": "uid", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/postAPIkeyResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -2999,8 +2973,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -3008,30 +2982,23 @@ } } }, - "/dashboards/uid/{uid}/restore": { - "post": { - "tags": ["dashboard_versions"], - "summary": "Restore a dashboard to a given dashboard version using UID.", - "operationId": "restoreDashboardVersionByUID", + "/auth/keys/{id}": { + "delete": { + "tags": ["api_keys"], + "summary": "Delete API key.", + "operationId": "deleteAPIkey", "parameters": [ { - "type": "string", - "name": "uid", + "type": "integer", + "format": "int64", + "name": "id", "in": "path", "required": true - }, - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RestoreDashboardVersionCommand" - } } ], "responses": { "200": { - "$ref": "#/responses/postDashboardResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3048,38 +3015,69 @@ } } }, - "/dashboards/uid/{uid}/versions": { + "/dashboard/snapshots": { "get": { - "tags": ["dashboard_versions"], - "summary": "Gets all existing versions for the dashboard using UID.", - "operationId": "getDashboardVersionsByUID", + "tags": ["snapshots"], + "summary": "List snapshots.", + "operationId": "getSnapshots", "parameters": [ { "type": "string", - "name": "uid", - "in": "path", - "required": true + "description": "Search Query", + "name": "query", + "in": "query" }, { "type": "integer", "format": "int64", - "default": 0, - "description": "Maximum number of results to return", + "default": 1000, + "description": "Limit the number of returned results", "name": "limit", "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getSnapshotsResponse" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/calculate-diff": { + "post": { + "produces": ["application/json", "text/html"], + "tags": ["dashboards"], + "summary": "Perform diff on two dashboards.", + "operationId": "calcDashboardDiff", + "parameters": [ { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Version to start from when returning queries", - "name": "start", - "in": "query" + "name": "Body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "base": { + "$ref": "#/definitions/CalculateDiffTarget" + }, + "diffType": { + "description": "The type of diff to return\nDescription:\n`basic`\n`json`", + "type": "string", + "enum": ["basic", "json"] + }, + "new": { + "$ref": "#/definitions/CalculateDiffTarget" + } + } + } } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionsResponse" + "$ref": "#/responses/dashboardDiffResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3087,38 +3085,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { - "get": { - "tags": ["dashboard_versions"], - "summary": "Get a specific dashboard version using UID.", - "operationId": "getDashboardVersionByUID", + "/dashboards/db": { + "post": { + "description": "Creates a new dashboard or updates an existing dashboard.", + "tags": ["dashboards"], + "summary": "Create / Update dashboard", + "operationId": "postDashboard", "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "DashboardVersionID", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SaveDashboardCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/dashboardVersionResponse" + "$ref": "#/responses/postDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3129,51 +3123,55 @@ "404": { "$ref": "#/responses/notFoundError" }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/datasources": { + "/dashboards/home": { "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scope: `datasources:*`.", - "tags": ["datasources"], - "summary": "Get all data sources.", - "operationId": "getDatasources", + "tags": ["dashboards"], + "summary": "Get home dashboard.", + "operationId": "getHomeDashboard", "responses": { "200": { - "$ref": "#/responses/getDatasourcesResponse" + "$ref": "#/responses/getHomeDashboardResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "post": { - "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", - "tags": ["datasources"], - "summary": "Create a data source.", - "operationId": "addDatasource", + } + }, + "/dashboards/id/{DashboardID}/permissions": { + "get": { + "description": "Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsWithUid) instead", + "tags": ["dashboard_permissions"], + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissions", + "deprecated": true, "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddDataSourceCommand" - } + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" + "$ref": "#/responses/getDashboardPermissionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3181,32 +3179,43 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/id/{name}": { - "get": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", - "tags": ["datasources"], - "summary": "Get data source Id by Name.", - "operationId": "getDatasourceIdByName", + }, + "post": { + "description": "Please refer to [updated API](#/dashboard_permissions/postDashboardPermissionsWithUid) instead\n\nThis operation will remove existing permissions if they’re not included in the request.", + "tags": ["dashboard_permissions"], + "summary": "Updates permissions for a dashboard.", + "operationId": "postDashboardPermissions", + "deprecated": true, "parameters": [ { - "type": "string", - "name": "name", + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardACLCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDatasourceIDresponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3223,23 +3232,33 @@ } } }, - "/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": ["datasources"], - "summary": "Get a single data source by Name.", - "operationId": "getDatasourceByName", + "/dashboards/id/{DashboardID}/restore": { + "post": { + "description": "Please refer to [updated API](#/dashboard_versions/restoreDashboardVersionByUID) instead", + "tags": ["dashboard_versions"], + "summary": "Restore a dashboard to a given dashboard version.", + "operationId": "restoreDashboardVersion", + "deprecated": true, "parameters": [ { - "type": "string", - "name": "name", + "type": "integer", + "format": "int64", + "name": "DashboardID", "in": "path", "required": true + }, + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RestoreDashboardVersionCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/getDatasourceResponse" + "$ref": "#/responses/postDashboardResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3247,27 +3266,50 @@ "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).", - "tags": ["datasources"], - "summary": "Delete an existing data source by name.", - "operationId": "deleteDatasourceByName", + } + }, + "/dashboards/id/{DashboardID}/versions": { + "get": { + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionsByUID) instead", + "tags": ["dashboard_versions"], + "summary": "Gets all existing versions for the dashboard.", + "operationId": "getDashboardVersions", + "deprecated": true, "parameters": [ { - "type": "string", - "name": "name", + "type": "integer", + "format": "int64", + "name": "DashboardID", "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/deleteDatasourceByNameResponse" + "$ref": "#/responses/dashboardVersionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3284,32 +3326,32 @@ } } }, - "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { "get": { - "description": "Proxies all calls to the actual data source.", - "tags": ["datasources"], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETByUIDcalls", + "description": "Please refer to [updated API](#/dashboard_versions/getDashboardVersionByUID) instead", + "tags": ["dashboard_versions"], + "summary": "Get a specific dashboard version.", + "operationId": "getDashboardVersion", + "deprecated": true, "parameters": [ { - "type": "string", - "name": "datasource_proxy_route", + "type": "integer", + "format": "int64", + "name": "DashboardID", "in": "path", "required": true }, { - "type": "string", - "name": "uid", + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", "in": "path", "required": true } ], "responses": { "200": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/dashboardVersionResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3324,27 +3366,98 @@ "$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", - "tags": ["datasources"], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTByUIDcalls", + "tags": ["dashboards"], + "summary": "Import dashboard.", + "operationId": "importDashboard", "parameters": [ { - "name": "DatasourceProxyParam", + "name": "Body", "in": "body", "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/ImportDashboardRequest" } + } + ], + "responses": { + "200": { + "$ref": "#/responses/importDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/tags": { + "get": { + "tags": ["dashboards"], + "summary": "Get all dashboards tags of an organisation.", + "operationId": "getDashboardTags", + "responses": { + "200": { + "$ref": "#/responses/dashboardsTagsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/trim": { + "post": { + "tags": ["dashboards"], + "summary": "Trim defaults from dashboard.", + "operationId": "trimDashboard", + "parameters": [ { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TrimDashboardCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/trimDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/uid/{uid}": { + "get": { + "description": "Will return the dashboard given the dashboard unique identifier (uid).", + "tags": ["dashboards"], + "summary": "Get dashboard by uid.", + "operationId": "getDashboardByUID", + "parameters": [ { "type": "string", "name": "uid", @@ -3353,14 +3466,8 @@ } ], "responses": { - "201": { - "description": "" - }, - "202": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "200": { + "$ref": "#/responses/dashboardResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3377,30 +3484,21 @@ } }, "delete": { - "description": "Proxies all calls to the actual data source.", - "tags": ["datasources"], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEByUIDcalls", + "description": "Will delete the dashboard given the specified unique identifier (uid).", + "tags": ["dashboards"], + "summary": "Delete dashboard by uid.", + "operationId": "deleteDashboardByUID", "parameters": [ { "type": "string", "name": "uid", "in": "path", "required": true - }, - { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true } ], "responses": { - "202": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "200": { + "$ref": "#/responses/deleteDashboardResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3417,33 +3515,22 @@ } } }, - "/datasources/proxy/{id}/{datasource_proxy_route}": { + "/dashboards/uid/{uid}/permissions": { "get": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", - "tags": ["datasources"], - "summary": "Data source proxy GET calls.", - "operationId": "datasourceProxyGETcalls", - "deprecated": true, + "tags": ["dashboard_permissions"], + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissionsWithUid", "parameters": [ { "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "id", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getDashboardPermissionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3460,39 +3547,29 @@ } }, "post": { - "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined\n\nPlease refer to [updated API](#/datasources/datasourceProxyPOSTByUIDcalls) instead", - "tags": ["datasources"], - "summary": "Data source proxy POST calls.", - "operationId": "datasourceProxyPOSTcalls", - "deprecated": true, + "description": "This operation will remove existing permissions if they’re not included in the request.", + "tags": ["dashboard_permissions"], + "summary": "Updates permissions for a dashboard.", + "operationId": "postDashboardPermissionsWithUid", "parameters": [ { - "name": "DatasourceProxyParam", + "name": "Body", "in": "body", "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/UpdateDashboardACLCommand" } }, { "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "id", + "name": "uid", "in": "path", "required": true } ], "responses": { - "201": { - "description": "" - }, - "202": { - "description": "" + "200": { + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -3510,33 +3587,32 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", - "tags": ["datasources"], - "summary": "Data source proxy DELETE calls.", - "operationId": "datasourceProxyDELETEcalls", - "deprecated": true, + } + }, + "/dashboards/uid/{uid}/restore": { + "post": { + "tags": ["dashboard_versions"], + "summary": "Restore a dashboard to a given dashboard version using UID.", + "operationId": "restoreDashboardVersionByUID", "parameters": [ { "type": "string", - "name": "id", + "name": "uid", "in": "path", "required": true }, { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RestoreDashboardVersionCommand" + } } ], "responses": { - "202": { - "description": "" - }, - "400": { - "$ref": "#/responses/badRequestError" + "200": { + "$ref": "#/responses/postDashboardResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3553,26 +3629,38 @@ } } }, - "/datasources/uid/{uid}": { + "/dashboards/uid/{uid}/versions": { "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": ["datasources"], - "summary": "Get a single data source by UID.", - "operationId": "getDatasourceByUID", + "tags": ["dashboard_versions"], + "summary": "Gets all existing versions for the dashboard using UID.", + "operationId": "getDashboardVersionsByUID", "parameters": [ { "type": "string", "name": "uid", "in": "path", "required": true + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "description": "Maximum number of results to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "description": "Version to start from when returning queries", + "name": "start", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getDatasourceResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/dashboardVersionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3587,59 +3675,31 @@ "$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", + } + }, + "/dashboards/uid/{uid}/versions/{DashboardVersionID}": { + "get": { + "tags": ["dashboard_versions"], + "summary": "Get a specific dashboard version using UID.", + "operationId": "getDashboardVersionByUID", "parameters": [ - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDataSourceCommand" - } - }, { "type": "string", "name": "uid", "in": "path", "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", - "tags": ["datasources"], - "summary": "Delete an existing data source by UID.", - "operationId": "deleteDatasourceByUID", - "parameters": [ { - "type": "string", - "name": "uid", + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/dashboardVersionResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3656,25 +3716,15 @@ } } }, - "/datasources/uid/{uid}/health": { + "/datasources": { "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scope: `datasources:*`.", "tags": ["datasources"], - "summary": "Check data source health by Id.", - "operationId": "checkDatasourceHealth", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - } - ], + "summary": "Get all data sources.", + "operationId": "getDatasources", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getDatasourcesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3686,33 +3736,25 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { - "get": { + }, + "post": { + "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", "tags": ["datasources"], - "summary": "Fetch data source resources.", - "operationId": "fetchDatasourceResources", + "summary": "Create a data source.", + "operationId": "addDatasource", "parameters": [ { - "type": "string", - "name": "uid", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "datasource_proxy_route", - "in": "path", - "required": true + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddDataSourceCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3720,8 +3762,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -3729,26 +3771,23 @@ } } }, - "/datasources/{datasourceId}/disable-permissions": { - "post": { - "description": "Disables permissions for the data source with the given id. All existing permissions will be removed and anyone will be able to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", - "tags": ["datasource_permissions", "enterprise"], - "summary": "Disable permissions for a data source.", - "operationId": "disablePermissions", + "/datasources/id/{name}": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source).", + "tags": ["datasources"], + "summary": "Get data source Id by Name.", + "operationId": "getDatasourceIdByName", "parameters": [ { "type": "string", - "name": "datasourceId", + "name": "name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getDatasourceIDresponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3765,26 +3804,23 @@ } } }, - "/datasources/{datasourceId}/enable-permissions": { - "post": { - "description": "Enables permissions for the data source with the given id.\nNo one except Org Admins will be able to query the data source until permissions have been added\nwhich permit certain users or teams to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", - "tags": ["datasource_permissions", "enterprise"], - "summary": "Enable permissions for a data source.", - "operationId": "enablePermissions", + "/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": ["datasources"], + "summary": "Get a single data source by Name.", + "operationId": "getDatasourceByName", "parameters": [ { "type": "string", - "name": "datasourceId", + "name": "name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3792,32 +3828,27 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/{datasourceId}/permissions": { - "get": { - "description": "Gets all existing permissions for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", - "tags": ["datasource_permissions", "enterprise"], - "summary": "Get permissions for a data source.", - "operationId": "getPermissions", + }, + "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": ["datasources"], + "summary": "Delete an existing data source by name.", + "operationId": "deleteDatasourceByName", "parameters": [ { "type": "string", - "name": "datasourceId", + "name": "name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getPermissionseResponse" + "$ref": "#/responses/deleteDatasourceByNameResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3834,29 +3865,32 @@ } } }, - "/datasources/{datasourceId}/permissions/{permissionId}": { - "delete": { - "description": "Removes the permission with the given permissionId for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:delete` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", - "tags": ["datasource_permissions", "enterprise"], - "summary": "Remove permission for a data source.", - "operationId": "deletePermissions", + "/datasources/proxy/uid/{uid}/{datasource_proxy_route}": { + "get": { + "description": "Proxies all calls to the actual data source.", + "tags": ["datasources"], + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETByUIDcalls", "parameters": [ { "type": "string", - "name": "datasourceId", + "name": "datasource_proxy_route", "in": "path", "required": true }, { "type": "string", - "name": "permissionId", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3871,26 +3905,40 @@ "$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", + }, + "post": { + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", "tags": ["datasources"], - "summary": "Get a single data source by Id.", - "operationId": "getDatasourceByID", - "deprecated": true, + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTByUIDcalls", "parameters": [ + { + "name": "DatasourceProxyParam", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + }, { "type": "string", - "name": "id", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/getDatasourceResponse" + "201": { + "description": "(empty)" + }, + "202": { + "description": "(empty)" }, "400": { "$ref": "#/responses/badRequestError" @@ -3909,31 +3957,31 @@ } } }, - "put": { - "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/updateDatasourceByUID) instead", + "delete": { + "description": "Proxies all calls to the actual data source.", "tags": ["datasources"], - "summary": "Update an existing data source by its sequential ID.", - "operationId": "updateDatasourceByID", - "deprecated": true, + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEByUIDcalls", "parameters": [ { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDataSourceCommand" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true }, { "type": "string", - "name": "id", + "name": "datasource_proxy_route", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/createOrUpdateDatasourceResponse" + "202": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3941,18 +3989,29 @@ "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:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/deleteDatasourceByUID) instead", + } + }, + "/datasources/proxy/{id}/{datasource_proxy_route}": { + "get": { + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyGETByUIDcalls) instead", "tags": ["datasources"], - "summary": "Delete an existing data source by id.", - "operationId": "deleteDatasourceByID", + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETcalls", "deprecated": true, "parameters": [ + { + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, { "type": "string", "name": "id", @@ -3962,7 +4021,10 @@ ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -3977,16 +4039,28 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/{id}/health": { - "get": { - "description": "Please refer to [updated API](#/datasources/checkDatasourceHealth) instead", + }, + "post": { + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined\n\nPlease refer to [updated API](#/datasources/datasourceProxyPOSTByUIDcalls) instead", "tags": ["datasources"], - "summary": "Check data source health by Id.", - "operationId": "checkDatasourceHealthByID", + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTcalls", "deprecated": true, "parameters": [ + { + "name": "DatasourceProxyParam", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + }, + { + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, { "type": "string", "name": "id", @@ -3995,8 +4069,11 @@ } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "201": { + "description": "(empty)" + }, + "202": { + "description": "(empty)" }, "400": { "$ref": "#/responses/badRequestError" @@ -4007,18 +4084,19 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/datasources/{id}/resources/{datasource_proxy_route}": { - "get": { - "description": "Please refer to [updated API](#/datasources/fetchDatasourceResources) instead", + }, + "delete": { + "description": "Proxies all calls to the actual data source.\n\nPlease refer to [updated API](#/datasources/datasourceProxyDELETEByUIDcalls) instead", "tags": ["datasources"], - "summary": "Fetch data source resources by Id.", - "operationId": "fetchDatasourceResourcesByID", + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEcalls", "deprecated": true, "parameters": [ { @@ -4035,8 +4113,8 @@ } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "202": { + "description": "(empty)" }, "400": { "$ref": "#/responses/badRequestError" @@ -4056,28 +4134,23 @@ } } }, - "/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": ["ds"], - "summary": "Query metrics with expressions", - "operationId": "queryMetricsWithExpressions", + "/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": ["datasources"], + "summary": "Get a single data source by UID.", + "operationId": "getDatasourceByUID", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MetricRequest" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/queryDataResponse" - }, - "207": { - "$ref": "#/responses/queryDataResponse" + "$ref": "#/responses/getDatasourceResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4088,39 +4161,38 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/folders": { - "get": { - "description": "Returns all folders that the authenticated user has permission to view.", - "tags": ["folders"], - "summary": "Get all folders.", - "operationId": "getFolders", + }, + "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": [ { - "type": "integer", - "format": "int64", - "default": 1000, - "description": "Limit the maximum number of folders to return", - "name": "limit", - "in": "query" + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDataSourceCommand" + } }, { - "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 } ], "responses": { "200": { - "$ref": "#/responses/getFoldersResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4133,26 +4205,22 @@ } } }, - "post": { - "tags": ["folders"], - "summary": "Create folder.", - "operationId": "createFolder", + "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": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateFolderCommand" - } + "type": "string", + "name": "uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4160,8 +4228,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4169,24 +4237,25 @@ } } }, - "/folders/id/{folder_id}": { + "/datasources/uid/{uid}/health": { "get": { - "description": "Returns the folder identified by id.", - "tags": ["folders"], - "summary": "Get folder by id.", - "operationId": "getFolderByID", + "tags": ["datasources"], + "summary": "Check data source health by Id.", + "operationId": "checkDatasourceHealth", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "folder_id", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4194,31 +4263,37 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/folders/{folder_uid}": { + "/datasources/uid/{uid}/resources/{datasource_proxy_route}": { "get": { - "tags": ["folders"], - "summary": "Get folder by uid.", - "operationId": "getFolderByUID", + "tags": ["datasources"], + "summary": "Fetch data source resources.", + "operationId": "fetchDatasourceResources", "parameters": [ { "type": "string", - "name": "folder_uid", + "name": "uid", "in": "path", "required": true - } - ], + }, + { + "type": "string", + "name": "datasource_proxy_route", + "in": "path", + "required": true + } + ], "responses": { "200": { - "description": "" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4233,31 +4308,25 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { - "tags": ["folders"], - "summary": "Update folder.", - "operationId": "updateFolder", + } + }, + "/datasources/{datasourceId}/disable-permissions": { + "post": { + "description": "Disables permissions for the data source with the given id. All existing permissions will be removed and anyone will be able to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", + "tags": ["datasource_permissions", "enterprise"], + "summary": "Disable permissions for a data source.", + "operationId": "disablePermissions", "parameters": [ { "type": "string", - "name": "folder_uid", + "name": "datasourceId", "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": { "200": { - "$ref": "#/responses/folderResponse" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4271,37 +4340,29 @@ "404": { "$ref": "#/responses/notFoundError" }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted.", - "tags": ["folders"], - "summary": "Delete folder.", - "operationId": "deleteFolder", + } + }, + "/datasources/{datasourceId}/enable-permissions": { + "post": { + "description": "Enables permissions for the data source with the given id.\nNo one except Org Admins will be able to query the data source until permissions have been added\nwhich permit certain users or teams to query the data source.\n\nYou need to have a permission with action `datasources.permissions:toggle` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", + "tags": ["datasource_permissions", "enterprise"], + "summary": "Enable permissions for a data source.", + "operationId": "enablePermissions", "parameters": [ { "type": "string", - "name": "folder_uid", + "name": "datasourceId", "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" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4321,22 +4382,23 @@ } } }, - "/folders/{folder_uid}/permissions": { + "/datasources/{datasourceId}/permissions": { "get": { - "tags": ["folder_permissions"], - "summary": "Gets all existing permissions for the folder with the given `uid`.", - "operationId": "getFolderPermissions", + "description": "Gets all existing permissions for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:read` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", + "tags": ["datasource_permissions", "enterprise"], + "summary": "Get permissions for a data source.", + "operationId": "getPermissions", "parameters": [ { "type": "string", - "name": "folder_uid", + "name": "datasourceId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getDashboardPermissionsResponse" + "$ref": "#/responses/getPermissionseResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4351,25 +4413,26 @@ "$ref": "#/responses/internalServerError" } } - }, - "post": { - "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", + } + }, + "/datasources/{datasourceId}/permissions/{permissionId}": { + "delete": { + "description": "Removes the permission with the given permissionId for the data source with the given id.\n\nYou need to have a permission with action `datasources.permissions:delete` and scopes `datasources:*`, `datasources:id:*`, `datasources:id:1` (single data source).", + "tags": ["datasource_permissions", "enterprise"], + "summary": "Remove permission for a data source.", + "operationId": "deletePermissions", "parameters": [ { "type": "string", - "name": "folder_uid", + "name": "datasourceId", "in": "path", "required": true }, { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateDashboardAclCommand" - } + "type": "string", + "name": "permissionId", + "in": "path", + "required": true } ], "responses": { @@ -4391,102 +4454,67 @@ } } }, - "/library-elements": { + "/datasources/{id}": { "get": { - "description": "Returns a list of all library elements the authenticated user has permission to view.\nUse the `perPage` query parameter to control the maximum number of library elements returned; the default limit is `100`.\nYou can also use the `page` query parameter to fetch library elements from any page other than the first one.", - "tags": ["library_elements"], - "summary": "Get all library elements.", - "operationId": "getLibraryElements", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).\n\nPlease refer to [updated API](#/datasources/getDatasourceByUID) instead", + "tags": ["datasources"], + "summary": "Get a single data source by Id.", + "operationId": "getDatasourceByID", + "deprecated": true, "parameters": [ { "type": "string", - "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" + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementsResponse" + "$ref": "#/responses/getDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Creates a new library element.", - "tags": ["library_elements"], - "summary": "Create library element.", - "operationId": "createLibraryElement", + "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": "Update an existing data source by its sequential ID.", + "operationId": "updateDatasourceByID", + "deprecated": true, "parameters": [ { - "name": "body", + "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateLibraryElementCommand" + "$ref": "#/definitions/UpdateDataSourceCommand" } + }, + { + "type": "string", + "name": "id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/createOrUpdateDatasourceResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4494,36 +4522,35 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/library-elements/name/{library_element_name}": { - "get": { - "description": "Returns a library element with the given name.", - "tags": ["library_elements"], - "summary": "Get library element by name.", - "operationId": "getLibraryElementByName", + }, + "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": ["datasources"], + "summary": "Delete an existing data source by id.", + "operationId": "deleteDatasourceByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "library_element_name", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "404": { "$ref": "#/responses/notFoundError" }, @@ -4533,44 +4560,57 @@ } } }, - "/library-elements/{library_element_uid}": { + "/datasources/{id}/health": { "get": { - "description": "Returns a library element with the given UID.", - "tags": ["library_elements"], - "summary": "Get library element by UID.", - "operationId": "getLibraryElementByUID", + "description": "Please refer to [updated API](#/datasources/checkDatasourceHealth) instead", + "tags": ["datasources"], + "summary": "Check data source health by Id.", + "operationId": "checkDatasourceHealthByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "library_element_uid", + "name": "id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "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": ["library_elements"], - "summary": "Delete library element.", - "operationId": "deleteLibraryElementByUID", + } + }, + "/datasources/{id}/resources/{datasource_proxy_route}": { + "get": { + "description": "Please refer to [updated API](#/datasources/fetchDatasourceResources) instead", + "tags": ["datasources"], + "summary": "Fetch data source resources by Id.", + "operationId": "fetchDatasourceResourcesByID", + "deprecated": true, "parameters": [ { "type": "string", - "name": "library_element_uid", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "datasource_proxy_route", "in": "path", "required": true } @@ -4595,31 +4635,30 @@ "$ref": "#/responses/internalServerError" } } - }, - "patch": { - "description": "Updates an existing library element identified by uid.", - "tags": ["library_elements"], - "summary": "Update library element.", - "operationId": "updateLibraryElement", + } + }, + "/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": ["ds"], + "summary": "Query metrics with expressions", + "operationId": "queryMetricsWithExpressions", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PatchLibraryElementCommand" + "$ref": "#/definitions/MetricRequest" } - }, - { - "type": "string", - "name": "library_element_uid", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementResponse" + "$ref": "#/responses/queryDataResponse" + }, + "207": { + "$ref": "#/responses/queryDataResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4630,86 +4669,80 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "412": { - "$ref": "#/responses/preconditionFailedError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/library-elements/{library_element_uid}/connections/": { + "/folders": { "get": { - "description": "Returns a list of connections for a library element based on the UID specified.", - "tags": ["library_elements"], - "summary": "Get library element connections.", - "operationId": "getLibraryElementConnections", + "description": "Returns all folders that the authenticated user has permission to view.", + "tags": ["folders"], + "summary": "Get all folders.", + "operationId": "getFolders", "parameters": [ { - "type": "string", - "name": "library_element_uid", - "in": "path", - "required": true + "type": "integer", + "format": "int64", + "default": 1000, + "description": "Limit the maximum number of folders to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "description": "Page index for starting fetching folders", + "name": "page", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/getLibraryElementConnectionsResponse" + "$ref": "#/responses/getFoldersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" + "403": { + "$ref": "#/responses/forbiddenError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/licensing/check": { - "get": { - "tags": ["licensing", "enterprise"], - "summary": "Check license availability.", - "operationId": "getLicenseStatus", - "responses": { - "200": { - "$ref": "#/responses/getLicenseStatusResponse" + }, + "post": { + "tags": ["folders"], + "summary": "Create folder.", + "operationId": "createFolder", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateFolderCommand" + } } - } - } - }, - "/licensing/custom-permissions": { - "get": { - "description": "You need to have a permission with action `licensing.reports:read`.", - "tags": ["licensing", "enterprise"], - "summary": "Get custom permissions report.", - "operationId": "getCustomPermissionsReport", + ], "responses": { "200": { - "$ref": "#/responses/getCustomPermissionsReportResponse" + "$ref": "#/responses/folderResponse" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/licensing/custom-permissions-csv": { - "get": { - "description": "You need to have a permission with action `licensing.reports:read`.", - "produces": ["text/csv"], - "tags": ["licensing", "enterprise"], - "summary": "Get custom permissions report in CSV format.", - "operationId": "getCustomPermissionsCSV", - "responses": { - "200": { - "$ref": "#/responses/getCustomPermissionsReportResponse" + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4717,15 +4750,33 @@ } } }, - "/licensing/refresh-stats": { + "/folders/id/{folder_id}": { "get": { - "description": "You need to have a permission with action `licensing:read`.", - "tags": ["licensing", "enterprise"], - "summary": "Refresh license stats.", - "operationId": "refreshLicenseStats", + "description": "Returns the folder identified by id.", + "tags": ["folders"], + "summary": "Get folder by id.", + "operationId": "getFolderByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "folder_id", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/refreshLicenseStatsResponse" + "$ref": "#/responses/folderResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -4733,60 +4784,61 @@ } } }, - "/licensing/token": { + "/folders/{folder_uid}": { "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", + "tags": ["folders"], + "summary": "Get folder by uid.", + "operationId": "getFolderByUID", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DeleteTokenCommand" - } + "type": "string", + "name": "folder_uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getLicenseTokenResponse" + "$ref": "#/responses/folderResponse" }, - "400": { - "$ref": "#/responses/badRequestError" + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "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`.", - "tags": ["licensing", "enterprise"], - "summary": "Remove license from database.", - "operationId": "deleteLicenseToken", + "put": { + "tags": ["folders"], + "summary": "Update folder.", + "operationId": "updateFolder", "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/DeleteTokenCommand" + "$ref": "#/definitions/UpdateFolderCommand" } } ], "responses": { - "202": { - "$ref": "#/responses/acceptedResponse" + "200": { + "$ref": "#/responses/folderResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -4797,52 +4849,49 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "404": { + "$ref": "#/responses/notFoundError" + }, + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/licensing/token/renew": { - "post": { - "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", - "tags": ["licensing", "enterprise"], - "summary": "Manually force license refresh.", - "operationId": "postRenewLicenseToken", + }, + "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.", + "tags": ["folders"], + "summary": "Delete folder.", + "operationId": "deleteFolder", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } + "type": "string", + "name": "folder_uid", + "in": "path", + "required": true + }, + { + "type": "boolean", + "default": false, + "description": "If `true` any Grafana 8 Alerts under this folder will be deleted.\nSet to `false` so that the request will fail if the folder contains any Grafana 8 Alerts.", + "name": "forceDeleteRules", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/postRenewLicenseTokenResponse" + "$ref": "#/responses/deleteFolderResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "404": { - "$ref": "#/responses/notFoundError" - } - } - } - }, - "/login/saml": { - "get": { - "tags": ["saml", "enterprise"], - "summary": "It initiates the login flow by redirecting the user to the IdP.", - "operationId": "getSAMLLogin", - "responses": { - "302": { - "description": "" + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { "$ref": "#/responses/notFoundError" @@ -4853,32 +4902,22 @@ } } }, - "/logout/saml": { + "/folders/{folder_uid}/permissions": { "get": { - "tags": ["saml", "enterprise"], - "summary": "GetLogout initiates single logout process.", - "operationId": "getSAMLLogout", - "responses": { - "302": { - "description": "" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "tags": ["folder_permissions"], + "summary": "Gets all existing permissions for the folder with the given `uid`.", + "operationId": "getFolderPermissions", + "parameters": [ + { + "type": "string", + "name": "folder_uid", + "in": "path", + "required": true } - } - } - }, - "/org": { - "get": { - "description": "Get current Organization", - "tags": ["current_org_details"], - "operationId": "getOrg", + ], "responses": { "200": { - "$ref": "#/responses/getOrgResponse" + "$ref": "#/responses/getDashboardPermissionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4886,22 +4925,31 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "put": { - "tags": ["current_org_details"], - "summary": "Update current Organization.", - "operationId": "updateOrg", + "post": { + "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": [ { - "name": "body", + "type": "string", + "name": "folder_uid", + "in": "path", + "required": true + }, + { + "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgForm" + "$ref": "#/definitions/UpdateDashboardACLCommand" } } ], @@ -4909,92 +4957,114 @@ "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/address": { - "put": { - "tags": ["current_org_details"], - "summary": "Update current Organization's address.", - "operationId": "updateOrgAddress", + "/library-elements": { + "get": { + "description": "Returns a list of all library elements the authenticated user has permission to view.\nUse the `perPage` query parameter to control the maximum number of library elements returned; the default limit is `100`.\nYou can also use the `page` query parameter to fetch library elements from any page other than the first one.", + "tags": ["library_elements"], + "summary": "Get all library elements.", + "operationId": "getLibraryElements", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrgAddressForm" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/okResponse" + "type": "string", + "description": "Part of the name or description searched for.", + "name": "searchString", + "in": "query" }, - "400": { - "$ref": "#/responses/badRequestError" + { + "enum": [1, 2], + "type": "integer", + "format": "int64", + "description": "Kind of element to search for.", + "name": "kind", + "in": "query" }, - "401": { - "$ref": "#/responses/unauthorisedError" + { + "enum": ["alpha-asc", "alpha-desc"], + "type": "string", + "description": "Sort order of elements.", + "name": "sortDirection", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "type": "string", + "description": "A comma separated list of types to filter the elements by", + "name": "typeFilter", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" + { + "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/invites": { - "get": { - "tags": ["org_invites"], - "summary": "Get pending invites.", - "operationId": "getInvites", + ], "responses": { "200": { - "$ref": "#/responses/getInvitesResponse" + "$ref": "#/responses/getLibraryElementsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { - "tags": ["org_invites"], - "summary": "Add invite.", - "operationId": "addInvite", + "description": "Creates a new library element.", + "tags": ["library_elements"], + "summary": "Create library element.", + "operationId": "createLibraryElement", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AddInviteForm" + "$ref": "#/definitions/CreateLibraryElementCommand" } } ], "responses": { "200": { - "$ref": "#/responses/addOrgUser" + "$ref": "#/responses/getLibraryElementResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5005,8 +5075,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "412": { - "$ref": "#/responses/SMTPNotEnabledError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -5014,43 +5084,81 @@ } } }, - "/org/preferences": { + "/library-elements/name/{library_element_name}": { "get": { - "tags": ["org_preferences"], - "summary": "Get Current Org Prefs.", - "operationId": "getOrgPreferences", + "description": "Returns a library element with the given name.", + "tags": ["library_elements"], + "summary": "Get library element by name.", + "operationId": "getLibraryElementByName", + "parameters": [ + { + "type": "string", + "name": "library_element_name", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getPreferencesResponse" + "$ref": "#/responses/getLibraryElementResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "put": { - "tags": ["org_preferences"], - "summary": "Update Current Org Prefs.", - "operationId": "updateOrgPreferences", + } + }, + "/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": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePrefsCmd" - } + "type": "string", + "name": "library_element_uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/addOrgUser" + "$ref": "#/responses/getLibraryElementResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing library element as specified by the UID. This operation cannot be reverted.\nYou cannot delete a library element that is connected. This operation cannot be reverted.", + "tags": ["library_elements"], + "summary": "Delete library element.", + "operationId": "deleteLibraryElementByUID", + "parameters": [ + { + "type": "string", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5061,28 +5169,38 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "patch": { - "tags": ["org_preferences"], - "summary": "Patch Current Org Prefs.", - "operationId": "patchOrgPreferences", + "description": "Updates an existing library element identified by uid.", + "tags": ["library_elements"], + "summary": "Update library element.", + "operationId": "updateLibraryElement", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PatchPrefsCmd" + "$ref": "#/definitions/PatchLibraryElementCommand" } + }, + { + "type": "string", + "name": "library_element_uid", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/addOrgUser" + "$ref": "#/responses/getLibraryElementResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5093,57 +5211,69 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/users": { + "/library-elements/{library_element_uid}/connections/": { "get": { - "description": "Returns all org users within the current organization. Accessible to users with org admin role.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", - "tags": ["current_org_details"], - "summary": "Get all users within the current organization.", - "operationId": "getOrgUsers", + "description": "Returns a list of connections for a library element based on the UID specified.", + "tags": ["library_elements"], + "summary": "Get library element connections.", + "operationId": "getLibraryElementConnections", + "parameters": [ + { + "type": "string", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getOrgUsersResponse" + "$ref": "#/responses/getLibraryElementConnectionsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "post": { - "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", - "tags": ["current_org_details"], - "summary": "Add a new user to the current organization", - "operationId": "addOrgUser", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddOrgUserCommand" - } + } + }, + "/licensing/check": { + "get": { + "tags": ["licensing", "enterprise"], + "summary": "Check license availability.", + "operationId": "getLicenseStatus", + "responses": { + "200": { + "$ref": "#/responses/getLicenseStatusResponse" } - ], + } + } + }, + "/licensing/custom-permissions": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "tags": ["licensing", "enterprise"], + "summary": "Get custom permissions report.", + "operationId": "getCustomPermissionsReport", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/getCustomPermissionsReportResponse" }, "500": { "$ref": "#/responses/internalServerError" @@ -5151,34 +5281,32 @@ } } }, - "/org/users/lookup": { + "/licensing/custom-permissions-csv": { "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": ["current_org_details"], - "summary": "Get all users within the current organization (lookup)", - "operationId": "lookupOrgUsers", - "parameters": [ - { - "type": "string", - "name": "query", - "in": "query" + "description": "You need to have a permission with action `licensing.reports:read`.", + "produces": ["text/csv"], + "tags": ["licensing", "enterprise"], + "summary": "Get custom permissions report in CSV format.", + "operationId": "getCustomPermissionsCSV", + "responses": { + "200": { + "$ref": "#/responses/getCustomPermissionsReportResponse" }, - { - "type": "integer", - "format": "int64", - "name": "limit", - "in": "query" + "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/lookupOrgUsersResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" + "$ref": "#/responses/refreshLicenseStatsResponse" }, "500": { "$ref": "#/responses/internalServerError" @@ -5186,64 +5314,60 @@ } } }, - "/org/users/{user_id}": { - "delete": { - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", - "tags": ["current_org_details"], - "summary": "Delete user in current organization", - "operationId": "deleteOrgUser", + "/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": "integer", - "format": "int64", - "name": "user_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" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "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:*`.", - "tags": ["current_org_details"], - "summary": "Updates the given user", - "operationId": "updateOrgUser", + "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/UpdateOrgUserCommand" + "$ref": "#/definitions/DeleteTokenCommand" } - }, - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "202": { + "$ref": "#/responses/acceptedResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -5254,34 +5378,52 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/org/{invitation_code}/invites": { - "delete": { - "tags": ["org_invites"], - "summary": "Revoke invite.", - "operationId": "revokeInvite", + "/licensing/token/renew": { + "post": { + "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + "tags": ["licensing", "enterprise"], + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", "parameters": [ { - "type": "string", - "name": "invitation_code", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/postRenewLicenseTokenResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "404": { + "$ref": "#/responses/notFoundError" + } + } + } + }, + "/login/saml": { + "get": { + "tags": ["saml", "enterprise"], + "summary": "It initiates the login flow by redirecting the user to the IdP.", + "operationId": "getSAMLLogin", + "responses": { + "302": { + "description": "(empty)" }, "404": { "$ref": "#/responses/notFoundError" @@ -5292,47 +5434,32 @@ } } }, - "/orgs": { + "/logout/saml": { "get": { - "security": [ - { - "basic": [] - } - ], - "description": "Search all Organizations", - "tags": ["orgs"], - "operationId": "searchOrg", - "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" + "tags": ["saml", "enterprise"], + "summary": "GetLogout initiates single logout process.", + "operationId": "getSAMLLogout", + "responses": { + "302": { + "description": "(empty)" }, - { - "type": "string", - "name": "name", - "in": "query" + "404": { + "$ref": "#/responses/notFoundError" }, - { - "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" + "500": { + "$ref": "#/responses/internalServerError" } - ], + } + } + }, + "/org": { + "get": { + "description": "Get current Organization", + "tags": ["current_org_details"], + "operationId": "getOrg", "responses": { "200": { - "$ref": "#/responses/searchOrgResponse" + "$ref": "#/responses/getOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5340,32 +5467,31 @@ "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.", - "tags": ["orgs"], - "summary": "Create Organization.", - "operationId": "createOrg", + "put": { + "tags": ["current_org_details"], + "summary": "Update current Organization.", + "operationId": "updateOrg", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateOrgCommand" + "$ref": "#/definitions/UpdateOrgForm" } } ], "responses": { "200": { - "$ref": "#/responses/createOrgResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5373,36 +5499,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "409": { - "$ref": "#/responses/conflictError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/name/{org_name}": { - "get": { - "security": [ - { - "basic": [] - } - ], - "tags": ["orgs"], - "summary": "Get Organization by ID.", - "operationId": "getOrgByName", + "/org/address": { + "put": { + "tags": ["current_org_details"], + "summary": "Update current Organization's address.", + "operationId": "updateOrgAddress", "parameters": [ { - "type": "string", - "name": "org_name", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } } ], "responses": { "200": { - "$ref": "#/responses/getOrgResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5416,28 +5539,14 @@ } } }, - "/orgs/{org_id}": { + "/org/invites": { "get": { - "security": [ - { - "basic": [] - } - ], - "tags": ["orgs"], - "summary": "Get Organization by ID.", - "operationId": "getOrgByID", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - } - ], + "tags": ["org_invites"], + "summary": "Get pending invites.", + "operationId": "getInvites", "responses": { "200": { - "$ref": "#/responses/getOrgResponse" + "$ref": "#/responses/getInvitesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5450,35 +5559,23 @@ } } }, - "put": { - "security": [ - { - "basic": [] - } - ], - "tags": ["orgs"], - "summary": "Update Organization.", - "operationId": "adminUpdateOrg", + "post": { + "tags": ["org_invites"], + "summary": "Add invite.", + "operationId": "addInvite", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgForm" + "$ref": "#/definitions/AddInviteForm" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/addOrgUser" }, "400": { "$ref": "#/responses/badRequestError" @@ -5489,32 +5586,52 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "412": { + "$ref": "#/responses/SMTPNotEnabledError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "security": [ - { - "basic": [] + } + }, + "/org/preferences": { + "get": { + "tags": ["org_preferences"], + "summary": "Get Current Org Prefs.", + "operationId": "getOrgPreferences", + "responses": { + "200": { + "$ref": "#/responses/getPreferencesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } - ], - "tags": ["orgs"], - "summary": "Delete Organization.", - "operationId": "adminDeleteOrg", + } + }, + "put": { + "tags": ["org_preferences"], + "summary": "Update Current Org Prefs.", + "operationId": "updateOrgPreferences", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/addOrgUser" }, "400": { "$ref": "#/responses/badRequestError" @@ -5525,40 +5642,28 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs/{org_id}/address": { - "put": { - "tags": ["orgs"], - "summary": "Update Organization's address.", - "operationId": "adminUpdateOrgAddress", + }, + "patch": { + "tags": ["org_preferences"], + "summary": "Patch Current Org Prefs.", + "operationId": "patchOrgPreferences", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgAddressForm" + "$ref": "#/definitions/PatchPrefsCmd" } - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/addOrgUser" }, "400": { "$ref": "#/responses/badRequestError" @@ -5575,24 +5680,15 @@ } } }, - "/orgs/{org_id}/quotas": { + "/org/users": { "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).\nlist", - "tags": ["orgs"], - "summary": "Fetch Organization quota.", - "operationId": "getOrgQuota", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - } - ], + "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": ["current_org_details"], + "summary": "Get all users within the current organization.", + "operationId": "getOrgUsers", "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" + "$ref": "#/responses/getOrgUsersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5600,47 +5696,24 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/orgs/{org_id}/quotas/{quota_target}": { - "put": { - "security": [ - { - "basic": [] - } - ], - "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).", - "tags": ["orgs"], - "summary": "Update user quota.", - "operationId": "updateOrgQuota", + }, + "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": ["current_org_details"], + "summary": "Add a new user to the current organization", + "operationId": "addOrgUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateOrgQuotaCmd" + "$ref": "#/definitions/AddOrgUserCommand" } - }, - { - "type": "string", - "name": "quota_target", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true } ], "responses": { @@ -5653,75 +5726,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/orgs/{org_id}/users": { + "/org/users/lookup": { "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": "adminGetOrgUsers", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/getOrgUsersResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "post": { - "description": "Adds a global user to the current organization.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:add` with scope `users:*`.", - "tags": ["orgs"], - "summary": "Add a new user to the current organization", - "operationId": "adminAddOrgUser", + "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": ["current_org_details"], + "summary": "Get all users within the current organization (lookup)", + "operationId": "lookupOrgUsers", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AddOrgUserCommand" - } + "type": "string", + "name": "query", + "in": "query" }, { "type": "integer", "format": "int64", - "name": "org_id", - "in": "path", - "required": true + "name": "limit", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/lookupOrgUsersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5735,20 +5767,13 @@ } } }, - "/orgs/{org_id}/users/{user_id}": { + "/org/users/{user_id}": { "delete": { "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", - "tags": ["orgs"], + "tags": ["current_org_details"], "summary": "Delete user in current organization", - "operationId": "adminDeleteOrgUser", + "operationId": "deleteOrgUser", "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", @@ -5777,9 +5802,9 @@ }, "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": ["orgs"], - "summary": "Update Users in Organization.", - "operationId": "adminUpdateOrgUser", + "tags": ["current_org_details"], + "summary": "Updates the given user", + "operationId": "updateOrgUser", "parameters": [ { "name": "body", @@ -5789,13 +5814,6 @@ "$ref": "#/definitions/UpdateOrgUserCommand" } }, - { - "type": "integer", - "format": "int64", - "name": "org_id", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", @@ -5823,51 +5841,22 @@ } } }, - "/playlists": { - "get": { - "tags": ["playlists"], - "summary": "Get playlists.", - "operationId": "searchPlaylists", + "/org/{invitation_code}/invites": { + "delete": { + "tags": ["org_invites"], + "summary": "Revoke invite.", + "operationId": "revokeInvite", "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": { - "tags": ["playlists"], - "summary": "Create playlist.", - "operationId": "createPlaylist", - "parameters": [ - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreatePlaylistCommand" - } + "name": "invitation_code", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/createPlaylistResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5884,22 +5873,47 @@ } } }, - "/playlists/{uid}": { + "/orgs": { "get": { - "tags": ["playlists"], - "summary": "Get playlist by UID.", - "operationId": "getPlaylist", + "security": [ + { + "basic": [] + } + ], + "description": "Search all Organizations", + "tags": ["orgs"], + "operationId": "searchOrg", "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": "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/getPlaylistResponse" + "$ref": "#/responses/searchOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5907,67 +5921,32 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" } } }, - "put": { - "tags": ["playlists"], - "summary": "Update playlist.", - "operationId": "updatePlaylist", + "post": { + "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", + "tags": ["orgs"], + "summary": "Create Organization.", + "operationId": "createOrg", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdatePlaylistCommand" + "$ref": "#/definitions/CreateOrgCommand" } - }, - { - "type": "string", - "name": "uid", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/updatePlaylistResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "delete": { - "tags": ["playlists"], - "summary": "Delete pllaylist.", - "operationId": "deletePlaylist", - "parameters": [ - { - "type": "string", - "name": "uid", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/createOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -5975,8 +5954,8 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" + "409": { + "$ref": "#/responses/conflictError" }, "500": { "$ref": "#/responses/internalServerError" @@ -5984,22 +5963,27 @@ } } }, - "/playlists/{uid}/dashboards": { + "/orgs/name/{org_name}": { "get": { - "tags": ["playlists"], - "summary": "Get playlist dashboards.", - "operationId": "getPlaylistDashboards", + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Get Organization by ID.", + "operationId": "getOrgByName", "parameters": [ { "type": "string", - "name": "uid", + "name": "org_name", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistDashboardsResponse" + "$ref": "#/responses/getOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6007,31 +5991,34 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/playlists/{uid}/items": { + "/orgs/{org_id}": { "get": { - "tags": ["playlists"], - "summary": "Get playlist items.", - "operationId": "getPlaylistItems", + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Get Organization by ID.", + "operationId": "getOrgByID", "parameters": [ { - "type": "string", - "name": "uid", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getPlaylistItemsResponse" + "$ref": "#/responses/getOrgResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6039,111 +6026,76 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$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.", - "tags": ["query_history"], - "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", - "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", - "name": "page", - "in": "query" - }, + }, + "put": { + "security": [ { - "type": "integer", - "format": "int64", - "description": "Limit the number of returned results", - "name": "limit", - "in": "query" - }, + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Update Organization.", + "operationId": "adminUpdateOrg", + "parameters": [ { - "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/UpdateOrgForm" + } }, { "type": "integer", "format": "int64", - "description": "To range for the query history search", - "name": "to", - "in": "query" + "name": "org_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" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Adds new query to query history.", - "tags": ["query_history"], - "summary": "Add query to query history.", - "operationId": "createQuery", + "delete": { + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Delete Organization.", + "operationId": "adminDeleteOrg", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateQueryInQueryHistoryCommand" - } + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6151,31 +6103,43 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/query-history/migrate": { - "post": { - "description": "Adds multiple queries to query history.", - "tags": ["query_history"], - "summary": "Migrate queries to query history.", - "operationId": "migrateQueries", + "/orgs/{org_id}/address": { + "put": { + "tags": ["orgs"], + "summary": "Update Organization's address.", + "operationId": "adminUpdateOrgAddress", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/MigrateQueriesToQueryHistoryCommand" + "$ref": "#/definitions/UpdateOrgAddressForm" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryMigrationResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6183,135 +6147,203 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/query-history/star/{query_history_uid}": { - "post": { - "description": "Adds star to query in query history as specified by the UID.", - "tags": ["query_history"], - "summary": "Add star to query in query history.", - "operationId": "starQuery", + "/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).\nlist", + "tags": ["orgs"], + "summary": "Fetch Organization quota.", + "operationId": "getOrgQuota", "parameters": [ { - "type": "string", - "name": "query_history_uid", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$ref": "#/responses/getQuotaResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Removes star from query in query history as specified by the UID.", - "tags": ["query_history"], - "summary": "Remove star to query in query history.", - "operationId": "unstarQuery", - "parameters": [ + } + }, + "/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": ["orgs"], + "summary": "Update user quota.", + "operationId": "updateOrgQuota", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgQuotaCmd" + } + }, { "type": "string", - "name": "query_history_uid", + "name": "quota_target", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/query-history/{query_history_uid}": { - "delete": { - "description": "Deletes an existing query in query history as specified by the UID. This operation cannot be reverted.", - "tags": ["query_history"], - "summary": "Delete query in query history.", - "operationId": "deleteQuery", + "/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": ["orgs"], + "summary": "Get Users in Organization.", + "operationId": "adminGetOrgUsers", "parameters": [ { - "type": "string", - "name": "query_history_uid", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryDeleteQueryResponse" + "$ref": "#/responses/getOrgUsersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "description": "Updates comment for query in query history as specified by the UID.", - "tags": ["query_history"], - "summary": "Update comment for query in query history.", - "operationId": "patchQueryComment", + "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": ["orgs"], + "summary": "Add a new user to the current organization", + "operationId": "adminAddOrgUser", "parameters": [ - { - "type": "string", - "name": "query_history_uid", - "in": "path", - "required": true - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" + "$ref": "#/definitions/AddOrgUserCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/getQueryHistoryResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/recording-rules": { - "get": { - "tags": ["recording_rules", "enterprise"], - "summary": "Get all recording rules.", - "operationId": "listRecordingRules", + "/orgs/{org_id}/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + "tags": ["orgs"], + "summary": "Delete user in current organization", + "operationId": "adminDeleteOrgUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/listRecordingRulesResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6319,31 +6351,46 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "put": { - "tags": ["recording_rules", "enterprise"], - "summary": "Update a recording rule.", - "operationId": "updateRecordingRule", + "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": ["orgs"], + "summary": "Update Users in Organization.", + "operationId": "adminUpdateOrgUser", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RecordingRuleJSON" + "$ref": "#/definitions/UpdateOrgUserCommand" } + }, + { + "type": "integer", + "format": "int64", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/recordingRuleResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6351,65 +6398,57 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "post": { - "tags": ["recording_rules", "enterprise"], - "summary": "Create a new recording rule.", - "operationId": "createRecordingRule", + } + }, + "/playlists": { + "get": { + "tags": ["playlists"], + "summary": "Get playlists.", + "operationId": "searchPlaylists", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RecordingRuleJSON" - } + "type": "string", + "name": "query", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "in:limit", + "name": "limit", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/recordingRuleResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" + "$ref": "#/responses/searchPlaylistsResponse" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/recording-rules/test": { + }, "post": { - "tags": ["recording_rules", "enterprise"], - "summary": "Test a recording rule.", - "operationId": "testCreateRecordingRule", + "tags": ["playlists"], + "summary": "Create playlist.", + "operationId": "createPlaylist", "parameters": [ { - "name": "body", + "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RecordingRuleJSON" + "$ref": "#/definitions/CreatePlaylistCommand" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/createPlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6420,23 +6459,28 @@ "404": { "$ref": "#/responses/notFoundError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/recording-rules/writer": { + "/playlists/{uid}": { "get": { - "tags": ["recording_rules", "enterprise"], - "summary": "Get the write target.", - "operationId": "getRecordingRuleWriteTarget", + "tags": ["playlists"], + "summary": "Get playlist by UID.", + "operationId": "getPlaylist", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/recordingRuleWriteTargetResponse" + "$ref": "#/responses/getPlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6452,23 +6496,29 @@ } } }, - "post": { - "tags": ["recording_rules", "enterprise"], - "summary": "Create a new write target.", - "operationId": "createRecordingRuleWriteTarget", + "put": { + "tags": ["playlists"], + "summary": "Update playlist.", + "operationId": "updatePlaylist", "parameters": [ { - "name": "body", + "name": "Body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + "$ref": "#/definitions/UpdatePlaylistCommand" } - } + }, + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } ], "responses": { "200": { - "$ref": "#/responses/recordingRuleWriteTargetResponse" + "$ref": "#/responses/updatePlaylistResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6479,18 +6529,23 @@ "404": { "$ref": "#/responses/notFoundError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "delete": { - "tags": ["recording_rules", "enterprise"], - "summary": "Delete the write target.", - "operationId": "deleteRecordingRuleWriteTarget", + "tags": ["playlists"], + "summary": "Delete pllaylist.", + "operationId": "deletePlaylist", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], "responses": { "200": { "$ref": "#/responses/okResponse" @@ -6510,23 +6565,22 @@ } } }, - "/recording-rules/{recordingRuleID}": { - "delete": { - "tags": ["recording_rules", "enterprise"], - "summary": "Delete a recording rule.", - "operationId": "deleteRecordingRule", + "/playlists/{uid}/dashboards": { + "get": { + "tags": ["playlists"], + "summary": "Get playlist dashboards.", + "operationId": "getPlaylistDashboards", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "recordingRuleID", + "type": "string", + "name": "uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getPlaylistDashboardsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6543,15 +6597,22 @@ } } }, - "/reports": { + "/playlists/{uid}/items": { "get": { - "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", - "tags": ["reports", "enterprise"], - "summary": "List reports.", - "operationId": "getReports", + "tags": ["playlists"], + "summary": "Get playlist items.", + "operationId": "getPlaylistItems", + "parameters": [ + { + "type": "string", + "name": "uid", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getReportsResponse" + "$ref": "#/responses/getPlaylistItemsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6559,29 +6620,111 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$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.", + "tags": ["query_history"], + "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", + "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "Limit the number of returned results", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "From range for the query history search", + "name": "from", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "To range for the query history search", + "name": "to", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQueryHistorySearchResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { - "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", - "tags": ["reports", "enterprise"], - "summary": "Create a report.", - "operationId": "createReport", + "description": "Adds new query to query history.", + "tags": ["query_history"], + "summary": "Add query to query history.", + "operationId": "createQuery", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateOrUpdateConfigCmd" + "$ref": "#/definitions/CreateQueryInQueryHistoryCommand" } } ], "responses": { "200": { - "$ref": "#/responses/createReportResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6589,37 +6732,31 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/reports/email": { + "/query-history/migrate": { "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", + "description": "Adds multiple queries to query history.", + "tags": ["query_history"], + "summary": "Migrate queries to query history.", + "operationId": "migrateQueries", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ReportEmailDTO" + "$ref": "#/definitions/MigrateQueriesToQueryHistoryCommand" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryMigrationResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6627,41 +6764,29 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/reports/render/pdf/{DashboardID}": { - "get": { - "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", - "produces": ["application/pdf"], - "tags": ["reports", "enterprise"], - "summary": "Render report for dashboard.", - "operationId": "renderReportPDF", - "deprecated": true, + "/query-history/star/{query_history_uid}": { + "post": { + "description": "Adds star to query in query history as specified by the UID.", + "tags": ["query_history"], + "summary": "Add star to query in query history.", + "operationId": "starQuery", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "DashboardID", + "type": "string", + "name": "query_history_uid", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/contentResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getQueryHistoryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6670,21 +6795,23 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/reports/render/pdfs": { - "get": { - "description": "Available to all users and with a valid license.", - "produces": ["application/pdf"], - "tags": ["reports", "enterprise"], - "summary": "Render report for multiple dashboards.", - "operationId": "renderReportPDFs", + }, + "delete": { + "description": "Removes star from query in query history as specified by the UID.", + "tags": ["query_history"], + "summary": "Remove star to query in query history.", + "operationId": "unstarQuery", + "parameters": [ + { + "type": "string", + "name": "query_history_uid", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/contentResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/getQueryHistoryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6695,45 +6822,56 @@ } } }, - "/reports/settings": { - "get": { - "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:read`x.", - "tags": ["reports", "enterprise"], - "summary": "Get settings.", - "operationId": "getReportSettings", + "/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": ["query_history"], + "summary": "Delete query in query history.", + "operationId": "deleteQuery", + "parameters": [ + { + "type": "string", + "name": "query_history_uid", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getReportSettingsResponse" + "$ref": "#/responses/getQueryHistoryDeleteQueryResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, - "post": { - "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:write`xx.", - "tags": ["reports", "enterprise"], - "summary": "Save settings.", - "operationId": "saveReportSettings", + "patch": { + "description": "Updates comment for query in query history as specified by the UID.", + "tags": ["query_history"], + "summary": "Update comment for query in query history.", + "operationId": "patchQueryComment", "parameters": [ + { + "type": "string", + "name": "query_history_uid", + "in": "path", + "required": true + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/SettingsDTO" + "$ref": "#/definitions/PatchQueryCommentInQueryHistoryCommand" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getQueryHistoryResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -6741,37 +6879,52 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules": { + "get": { + "tags": ["recording_rules", "enterprise"], + "summary": "Get all recording rules.", + "operationId": "listRecordingRules", + "responses": { + "200": { + "$ref": "#/responses/listRecordingRulesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/reports/test-email": { - "post": { - "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", - "tags": ["reports", "enterprise"], - "summary": "Send test report via email.", - "operationId": "sendTestEmail", + }, + "put": { + "tags": ["recording_rules", "enterprise"], + "summary": "Update a recording rule.", + "operationId": "updateRecordingRule", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateOrUpdateConfigCmd" + "$ref": "#/definitions/RecordingRuleJSON" } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/recordingRuleResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6786,29 +6939,24 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/reports/{reportID}": { - "get": { - "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", - "tags": ["reports", "enterprise"], - "summary": "Get a report.", - "operationId": "getReport", + }, + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Create a new recording rule.", + "operationId": "createRecordingRule", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "reportID", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } } ], "responses": { "200": { - "$ref": "#/responses/getReportResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/recordingRuleResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6823,36 +6971,27 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { - "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", - "tags": ["reports", "enterprise"], - "summary": "Update a report.", - "operationId": "updateReport", + } + }, + "/recording-rules/test": { + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Test a recording rule.", + "operationId": "testCreateRecordingRule", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CreateOrUpdateConfigCmd" + "$ref": "#/definitions/RecordingRuleJSON" } - }, - { - "type": "integer", - "format": "int64", - "name": "reportID", - "in": "path", - "required": true } ], "responses": { "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -6862,31 +7001,23 @@ "404": { "$ref": "#/responses/notFoundError" }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", - "tags": ["reports", "enterprise"], - "summary": "Delete a report.", - "operationId": "deleteReport", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "reportID", - "in": "path", - "required": true - } - ], + } + }, + "/recording-rules/writer": { + "get": { + "tags": ["recording_rules", "enterprise"], + "summary": "Get the write target.", + "operationId": "getRecordingRuleWriteTarget", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/recordingRuleWriteTargetResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -6901,173 +7032,149 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/saml/acs": { + }, "post": { - "tags": ["saml", "enterprise"], - "summary": "It performs assertion Consumer Service (ACS).", - "operationId": "postACS", + "tags": ["recording_rules", "enterprise"], + "summary": "Create a new write target.", + "operationId": "createRecordingRuleWriteTarget", "parameters": [ { - "type": "string", - "name": "RelayState", - "in": "query" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } } ], "responses": { - "302": { - "description": "" + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/saml/metadata": { - "get": { - "produces": ["application/xml;application/samlmetadata+xml"], - "tags": ["saml", "enterprise"], - "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", - "operationId": "getSAMLMetadata", + }, + "delete": { + "tags": ["recording_rules", "enterprise"], + "summary": "Delete the write target.", + "operationId": "deleteRecordingRuleWriteTarget", "responses": { "200": { - "$ref": "#/responses/contentResponse" + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/saml/slo": { - "post": { - "tags": ["saml", "enterprise"], - "summary": "It performs Single Logout (SLO) callback.", - "operationId": "postSLO", + "/recording-rules/{recordingRuleID}": { + "delete": { + "tags": ["recording_rules", "enterprise"], + "summary": "Delete a recording rule.", + "operationId": "deleteRecordingRule", "parameters": [ { - "type": "string", - "name": "SAMLRequest", - "in": "query" - }, - { - "type": "string", - "name": "SAMLResponse", - "in": "query" + "type": "integer", + "format": "int64", + "name": "recordingRuleID", + "in": "path", + "required": true } ], "responses": { - "302": { - "description": "" + "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": { + "/reports": { "get": { - "tags": ["search"], - "operationId": "search", - "parameters": [ - { - "type": "string", - "description": "Search Query", - "name": "query", - "in": "query" + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", + "tags": ["reports", "enterprise"], + "summary": "List reports.", + "operationId": "getReports", + "responses": { + "200": { + "$ref": "#/responses/getReportsResponse" }, - { - "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", - "name": "dashboardIds", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "List of folder id’s to search in for dashboards", - "name": "folderIds", - "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" + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "enum": ["Edit", "View"], - "type": "string", - "default": "View", - "description": "Set to `Edit` to return dashboards/folders that the user can edit", - "name": "permission", - "in": "query" + "403": { + "$ref": "#/responses/forbiddenError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "tags": ["reports", "enterprise"], + "summary": "Create a report.", + "operationId": "createReport", + "parameters": [ { - "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": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } } ], "responses": { "200": { - "$ref": "#/responses/searchResponse" + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "422": { - "$ref": "#/responses/unprocessableEntityError" + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" @@ -7075,39 +7182,25 @@ } } }, - "/search/sorting": { - "get": { - "description": "List search sorting options", - "tags": ["search"], - "operationId": "searchSorting", - "responses": { - "200": { - "$ref": "#/responses/searchSortingResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - } - } - } - }, - "/serviceaccounts": { + "/reports/email": { "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"], - "summary": "Create service account", - "operationId": "createServiceAccount", + "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", + "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/CreateServiceAccountForm" + "$ref": "#/definitions/ReportEmailDTO" } } ], "responses": { - "201": { - "$ref": "#/responses/createServiceAccountResponse" + "200": { + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -7118,84 +7211,58 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/serviceaccounts/search": { + "/reports/render/pdf/{DashboardID}": { "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": ["service_accounts"], - "summary": "Search service accounts with Paging", - "operationId": "searchOrgServiceAccountsWithPaging", + "description": "Please refer to [reports enterprise](#/reports/renderReportPDFs) instead. This will be removed in Grafana 10.", + "produces": ["application/pdf"], + "tags": ["reports", "enterprise"], + "summary": "Render report for dashboard.", + "operationId": "renderReportPDF", + "deprecated": true, "parameters": [ - { - "type": "boolean", - "name": "Disabled", - "in": "query" - }, - { - "type": "boolean", - "name": "expiredTokens", - "in": "query" - }, - { - "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" - }, { "type": "integer", "format": "int64", - "description": "The default value is 1.", - "name": "page", - "in": "query" + "name": "DashboardID", + "in": "path", + "required": true } ], "responses": { "200": { - "$ref": "#/responses/searchOrgServiceAccountsWithPagingResponse" + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/serviceaccounts/{serviceAccountId}": { + "/reports/render/pdfs": { "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": ["service_accounts"], - "summary": "Get single serviceaccount by Id", - "operationId": "retrieveServiceAccount", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", - "in": "path", - "required": true - } - ], + "description": "Available to all users and with a valid license.", + "produces": ["application/pdf"], + "tags": ["reports", "enterprise"], + "summary": "Render report for multiple dashboards.", + "operationId": "renderReportPDFs", "responses": { "200": { - "$ref": "#/responses/retrieveServiceAccountResponse" + "$ref": "#/responses/contentResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -7203,29 +7270,46 @@ "401": { "$ref": "#/responses/unauthorisedError" }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/settings": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:read`x.", + "tags": ["reports", "enterprise"], + "summary": "Get settings.", + "operationId": "getReportSettings", + "responses": { + "200": { + "$ref": "#/responses/getReportSettingsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "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": ["service_accounts"], - "summary": "Delete service account", - "operationId": "deleteServiceAccount", + "post": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:write`xx.", + "tags": ["reports", "enterprise"], + "summary": "Save settings.", + "operationId": "saveReportSettings", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SettingsDTO" + } } ], "responses": { @@ -7245,31 +7329,27 @@ "$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)", - "tags": ["service_accounts"], - "summary": "Update service account", - "operationId": "updateServiceAccount", + } + }, + "/reports/test-email": { + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", + "tags": ["reports", "enterprise"], + "summary": "Send test report via email.", + "operationId": "sendTestEmail", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", - "in": "path", - "required": true - }, - { - "name": "Body", + "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/UpdateServiceAccountForm" + "$ref": "#/definitions/CreateOrUpdateConfigCmd" } } ], "responses": { "200": { - "$ref": "#/responses/updateServiceAccountResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -7289,24 +7369,24 @@ } } }, - "/serviceaccounts/{serviceAccountId}/tokens": { + "/reports/{reportID}": { "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.", - "tags": ["service_accounts"], - "summary": "Get service account tokens", - "operationId": "listTokens", + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:id:\u003creport ID\u003e`.", + "tags": ["reports", "enterprise"], + "summary": "Get a report.", + "operationId": "getReport", "parameters": [ { "type": "integer", "format": "int64", - "name": "serviceAccountId", + "name": "reportID", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/listTokensResponse" + "$ref": "#/responses/getReportResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -7317,35 +7397,39 @@ "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)", - "tags": ["service_accounts"], - "summary": "Create service account tokens", - "operationId": "createToken", + "put": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", + "tags": ["reports", "enterprise"], + "summary": "Update a report.", + "operationId": "updateReport", "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + }, { "type": "integer", "format": "int64", - "name": "serviceAccountId", + "name": "reportID", "in": "path", "required": true - }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/AddServiceAccountTokenCommand" - } } ], "responses": { "200": { - "$ref": "#/responses/createTokenResponse" + "$ref": "#/responses/okResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -7359,33 +7443,21 @@ "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.", - "tags": ["service_accounts"], - "summary": "Delete service account tokens", - "operationId": "deleteToken", + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.delete` with scope `reports:id:\u003creport ID\u003e`.", + "tags": ["reports", "enterprise"], + "summary": "Delete a report.", + "operationId": "deleteReport", "parameters": [ { "type": "integer", "format": "int64", - "name": "tokenId", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "name": "serviceAccountId", + "name": "reportID", "in": "path", "required": true } @@ -7412,43 +7484,21 @@ } } }, - "/snapshot/shared-options": { - "get": { - "tags": ["snapshots"], - "summary": "Get snapshot sharing settings.", - "operationId": "getSnapshotSharingOptions", - "responses": { - "200": { - "$ref": "#/responses/getSnapshotSharingOptionsResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - } - } - } - }, - "/snapshots": { + "/saml/acs": { "post": { - "description": "Snapshot public mode should be enabled or authentication is required.", - "tags": ["snapshots"], - "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": "createSnapshot", + "tags": ["saml", "enterprise"], + "summary": "It performs assertion Consumer Service (ACS).", + "operationId": "postACS", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateDashboardSnapshotCommand" - } + "type": "string", + "name": "RelayState", + "in": "query" } ], "responses": { - "200": { - "$ref": "#/responses/createSnapshotResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "302": { + "description": "(empty)" }, "403": { "$ref": "#/responses/forbiddenError" @@ -7459,168 +7509,146 @@ } } }, - "/snapshots-delete/{deleteKey}": { + "/saml/metadata": { "get": { - "description": "Snapshot public mode should be enabled or authentication is required.", - "tags": ["snapshots"], - "summary": "Delete Snapshot by deleteKey.", - "operationId": "deleteSnapshotByDeleteKey", - "parameters": [ - { - "type": "string", - "name": "deleteKey", - "in": "path", - "required": true - } - ], + "produces": ["application/xml;application/samlmetadata+xml"], + "tags": ["saml", "enterprise"], + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "operationId": "getSAMLMetadata", "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" + "$ref": "#/responses/contentResponse" } } } }, - "/snapshots/{key}": { - "get": { - "tags": ["snapshots"], - "summary": "Get Snapshot by Key.", - "operationId": "getSnapshotByKey", + "/saml/slo": { + "post": { + "tags": ["saml", "enterprise"], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", "parameters": [ { "type": "string", - "name": "key", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/snapshotResponse" - }, - "404": { - "$ref": "#/responses/notFoundError" + "name": "SAMLRequest", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - }, - "delete": { - "tags": ["snapshots"], - "summary": "Delete Snapshot by Key.", - "operationId": "deleteSnapshotByKey", - "parameters": [ { "type": "string", - "name": "key", - "in": "path", - "required": true + "name": "SAMLResponse", + "in": "query" } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "302": { + "description": "(empty)" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams": { - "post": { - "tags": ["teams"], - "summary": "Add Team.", - "operationId": "createTeam", + "/search": { + "get": { + "tags": ["search"], + "operationId": "search", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateTeamCommand" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/createTeamResponse" + "type": "string", + "description": "Search Query", + "name": "query", + "in": "query" }, - "401": { - "$ref": "#/responses/unauthorisedError" + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "List of tags to search for", + "name": "tag", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "enum": ["dash-folder", "dash-db"], + "type": "string", + "description": "Type to search for, dash-folder or dash-db", + "name": "type", + "in": "query" }, - "409": { - "$ref": "#/responses/conflictError" + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "List of dashboard id’s to search for", + "name": "dashboardIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "List of folder id’s to search in for dashboards", + "name": "folderIds", + "in": "query" + }, + { + "type": "boolean", + "description": "Flag indicating if only starred Dashboards should be returned", + "name": "starred", + "in": "query" }, - "500": { - "$ref": "#/responses/internalServerError" - } - } - } - }, - "/teams/search": { - "get": { - "tags": ["teams"], - "summary": "Team Search With Paging.", - "operationId": "searchTeams", - "parameters": [ { "type": "integer", "format": "int64", - "default": 1, - "name": "page", + "description": "Limit the number of returned results (max 5000)", + "name": "limit", "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": "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", - "name": "name", + "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", - "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", + "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/searchTeamsResponse" + "$ref": "#/responses/searchResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" + "422": { + "$ref": "#/responses/unprocessableEntityError" }, "500": { "$ref": "#/responses/internalServerError" @@ -7628,65 +7656,39 @@ } } }, - "/teams/{teamId}/groups": { + "/search/sorting": { "get": { - "tags": ["sync_team_groups", "enterprise"], - "summary": "Get External Groups.", - "operationId": "getTeamGroupsApi", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "teamId", - "in": "path", - "required": true - } - ], + "description": "List search sorting options", + "tags": ["search"], + "operationId": "searchSorting", "responses": { "200": { - "$ref": "#/responses/getTeamGroupsApiResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/searchSortingResponse" }, "401": { "$ref": "#/responses/unauthorisedError" - }, - "403": { - "$ref": "#/responses/forbiddenError" - }, - "404": { - "$ref": "#/responses/notFoundError" - }, - "500": { - "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/serviceaccounts": { "post": { - "tags": ["sync_team_groups", "enterprise"], - "summary": "Add External Group.", - "operationId": "addTeamGroupApi", + "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"], + "summary": "Create service account", + "operationId": "createServiceAccount", "parameters": [ { - "name": "body", + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/TeamGroupMapping" + "$ref": "#/definitions/CreateServiceAccountForm" } - }, - { - "type": "integer", - "format": "int64", - "name": "teamId", - "in": "path", - "required": true } ], "responses": { - "200": { - "$ref": "#/responses/okResponse" + "201": { + "$ref": "#/responses/createServiceAccountResponse" }, "400": { "$ref": "#/responses/badRequestError" @@ -7697,41 +7699,53 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams/{teamId}/groups/{groupId}": { - "delete": { - "tags": ["sync_team_groups", "enterprise"], - "summary": "Remove External Group.", - "operationId": "removeTeamGroupApi", + "/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": ["service_accounts"], + "summary": "Search service accounts with Paging", + "operationId": "searchOrgServiceAccountsWithPaging", "parameters": [ + { + "type": "boolean", + "name": "Disabled", + "in": "query" + }, + { + "type": "boolean", + "name": "expiredTokens", + "in": "query" + }, { "type": "string", - "name": "groupId", - "in": "path", - "required": true + "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", - "name": "teamId", - "in": "path", - "required": true + "description": "The default value is 1000.", + "name": "perpage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "description": "The default value is 1.", + "name": "page", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/searchOrgServiceAccountsWithPagingResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7739,31 +7753,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams/{team_id}": { + "/serviceaccounts/{serviceAccountId}": { "get": { - "tags": ["teams"], - "summary": "Get Team By ID.", - "operationId": "getTeam", + "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": ["service_accounts"], + "summary": "Get single serviceaccount by Id", + "operationId": "retrieveServiceAccount", "parameters": [ { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "name": "serviceAccountId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getTeamResponse" + "$ref": "#/responses/retrieveServiceAccountResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7779,22 +7795,16 @@ } } }, - "put": { - "tags": ["teams"], - "summary": "Update Team.", - "operationId": "updateTeam", + "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": ["service_accounts"], + "summary": "Delete service account", + "operationId": "deleteServiceAccount", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateTeamCommand" - } - }, - { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "name": "serviceAccountId", "in": "path", "required": true } @@ -7803,38 +7813,47 @@ "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": { - "tags": ["teams"], - "summary": "Delete Team By ID.", - "operationId": "deleteTeamByID", + "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": ["service_accounts"], + "summary": "Update service account", + "operationId": "updateServiceAccount", "parameters": [ { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "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" @@ -7851,22 +7870,27 @@ } } }, - "/teams/{team_id}/members": { + "/serviceaccounts/{serviceAccountId}/tokens": { "get": { - "tags": ["teams"], - "summary": "Get Team Members.", - "operationId": "getTeamMembers", - "parameters": [ + "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": ["service_accounts"], + "summary": "Get service account tokens", + "operationId": "listTokens", + "parameters": [ { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "name": "serviceAccountId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/listTokensResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7874,37 +7898,38 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } }, "post": { - "tags": ["teams"], - "summary": "Add Team Member.", - "operationId": "addTeamMember", + "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": ["service_accounts"], + "summary": "Create service account tokens", + "operationId": "createToken", "parameters": [ { - "name": "body", + "type": "integer", + "format": "int64", + "name": "serviceAccountId", + "in": "path", + "required": true + }, + { + "name": "Body", "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/AddTeamMemberCommand" + "$ref": "#/definitions/AddServiceAccountTokenCommand" } - }, - { - "type": "string", - "name": "team_id", - "in": "path", - "required": true } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/createTokenResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7915,36 +7940,33 @@ "404": { "$ref": "#/responses/notFoundError" }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams/{team_id}/members/{user_id}": { - "put": { - "tags": ["teams"], - "summary": "Update Team Member.", - "operationId": "updateTeamMember", + "/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": ["service_accounts"], + "summary": "Delete service account tokens", + "operationId": "deleteToken", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateTeamMemberCommand" - } - }, - { - "type": "string", - "name": "team_id", + "type": "integer", + "format": "int64", + "name": "tokenId", "in": "path", "required": true }, { "type": "integer", "format": "int64", - "name": "user_id", + "name": "serviceAccountId", "in": "path", "required": true } @@ -7953,6 +7975,9 @@ "200": { "$ref": "#/responses/okResponse" }, + "400": { + "$ref": "#/responses/badRequestError" + }, "401": { "$ref": "#/responses/unauthorisedError" }, @@ -7966,29 +7991,42 @@ "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "tags": ["teams"], - "summary": "Remove Member From Team.", - "operationId": "removeTeamMember", - "parameters": [ - { - "type": "string", - "name": "team_id", - "in": "path", - "required": true + } + }, + "/snapshot/shared-options": { + "get": { + "tags": ["snapshots"], + "summary": "Get snapshot sharing settings.", + "operationId": "getSnapshotSharingOptions", + "responses": { + "200": { + "$ref": "#/responses/getSnapshotSharingOptionsResponse" }, + "401": { + "$ref": "#/responses/unauthorisedError" + } + } + } + }, + "/snapshots": { + "post": { + "description": "Snapshot public mode should be enabled or authentication is required.", + "tags": ["snapshots"], + "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": "createSnapshot", + "parameters": [ { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateDashboardSnapshotCommand" + } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/createSnapshotResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -7996,87 +8034,85 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/teams/{team_id}/preferences": { + "/snapshots-delete/{deleteKey}": { "get": { - "tags": ["teams"], - "summary": "Get Team Preferences.", - "operationId": "getTeamPreferences", + "description": "Snapshot public mode should be enabled or authentication is required.", + "tags": ["snapshots"], + "summary": "Delete Snapshot by deleteKey.", + "operationId": "deleteSnapshotByDeleteKey", "parameters": [ { "type": "string", - "name": "team_id", + "name": "deleteKey", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/getPreferencesResponse" + "$ref": "#/responses/okResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - }, - "put": { - "tags": ["teams"], - "summary": "Update Team Preferences.", - "operationId": "updateTeamPreferences", + } + }, + "/snapshots/{key}": { + "get": { + "tags": ["snapshots"], + "summary": "Get Snapshot by Key.", + "operationId": "getSnapshotByKey", "parameters": [ { "type": "string", - "name": "team_id", + "name": "key", "in": "path", "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePrefsCmd" - } } ], "responses": { "200": { - "$ref": "#/responses/okResponse" - }, - "400": { - "$ref": "#/responses/badRequestError" + "$ref": "#/responses/snapshotResponse" }, - "401": { - "$ref": "#/responses/unauthorisedError" + "404": { + "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/user": { - "get": { - "tags": ["signed_in_user"], - "summary": "Get signed in User.", - "operationId": "getSignedInUser", + }, + "delete": { + "tags": ["snapshots"], + "summary": "Delete Snapshot by Key.", + "operationId": "deleteSnapshotByKey", + "parameters": [ + { + "type": "string", + "name": "key", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/userResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "$ref": "#/responses/okResponse" }, "403": { "$ref": "#/responses/forbiddenError" @@ -8088,25 +8124,26 @@ "$ref": "#/responses/internalServerError" } } - }, - "put": { - "tags": ["signed_in_user"], - "summary": "Update signed in User.", - "operationId": "updateSignedInUser", + } + }, + "/teams": { + "post": { + "tags": ["teams"], + "summary": "Add Team.", + "operationId": "createTeam", "parameters": [ { - "description": "To change the email, name, login, theme, provide another one.", "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateUserCommand" + "$ref": "#/definitions/CreateTeamCommand" } } ], "responses": { "200": { - "$ref": "#/responses/userResponse" + "$ref": "#/responses/createTeamResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8114,42 +8151,51 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/user/auth-tokens": { + "/teams/search": { "get": { - "description": "Return a list of all auth tokens (devices) that the actual user currently have logged in from.", - "tags": ["signed_in_user"], - "summary": "Auth tokens of the actual User.", - "operationId": "getSignedInUserAuthTokens", - "responses": { - "200": { - "$ref": "#/responses/getAuthTokensResponse" - }, - "401": { - "$ref": "#/responses/unauthorisedError" + "tags": ["teams"], + "summary": "Team Search With Paging.", + "operationId": "searchTeams", + "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1, + "name": "page", + "in": "query" }, - "403": { - "$ref": "#/responses/forbiddenError" + { + "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" }, - "500": { - "$ref": "#/responses/internalServerError" + { + "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" } - } - } - }, - "/user/helpflags/clear": { - "get": { - "tags": ["signed_in_user"], - "summary": "Clear user help flag.", - "operationId": "clearHelpFlags", + ], "responses": { "200": { - "$ref": "#/responses/helpFlagResponse" + "$ref": "#/responses/searchTeamsResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8163,22 +8209,26 @@ } } }, - "/user/helpflags/{flag_id}": { - "put": { - "tags": ["signed_in_user"], - "summary": "Set user help flag.", - "operationId": "setHelpFlag", + "/teams/{teamId}/groups": { + "get": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Get External Groups.", + "operationId": "getTeamGroupsApi", "parameters": [ { - "type": "string", - "name": "flag_id", + "type": "integer", + "format": "int64", + "name": "teamId", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/helpFlagResponse" + "$ref": "#/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8186,26 +8236,41 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/user/orgs": { - "get": { - "security": [ + }, + "post": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Add External Group.", + "operationId": "addTeamGroupApi", + "parameters": [ { - "basic": [] + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamGroupMapping" + } + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], - "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/getUserOrgListResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8213,32 +8278,33 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/user/password": { - "put": { - "security": [ - { - "basic": [] - } - ], - "description": "Changes the password for the user.", - "tags": ["signed_in_user"], - "summary": "Change Password.", - "operationId": "changeUserPassword", + "/teams/{teamId}/groups/{groupId}": { + "delete": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Remove External Group.", + "operationId": "removeTeamGroupApi", "parameters": [ { - "description": "To change the email, name, login, theme, provide another one.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ChangeUserPasswordCommand" - } + "type": "string", + "name": "groupId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "teamId", + "in": "path", + "required": true } ], "responses": { @@ -8254,97 +8320,134 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/user/preferences": { + "/teams/{team_id}": { "get": { - "tags": ["user_preferences"], - "summary": "Get user preferences.", - "operationId": "getUserPreferences", + "tags": ["teams"], + "summary": "Get Team By ID.", + "operationId": "getTeam", + "parameters": [ + { + "type": "string", + "name": "team_id", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getPreferencesResponse" + "$ref": "#/responses/getTeamResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, "put": { - "description": "Omitting a key (`theme`, `homeDashboardId`, `timezone`) will cause the current value to be replaced with the system default value.", - "tags": ["user_preferences"], - "summary": "Update user preferences.", - "operationId": "updateUserPreferences", + "tags": ["teams"], + "summary": "Update Team.", + "operationId": "updateTeam", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdatePrefsCmd" + "$ref": "#/definitions/UpdateTeamCommand" } + }, + { + "type": "string", + "name": "team_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" + }, + "409": { + "$ref": "#/responses/conflictError" + }, "500": { "$ref": "#/responses/internalServerError" } } }, - "patch": { - "tags": ["user_preferences"], - "summary": "Patch user preferences.", - "operationId": "patchUserPreferences", + "delete": { + "tags": ["teams"], + "summary": "Delete Team By ID.", + "operationId": "deleteTeamByID", "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchPrefsCmd" - } + "type": "string", + "name": "team_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" } } } }, - "/user/quotas": { + "/teams/{team_id}/members": { "get": { - "tags": ["signed_in_user"], - "summary": "Fetch user quota.", - "operationId": "getUserQuotas", + "tags": ["teams"], + "summary": "Get Team Members.", + "operationId": "getTeamMembers", + "parameters": [ + { + "type": "string", + "name": "team_id", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getQuotaResponse" + "$ref": "#/responses/getTeamMembersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8359,84 +8462,107 @@ "$ref": "#/responses/internalServerError" } } - } - }, - "/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": ["signed_in_user"], - "summary": "Revoke an auth token of the actual User.", - "operationId": "revokeSignedInAuthToken", + "tags": ["teams"], + "summary": "Add Team Member.", + "operationId": "addTeamMember", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RevokeAuthTokenCmd" + "$ref": "#/definitions/AddTeamMemberCommand" } + }, + { + "type": "string", + "name": "team_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" } } } }, - "/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", + "/teams/{team_id}/members/{user_id}": { + "put": { + "tags": ["teams"], + "summary": "Update Team Member.", + "operationId": "updateTeamMember", "parameters": [ { - "type": "string", - "name": "dashboard_id", - "in": "path", - "required": true - } + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTeamMemberCommand" + } + }, + { + "type": "string", + "name": "team_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true + } ], "responses": { "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, "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": ["signed_in_user"], - "summary": "Unstar a dashboard.", - "operationId": "unstarDashboard", + "tags": ["teams"], + "summary": "Remove Member From Team.", + "operationId": "removeTeamMember", "parameters": [ { "type": "string", - "name": "dashboard_id", + "name": "team_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } @@ -8445,56 +8571,64 @@ "200": { "$ref": "#/responses/okResponse" }, - "400": { - "$ref": "#/responses/badRequestError" - }, "401": { "$ref": "#/responses/unauthorisedError" }, "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/user/teams": { + "/teams/{team_id}/preferences": { "get": { - "description": "Return a list of all teams that the current user is member of.", - "tags": ["signed_in_user"], - "summary": "Teams that the actual User is member of.", - "operationId": "getSignedInUserTeamList", + "tags": ["teams"], + "summary": "Get Team Preferences.", + "operationId": "getTeamPreferences", + "parameters": [ + { + "type": "string", + "name": "team_id", + "in": "path", + "required": true + } + ], "responses": { "200": { - "$ref": "#/responses/getUserOrgListResponse" + "$ref": "#/responses/getPreferencesResponse" }, "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "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", + }, + "put": { + "tags": ["teams"], + "summary": "Update Team Preferences.", + "operationId": "updateTeamPreferences", "parameters": [ { - "type": "integer", - "format": "int64", - "name": "org_id", + "type": "string", + "name": "team_id", "in": "path", "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } } ], "responses": { @@ -8507,42 +8641,20 @@ "401": { "$ref": "#/responses/unauthorisedError" }, - "403": { - "$ref": "#/responses/forbiddenError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/users": { + "/user": { "get": { - "description": "Returns all users that the authenticated user has permission to view, admin permission required.", - "tags": ["users"], - "summary": "Get users.", - "operationId": "searchUsers", - "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" - } - ], + "tags": ["signed_in_user"], + "summary": "Get signed in User.", + "operationId": "getSignedInUser", "responses": { "200": { - "$ref": "#/responses/searchUsersResponse" + "$ref": "#/responses/userResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8550,24 +8662,27 @@ "403": { "$ref": "#/responses/forbiddenError" }, + "404": { + "$ref": "#/responses/notFoundError" + }, "500": { "$ref": "#/responses/internalServerError" } } - } - }, - "/users/lookup": { - "get": { - "tags": ["users"], - "summary": "Get user by login or email.", - "operationId": "getUserByLoginOrEmail", + }, + "put": { + "tags": ["signed_in_user"], + "summary": "Update signed in User.", + "operationId": "updateSignedInUser", "parameters": [ { - "type": "string", - "description": "loginOrEmail of the user", - "name": "loginOrEmail", - "in": "query", - "required": true + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserCommand" + } } ], "responses": { @@ -8580,23 +8695,21 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/users/search": { + "/user/auth-tokens": { "get": { - "tags": ["users"], - "summary": "Get users with paging.", - "operationId": "searchUsersWithPaging", + "description": "Return a list of all auth tokens (devices) that the actual user currently have logged in from.", + "tags": ["signed_in_user"], + "summary": "Auth tokens of the actual User.", + "operationId": "getSignedInUserAuthTokens", "responses": { "200": { - "$ref": "#/responses/searchUsersResponse" + "$ref": "#/responses/getAuthTokensResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8604,32 +8717,20 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/users/{user_id}": { + "/user/helpflags/clear": { "get": { - "tags": ["users"], - "summary": "Get user by id.", - "operationId": "getUserByID", - "parameters": [ - { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true - } - ], + "tags": ["signed_in_user"], + "summary": "Clear user help flag.", + "operationId": "clearHelpFlags", "responses": { "200": { - "$ref": "#/responses/userResponse" + "$ref": "#/responses/helpFlagResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8637,40 +8738,28 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/user/helpflags/{flag_id}": { "put": { - "description": "Update the user identified by id.", - "tags": ["users"], - "summary": "Update user.", - "operationId": "updateUser", + "tags": ["signed_in_user"], + "summary": "Set user help flag.", + "operationId": "setHelpFlag", "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", + "name": "flag_id", "in": "path", "required": true } ], "responses": { "200": { - "$ref": "#/responses/userResponse" + "$ref": "#/responses/helpFlagResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8678,30 +8767,23 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/users/{user_id}/orgs": { + "/user/orgs": { "get": { - "description": "Get organizations for user identified by id.", - "tags": ["users"], - "summary": "Get organizations for user.", - "operationId": "getUserOrgList", - "parameters": [ + "security": [ { - "type": "integer", - "format": "int64", - "name": "user_id", - "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/getUserOrgListResponse" @@ -8712,33 +8794,40 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/users/{user_id}/teams": { - "get": { - "description": "Get teams for user identified by id.", - "tags": ["users"], - "summary": "Get teams for user.", - "operationId": "getUserTeams", - "parameters": [ + "/user/password": { + "put": { + "security": [ { - "type": "integer", - "format": "int64", - "name": "user_id", - "in": "path", - "required": true + "basic": [] + } + ], + "description": "Changes the password for the user.", + "tags": ["signed_in_user"], + "summary": "Change Password.", + "operationId": "changeUserPassword", + "parameters": [ + { + "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/getUserTeamsResponse" + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -8746,592 +8835,503 @@ "403": { "$ref": "#/responses/forbiddenError" }, - "404": { - "$ref": "#/responses/notFoundError" - }, "500": { "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/alert-rules": { - "post": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Create a new alert rule.", - "operationId": "RoutePostAlertRule", - "parameters": [ - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } - } - ], - "responses": { - "201": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } - }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - } - } - }, - "/v1/provisioning/alert-rules/{UID}": { + "/user/preferences": { "get": { - "tags": ["provisioning"], - "summary": "Get a specific alert rule by UID.", - "operationId": "RouteGetAlertRule", - "parameters": [ - { - "type": "string", - "description": "Alert rule UID", - "name": "UID", - "in": "path", - "required": true - } - ], + "tags": ["user_preferences"], + "summary": "Get user preferences.", + "operationId": "getUserPreferences", "responses": { "200": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "$ref": "#/responses/getPreferencesResponse" }, - "404": { - "description": " Not found." + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "put": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Update an existing alert rule.", - "operationId": "RoutePutAlertRule", + "description": "Omitting a key (`theme`, `homeDashboardId`, `timezone`) will cause the current value to be replaced with the system default value.", + "tags": ["user_preferences"], + "summary": "Update user preferences.", + "operationId": "updateUserPreferences", "parameters": [ { - "type": "string", - "description": "Alert rule UID", - "name": "UID", - "in": "path", - "required": true - }, - { - "name": "Body", + "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" + "$ref": "#/definitions/UpdatePrefsCmd" } } ], "responses": { "200": { - "description": "ProvisionedAlertRule", - "schema": { - "$ref": "#/definitions/ProvisionedAlertRule" - } + "$ref": "#/responses/okResponse" }, "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, - "delete": { - "tags": ["provisioning"], - "summary": "Delete a specific alert rule by UID.", - "operationId": "RouteDeleteAlertRule", + "patch": { + "tags": ["user_preferences"], + "summary": "Patch user preferences.", + "operationId": "patchUserPreferences", "parameters": [ { - "type": "string", - "description": "Alert rule UID", - "name": "UID", - "in": "path", - "required": true + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchPrefsCmd" + } } ], "responses": { - "204": { - "description": " The alert rule was deleted successfully." + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/contact-points": { + "/user/quotas": { "get": { - "tags": ["provisioning"], - "summary": "Get all the contact points.", - "operationId": "RouteGetContactpoints", - "parameters": [ - { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" - } - ], + "tags": ["signed_in_user"], + "summary": "Fetch user quota.", + "operationId": "getUserQuotas", "responses": { "200": { - "description": "ContactPoints", - "schema": { - "$ref": "#/definitions/ContactPoints" - } + "$ref": "#/responses/getQuotaResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - }, + } + }, + "/user/revoke-auth-token": { "post": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Create a contact point.", - "operationId": "RoutePostContactpoints", + "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": ["signed_in_user"], + "summary": "Revoke an auth token of the actual User.", + "operationId": "revokeSignedInAuthToken", "parameters": [ { - "name": "Body", + "name": "body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" + "$ref": "#/definitions/RevokeAuthTokenCmd" } } ], "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" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/contact-points/{UID}": { - "put": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Update an existing contact point.", - "operationId": "RoutePutContactpoint", + "/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", "parameters": [ { "type": "string", - "description": "UID is the contact point unique identifier", - "name": "UID", + "name": "dashboard_id", "in": "path", "required": true - }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/EmbeddedContactPoint" - } } ], "responses": { - "202": { - "description": "Ack", - "schema": { - "$ref": "#/definitions/Ack" - } + "200": { + "$ref": "#/responses/okResponse" }, "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "delete": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Delete a contact point.", - "operationId": "RouteDeleteContactpoints", - "parameters": [ - { - "type": "string", - "description": "UID is the contact point unique identifier", - "name": "UID", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": " The contact point was deleted successfully." - } - } - } - }, - "/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}": { - "get": { - "tags": ["provisioning"], - "summary": "Get a rule group.", - "operationId": "RouteGetAlertRuleGroup", + "description": "Deletes the starring of the given Dashboard for the actual user.", + "tags": ["signed_in_user"], + "summary": "Unstar a dashboard.", + "operationId": "unstarDashboard", "parameters": [ { "type": "string", - "name": "FolderUID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "Group", + "name": "dashboard_id", "in": "path", "required": true } ], "responses": { "200": { - "description": "AlertRuleGroup", - "schema": { - "$ref": "#/definitions/AlertRuleGroup" - } + "$ref": "#/responses/okResponse" }, - "404": { - "description": " Not found." - } - } - }, - "put": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Update the interval of a rule group.", - "operationId": "RoutePutAlertRuleGroup", - "parameters": [ - { - "type": "string", - "name": "FolderUID", - "in": "path", - "required": true + "400": { + "$ref": "#/responses/badRequestError" }, - { - "type": "string", - "name": "Group", - "in": "path", - "required": true + "401": { + "$ref": "#/responses/unauthorisedError" }, - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/AlertRuleGroupMetadata" - } - } - ], - "responses": { - "200": { - "description": "AlertRuleGroupMetadata", - "schema": { - "$ref": "#/definitions/AlertRuleGroupMetadata" - } + "403": { + "$ref": "#/responses/forbiddenError" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/mute-timings": { + "/user/teams": { "get": { - "tags": ["provisioning"], - "summary": "Get all the mute timings.", - "operationId": "RouteGetMuteTimings", + "description": "Return a list of all teams that the current user is member of.", + "tags": ["signed_in_user"], + "summary": "Teams that the actual User is member of.", + "operationId": "getSignedInUserTeamList", "responses": { "200": { - "description": "MuteTimings", - "schema": { - "$ref": "#/definitions/MuteTimings" - } - } - } - }, - "post": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Create a new mute timing.", - "operationId": "RoutePostMuteTiming", - "parameters": [ - { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } - } - ], - "responses": { - "201": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "$ref": "#/responses/getUserOrgListResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/mute-timings/{name}": { - "get": { - "tags": ["provisioning"], - "summary": "Get a mute timing.", - "operationId": "RouteGetMuteTiming", + "/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": "string", - "description": "Mute timing name", - "name": "name", + "type": "integer", + "format": "int64", + "name": "org_id", "in": "path", "required": true } ], "responses": { "200": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "$ref": "#/responses/okResponse" }, - "404": { - "description": " Not found." + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "put": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Replace an existing mute timing.", - "operationId": "RoutePutMuteTiming", + } + }, + "/users": { + "get": { + "description": "Returns all users that the authenticated user has permission to view, admin permission required.", + "tags": ["users"], + "summary": "Get users.", + "operationId": "searchUsers", "parameters": [ { - "type": "string", - "description": "Mute timing name", - "name": "name", - "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" }, { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "type": "integer", + "format": "int64", + "default": 1, + "description": "Page index for starting fetching users", + "name": "page", + "in": "query" } ], "responses": { "200": { - "description": "MuteTimeInterval", - "schema": { - "$ref": "#/definitions/MuteTimeInterval" - } + "$ref": "#/responses/searchUsersResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - } - }, - "delete": { - "tags": ["provisioning"], - "summary": "Delete a mute timing.", - "operationId": "RouteDeleteMuteTiming", - "parameters": [ - { - "type": "string", - "description": "Mute timing name", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": " The mute timing was deleted successfully." + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/policies": { + "/users/lookup": { "get": { - "tags": ["provisioning"], - "summary": "Get the notification policy tree.", - "operationId": "RouteGetPolicyTree", - "responses": { - "200": { - "description": "Route", - "schema": { - "$ref": "#/definitions/Route" - } - } - } - }, - "put": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Sets the notification policy tree.", - "operationId": "RoutePutPolicyTree", + "tags": ["users"], + "summary": "Get user by login or email.", + "operationId": "getUserByLoginOrEmail", "parameters": [ { - "description": "The new notification routing tree to use", - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/Route" - } + "type": "string", + "description": "loginOrEmail of the user", + "name": "loginOrEmail", + "in": "query", + "required": true } ], "responses": { - "202": { - "description": "Ack", - "schema": { - "$ref": "#/definitions/Ack" - } + "200": { + "$ref": "#/responses/userResponse" }, - "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" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/templates": { + "/users/search": { "get": { - "tags": ["provisioning"], - "summary": "Get all message templates.", - "operationId": "RouteGetTemplates", + "tags": ["users"], + "summary": "Get users with paging.", + "operationId": "searchUsersWithPaging", "responses": { "200": { - "description": "MessageTemplates", - "schema": { - "$ref": "#/definitions/MessageTemplates" - } + "$ref": "#/responses/searchUsersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } }, - "/v1/provisioning/templates/{name}": { + "/users/{user_id}": { "get": { - "tags": ["provisioning"], - "summary": "Get a message template.", - "operationId": "RouteGetTemplate", + "tags": ["users"], + "summary": "Get user by id.", + "operationId": "getUserByID", "parameters": [ { - "type": "string", - "description": "Template Name", - "name": "name", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { - "description": "MessageTemplate", - "schema": { - "$ref": "#/definitions/MessageTemplate" - } + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" }, "404": { - "description": " Not found." + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } }, "put": { - "consumes": ["application/json"], - "tags": ["provisioning"], - "summary": "Updates an existing template.", - "operationId": "RoutePutTemplate", + "description": "Update the user identified by id.", + "tags": ["users"], + "summary": "Update user.", + "operationId": "updateUser", "parameters": [ { - "type": "string", - "description": "Template Name", - "name": "name", + "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", "in": "path", "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" }, + "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": [ { - "name": "Body", - "in": "body", - "schema": { - "$ref": "#/definitions/MessageTemplateContent" - } + "type": "integer", + "format": "int64", + "name": "user_id", + "in": "path", + "required": true } ], "responses": { - "202": { - "description": "MessageTemplate", - "schema": { - "$ref": "#/definitions/MessageTemplate" - } + "200": { + "$ref": "#/responses/getUserOrgListResponse" }, - "400": { - "description": "ValidationError", - "schema": { - "$ref": "#/definitions/ValidationError" - } + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } - }, - "delete": { - "tags": ["provisioning"], - "summary": "Delete a template.", - "operationId": "RouteDeleteTemplate", + } + }, + "/users/{user_id}/teams": { + "get": { + "description": "Get teams for user identified by id.", + "tags": ["users"], + "summary": "Get teams for user.", + "operationId": "getUserTeams", "parameters": [ { - "type": "string", - "description": "Template Name", - "name": "name", + "type": "integer", + "format": "int64", + "name": "user_id", "in": "path", "required": true } ], "responses": { - "204": { - "description": " The template was deleted successfully." + "200": { + "$ref": "#/responses/getUserTeamsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" } } } @@ -10781,7 +10781,7 @@ } } }, - "DashboardAclInfoDTO": { + "DashboardACLInfoDTO": { "type": "object", "properties": { "created": { @@ -10856,7 +10856,7 @@ } } }, - "DashboardAclUpdateItem": { + "DashboardACLUpdateItem": { "type": "object", "properties": { "permission": { @@ -10970,6 +10970,9 @@ "publicDashboardAccessToken": { "type": "string" }, + "publicDashboardEnabled": { + "type": "boolean" + }, "slug": { "type": "string" }, @@ -11439,6 +11442,10 @@ } } }, + "DataTopic": { + "type": "string", + "title": "DataTopic is used to identify which topic the frame should be assigned to." + }, "DateTime": { "description": "DateTime is a time but it serializes to ISO8601 format with millis\nIt knows how to read 3 different variations of a RFC3339 date time.\nMost APIs we encounter want either millisecond or second precision times.\nThis just tries to make it worry-free.", "type": "string", @@ -11490,9 +11497,9 @@ "format": "int64" }, "Duration": { + "description": "A Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years.", "type": "integer", - "format": "int64", - "title": "Duration is a type used for marshalling durations." + "format": "int64" }, "EmailConfig": { "type": "object", @@ -11728,7 +11735,7 @@ "$ref": "#/definitions/FieldConfig" }, "labels": { - "$ref": "#/definitions/Labels" + "$ref": "#/definitions/FrameLabels" }, "name": { "description": "Name is default identifier of the field. The name does not have to be unique, but the combination\nof name and Labels should be unique for proper behavior in all situations.", @@ -11939,6 +11946,13 @@ } } }, + "FrameLabels": { + "description": "Labels are used to add metadata to an object. The JSON will always be sorted keys", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "FrameMeta": { "description": "https://github.com/grafana/grafana/blob/master/packages/grafana-data/src/types/data.ts#L11\nNOTE -- in javascript this can accept any `[key: string]: any;` however\nthis interface only exposes the values we want to be exposed", "type": "object", @@ -11952,6 +11966,9 @@ "description": "Custom datasource specific values.", "type": "object" }, + "dataTopic": { + "$ref": "#/definitions/DataTopic" + }, "executedQueryString": { "description": "ExecutedQueryString is the raw query sent to the underlying system. All macros and templating\nhave been applied. When metadata contains this value, it will be shown in the query inspector.", "type": "string" @@ -12812,6 +12829,82 @@ "$ref": "#/definitions/Label" } }, + "LegacyAlert": { + "type": "object", + "properties": { + "Created": { + "type": "string", + "format": "date-time" + }, + "DashboardId": { + "type": "integer", + "format": "int64" + }, + "EvalData": { + "$ref": "#/definitions/Json" + }, + "ExecutionError": { + "type": "string" + }, + "For": { + "$ref": "#/definitions/Duration" + }, + "Frequency": { + "type": "integer", + "format": "int64" + }, + "Handler": { + "type": "integer", + "format": "int64" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Message": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "NewStateDate": { + "type": "string", + "format": "date-time" + }, + "OrgId": { + "type": "integer", + "format": "int64" + }, + "PanelId": { + "type": "integer", + "format": "int64" + }, + "Settings": { + "$ref": "#/definitions/Json" + }, + "Severity": { + "type": "string" + }, + "Silenced": { + "type": "boolean" + }, + "State": { + "$ref": "#/definitions/AlertStateType" + }, + "StateChanges": { + "type": "integer", + "format": "int64" + }, + "Updated": { + "type": "string", + "format": "date-time" + }, + "Version": { + "type": "integer", + "format": "int64" + } + } + }, "LibraryElementConnectionDTO": { "type": "object", "title": "LibraryElementConnectionDTO is the frontend DTO for element connections.", @@ -14234,10 +14327,10 @@ "type": "and" }, "query": { - "params": null + "params": [] }, "reducer": { - "params": null, + "params": [], "type": "avg" }, "type": "query" @@ -14757,7 +14850,7 @@ } }, "Responses": { - "description": "The QueryData method the QueryDataHandler method will set the RefId\nproperty on the DataRespones' frames based on these RefIDs.", + "description": "The QueryData method the QueryDataHandler method will set the RefId\nproperty on the DataResponses' frames based on these RefIDs.", "type": "object", "title": "Responses is a map of RefIDs (Unique Query ID) to DataResponses.", "additionalProperties": { @@ -16278,13 +16371,13 @@ } } }, - "UpdateDashboardAclCommand": { + "UpdateDashboardACLCommand": { "type": "object", "properties": { "items": { "type": "array", "items": { - "$ref": "#/definitions/DashboardAclUpdateItem" + "$ref": "#/definitions/DashboardACLUpdateItem" } } } @@ -17377,7 +17470,7 @@ }, "responses": { "SMTPNotEnabledError": { - "description": "" + "description": "(empty)" }, "acceptedResponse": { "description": "AcceptedResponse", @@ -17386,7 +17479,7 @@ } }, "addOrgUser": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id", "message"], @@ -17418,7 +17511,7 @@ } }, "contentResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17428,7 +17521,7 @@ } }, "createAnnotationResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id", "message"], @@ -17447,7 +17540,7 @@ } }, "createOrUpdateDatasourceResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id", "name", "message", "datasource"], @@ -17475,7 +17568,7 @@ } }, "createOrgResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["orgId", "message"], @@ -17495,13 +17588,13 @@ } }, "createPlaylistResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/Playlist" } }, "createReportResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "properties": { @@ -17516,13 +17609,13 @@ } }, "createServiceAccountResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/ServiceAccountDTO" } }, "createSnapshotResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "properties": { @@ -17549,7 +17642,7 @@ } }, "createTeamResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "properties": { @@ -17564,13 +17657,13 @@ } }, "createTokenResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/NewApiKeyResult" } }, "createUserResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/UserIdDTO" } @@ -17586,19 +17679,19 @@ } }, "dashboardResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/DashboardFullWithMeta" } }, "dashboardVersionResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/DashboardVersionMeta" } }, "dashboardVersionsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17607,7 +17700,7 @@ } }, "dashboardsTagsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17616,7 +17709,7 @@ } }, "deleteAlertNotificationChannelResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id", "message"], @@ -17635,7 +17728,7 @@ } }, "deleteDashboardResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id", "title", "message"], @@ -17660,7 +17753,7 @@ } }, "deleteDatasourceByNameResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id", "message"], @@ -17680,7 +17773,7 @@ } }, "deleteFolderResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id", "title", "message"], @@ -17705,7 +17798,7 @@ } }, "folderResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/Folder" } @@ -17723,7 +17816,7 @@ } }, "getAPIkeyResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17732,19 +17825,19 @@ } }, "getAccessControlStatusResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/Status" } }, "getAlertNotificationChannelResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/AlertNotification" } }, "getAlertNotificationChannelsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17753,16 +17846,13 @@ } }, "getAlertResponse": { - "description": "", + "description": "(empty)", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Alert" - } + "$ref": "#/definitions/LegacyAlert" } }, "getAlertsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17771,7 +17861,7 @@ } }, "getAllRolesResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17780,19 +17870,19 @@ } }, "getAnnotationResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/ItemDTO" } }, "getAnnotationTagsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/GetAnnotationTagsResponse" } }, "getAnnotationsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17801,7 +17891,7 @@ } }, "getAuthTokensResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17810,7 +17900,7 @@ } }, "getCustomPermissionsReportResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17819,16 +17909,16 @@ } }, "getDashboardPermissionsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { - "$ref": "#/definitions/DashboardAclInfoDTO" + "$ref": "#/definitions/DashboardACLInfoDTO" } } }, "getDashboardStatesResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17837,7 +17927,7 @@ } }, "getDatasourceIDresponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["id"], @@ -17852,19 +17942,19 @@ } }, "getDatasourceResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/DataSource" } }, "getDatasourcesResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/DataSourceList" } }, "getFoldersResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17879,7 +17969,7 @@ } }, "getInvitesResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17888,46 +17978,46 @@ } }, "getLDAPSyncStatusResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/ActiveSyncStatusDTO" } }, "getLibraryElementConnectionsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/LibraryElementConnectionsResponse" } }, "getLibraryElementResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/LibraryElementResponse" } }, "getLibraryElementsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/LibraryElementSearchResponse" } }, "getLicenseStatusResponse": { - "description": "" + "description": "(empty)" }, "getLicenseTokenResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/Token" } }, "getOrgResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/OrgDetailsDTO" } }, "getOrgUsersResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17936,19 +18026,19 @@ } }, "getPermissionseResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/DataSourcePermissionsDTO" } }, "getPlaylistDashboardsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/PlaylistDashboardsSlice" } }, "getPlaylistItemsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -17957,43 +18047,43 @@ } }, "getPlaylistResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/PlaylistDTO" } }, "getPreferencesResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/Prefs" } }, "getQueryHistoryDeleteQueryResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/QueryHistoryDeleteQueryResponse" } }, "getQueryHistoryMigrationResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/QueryHistoryMigrationResponse" } }, "getQueryHistoryResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/QueryHistoryResponse" } }, "getQueryHistorySearchResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/QueryHistorySearchResponse" } }, "getQuotaResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18002,19 +18092,19 @@ } }, "getReportResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/ConfigDTO" } }, "getReportSettingsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/SettingsDTO" } }, "getReportsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18023,19 +18113,19 @@ } }, "getRoleResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/RoleDTO" } }, "getSettingsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/SettingsBag" } }, "getSnapshotSharingOptionsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "properties": { @@ -18052,7 +18142,7 @@ } }, "getSnapshotsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18061,13 +18151,13 @@ } }, "getStatsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/AdminStats" } }, "getTeamGroupsApiResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18076,7 +18166,7 @@ } }, "getTeamMembersResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18085,13 +18175,13 @@ } }, "getTeamResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/TeamDTO" } }, "getUserOrgListResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18100,7 +18190,7 @@ } }, "getUserTeamsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18109,7 +18199,7 @@ } }, "helpFlagResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "properties": { @@ -18124,7 +18214,7 @@ } }, "importDashboardResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/ImportDashboardResponse" } @@ -18136,7 +18226,7 @@ } }, "listBuiltinRolesResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "additionalProperties": { @@ -18148,7 +18238,7 @@ } }, "listRecordingRulesResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18157,13 +18247,13 @@ } }, "listTokensResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/TokenDTO" } }, "lookupAlertNotificationChannelsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18172,7 +18262,7 @@ } }, "lookupOrgUsersResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18193,7 +18283,7 @@ } }, "pauseAlertResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["alertId", "message"], @@ -18213,7 +18303,7 @@ } }, "pauseAlertsResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "required": ["alertsAffected", "message"], @@ -18234,7 +18324,7 @@ } }, "postAPIkeyResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/NewApiKeyResult" } @@ -18280,7 +18370,7 @@ } }, "postRenewLicenseTokenResponse": { - "description": "" + "description": "(empty)" }, "preconditionFailedError": { "description": "PreconditionFailedError", @@ -18289,37 +18379,37 @@ } }, "queryDataResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/QueryDataResponse" } }, "recordingRuleResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/RecordingRuleJSON" } }, "recordingRuleWriteTargetResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" } }, "refreshLicenseStatsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/ActiveUserStats" } }, "retrieveServiceAccountResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/ServiceAccountDTO" } }, "searchOrgResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "array", "items": { @@ -18328,25 +18418,25 @@ } }, "searchOrgServiceAccountsWithPagingResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/SearchServiceAccountsResult" } }, "searchPlaylistsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/Playlists" } }, "searchResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/HitList" } }, "searchSortingResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "properties": { @@ -18366,22 +18456,22 @@ } }, "searchTeamsResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/SearchTeamQueryResult" } }, "searchUsersResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/SearchUserQueryResult" } }, "snapshotResponse": { - "description": "" + "description": "(empty)" }, "testAlertResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/AlertTestResult" } @@ -18405,13 +18495,13 @@ } }, "updatePlaylistResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/PlaylistDTO" } }, "updateServiceAccountResponse": { - "description": "", + "description": "(empty)", "schema": { "type": "object", "properties": { @@ -18432,7 +18522,7 @@ } }, "userResponse": { - "description": "", + "description": "(empty)", "schema": { "$ref": "#/definitions/UserProfileDTO" } diff --git a/public/api-spec.json b/public/api-spec.json index 1a3a181b650..0ece8019daf 100644 --- a/public/api-spec.json +++ b/public/api-spec.json @@ -2618,7 +2618,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardAclCommand" + "$ref": "#/definitions/UpdateDashboardACLCommand" } }, { @@ -2976,7 +2976,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardAclCommand" + "$ref": "#/definitions/UpdateDashboardACLCommand" } }, { @@ -4218,7 +4218,7 @@ ], "responses": { "200": { - "description": "" + "$ref": "#/responses/folderResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -4368,7 +4368,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UpdateDashboardAclCommand" + "$ref": "#/definitions/UpdateDashboardACLCommand" } } ], @@ -7866,7 +7866,7 @@ ], "responses": { "200": { - "$ref": "#/responses/okResponse" + "$ref": "#/responses/getTeamMembersResponse" }, "401": { "$ref": "#/responses/unauthorisedError" @@ -9120,82 +9120,6 @@ } } }, - "Alert": { - "type": "object", - "properties": { - "Created": { - "type": "string", - "format": "date-time" - }, - "DashboardId": { - "type": "integer", - "format": "int64" - }, - "EvalData": { - "$ref": "#/definitions/Json" - }, - "ExecutionError": { - "type": "string" - }, - "For": { - "$ref": "#/definitions/Duration" - }, - "Frequency": { - "type": "integer", - "format": "int64" - }, - "Handler": { - "type": "integer", - "format": "int64" - }, - "Id": { - "type": "integer", - "format": "int64" - }, - "Message": { - "type": "string" - }, - "Name": { - "type": "string" - }, - "NewStateDate": { - "type": "string", - "format": "date-time" - }, - "OrgId": { - "type": "integer", - "format": "int64" - }, - "PanelId": { - "type": "integer", - "format": "int64" - }, - "Settings": { - "$ref": "#/definitions/Json" - }, - "Severity": { - "type": "string" - }, - "Silenced": { - "type": "boolean" - }, - "State": { - "$ref": "#/definitions/AlertStateType" - }, - "StateChanges": { - "type": "integer", - "format": "int64" - }, - "Updated": { - "type": "string", - "format": "date-time" - }, - "Version": { - "type": "integer", - "format": "int64" - } - } - }, "AlertListItemDTO": { "type": "object", "properties": { @@ -9889,7 +9813,7 @@ } } }, - "DashboardAclInfoDTO": { + "DashboardACLInfoDTO": { "type": "object", "properties": { "created": { @@ -9964,7 +9888,7 @@ } } }, - "DashboardAclUpdateItem": { + "DashboardACLUpdateItem": { "type": "object", "properties": { "permission": { @@ -10078,6 +10002,9 @@ "publicDashboardAccessToken": { "type": "string" }, + "publicDashboardEnabled": { + "type": "boolean" + }, "slug": { "type": "string" }, @@ -10547,6 +10474,10 @@ } } }, + "DataTopic": { + "type": "string", + "title": "DataTopic is used to identify which topic the frame should be assigned to." + }, "DeleteTokenCommand": { "type": "object", "properties": { @@ -10624,7 +10555,7 @@ "$ref": "#/definitions/FieldConfig" }, "labels": { - "$ref": "#/definitions/Labels" + "$ref": "#/definitions/FrameLabels" }, "name": { "description": "Name is default identifier of the field. The name does not have to be unique, but the combination\nof name and Labels should be unique for proper behavior in all situations.", @@ -10835,6 +10766,13 @@ } } }, + "FrameLabels": { + "description": "Labels are used to add metadata to an object. The JSON will always be sorted keys", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "FrameMeta": { "description": "https://github.com/grafana/grafana/blob/master/packages/grafana-data/src/types/data.ts#L11\nNOTE -- in javascript this can accept any `[key: string]: any;` however\nthis interface only exposes the values we want to be exposed", "type": "object", @@ -10848,6 +10786,9 @@ "description": "Custom datasource specific values.", "type": "object" }, + "dataTopic": { + "$ref": "#/definitions/DataTopic" + }, "executedQueryString": { "description": "ExecutedQueryString is the raw query sent to the underlying system. All macros and templating\nhave been applied. When metadata contains this value, it will be shown in the query inspector.", "type": "string" @@ -11175,11 +11116,80 @@ "Json": { "type": "object" }, - "Labels": { - "description": "Labels are used to add metadata to an object. The JSON will always be sorted keys", + "LegacyAlert": { "type": "object", - "additionalProperties": { - "type": "string" + "properties": { + "Created": { + "type": "string", + "format": "date-time" + }, + "DashboardId": { + "type": "integer", + "format": "int64" + }, + "EvalData": { + "$ref": "#/definitions/Json" + }, + "ExecutionError": { + "type": "string" + }, + "For": { + "$ref": "#/definitions/Duration" + }, + "Frequency": { + "type": "integer", + "format": "int64" + }, + "Handler": { + "type": "integer", + "format": "int64" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Message": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "NewStateDate": { + "type": "string", + "format": "date-time" + }, + "OrgId": { + "type": "integer", + "format": "int64" + }, + "PanelId": { + "type": "integer", + "format": "int64" + }, + "Settings": { + "$ref": "#/definitions/Json" + }, + "Severity": { + "type": "string" + }, + "Silenced": { + "type": "boolean" + }, + "State": { + "$ref": "#/definitions/AlertStateType" + }, + "StateChanges": { + "type": "integer", + "format": "int64" + }, + "Updated": { + "type": "string", + "format": "date-time" + }, + "Version": { + "type": "integer", + "format": "int64" + } } }, "LibraryElementConnectionDTO": { @@ -12270,7 +12280,7 @@ } }, "Responses": { - "description": "The QueryData method the QueryDataHandler method will set the RefId\nproperty on the DataRespones' frames based on these RefIDs.", + "description": "The QueryData method the QueryDataHandler method will set the RefId\nproperty on the DataResponses' frames based on these RefIDs.", "type": "object", "title": "Responses is a map of RefIDs (Unique Query ID) to DataResponses.", "additionalProperties": { @@ -13164,13 +13174,13 @@ } } }, - "UpdateDashboardAclCommand": { + "UpdateDashboardACLCommand": { "type": "object", "properties": { "items": { "type": "array", "items": { - "$ref": "#/definitions/DashboardAclUpdateItem" + "$ref": "#/definitions/DashboardACLUpdateItem" } } } @@ -14058,10 +14068,7 @@ "getAlertResponse": { "description": "", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Alert" - } + "$ref": "#/definitions/LegacyAlert" } }, "getAlertsResponse": { @@ -14126,7 +14133,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/DashboardAclInfoDTO" + "$ref": "#/definitions/DashboardACLInfoDTO" } } },