diff --git a/Dockerfile b/Dockerfile index 8dd105f442a..618c0fa1e88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ COPY plugins-bundled plugins-bundled RUN yarn install -COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json ./ +COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json .linguirc ./ COPY public public COPY tools tools COPY scripts scripts @@ -30,6 +30,7 @@ COPY go.mod go.sum embed.go Makefile build.go package.json ./ COPY cue cue COPY packages/grafana-schema packages/grafana-schema COPY public/app/plugins public/app/plugins +COPY public/api-spec.json public/api-spec.json COPY pkg pkg COPY scripts scripts COPY cue.mod cue.mod diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 9323c935bdb..db3794d1bb1 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -12,7 +12,7 @@ COPY plugins-bundled plugins-bundled RUN yarn install -COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json ./ +COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json .linguirc ./ COPY public public COPY tools tools COPY scripts scripts @@ -33,6 +33,7 @@ COPY cue cue/ COPY cue.mod cue.mod/ COPY packages/grafana-schema packages/grafana-schema/ COPY public/app/plugins public/app/plugins/ +COPY public/api-spec.json public/api-spec.json RUN go mod verify RUN make build-go diff --git a/Makefile b/Makefile index 45544ca5e8a..1c9568128ac 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,13 @@ WIRE_TAGS = "oss" -include local/Makefile include .bingo/Variables.mk -.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-full lint-go golangci-lint test-go test-js gen-ts test run run-frontend clean devenv devenv-down protobuf drone help +.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-full build-docker-full-ubuntu lint-go golangci-lint test-go test-js gen-ts test run run-frontend clean devenv devenv-down protobuf drone help GO = go GO_FILES ?= ./pkg/... SH_FILES ?= $(shell find ./scripts -name *.sh) +API_DEFINITION_FILES = $(shell find ./pkg/api/docs/definitions -name '*.go' -print) +SWAGGER_TAG ?= latest all: deps build @@ -28,13 +30,62 @@ node_modules: package.json yarn.lock ## Install node modules. @echo "install frontend dependencies" YARN_ENABLE_PROGRESS_BARS=false yarn install --immutable +##@ Swagger +SPEC_TARGET = public/api-spec.json +MERGED_SPEC_TARGET := public/api-merged.json +NGALERT_SPEC_TARGET = pkg/services/ngalert/api/tooling/post.json + +$(SPEC_TARGET): $(API_DEFINITION_FILES) ## Generate API spec + docker run --rm -it \ + -e GOPATH=${HOME}/go:/go \ + -e SWAGGER_GENERATE_EXTENSION=false \ + -v ${HOME}/go:/go \ + -v $$(pwd):/grafana \ + -w $$(pwd)/pkg/api/docs quay.io/goswagger/swagger:$(SWAGGER_TAG) \ + generate spec -m -o /grafana/public/api-spec.json \ + -w /grafana/pkg/server \ + -x "grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \ + -x "github.com/prometheus/alertmanager" \ + -i /grafana/pkg/api/docs/tags.json + +swagger-api-spec: $(SPEC_TARGET) $(MERGED_SPEC_TARGET) + +$(NGALERT_SPEC_TARGET): + +$(MAKE) -C pkg/services/ngalert/api/tooling post.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=public/api-merged.json $(<) pkg/services/ngalert/api/tooling/post.json + +ensure_go-swagger_mac: + @hash swagger &>/dev/null || (brew tap go-swagger/go-swagger && brew install go-swagger) + +--swagger-api-spec-mac: ensure_go-swagger_mac $(API_DEFINITION_FILES) ## Generate API spec (for M1 Mac) + swagger generate spec -m -w pkg/server -o public/api-spec.json \ + -x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \ + -x "github.com/prometheus/alertmanager" \ + -i pkg/api/docs/tags.json + +swagger-api-spec-mac: --swagger-api-spec-mac $(MERGED_SPEC_TARGET) + +validate-api-spec: $(MERGED_SPEC_TARGET) ## Validate API spec + docker run --rm -it \ + -e GOPATH=${HOME}/go:/go \ + -e SWAGGER_GENERATE_EXTENSION=false \ + -v ${HOME}/go:/go \ + -v $$(pwd):/grafana \ + -w $$(pwd)/pkg/api/docs quay.io/goswagger/swagger:$(SWAGGER_TAG) \ + validate /grafana/$(<) + +clean-api-spec: + rm $(SPEC_TARGET) $(MERGED_SPEC_TARGET) + ##@ Building gen-go: $(WIRE) @echo "generate go files" $(WIRE) gen -tags $(WIRE_TAGS) ./pkg/server ./pkg/cmd/grafana-cli/runner -build-go: gen-go ## Build all Go binaries. +build-go: $(MERGED_SPEC_TARGET) gen-go ## Build all Go binaries. @echo "build go files" $(GO) run build.go build @@ -99,6 +150,11 @@ build-docker-full: ## Build Docker image for development. @echo "build docker container" docker build --tag grafana/grafana:dev . +build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development. + @echo "build docker container" + docker build --tag grafana/grafana:dev-ubuntu -f ./Dockerfile.ubuntu . + + ##@ Services # create docker-compose file with provided sources and start them diff --git a/go.mod b/go.mod index df9a267e849..57639febcc6 100644 --- a/go.mod +++ b/go.mod @@ -167,10 +167,10 @@ require ( github.com/go-openapi/analysis v0.20.1 // indirect github.com/go-openapi/errors v0.20.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.6 // indirect github.com/go-openapi/loads v0.20.2 // indirect github.com/go-openapi/runtime v0.19.29 // indirect - github.com/go-openapi/spec v0.20.3 // indirect + github.com/go-openapi/spec v0.20.4 // indirect github.com/go-openapi/swag v0.19.15 // indirect github.com/go-openapi/validate v0.20.2 // indirect github.com/gogo/googleapis v1.4.1 // indirect diff --git a/go.sum b/go.sum index 8df53ae14bb..34cb5e02fd3 100644 --- a/go.sum +++ b/go.sum @@ -867,6 +867,8 @@ github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL9 github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.17.2/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -907,6 +909,8 @@ github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFut github.com/go-openapi/spec v0.20.1/go.mod h1:93x7oh+d+FQsmsieroS4cmR3u0p/ywH649a3qwC9OsQ= github.com/go-openapi/spec v0.20.3 h1:uH9RQ6vdyPSs2pSy9fL8QPspDF2AMIMPtmK5coSSjtQ= github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= +github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.17.2/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index a3e25ab89a4..b93bf315b4a 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -37,5 +37,6 @@ export interface FeatureToggles { showFeatureFlagsInUI?: boolean; disable_http_request_histogram?: boolean; validatedQueries?: boolean; + swaggerUi?: boolean; featureHighlights?: boolean; } diff --git a/pkg/api/api.go b/pkg/api/api.go index 7e4835ddab2..a6f3f61808d 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -140,6 +140,10 @@ func (hs *HTTPServer) registerRoutes() { // expose plugin file system assets r.Get("/public/plugins/:pluginId/*", hs.getPluginAssets) + if hs.Features.IsEnabled(featuremgmt.FlagSwaggerUi) { + r.Get("/swagger-ui", swaggerUI) + } + // authed api r.Group("/api", func(apiRoute routing.RouteRegister) { // user (signed in) diff --git a/pkg/api/docs/definitions/admin.go b/pkg/api/docs/definitions/admin.go new file mode 100644 index 00000000000..07d2262886b --- /dev/null +++ b/pkg/api/docs/definitions/admin.go @@ -0,0 +1,67 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" +) + +// swagger:route GET /admin/settings admin getSettings +// +// Fetch settings. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `settings:read` and scopes: `settings:*`, `settings:auth.saml:` and `settings:auth.saml:enabled` (property level). +// +// Security: +// - basic: +// +// Responses: +// 200: getSettingsResponse +// 401: unauthorisedError +// 403: forbiddenError + +// swagger:route GET /admin/stats admin getStats +// +// Fetch Grafana Stats. +// +// Only works with Basic Authentication (username and password). See introduction for an explanation. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `server:stats:read`. +// +// Responses: +// 200: getStatsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /admin/pause-all-alerts admin pauseAllAlerts +// +// Pause/unpause all (legacy) alerts. +// +// Security: +// - basic: +// +// Responses: +// 200: pauseAlertsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:parameters pauseAllAlerts +type PauseAllAlertsParam struct { + // in:body + // required:true + Body dtos.PauseAllAlertsCommand `json:"body"` +} + +// swagger:response pauseAlertsResponse +type PauseAllAlertsResponse struct { + // in:body + Body struct { + // AlertsAffected is the number of the affected alerts. + // required: true + AlertsAffected int64 `json:"alertsAffected"` + // required: true + Message string `json:"message"` + // Alert result state + // required true + State string `json:"state"` + } `json:"body"` +} diff --git a/pkg/api/docs/definitions/admin_ldap.go b/pkg/api/docs/definitions/admin_ldap.go new file mode 100644 index 00000000000..e3933cce712 --- /dev/null +++ b/pkg/api/docs/definitions/admin_ldap.go @@ -0,0 +1,68 @@ +package definitions + +// swagger:route POST /admin/ldap/reload admin_ldap reloadLDAP +// +// Reloads the LDAP configuration. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /admin/ldap/sync/{user_id} admin_ldap syncLDAPUser +// +// Enables a single Grafana user to be synchronized against LDAP. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /admin/ldap/{user_name} admin_ldap getLDAPUser +// +// Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /admin/ldap/status admin_ldap getLDAPStatus +// +// Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:parameters getLDAPUser +type UserNameParam struct { + // in:path + // required:true + UserID string `json:"user_name"` +} diff --git a/pkg/api/docs/definitions/admin_provisioning.go b/pkg/api/docs/definitions/admin_provisioning.go new file mode 100644 index 00000000000..f2acfde3d7b --- /dev/null +++ b/pkg/api/docs/definitions/admin_provisioning.go @@ -0,0 +1,81 @@ +package definitions + +// swagger:route POST /admin/provisioning/dashboards/reload admin_provisioning reloadProvisionedDashboards +// +// Reload dashboard provisioning configurations. +// +// Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /admin/provisioning/datasources/reload admin_provisioning reloadProvisionedDatasources +// +// Reload datasource provisioning configurations. +// +// Reloads the provisioning config files for datasources again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:datasources`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /admin/provisioning/plugins/reload admin_provisioning reloadProvisionedPlugins +// +// Reload plugin provisioning configurations. +// +// Reloads the provisioning config files for plugins again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:plugin`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /admin/provisioning/notifications/reload admin_provisioning reloadProvisionedAlertNotifiers +// +// Reload legacy alert notifier provisioning configurations. +// +// Reloads the provisioning config files for legacy alert notifiers again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:notifications`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /admin/provisioning/accesscontrol/reload admin_provisioning reloadProvisionedAccessControl +// +// Reload access control provisioning configurations. +// +// Reloads the provisioning config files for access control again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:accesscontrol`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError diff --git a/pkg/api/docs/definitions/admin_users.go b/pkg/api/docs/definitions/admin_users.go new file mode 100644 index 00000000000..bd8ef4a0b7f --- /dev/null +++ b/pkg/api/docs/definitions/admin_users.go @@ -0,0 +1,255 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" + "github.com/grafana/grafana/pkg/setting" +) + +// swagger:route POST /admin/users admin_users createUser +// +// Create new user. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:create`. +// Note that OrgId is an optional parameter that can be used to assign a new user to a different organization when `auto_assign_org` is set to `true`. +// +// Security: +// - basic: +// +// Responses: +// 200: createUserResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 412: preconditionFailedError +// 500: internalServerError + +// swagger:route PUT /admin/users/{user_id}/password admin_users setPassword +// +// Set password for user. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.password:update` and scope `global:users:*`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PUT /admin/users/{user_id}/permissions admin_users setPermissions +// +// Set permissions for user. +// +// Only works with Basic Authentication (username and password). See introduction for an explanation. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.permissions:update` and scope `global:users:*`. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route DELETE /admin/users/{user_id} admin_users deleteUser +// +// Delete global User. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:delete` and scope `global:users:*`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /admin/users/{user_id}/disable admin_users disableUser +// +// Disable user. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:disable` and scope `global:users:1` (userIDScope). +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /admin/users/{user_id}/enable admin_users enableUser +// +// Enable user. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:enable` and scope `global:users:1` (userIDScope). +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /admin/users/{user_id}/quotas admin_users getUserQuota +// +// Fetch user quota. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global:users:1` (userIDScope). +// +// Security: +// - basic: +// +// Responses: +// 200: getQuotaResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /admin/users/{user_id}/quotas/{quota_target} admin_users updateUserQuota +// +// Update user quota. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:update` and scope `global:users:1` (userIDScope). +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /admin/users/{user_id}/auth-tokens admin_users getAuthTokens +// +// Return a list of all auth tokens (devices) that the user currently have logged in from. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:list` and scope `global:users:*`. +// +// Security: +// - basic: +// +// Responses: +// 200: getAuthTokensResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /admin/users/{user_id}/revoke-auth-token admin_users revokeAuthToken +// +// Revoke auth token for user. +// +// Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:update` and scope `global:users:*`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /admin/users/{user_id}/logout admin_users logoutUser +// +// Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity. +// If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.logout` and scope `global:users:*`. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters setPassword +type SetPasswordParam struct { + // in:body + // required:true + Body dtos.AdminUpdateUserPasswordForm `json:"body"` +} + +// swagger:parameters revokeAuthToken revokeSignedINAuthTokenCmd +type RevokeAuthTokenParam struct { + // in:body + // required:true + Body models.RevokeAuthTokenCmd `json:"body"` +} + +// swagger:parameters createUser +type CreateUserParam struct { + // in:body + // required:true + Body dtos.AdminCreateUserForm `json:"body"` +} + +// swagger:parameters updateUserQuota updateOrgQuota +type TargeQuotaParam struct { + // in:path + // required:true + QuotaTarget string `json:"quota_target"` +} + +// swagger:parameters updateUserQuota +type UpdateUserQuotaParam struct { + // in:body + // required:true + Body models.UpdateUserQuotaCmd `json:"body"` +} + +// swagger:parameters setPermissions +type SetPermissionsParam struct { + // in:body + // required:true + Body dtos.AdminUpdateUserPermissionsForm `json:"body"` +} + +// swagger:response createUserResponse +type CreateUserResponse struct { + // in:body + Body models.UserIdDTO `json:"body"` +} + +// swagger:response getSettingsResponse +type GetSettingsResponse struct { + // in:body + Body setting.SettingsBag `json:"body"` +} + +// swagger:response getStatsResponse +type GetStatsResponse struct { + // in:body + Body models.AdminStats `json:"body"` +} + +// swagger:response getAuthTokensResponse +type GetAuthTokensResponse struct { + // in:body + Body []*models.UserToken `json:"body"` +} + +// swagger:response getQuotaResponse +type GetQuotaResponseResponse struct { + // in:body + Body []*models.UserQuotaDTO `json:"body"` +} diff --git a/pkg/api/docs/definitions/annotations.go b/pkg/api/docs/definitions/annotations.go new file mode 100644 index 00000000000..f71da642410 --- /dev/null +++ b/pkg/api/docs/definitions/annotations.go @@ -0,0 +1,240 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/services/annotations" +) + +// swagger:route GET /annotations annotations getAnnotations +// +// Find Annotations. +// +// Starting in Grafana v6.4 regions annotations are now returned in one entity that now includes the timeEnd property. +// +// Responses: +// 200: getAnnotationsResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route POST /annotations/mass-delete annotations massDeleteAnnotations +// +// Delete multiple annotations. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route POST /annotations annotations createAnnotation +// +// Create Annotation. +// +// Creates an annotation in the Grafana database. The dashboardId and panelId fields are optional. If they are not specified then a global annotation is created and can be queried in any dashboard that adds the Grafana annotations data source. When creating a region annotation include the timeEnd property. +// The format for `time` and `timeEnd` should be epoch numbers in millisecond resolution. +// The response for this HTTP request is slightly different in versions prior to v6.4. In prior versions you would also get an endId if you where creating a region. But in 6.4 regions are represented using a single event with time and timeEnd properties. +// +// Responses: +// 200: createAnnotationResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /annotations/graphite annotations createGraphiteAnnotation +// +// Create Annotation in Graphite format. +// +// Creates an annotation by using Graphite-compatible event format. The `when` and `data` fields are optional. If `when` is not specified then the current time will be used as annotation’s timestamp. The `tags` field can also be in prior to Graphite `0.10.0` format (string with multiple tags being separated by a space). +// +// Responses: +// 200: createAnnotationResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PUT /annotations/{annotation_id} annotations updateAnnotation +// +// Update Annotation. +// +// Updates all properties of an annotation that matches the specified id. To only update certain property, consider using the Patch Annotation operation. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PATCH /annotations/{annotation_id} annotations patchAnnotation +// +// Patch Annotation +// +// Updates one or more properties of an annotation that matches the specified ID. +// This operation currently supports updating of the `text`, `tags`, `time` and `timeEnd` properties. +// This is available in Grafana 6.0.0-beta2 and above. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route DELETE /annotations/{annotation_id} annotations deleteAnnotation +// +// Delete Annotation By ID. +// +// Deletes the annotation that matches the specified ID. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /annotations/tags annotations getAnnotationTags +// +// Find Annotations Tags. +// +// Find all the event tags created in the annotations. +// +// Responses: +// 200: getAnnotationTagsResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:parameters updateAnnotation patchAnnotation deleteAnnotation +type AnnotationIDParam struct { + // in:path + // required:true + AnnotationID string `json:"annotation_id"` +} + +// swagger:parameters getAnnotations +type GetAnnotationsParams struct { + // Find annotations created after specific epoch datetime in milliseconds. + // in:query + // required:false + From int64 `json:"from"` + // Find annotations created before specific epoch datetime in milliseconds. + // in:query + // required:false + To int64 `json:"to"` + // Limit response to annotations created by specific user. + // in:query + // required:false + UserID int64 `json:"userId"` + // Find annotations for a specified alert. + // in:query + // required:false + AlertID int64 `json:"alertId"` + // Find annotations that are scoped to a specific dashboard + // in:query + // required:false + DashboardID int64 `json:"dashboardId"` + // Find annotations that are scoped to a specific panel + // in:query + // required:false + PanelID int64 `json:"panelId"` + // Max limit for results returned. + // in:query + // required:false + Limit int64 `json:"limit"` + // Use this to filter global annotations. Global annotations are annotations from an annotation data source that are not connected specifically to a dashboard or panel. You can filter by multiple tags. + // in:query + // required:false + // type: array + // collectionFormat: multi + Tags []string `json:"tags"` + // Return alerts or user created annotations + // in:query + // required:false + // Description: + // * `alert` + // * `annotation` + // enum: alert,annotation + Type string `json:"type"` + // Match any or all tags + // in:query + // required:false + MatchAny bool `json:"matchAny"` +} + +// swagger:parameters getAnnotationTags +type GetAnnotationTagssParams struct { + // Tag is a string that you can use to filter tags. + // in:query + // required:false + Tag string `json:"tag"` + // Max limit for results returned. + // in:query + // required:false + // default: 100 + Limit string `json:"limit"` +} + +// swagger:parameters massDeleteAnnotations +type MassDeleteAnnotationsParams struct { + // in:body + // required:true + Body dtos.DeleteAnnotationsCmd `json:"body"` +} + +// swagger:parameters createAnnotation +type CreateAnnotationParams struct { + // in:body + // required:true + Body dtos.PostAnnotationsCmd `json:"body"` +} + +// swagger:parameters createGraphiteAnnotation +type CreateGraphiteAnnotationParams struct { + // in:body + // required:true + Body dtos.PostGraphiteAnnotationsCmd `json:"body"` +} + +// swagger:parameters updateAnnotation +type UpdateAnnotationParams struct { + // in:body + // required:true + Body dtos.UpdateAnnotationsCmd `json:"body"` +} + +// swagger:parameters patchAnnotation +type PatchAnnotationParams struct { + // in:body + // required:true + Body dtos.PatchAnnotationsCmd `json:"body"` +} + +// swagger:response getAnnotationsResponse +type GetAnnotationsResponse struct { + // The response message + // in: body + Body []*annotations.ItemDTO `json:"body"` +} + +// swagger:response createAnnotationResponse +type CreateAnnotationResponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the created annotation. + // required: true + // example: 65 + ID int64 `json:"id"` + + // Message Message of the created annotation. + // required: true + Message string `json:"message"` + } `json:"body"` +} + +// swagger:response getAnnotationTagsResponse +type GetAnnotationTagsResponse struct { + // The response message + // in: body + Body annotations.GetAnnotationTagsResponse `json:"body"` +} diff --git a/pkg/api/docs/definitions/apikey.go b/pkg/api/docs/definitions/apikey.go new file mode 100644 index 00000000000..f8ff0cbc64c --- /dev/null +++ b/pkg/api/docs/definitions/apikey.go @@ -0,0 +1,81 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /auth/keys api_keys getAPIkeys +// +// Get auth keys. +// +// Will return auth keys. +// +// Responses: +// 200: getAPIkeyResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /auth/keys api_keys addAPIkey +// +// Creates an API key. +// +// Will return details of the created API key +// +// Responses: +// 200: postAPIkeyResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 409: conflictError +// 500: internalServerError + +// swagger:route DELETE /auth/keys/{id} api_keys deleteAPIkey +// +// Delete API key. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters getAPIkeys +type GetAPIkeysParams struct { + // Show expired keys + // in:query + // required:false + // default:false + IncludeExpired bool `json:"includeExpired"` +} + +// swagger:parameters addAPIkey +type AddAPIkeyParams struct { + // in:body + // required:true + Body models.AddApiKeyCommand +} + +// swagger:parameters deleteAPIkey +type DeleteAPIkeyParams struct { + // in:path + // required:true + ID int64 `json:"id"` +} + +// swagger:response getAPIkeyResponse +type GetAPIkeyResponse struct { + // The response message + // in: body + Body []*models.ApiKeyDTO `json:"body"` +} + +// swagger:response postAPIkeyResponse +type PostAPIkeyResponse struct { + // The response message + // in: body + Body dtos.NewApiKeyResult `json:"body"` +} diff --git a/pkg/api/docs/definitions/dashboard.go b/pkg/api/docs/definitions/dashboard.go new file mode 100644 index 00000000000..1c261a7da95 --- /dev/null +++ b/pkg/api/docs/definitions/dashboard.go @@ -0,0 +1,257 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" + "github.com/grafana/grafana/pkg/services/dashboardimport" +) + +// swagger:route GET /dashboards/uid/{uid} dashboards getDashboardByUID +// +// Get dashboard by uid. +// +// Will return the dashboard given the dashboard unique identifier (uid). +// +// Responses: +// 200: dashboardResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// DeleteDashboardByUID swagger:route DELETE /dashboards/uid/{uid} dashboards deleteDashboardByUID +// +// Delete dashboard by uid. +// +// Will delete the dashboard given the specified unique identifier (uid). +// +// Responses: +// 200: deleteDashboardResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /dashboards/calculate-diff dashboards calcDashboardDiff +// +// Perform diff on two dashboards. +// +// Produces: +// - application/json +// - text/html +// +// Responses: +// 200: dashboardDiffResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /dashboards/trim dashboards trimDashboard +// +// Trim defaults from dashboard. +// +// Responses: +// 200: trimDashboardResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route POST /dashboards/db dashboards postDashboard +// +// Create / Update dashboard +// +// Creates a new dashboard or updates an existing dashboard. +// +// Responses: +// 200: postDashboardResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 412: preconditionFailedError +// 422: unprocessableEntityError +// 500: internalServerError + +// swagger:route GET /dashboards/home dashboards getHomeDashboard +// +// Get home dashboard. +// +// Responses: +// 200: getHomeDashboardResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route GET /dashboards/tags dashboards getDashboardTags +// +// Get all dashboards tags of an organisation. +// +// Responses: +// 200: dashboardsTagsResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route POST /dashboards/import dashboards importDashboard +// +// Import dashboard. +// +// Responses: +// 200: importDashboardResponse +// 400: badRequestError +// 401: unauthorisedError +// 412: preconditionFailedError +// 422: unprocessableEntityError +// 500: internalServerError + +// swagger:parameters getDashboardByUID deleteDashboardByUID +type UID struct { + // in:path + // required:true + UID string `json:"uid"` +} + +// swagger:parameters postDashboard +type PostDashboardParam struct { + // in:body + // required:true + Body models.SaveDashboardCommand +} + +// swagger:parameters calcDashboardDiff +type CalcDashboardDiffOptions struct { + // in:body + // required:true + Body struct { + Base dtos.CalculateDiffTarget `json:"base" binding:"Required"` + New dtos.CalculateDiffTarget `json:"new" binding:"Required"` + // The type of diff to return + // Description: + // * `basic` + // * `json` + // Enum: basic,json + DiffType string `json:"diffType" binding:"Required"` + } +} + +// swagger:parameters trimDashboard +type TrimDashboardParam struct { + // in:body + // required:true + Body models.TrimDashboardCommand +} + +// swagger:parameters importDashboard +type ImportDashboardParam struct { + // in:body + // required:true + Body dashboardimport.ImportDashboardRequest +} + +// swagger:response dashboardResponse +type DashboardResponse struct { + // The response message + // in: body + Body dtos.DashboardFullWithMeta `json:"body"` +} + +// swagger:response deleteDashboardResponse +type DeleteDashboardResponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the deleted dashboard. + // required: true + // example: 65 + ID int64 `json:"id"` + + // Title Title of the deleted dashboard. + // required: true + // example: My Dashboard + Title string `json:"title"` + + // Message Message of the deleted dashboard. + // required: true + // example: Dashboard My Dashboard deleted + Message string `json:"message"` + } `json:"body"` +} + +// Create/update dashboard response. +// swagger:response postDashboardResponse +type PostDashboardResponse struct { + // in: body + Body struct { + // Status status of the response. + // required: true + // example: success + Status string `json:"status"` + + // Slug The slug of the dashboard. + // required: true + // example: my-dashboard + Slug string `json:"title"` + + // Version The version of the dashboard. + // required: true + // example: 2 + Verion int64 `json:"version"` + + // ID The unique identifier (id) of the created/updated dashboard. + // required: true + // example: 1 + ID string `json:"id"` + + // UID The unique identifier (uid) of the created/updated dashboard. + // required: true + // example: nHz3SXiiz + UID string `json:"uid"` + + // URL The relative URL for accessing the created/updated dashboard. + // required: true + // example: /d/nHz3SXiiz/my-dashboard + URL string `json:"url"` + } `json:"body"` +} + +// Calculate dashboard diff response. +// swagger:response dashboardDiffResponse +type DashboardDiffResponse struct { + // in: body + Body []byte `json:"body"` +} + +// Trimmed dashboard response. +// swagger:response trimDashboardResponse +type TrimDashboardResponse struct { + // in: body + Body dtos.TrimDashboardFullWithMeta `json:"body"` +} + +// Home dashboard response. +// swagger:response getHomeDashboardResponse +type GetHomeDashboardResponse struct { + // in: body + Body GetHomeDashboardResponseBody `json:"body"` +} + +// swagger:response dashboardsTagsResponse +type DashboardsTagsResponse struct { + // in: body + Body []*models.DashboardTagCloudItem `json:"body"` +} + +// swagger:response importDashboardResponse +type ImportDashboardResponse struct { + // in: body + Body dashboardimport.ImportDashboardResponse `json:"body"` +} + +// Get home dashboard response. +// swagger:model GetHomeDashboardResponse +type GetHomeDashboardResponseBody struct { + // swagger:allOf + // required: false + dtos.DashboardFullWithMeta + + // swagger:allOf + // required: false + dtos.DashboardRedirect +} diff --git a/pkg/api/docs/definitions/dashboard_permissions.go b/pkg/api/docs/definitions/dashboard_permissions.go new file mode 100644 index 00000000000..940638dfd1f --- /dev/null +++ b/pkg/api/docs/definitions/dashboard_permissions.go @@ -0,0 +1,44 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /dashboards/id/{DashboardID}/permissions dashboard_permissions getDashboardPermissions +// +// Gets all existing permissions for the given dashboard. +// +// Responses: +// 200: getDashboardPermissionsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /dashboards/id/{DashboardID}/permissions dashboard_permissions postDashboardPermissions +// +// Updates permissions for a dashboard. +// +// This operation will remove existing permissions if they’re not included in the request. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters postDashboardPermissions updateFolderPermissions +type PostDashboardPermissionsParam struct { + // in:body + // required:true + Body dtos.UpdateDashboardAclCommand +} + +// swagger:response getDashboardPermissionsResponse +type GetDashboardPermissionsResponse struct { + // in: body + Body []*models.DashboardAclInfoDTO `json:"body"` +} diff --git a/pkg/api/docs/definitions/dashboard_versions.go b/pkg/api/docs/definitions/dashboard_versions.go new file mode 100644 index 00000000000..ea1a30f94f9 --- /dev/null +++ b/pkg/api/docs/definitions/dashboard_versions.go @@ -0,0 +1,77 @@ +package definitions + +import "github.com/grafana/grafana/pkg/models" + +// swagger:route GET /dashboards/id/{DashboardID}/versions dashboard_versions getDashboardVersions +// +// Gets all existing versions for the dashboard. +// +// Responses: +// 200: dashboardVersionsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /dashboards/id/{DashboardID}/versions/{DashboardVersionID} dashboard_versions getDashboardVersion +// +// Get a specific dashboard version. +// +// Responses: +// 200: dashboardVersionResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /dashboards/id/{DashboardID}/restore dashboard_versions restoreDashboardVersion +// +// Restore a dashboard to a given dashboard version. +// +// Responses: +// 200: postDashboardResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters getDashboardVersions getDashboardVersion restoreDashboardVersion +// swagger:parameters getDashboardPermissions postDashboardPermissions +// swagger:parameters renderReportPDF +type DashboardIdParam struct { + // in:path + DashboardID int64 +} + +// swagger:parameters getDashboardVersion +type DashboardVersionIdParam struct { + // in:path + DashboardVersionID int64 +} + +// swagger:parameters getDashboardVersions +type GetDashboardVersionsParams struct { + // Maximum number of results to return + // in:query + // required:false + // default:0 + Limit int `json:"limit"` + + // Version to start from when returning queries + // in:query + // required:false + // default:0 + Start int `json:"start"` +} + +// swagger:response dashboardVersionsResponse +type DashboardVersionsResponse struct { + // in: body + Body []*models.DashboardVersionDTO `json:"body"` +} + +// swagger:response dashboardVersionResponse +type DashboardVersionResponse struct { + // in: body + Body *models.DashboardVersionMeta `json:"body"` +} diff --git a/pkg/api/docs/definitions/datasources.go b/pkg/api/docs/definitions/datasources.go new file mode 100644 index 00000000000..bd7a5c7bdb7 --- /dev/null +++ b/pkg/api/docs/definitions/datasources.go @@ -0,0 +1,350 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" + "github.com/grafana/grafana/pkg/tsdb/legacydata" +) + +// swagger:route GET /datasources datasources getDatasources +// +// Get all data sources. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:read` and scope: `datasources:*`. +// +// Responses: +// 200: getDatasourcesResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /datasources datasources addDatasource +// +// Create a data source. +// +// By defining `password` and `basicAuthPassword` under secureJsonData property +// Grafana encrypts them securely as an encrypted blob in the database. +// The response then lists the encrypted fields under secureJsonFields. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:create` +// +// Responses: +// 200: createOrUpdateDatasourceResponse +// 401: unauthorisedError +// 403: forbiddenError +// 409: conflictError +// 500: internalServerError + +// swagger:route PUT /datasources/{datasource_id} datasources updateDatasource +// +// Update an existing data source. +// +// Similar to creating a data source, `password` and `basicAuthPassword` should be defined under +// secureJsonData in order to be stored securely as an encrypted blob in the database. Then, the +// encrypted fields are listed under secureJsonFields section in the response. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source). +// +// Responses: +// 200: createOrUpdateDatasourceResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route DELETE /datasources/{datasource_id} datasources deleteDatasourceByID +// +// Delete an existing data source by id. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source). +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 404: notFoundError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route DELETE /datasources/uid/{datasource_uid} datasources deleteDatasourceByUID +// +// Delete an existing data source by UID. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:kLtEtcRGk` (single data source). +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route DELETE /datasources/name/{datasource_name} datasources deleteDatasourceByName +// +// Delete an existing data source by name. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:delete` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source). +// +// Responses: +// 200: deleteDatasourceByNameResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /datasources/{datasource_id} datasources getDatasourceByID +// +// Get a single data source by Id. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source). +// +// Responses: +// 200: getDatasourceResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /datasources/uid/{datasource_uid} datasources getDatasourceByUID +// +// Get a single data source by UID. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:uid:*` and `datasources:uid:kLtEtcRGk` (single data source). +// +// Responses: +// 200: getDatasourceResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /datasources/name/{datasource_name} datasources getDatasourceByName +// +// Get a single data source by Name. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source). +// +// Responses: +// 200: getDatasourceResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /datasources/id/{datasource_name} datasources getDatasourceIdByName +// +// Get data source Id by Name. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:read` and scopes: `datasources:*`, `datasources:name:*` and `datasources:name:test_datasource` (single data source). +// +// Responses: +// 200: getDatasourceIDresponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /datasources/proxy/{datasource_id}/{datasource_proxy_route} datasources datasourceProxyGETcalls +// +// Data source proxy GET calls. +// +// Proxies all calls to the actual data source. +// +// Responses: +// 200: +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /datasources/proxy/{datasource_id}/{datasource_proxy_route} datasources datasourceProxyPOSTcalls +// +// Data source proxy POST calls. +// +// Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined +// +// Responses: +// 201: +// 202: +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route DELETE /datasources/proxy/{datasource_id}/{datasource_proxy_route} datasources datasourceProxyDELETEcalls +// +// Data source proxy DELETE calls. +// +// Proxies all calls to the actual data source. +// +// Responses: +// 202: +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /tsdb/query datasources queryDatasource +// +// Query metrics. +// +// Queries a data source having backend implementation. +// +// Most of Grafana’s builtin data sources have backend implementation. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:query`. +// +// Responses: +// 200: queryDatasourceResponse +// 401: unauthorisedError +// 400: badRequestError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters updateDatasource deleteDatasourceByID getDatasourceByID datasourceProxyGETcalls datasourceProxyPOSTcalls datasourceProxyDELETEcalls +// swagger:parameters enablePermissions disablePermissions getPermissions deletePermissions +type DatasourceID struct { + // in:path + // required:true + DatasourceID string `json:"datasource_id"` +} + +// swagger:parameters deleteDatasourceByUID getDatasourceByUID +type DatasourceUID struct { + // in:path + // required:true + DatasourceUID string `json:"datasource_uid"` +} + +// swagger:parameters getDatasourceByName deleteDatasourceByName getDatasourceIdByName +type DatasourceName struct { + // in:path + // required:true + DatasourceName string `json:"datasource_name"` +} + +// swagger:parameters datasourceProxyGETcalls datasourceProxyPOSTcalls datasourceProxyDELETEcalls +type DatasourceProxyRouteParam struct { + // in:path + // required:true + DatasourceProxyRoute string `json:"datasource_proxy_route"` +} + +// swagger:parameters datasourceProxyPOSTcalls +type DatasourceProxyParam struct { + // in:body + // required:true + DatasourceProxyParam interface{} +} + +// swagger:parameters addDatasource +type AddDatasourceParam struct { + // in:body + // required:true + Body models.AddDataSourceCommand +} + +// swagger:parameters updateDatasource +type UpdateDatasource struct { + // in:body + // required:true + Body models.UpdateDataSourceCommand +} + +// swagger:parameters queryDatasource +type QueryDatasource struct { + // in:body + // required:true + Body dtos.MetricRequest +} + +// swagger:response getDatasourcesResponse +type GetDatasourcesResponse struct { + // The response message + // in: body + Body dtos.DataSourceList `json:"body"` +} + +// swagger:response getDatasourceResponse +type GetDatasourceResponse struct { + // The response message + // in: body + Body dtos.DataSource `json:"body"` +} + +// swagger:response createOrUpdateDatasourceResponse +type CreateOrUpdateDatasourceResponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the new data source. + // required: true + // example: 65 + ID int64 `json:"id"` + + // Name of the new data source. + // required: true + // example: My Data source + Name string `json:"name"` + + // Message Message of the deleted dashboard. + // required: true + // example: Data source added + Message string `json:"message"` + + // Datasource properties + // required: true + Datasource dtos.DataSource `json:"datasource"` + } `json:"body"` +} + +// swagger:response getDatasourceIDresponse +type GetDatasourceIDresponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the data source. + // required: true + // example: 65 + ID int64 `json:"id"` + } `json:"body"` +} + +// swagger:response deleteDatasourceByNameResponse +type DeleteDatasourceByNameResponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the deleted data source. + // required: true + // example: 65 + ID int64 `json:"id"` + + // Message Message of the deleted dashboard. + // required: true + // example: Dashboard My Dashboard deleted + Message string `json:"message"` + } `json:"body"` +} + +// swagger:response queryDatasourceResponse +type QueryDatasourceResponse struct { + // The response message + // in: body + //nolint: staticcheck // plugins.DataResponse deprecated + Body legacydata.DataResponse `json:"body"` +} diff --git a/pkg/api/docs/definitions/ds.go b/pkg/api/docs/definitions/ds.go new file mode 100644 index 00000000000..a77449ba073 --- /dev/null +++ b/pkg/api/docs/definitions/ds.go @@ -0,0 +1,34 @@ +package definitions + +import ( + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/api/dtos" +) + +// swagger:route POST /ds/query ds queryMetricsWithExpressions +// +// Query metrics with expressions +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `datasources:query`. +// +// Responses: +// 200: queryDataResponse +// 401: unauthorisedError +// 400: badRequestError +// 403: forbiddenError +// 500: internalServerError + +// swagger:parameters queryMetricsWithExpressions +type QueryMetricsWithExpressionsBodyParam struct { + // in:body + // required:true + Body dtos.MetricRequest `json:"body"` +} + +// swagger:response queryDataResponse +type QueryDataResponseResponse struct { + // The response message + // in: body + Body *backend.QueryDataResponse `json:"body"` +} diff --git a/pkg/api/docs/definitions/folder.go b/pkg/api/docs/definitions/folder.go new file mode 100644 index 00000000000..3ce1e9f8110 --- /dev/null +++ b/pkg/api/docs/definitions/folder.go @@ -0,0 +1,174 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /folders folders getFolders +// +// Get all folders. +// +// Returns all folders that the authenticated user has permission to view. +// +// Responses: +// 200: getFoldersResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /folders/{folder_uid} folders getFolderByUID +// +// Get folder by uid. +// +// Responses: +// 200: +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /folders folders createFolder +// +// Create folder. +// +// Responses: +// 200: folderResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 409: conflictError +// 500: internalServerError + +// swagger:route PUT /folders/{folder_uid} folders updateFolder +// +// Update folder. +// +// Responses: +// 200: folderResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 409: conflictError +// 500: internalServerError + +// swagger:route DELETE /folders/{folder_uid} folders deleteFolder +// +// Delete folder. +// +// Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted. +// +// Responses: +// 200: deleteFolderResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /folders/id/{folder_id} folders getFolderByID +// +// Get folder by id. +// +// Returns the folder identified by id. +// +// Responses: +// 200: folderResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters getFolders +type GetFoldersParams struct { + // Limit the maximum number of folders to return + // in:query + // required:false + // default:1000 + Limit int64 `json:"limit"` + // Page index for starting fetching folders + // in:query + // required:false + // default:1 + Page int64 `json:"page"` +} + +// swagger:parameters getFolderByUID updateFolder deleteFolder +// swagger:parameters getFolderPermissions updateFolderPermissions +type FolderUIDParam struct { + // in:path + // required:true + FolderUID string `json:"folder_uid"` +} + +// swagger:parameters getFolderByID +type FolderIDParam struct { + // in:path + // required:true + FolderID int64 `json:"folder_id"` +} + +// swagger:parameters createFolder +type CreateFolderParam struct { + // in:body + // required:true + Body models.CreateFolderCommand `json:"body"` +} + +// swagger:parameters updateFolder +type UpdateFolderParam struct { + // To change the unique identifier (uid), provide another one. + // To overwrite an existing folder with newer version, set `overwrite` to `true`. + // Provide 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`. + // + // in:body + // required:true + Body models.UpdateFolderCommand `json:"body"` +} + +// swagger:parameters deleteFolder +type DeleteFolderParam struct { + // If `true` any Grafana 8 Alerts under this folder will be deleted. + // Set to `false` so that the request will fail if the folder contains any Grafana 8 Alerts. + // in:query + // required:false + // default:false + ForceDeleteRules bool `json:"forceDeleteRules"` +} + +// swagger:response getFoldersResponse +type GetFoldersResponse struct { + // The response message + // in: body + Body []dtos.FolderSearchHit `json:"body"` +} + +// swagger:response folderResponse +type FolderResponse struct { + // The response message + // in: body + Body dtos.Folder `json:"body"` +} + +// swagger:response deleteFolderResponse +type DeleteFolderResponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the deleted folder. + // required: true + // example: 65 + ID int64 `json:"id"` + + // Title of the deleted folder. + // required: true + // example: My Folder + Title string `json:"title"` + + // Message Message of the deleted folder. + // required: true + // example: Folder My Folder deleted + Message string `json:"message"` + } `json:"body"` +} diff --git a/pkg/api/docs/definitions/folder_permissions.go b/pkg/api/docs/definitions/folder_permissions.go new file mode 100644 index 00000000000..77054f14a0c --- /dev/null +++ b/pkg/api/docs/definitions/folder_permissions.go @@ -0,0 +1,23 @@ +package definitions + +// swagger:route GET /folders/{folder_uid}/permissions folder_permissions getFolderPermissions +// +// Gets all existing permissions for the folder with the given `uid`. +// +// Responses: +// 200: getDashboardPermissionsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /folders/{folder_uid}/permissions folder_permissions updateFolderPermissions +// +// Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError diff --git a/pkg/api/docs/definitions/legacy_alert_notifications.go b/pkg/api/docs/definitions/legacy_alert_notifications.go new file mode 100644 index 00000000000..a4a17a386eb --- /dev/null +++ b/pkg/api/docs/definitions/legacy_alert_notifications.go @@ -0,0 +1,217 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /alert-notifications legacy_alerts_notification_channels getAlertNotificationChannels +// +// Get all notification channels. +// +// Returns all notification channels that the authenticated user has permission to view. +// +// Responses: +// 200: getAlertNotificationChannelsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /alert-notifications/lookup legacy_alerts_notification_channels lookupAlertNotificationChannels +// +// Get all notification channels (lookup) +// +// Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule. +// +// Responses: +// 200: lookupAlertNotificationChannelsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /alert-notifications/test legacy_alerts_notification_channels notificationChannelTest +// +// Test notification channel. +// +// Sends a test notification to the channel. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 412: SMTPNotEnabledError +// 500: internalServerError + +// swagger:route POST /alert-notifications legacy_alerts_notification_channels createAlertNotificationChannel +// +// Create notification channel. +// +// You can find the full list of [supported notifiers](https://grafana.com/docs/grafana/latest/alerting/old-alerting/notifications/#list-of-supported-notifiers) on the alert notifiers page. +// +// Responses: +// 200: getAlertNotificationChannelResponse +// 401: unauthorisedError +// 403: forbiddenError +// 409: conflictError +// 500: internalServerError + +// swagger:route PUT /alert-notifications/{notification_channel_id} legacy_alerts_notification_channels updateAlertNotificationChannel +// +// Update notification channel by ID. +// +// Updates an existing notification channel identified by ID. +// +// Responses: +// 200: getAlertNotificationChannelResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /alert-notifications/{notification_channel_id} legacy_alerts_notification_channels getAlertNotificationChannelByID +// +// Get notification channel by ID. +// +// Returns the notification channel given the notification channel ID. +// +// Responses: +// 200: getAlertNotificationChannelResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route DELETE /alert-notifications/{notification_channel_id} legacy_alerts_notification_channels deleteAlertNotificationChannel +// +// Delete alert notification by ID. +// +// Deletes an existing notification channel identified by ID. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /alert-notifications/uid/{notification_channel_uid} legacy_alerts_notification_channels getAlertNotificationChannelByUID +// +// Get notification channel by UID +// +// Returns the notification channel given the notification channel UID. +// +// Responses: +// 200: getAlertNotificationChannelResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /alert-notifications/uid/{notification_channel_uid} legacy_alerts_notification_channels updateAlertNotificationChannelBYUID +// +// Update notification channel by UID. +// +// Updates an existing notification channel identified by uid. +// +// Responses: +// 200: getAlertNotificationChannelResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route DELETE /alert-notifications/uid/{notification_channel_uid} legacy_alerts_notification_channels deleteAlertNotificationChannelByUID +// +// Delete alert notification by UID. +// +// Deletes an existing notification channel identified by UID. +// +// Responses: +// 200: deleteAlertNotificationChannelResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters updateAlertNotificationChannel getAlertNotificationChannelByID deleteAlertNotificationChannel +type NotificationIDParam struct { + // in:path + // required:true + NotificationID int64 `json:"notification_channel_id"` +} + +// swagger:parameters getAlertNotificationChannelByUID updateAlertNotificationChannelBYUID deleteAlertNotificationChannelByUID +type NotificationUIDParam struct { + // in:path + // required:true + NotificationUID string `json:"notification_channel_uid"` +} + +// swagger:parameters notificationChannelTest +type NotificationChannelTestParam struct { + // in:body + // required:true + Body dtos.NotificationTestCommand `json:"body"` +} + +// swagger:parameters createAlertNotificationChannel +type CreateAlertNotificationChannelParam struct { + // in:body + // required:true + Body models.CreateAlertNotificationCommand `json:"body"` +} + +// swagger:parameters updateAlertNotificationChannel +type UpdateAlertNotificationChannelParam struct { + // in:body + // required:true + Body models.UpdateAlertNotificationCommand `json:"body"` +} + +// swagger:parameters updateAlertNotificationChannelBYUID +type UpdateAlertNotificationChannelBYUIDParam struct { + // in:body + // required:true + Body models.UpdateAlertNotificationWithUidCommand `json:"body"` +} + +// swagger:response getAlertNotificationChannelsResponse +type GetAlertNotificationChannelsResponse struct { + // The response message + // in: body + Body []*dtos.AlertNotification `json:"body"` +} + +// swagger:response lookupAlertNotificationChannelsResponse +type LookupAlertNotificationChannelsResponse struct { + // The response message + // in: body + Body []*dtos.AlertNotificationLookup `json:"body"` +} + +// swagger:response getAlertNotificationChannelResponse +type GetAlertNotificationChannelResponse struct { + // The response message + // in: body + Body *dtos.AlertNotification `json:"body"` +} + +// swagger:response deleteAlertNotificationChannelResponse +type DeleteAlertNotificationChannelResponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the deleted notification channel. + // required: true + // example: 65 + ID int64 `json:"id"` + + // Message Message of the deleted notificatiton channel. + // required: true + Message string `json:"message"` + } `json:"body"` +} + +// swagger:response SMTPNotEnabledError +type SMTPNotEnabledError PreconditionFailedError diff --git a/pkg/api/docs/definitions/legacy_alerting.go b/pkg/api/docs/definitions/legacy_alerting.go new file mode 100644 index 00000000000..7ddf03fadf9 --- /dev/null +++ b/pkg/api/docs/definitions/legacy_alerting.go @@ -0,0 +1,177 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /alerts legacy_alerts getAlerts +// +// Get legacy alerts. +// +// Responses: +// 200: getAlertsResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route GET /alerts/{alert_id} legacy_alerts getAlertByID +// +// Get alert by ID. +// +// “evalMatches” data in the response is cached in the db when and only when the state of the alert changes (e.g. transitioning from “ok” to “alerting” state). +// If data from one server triggers the alert first and, before that server is seen leaving alerting state, a second server also enters a state that would trigger the alert, the second server will not be visible in “evalMatches” data. +// +// Responses: +// 200: getAlertResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route POST /alerts/{alert_id}/pause legacy_alerts pauseAlert +// +// Pause/unpause alert by id. +// +// Responses: +// 200: pauseAlertResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /alerts/test legacy_alerts testAlert +// +// Test alert. +// +// Responses: +// 200: testAlertResponse +// 400: badRequestError +// 422: unprocessableEntityError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /alerts/states-for-dashboard legacy_alerts getDashboardStates +// +// Get alert states for a dashboard. +// +// Responses: +// Responses: +// 200: getDashboardStatesResponse +// 400: badRequestError +// 500: internalServerError + +// swagger:parameters getAlertByID pauseAlert +type AlertIDParam struct { + // in:path + // required:true + AlertID string `json:"alert_id"` +} + +// swagger:parameters pauseAlert +type PauseAlertParam struct { + // in:body + // required:true + Body dtos.PauseAlertCommand `json:"body"` +} + +// swagger:parameters getAlerts +type GetAlertsParams struct { + // Limit response to alerts in specified dashboard(s). You can specify multiple dashboards. + // in:query + // required:false + DashboardID []string `json:"dashboardId"` + // Limit response to alert for a specified panel on a dashboard. + // in:query + // required:false + PanelID int64 `json:"panelId"` + // Limit response to alerts having a name like this value. + // in:query + // required: false + Query string `json:"query"` + // Return alerts with one or more of the following alert states + // in:query + // required:false + // Description: + // * `all` + // * `no_data` + // * `paused` + // * `alerting` + // * `ok` + // * `pending` + // * `unknown` + // enum: all,no_data,paused,alerting,ok,pending,unknown + State string `json:"state"` + // Limit response to X number of alerts. + // in:query + // required:false + Limit int64 `json:"limit"` + // Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders + // in:query + // required:false + // type array + // collectionFormat: multi + FolderID []string `json:"folderId"` + // Limit response to alerts having a dashboard name like this value./ Limit response to alerts having a dashboard name like this value. + // in:query + // required:false + DashboardQuery string `json:"dashboardQuery"` + // Limit response to alerts of dashboards with specified tags. To do an “AND” filtering with multiple tags, specify the tags parameter multiple times + // in:query + // required:false + // type: array + // collectionFormat: multi + DashboardTag []string `json:"dashboardTag"` +} + +// swagger:parameters testAlert +type TestAlertParam struct { + // in:body + Body dtos.AlertTestCommand `json:"body"` +} + +// swagger:parameters getDashboardStates +type GetDashboardStatesParam struct { + // in:query + // required: true + DashboardID int64 `json:"dashboardId"` +} + +// swagger:response getAlertsResponse +type GetAlertsResponse struct { + // The response message + // in: body + Body []*models.AlertListItemDTO `json:"body"` +} + +// swagger:response getAlertResponse +type GetAlertResponse struct { + // The response message + // in: body + Body []*models.Alert `json:"body"` +} + +// swagger:response pauseAlertResponse +type PauseAlertResponse struct { + // in:body + Body struct { + // required: true + AlertID int64 `json:"alertId"` + // required: true + Message string `json:"message"` + // Alert result state + // required true + State string `json:"state"` + } `json:"body"` +} + +// swagger:response testAlertResponse +type TestAlertResponse struct { + // The response message + // in: body + Body *dtos.AlertTestResult `json:"body"` +} + +// swagger:response getDashboardStatesResponse +type GetDashboardStatesResponse struct { + // The response message + // in: body + Body []*models.AlertStateInfoDTO `json:"body"` +} diff --git a/pkg/api/docs/definitions/library_elements.go b/pkg/api/docs/definitions/library_elements.go new file mode 100644 index 00000000000..414f3683aa2 --- /dev/null +++ b/pkg/api/docs/definitions/library_elements.go @@ -0,0 +1,190 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/services/libraryelements" +) + +// swagger:route GET /library-elements library_elements getLibraryElements +// +// Get all library elements. +// +// Returns a list of all library elements the authenticated user has permission to view. +// Use the `perPage` query parameter to control the maximum number of library elements returned; the default limit is `100`. +// You can also use the `page` query parameter to fetch library elements from any page other than the first one. +// +// Responses: +// 200: getLibraryElementsResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route GET /library-elements/{library_element_uid} library_elements getLibraryElementByUID +// +// Get library element by UID. +// +// Returns a library element with the given UID. +// +// Responses: +// 200: getLibraryElementResponse +// 401: unauthorisedError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /library-elements/name/{library_element_name} library_elements getLibraryElementByName +// +// Get library element by name. +// +// Returns a library element with the given name. +// +// Responses: +// 200: getLibraryElementResponse +// 401: unauthorisedError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /library-elements/{library_element_uid}/connections/ library_elements getLibraryElementConnections +// +// Get library element connections. +// +// Returns a list of connections for a library element based on the UID specified. +// +// Responses: +// 200: getLibraryElementConnectionsResponse +// 401: unauthorisedError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /library-elements library_elements createLibraryElement +// +// Create library element. +// +// Creates a new library element. +// +// Responses: +// 200: getLibraryElementResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PATCH /library-elements/{library_element_uid} library_elements updateLibraryElement +// +// Update library element. +// +// Updates an existing library element identified by uid. +// +// Responses: +// 200: getLibraryElementResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 412: preconditionFailedError +// 500: internalServerError + +// swagger:route DELETE /library-elements/{library_element_uid} library_elements deleteLibraryElementByUID +// +// Delete library element. +// +// Deletes an existing library element as specified by the UID. This operation cannot be reverted. +// You cannot delete a library element that is connected. This operation cannot be reverted. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters getLibraryElementByUID getLibraryElementConnections updateLibraryElement deleteLibraryElementByUID +type LibraryElementByUID struct { + // in:path + // required:true + UID string `json:"library_element_uid"` +} + +// swagger:parameters getLibraryElementByName +type LibraryElementByName struct { + // in:path + // required:true + Name string `json:"library_element_name"` +} + +// swagger:parameters getLibraryElements +type GetLibraryElementsParams struct { + // Part of the name or description searched for. + // in:query + // required:false + SearchString string `json:"searchString"` + // Kind of element to search for. + // in:query + // required:false + // Description: + // * 1 - library panels + // * 2 - library variables + // enum: 1,2 + Kind int `json:"kind"` + // Sort order of elements. + // in:query + // required:false + // Description: + // * alpha-asc: ascending + // * alpha-desc: descending + // Enum: alpha-asc,alpha-desc + SortDirection string `json:"sortDirection"` + // A comma separated list of types to filter the elements by + // in:query + // required:false + TypeFilter string `json:"typeFilter"` + // Element UID to exclude from search results. + // in:query + // required:false + ExcludeUID string `json:"excludeUid"` + // A comma separated list of folder ID(s) to filter the elements by. + // in:query + // required:false + FolderFilter string `json:"folderFilter"` + // The number of results per page. + // in:query + // required:false + // default: 100 + PerPage int `json:"perPage"` + // The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1. + // in:query + // required:false + // default: 1 + Page int `json:"page"` +} + +// swagger:parameters createLibraryElement +type CreateLibraryElementParam struct { + // in:body + // required:true + Body libraryelements.CreateLibraryElementCommand `json:"body"` +} + +// swagger:parameters updateLibraryElement +type UpdateLibraryElementParam struct { + // in:body + // required:true + Body libraryelements.PatchLibraryElementCommand `json:"body"` +} + +// swagger:response getLibraryElementsResponse +type GetLibraryElementsResponse struct { + // in: body + Body libraryelements.LibraryElementSearchResponse `json:"body"` +} + +// swagger:response getLibraryElementResponse +type GetLibraryElementResponse struct { + // in: body + Body libraryelements.LibraryElementResponse `json:"body"` +} + +// swagger:response getLibraryElementConnectionsResponse +type GetLibraryElementConnectionsResponse struct { + // in: body + Body libraryelements.LibraryElementConnectionsResponse `json:"body"` +} diff --git a/pkg/api/docs/definitions/meta.go b/pkg/api/docs/definitions/meta.go new file mode 100644 index 00000000000..560196f4291 --- /dev/null +++ b/pkg/api/docs/definitions/meta.go @@ -0,0 +1,31 @@ +// Package api Grafana HTTP API. +// +// The Grafana backend exposes an HTTP API, the same API is used by the frontend to do +// everything from saving dashboards, creating users and updating data sources. +// +// Schemes: http, https +// BasePath: /api +// Version: 0.0.1 +// License: GNU Affero General Public License v3.0 https://www.gnu.org/licenses/agpl-3.0.en.html +// Contact: Grafana Labs https://grafana.com +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// Security: +// - basic: +// - api_key: +// +// SecurityDefinitions: +// basic: +// type: basic +// api_key: +// type: apiKey +// name: Authorization +// in: header +// +// swagger:meta +package definitions diff --git a/pkg/api/docs/definitions/org.go b/pkg/api/docs/definitions/org.go new file mode 100644 index 00000000000..08322dc2873 --- /dev/null +++ b/pkg/api/docs/definitions/org.go @@ -0,0 +1,185 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /org current_org_details getOrg +// +// Get current Organization +// +// Responses: +// 200: getOrgResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /org/users current_org_details getOrgUsers +// +// Get all users within the current organization. +// +// Returns all org users within the current organization. Accessible to users with org admin role. +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users:read` with scope `users:*`. +// +// Responses: +// 200: getOrgUsersResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /org/users/lookup current_org_details lookupOrgUsers +// +// Get all users within the current organization (lookup) +// +// Returns all org users within the current organization, but with less detailed information. +// Accessible to users with org admin role, admin in any folder or admin of any team. +// Mainly used by Grafana UI for providing list of users when adding team members and when editing folder/dashboard permissions. +// +// Responses: +// 200: lookupOrgUsersResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PATCH /org/users/{user_id} current_org_details updateOrgUser +// +// Updates the given user +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users.role:update` with scope `users:*`. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route DELETE /org/users/{user_id} current_org_details deleteOrgUser +// +// Delete user in current organization +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users:remove` with scope `users:*`. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PUT /org current_org_details updateOrg +// +// Update current Organization. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PUT /org/address current_org_details updateOrgAddress +// +// Update current Organization's address. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /org/users current_org_details addOrgUser +// +// Add a new user to the current organization +// +// Adds a global user to the current organization. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users:add` with scope `users:*`. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:parameters updateOrgAddress adminUpdateOrgAddress +type UpdateOrgAddressParam struct { + // in:body + // required:true + Body dtos.UpdateOrgAddressForm `json:"body"` +} + +// swagger:parameters updateOrgUser adminUpdateOrgUser +type UpdateOrgUserParam struct { + // in:body + // required:true + Body models.UpdateOrgUserCommand `json:"body"` +} + +// swagger:parameters updateOrg adminUpdateOrg +type UpdateOrgParam struct { + // in:body + // required:true + Body dtos.UpdateOrgForm `json:"body"` +} + +// swagger:parameters addOrgUser adminAddOrgUser +type AddOrgUserParam struct { + // in:body + // required:true + Body models.AddOrgUserCommand `json:"body"` +} + +// swagger:parameters lookupOrgUsers +type LookupOrgUsersParams struct { + // in:query + // required:false + Query string `json:"query"` + // in:query + // required:false + Limit int `json:"limit"` +} + +// swagger:response getOrgResponse +type GetOrgResponse struct { + // The response message + // in: body + Body models.OrgDetailsDTO `json:"body"` +} + +// swagger:response getOrgUsersResponse +type GetOrgUsersResponse struct { + // The response message + // in: body + Body []*models.OrgUserDTO `json:"body"` +} + +// swagger:response lookupOrgUsersResponse +type LookupOrgUsersResponse struct { + // The response message + // in: body + Body []*dtos.UserLookupDTO `json:"body"` +} + +// swagger:response addOrgUser +type AddOrgUser struct { + // The response message + // in: body + Body struct { + // ID Identifier of the added user. + // required: true + // example: 65 + UsedID int64 `json:"id"` + + // Message Message of the added user. + // required: true + // example: Data source added + Message string `json:"message"` + } `json:"body"` +} diff --git a/pkg/api/docs/definitions/org_invites.go b/pkg/api/docs/definitions/org_invites.go new file mode 100644 index 00000000000..2d8344dc295 --- /dev/null +++ b/pkg/api/docs/definitions/org_invites.go @@ -0,0 +1,60 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/api/dtos" + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /org/invites org_invites getInvites +// +// Get pending invites. +// +// Responses: +// 200: getInvitesResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /org/invites org_invites addInvite +// +// Add invite. +// +// Responses: +// 200: addOrgUser +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 412: SMTPNotEnabledError +// 500: internalServerError + +// swagger:route DELETE /org/{invitation_code}/invites org_invites revokeInvite +// +// Revoke invite. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters addInvite +type AddInviteParam struct { + // in:body + // required:true + Body dtos.AddInviteForm `json:"body"` +} + +// swagger:parameters revokeInvite +type RevokeInviteParam struct { + // in:path + // required:true + Code string `json:"invitation_code"` +} + +// swagger:response getInvitesResponse +type GetInvitesResponse struct { + // The response message + // in: body + Body []*models.TempUserDTO `json:"body"` +} diff --git a/pkg/api/docs/definitions/org_preferences.go b/pkg/api/docs/definitions/org_preferences.go new file mode 100644 index 00000000000..3299de16c37 --- /dev/null +++ b/pkg/api/docs/definitions/org_preferences.go @@ -0,0 +1,22 @@ +package definitions + +// swagger:route GET /org/preferences org_preferences getOrgPreferences +// +// Get Current Org Prefs. +// +// Responses: +// 200: getPreferencesResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PUT /org/preferences org_preferences updateOrgPreferences +// +// Update Current Org Prefs. +// +// Responses: +// 200: addOrgUser +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError diff --git a/pkg/api/docs/definitions/orgs.go b/pkg/api/docs/definitions/orgs.go new file mode 100644 index 00000000000..f72924fd5ba --- /dev/null +++ b/pkg/api/docs/definitions/orgs.go @@ -0,0 +1,256 @@ +package definitions + +import "github.com/grafana/grafana/pkg/models" + +// swagger:route GET /orgs/{org_id} orgs getOrgByID +// +// Get Organization by ID. +// +// Security: +// - basic: +// +// Responses: +// 200: getOrgResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /orgs/name/{org_name} orgs getOrgByName +// +// Get Organization by ID. +// +// Security: +// - basic: +// +// Responses: +// 200: getOrgResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /orgs orgs createOrg +// +// Create Organization. +// +// Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set. +// +// Responses: +// 200: createOrgResponse +// 401: unauthorisedError +// 403: forbiddenError +// 409: conflictError +// 500: internalServerError + +// swagger:route GET /orgs orgs searchOrg +// +// Search all Organizations +// +// Security: +// - basic: +// +// Responses: +// 200: searchOrgResponse +// 401: unauthorisedError +// 403: forbiddenError +// 409: conflictError +// 500: internalServerError + +// swagger:route PUT /orgs/{org_id} orgs adminUpdateOrg +// +// Update Organization. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PUT /orgs/{org_id}/address orgs adminUpdateOrgAddress +// +// Update Organization's address. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route DELETE /orgs/{org_id} orgs adminDeleteOrg +// +// Delete Organization. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /orgs/{org_id}/users orgs adminGetOrgUsers +// +// Get Users in Organization. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users:read` with scope `users:*`. +// +// Security: +// - basic: +// +// Responses: +// 200: getOrgUsersResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /orgs/{org_id}/users orgs adminAddOrgUser +// +// Add a new user to the current organization +// +// Adds a global user to the current organization. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users:add` with scope `users:*`. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PATCH /orgs/{org_id}/users/{user_id} orgs adminUpdateOrgUser +// +// Update Users in Organization. +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users.role:update` with scope `users:*`. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route DELETE /orgs/{org_id}/users/{user_id} orgs adminDeleteOrgUser +// +// Delete user in current organization +// +// If you are running Grafana Enterprise and have Fine-grained access control enabled +// you need to have a permission with action: `org.users:remove` with scope `users:*`. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /orgs/{org_id}/quotas orgs getOrgQuota +// +// Fetch Organization quota. +// +// 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). +//list +// Responses: +// 200: getQuotaResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /orgs/{org_id}/quotas/{quota_target} orgs updateOrgQuota +// +// Update user quota. +// +// 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). +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters getOrgByID adminUpdateOrg adminUpdateOrgAddress adminDeleteOrg adminGetOrgUsers +// swagger:parameters adminAddOrgUser adminUpdateOrgUser adminDeleteOrgUser +// swagger:parameters getOrgQuota updateOrgQuota userSetUsingOrg +type OrgIDParam struct { + // in:path + // required:true + OrgID int64 `json:"org_id"` +} + +// swagger:parameters getOrgByName +type OrgNameParam struct { + // in:path + // required:true + OrgName string `json:"org_name"` +} + +// swagger:parameters createOrg +type CreateOrgParam struct { + // in:body + // required:true + Body models.CreateOrgCommand `json:"body"` +} + +// swagger:parameters searchOrg searchTeams +type SearchOrgParams struct { + // in:query + // required:false + // default: 1 + Page int `json:"page"` + // Number of items per page + // The totalCount field in the response can be used for pagination list E.g. if totalCount is equal to 100 teams and the perpage parameter is set to 10 then there are 10 pages of teams. + // in:query + // required:false + // default: 1000 + PerPage int `json:"perpage"` + Name string `json:"name"` + // 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. + // required:false + Query string `json:"query"` +} + +// swagger:parameters updateOrgQuota +type UpdateOrgQuotaParam struct { + // in:body + // required:true + Body models.UpdateOrgQuotaCmd `json:"body"` +} + +// swagger:response createOrgResponse +type CreateOrgResponse struct { + // The response message + // in: body + Body struct { + // ID Identifier of the created org. + // required: true + // example: 65 + OrgID int64 `json:"orgId"` + + // Message Message of the created org. + // required: true + // example: Data source added + Message string `json:"message"` + } `json:"body"` +} + +// swagger:response searchOrgResponse +type SearchOrgResponse struct { + // The response message + // in: body + Body []*models.OrgDTO `json:"body"` +} diff --git a/pkg/api/docs/definitions/responses.go b/pkg/api/docs/definitions/responses.go new file mode 100644 index 00000000000..712360880b8 --- /dev/null +++ b/pkg/api/docs/definitions/responses.go @@ -0,0 +1,83 @@ +package definitions + +// A GenericError is the default error message that is generated. +// For certain status codes there are more appropriate error structures. +// +// swagger:response genericError +type GenericError struct { + // The response message + // in: body + Body ErrorResponseBody `json:"body"` +} + +type ErrorResponseBody struct { + // a human readable version of the error + // required: true + Message string `json:"message"` + + // Error An optional detailed description of the actual error. Only included if running in developer mode. + Error string `json:"error"` + + // Status An optional status to denote the cause of the error. + // + // For example, a 412 Precondition Failed error may include additional information of why that error happened. + Status string `json:"status"` +} + +// swagger:model +type SuccessResponseBody struct { + Message string `json:"message,omitempty"` +} + +// An OKResponse is returned if the request was successful. +// +// swagger:response okResponse +type OKResponse struct { + // in: body + Body SuccessResponseBody `json:"body"` +} + +// ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource. +// +// swagger:response forbiddenError +type ForbiddenError GenericError + +// NotFoundError is returned when the requested resource was not found. +// +// swagger:response notFoundError +type NotFoundError GenericError + +// BadRequestError is returned when the request is invalid and it cannot be processed. +// +// swagger:response badRequestError +type BadRequestError GenericError + +// ConflictError +// +// swagger:response conflictError +type ConflictError GenericError + +// PreconditionFailedError +// +// swagger:response preconditionFailedError +type PreconditionFailedError GenericError + +// UnprocessableEntityError +// +// swagger:response unprocessableEntityError +type UnprocessableEntityError GenericError + +// InternalServerError is a general error indicating something went wrong internally. +// +// swagger:response internalServerError +type InternalServerError GenericError + +// UnauthorizedError is returned when the request is not authenticated. +// +// swagger:response unauthorisedError +type UnauthorizedError GenericError + +// AcceptedResponse +// +// swagger:response acceptedResponse +type AcceptedResponse GenericError diff --git a/pkg/api/docs/definitions/search.go b/pkg/api/docs/definitions/search.go new file mode 100644 index 00000000000..a76acd39be6 --- /dev/null +++ b/pkg/api/docs/definitions/search.go @@ -0,0 +1,90 @@ +package definitions + +import "github.com/grafana/grafana/pkg/services/search" + +// swagger:route GET /search/sorting search searchSorting +// +// List search sorting options +// +// Responses: +// 200: searchSortingResponse +// 401: unauthorisedError + +// swagger:route GET /search search search +// +// Responses: +// 200: searchResponse +// 401: unauthorisedError +// 422: unprocessableEntityError +// 500: internalServerError + +// swagger:parameters search +type SearchParameters struct { + // Search Query + // in:query + // required: false + Query string `json:"query"` + // List of tags to search for + // in:query + // required: false + // type: array + // collectionFormat: multi + Tag []string `json:"tag"` + // Type to search for, dash-folder or dash-db + // in:query + // required: false + // Description: + // * `dash-folder` - Search for folder + // * `dash-db` - Seatch for dashboard + // Enum: dash-folder,dash-db + Type string `json:"type"` + // List of dashboard id’s to search for + // in:query + // required: false + DashboardIds []int64 `json:"dashboardIds"` + // List of folder id’s to search in for dashboards + // in:query + // required: false + FolderIds []int64 `json:"folderIds"` + // Flag indicating if only starred Dashboards should be returned + // in:query + // required: false + Starred bool `json:"starred"` + // Limit the number of returned results (max 5000) + // in:query + // required: false + Limit int64 `json:"limit"` + // Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size. Only available in Grafana v6.2+. + // in:query + // required: false + Page int64 `json:"page"` + // Set to `Edit` to return dashboards/folders that the user can edit + // in:query + // required: false + // default:View + // Enum: Edit,View + Permission string `json:"permission"` + // Sort method; for listing all the possible sort methods use the search sorting endpoint. + // in:query + // required: false + // default: alpha-asc + // Enum: alpha-asc,alpha-desc + Sort string `json:"sort"` +} + +// swagger:response searchResponse +type SearchResponse struct { + // in: body + Body search.HitList `json:"body"` +} + +// swagger:response searchSortingResponse +type SearchSortingResponse struct { + // in: body + Body struct { + Name string `json:"name"` + DisplayName string `json:"displayName"` + Description string `json:"description"` + Meta string `json:"meta"` + } `json:"body"` +} diff --git a/pkg/api/docs/definitions/snapshot.go b/pkg/api/docs/definitions/snapshot.go new file mode 100644 index 00000000000..4926595a722 --- /dev/null +++ b/pkg/api/docs/definitions/snapshot.go @@ -0,0 +1,129 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route POST /snapshots snapshots createSnapshot +// +// 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. +// +// Snapshot public mode should be enabled or authentication is required. +// +// Responses: +// 200: createSnapshotResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /dashboard/snapshots snapshots getSnapshots +// +// List snapshots. +// +// Responses: +// 200: getSnapshotsResponse +// 500: internalServerError + +// swagger:route GET /snapshots/{key} snapshots getSnapshotByKey +// +// Get Snapshot by Key. +// +// Responses: +// 200: snapshotResponse +// 404: notFoundError +// 500: internalServerError + +// swagger:route DELETE /snapshots/{key} snapshots deleteSnapshotByKey +// +// Delete Snapshot by Key. +// +// Responses: +// 200: okResponse +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /snapshots-delete/{deleteKey} snapshots deleteSnapshotByDeleteKey +// +// Delete Snapshot by deleteKey. +// +// Snapshot public mode should be enabled or authentication is required. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /snapshot/shared-options snapshots getSnapshotSharingOptions +// +// Get snapshot sharing settings. +// +// Responses: +// 200: getSnapshotSharingOptionsResponse +// 401: unauthorisedError + +// swagger:parameters createSnapshot +type CreateSnapshotParam struct { + // in:body + // required:true + Body models.CreateDashboardSnapshotCommand `json:"body"` +} + +// swagger:parameters getSnapshots +type GetSnapshotsParams struct { + // Search Query + // in:query + Query string `json:"query"` + // Limit the number of returned results + // in:query + // default:1000 + Limit int64 `json:"limit"` +} + +// swagger:parameters getSnapshotByKey deleteSnapshotByKey +type SnapshotByKeyParam struct { + // in:path + Key string `json:"key"` +} + +// swagger:parameters deleteSnapshotByDeleteKey +type DeleteSnapshotByDeleteKeyParam struct { + // in:path + DeleteKey string `json:"deleteKey"` +} + +// swagger:response createSnapshotResponse +type CreateSnapshotResponse struct { + // in:body + Body struct { + // Unique key + Key string `json:"key"` + // Unique key used to delete the snapshot. It is different from the key so that only the creator can delete the snapshot. + DeleteKey string `json:"deleteKey"` + URL string `json:"url"` + DeleteUrl string `json:"deleteUrl"` + // Snapshot id + ID int64 `json:"id"` + } `json:"body"` +} + +// swagger:response getSnapshotsResponse +type GetSnapshotsResponse struct { + // in:body + Body []*models.DashboardSnapshotDTO `json:"body"` +} + +// swagger:response snapshotResponse +type SnapshotResponse DashboardResponse + +// swagger:response getSnapshotSharingOptionsResponse +type GetSnapshotSharingOptionsResponse struct { + // in:body + Body struct { + ExternalSnapshotURL string `json:"externalSnapshotURL"` + ExternalSnapshotName string `json:"externalSnapshotName"` + ExternalEnabled bool `json:"externalEnabled"` + } `json:"body"` +} diff --git a/pkg/api/docs/definitions/teams.go b/pkg/api/docs/definitions/teams.go new file mode 100644 index 00000000000..90b667abb2b --- /dev/null +++ b/pkg/api/docs/definitions/teams.go @@ -0,0 +1,188 @@ +package definitions + +import "github.com/grafana/grafana/pkg/models" + +// swagger:route GET /teams/search teams searchTeams +// +// Team Search With Paging. +// +// Responses: +// 200: searchTeamsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /teams teams createTeam +// +// Add Team. +// +// Responses: +// 200: createTeamResponse +// 401: unauthorisedError +// 403: forbiddenError +// 409: conflictError +// 500: internalServerError + +// swagger:route GET /teams/{team_id} teams getTeam +// +// Get Team By ID. +// +// Responses: +// 200: getTeamResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /teams/{team_id} teams updateTeam +// +// Update Team. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 409: conflictError +// 500: internalServerError + +// swagger:route DELETE /teams/{team_id} teams deleteTeamByID +// +// Delete Team By ID. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /teams/{team_id}/members teams getTeamMembers +// +// Get Team Members. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route POST /teams/{team_id}/members teams addTeamMember +// +// Add Team Member. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /teams/{team_id}/members/{user_id} teams updateTeamMember +// +// Update Team Member. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route DELETE /teams/{team_id}/members/{user_id} teams removeTeamMember +// +// Remove Member From Team. +// +// Responses: +// 200: okResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /teams/{team_id}/preferences teams getTeamPreferences +// +// Get Team Preferences. +// +// Responses: +// 200: getPreferencesResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route PUT /teams/{team_id}/preferences teams updateTeamPreferences +// +// Update Team Preferences. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 500: internalServerError + +// swagger:parameters getTeam updateTeam deleteTeamByID getTeamMembers addTeamMember updateTeamMember +// swagger:parameters removeTeamMember getTeamPreferences updateTeamPreferences +type TeamIDParam struct { + // in:path + // required:true + TeamID string `json:"team_id"` +} + +// swagger:parameters createTeam +type CreateTeamParam struct { + // in:body + // required:true + Body models.CreateTeamCommand `json:"body"` +} + +// swagger:parameters updateTeam +type UpdateTeamParam struct { + // in:body + // required:true + Body models.UpdateTeamCommand `json:"body"` +} + +// swagger:parameters addTeamMemberTeam +type AddTeamMemberParam struct { + // in:body + // required:true + Body models.AddTeamMemberCommand `json:"body"` +} + +// swagger:parameters updateTeamMember +type UpdateTeamMember struct { + // in:body + // required:true + Body models.UpdateTeamMemberCommand `json:"body"` +} + +// swagger:response searchTeamsResponse +type SearchTeamsResponse struct { + // The response message + // in: body + Body models.SearchTeamQueryResult `json:"body"` +} + +// swagger:response getTeamResponse +type GetTeamResponse struct { + // The response message + // in: body + Body *models.TeamDTO `json:"body"` +} + +// swagger:response createTeamResponse +type CreateTeamResponse struct { + // The response message + // in: body + Body struct { + TeamId int64 `json:"teamId"` + Message string `json:"message"` + } `json:"body"` +} + +// swagger:response getTeamMembersResponse +type GetTeamMembersResponse struct { + // The response message + // in: body + Body []*models.TeamMemberDTO `json:"body"` +} diff --git a/pkg/api/docs/definitions/user.go b/pkg/api/docs/definitions/user.go new file mode 100644 index 00000000000..e63049908d3 --- /dev/null +++ b/pkg/api/docs/definitions/user.go @@ -0,0 +1,194 @@ +package definitions + +import "github.com/grafana/grafana/pkg/models" + +// swagger:route GET /user signed_in_user getSignedInUser +// +// Get signed in User. +// +// Responses: +// 200: userResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /user signed_in_user updateSignedInUser +// +// Update signed in User. +// +// Responses: +// 200: userResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /user/using/{org_id} signed_in_user userSetUsingOrg +// +// Switch user context for signed in user. +// +// Switch user context to the given organization. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /user/orgs signed_in_user getSignedInUserOrgList +// +// Organizations of the actual User. +// +// Return a list of all organizations of the current user. +// +// Security: +// - basic: +// +// Responses: +// 200: getUserOrgListResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /user/teams signed_in_user getSignedInUserTeamList +// +// Teams that the actual User is member of. +// +// Return a list of all teams that the current user is member of. +// +// Responses: +// 200: getUserOrgListResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /user/stars/dashboard/{dashboard_id} signed_in_user starDashboard +// +// Star a dashboard. +// +// Stars the given Dashboard for the actual user. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route DELETE /user/stars/dashboard/{dashboard_id} signed_in_user unstarDashboard +// +// Unstar a dashboard. +// +// Deletes the starring of the given Dashboard for the actual user. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route PUT /user/password signed_in_user changeUserPassword +// +// Change Password. +// +// Changes the password for the user. +// +// Security: +// - basic: +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /user/quotas signed_in_user getUserQuotas +// +// Fetch user quota. +// +// Responses: +// 200: getQuotaResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /user/helpflags/{flag_id} signed_in_user setHelpFlag +// +// Set user help flag. +// +// Responses: +// 200: helpFlagResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /user/helpflags/clear signed_in_user clearHelpFlags +// +// Clear user help flag. +// +// Responses: +// 200: helpFlagResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /user/auth-tokens signed_in_user getSignedInUserAuthTokens +// +// Auth tokens of the actual User. +// +// Return a list of all auth tokens (devices) that the actual user currently have logged in from. +// +// Responses: +// 200: getAuthTokensResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route POST /user/revoke-auth-token signed_in_user revokeSignedINAuthTokenCmd +// +// Revoke an auth token of the actual User. +// +// 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. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:parameters starDashboard unstarDashboard +type DashboardIDParam struct { + // in:path + // required:true + DashboardID string `json:"dashboard_id"` +} + +// swagger:parameters setHelpFlag +type FlagIDParam struct { + // in:path + // required:true + FlagID string `json:"flag_id"` +} + +// swagger:parameters updateUser changeUserPassword +type ChangeUserPasswordParam struct { + // To change the email, name, login, theme, provide another one. + // in:body + // required:true + Body models.ChangeUserPasswordCommand `json:"body"` +} + +// swagger:response helpFlagResponse +type HelpFlagResponse struct { + // The response message + // in: body + Body struct { + HelpFlags1 int64 `json:"helpFlags1"` + Message string `json:"message"` + } `json:"body"` +} diff --git a/pkg/api/docs/definitions/user_preferences.go b/pkg/api/docs/definitions/user_preferences.go new file mode 100644 index 00000000000..71e81643673 --- /dev/null +++ b/pkg/api/docs/definitions/user_preferences.go @@ -0,0 +1,37 @@ +package definitions + +import "github.com/grafana/grafana/pkg/api/dtos" + +// swagger:route GET /user/preferences user_preferences getUserPreferences +// +// Get user preferences. +// +// Responses: +// 200: getPreferencesResponse +// 401: unauthorisedError +// 500: internalServerError + +// swagger:route PUT /user/preferences user_preferences updateUserPreferences +// +// Update user preferences. +// +// Omitting a key (`theme`, `homeDashboardId`, `timezone`) will cause the current value to be replaced with the system default value. +// +// Responses: +// 200: okResponse +// 400: badRequestError +// 401: unauthorisedError +// 500: internalServerError + +// swagger:parameters updateUserPreferences updateOrgPreferences updateTeamPreferences +type UpdateUserPreferencesParam struct { + // in:body + // required:true + Body dtos.UpdatePrefsCmd `json:"body"` +} + +// swagger:response getPreferencesResponse +type GetPreferencesResponse struct { + // in:body + Body dtos.Prefs `json:"body"` +} diff --git a/pkg/api/docs/definitions/users.go b/pkg/api/docs/definitions/users.go new file mode 100644 index 00000000000..28f9e22873f --- /dev/null +++ b/pkg/api/docs/definitions/users.go @@ -0,0 +1,179 @@ +package definitions + +import ( + "github.com/grafana/grafana/pkg/models" +) + +// swagger:route GET /users users searchUsers +// +// Get users. +// +// Returns all users that the authenticated user has permission to view, admin permission required. +// +// Responses: +// 200: searchUsersResponse +// 401: unauthorisedError +// 403: forbiddenError +// 500: internalServerError + +// swagger:route GET /users/search users searchUsersWithPaging +// +// Get users with paging. +// +// Responses: +// 200: searchUsersResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /users/{user_id} users getUserByID +// +// Get user by id. +// +// Responses: +// 200: userResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /users/lookup users getUserByLoginOrEmail +// +// Get user by login or email. +// +// Responses: +// 200: userResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route PUT /users/{user_id} users updateUser +// +// Update user. +// +// Update the user identified by id. +// +// Responses: +// 200: userResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /users/{user_id}/orgs users getUserOrgList +// +// Get organizations for user. +// +// Get organizations for user identified by id. +// +// Responses: +// 200: getUserOrgListResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:route GET /users/{user_id}/teams users getUserTeams +// +// Get teams for user. +// +// Get teams for user identified by id. +// +// Responses: +// 200: getUserTeamsResponse +// 401: unauthorisedError +// 403: forbiddenError +// 404: notFoundError +// 500: internalServerError + +// swagger:parameters searchUsers +type SearchUsersParams struct { + // Limit the maximum number of users to return per page + // in:query + // required:false + // default:1000 + Limit int64 `json:"perpage"` + // Page index for starting fetching users + // in:query + // required:false + // default:1 + Page int64 `json:"page"` +} + +// swagger:parameters searchUsersWithPaging + +type SearchUsersWithPagingParams struct { + // Limit the maximum number of users to return per page + // in:query + // required:false + // default:1000 + Limit int64 `json:"perpage"` + // Page index for starting fetching users + // in:query + // required:false + // default:1 + Page int64 `json:"page"` + // Query allows return results where the query value is contained in one of the name, login or email fields. Query values with spaces need to be URL encoded e.g. query=Jane%20Doe + // in:query + // required:false + Query string `json:"query"` +} + +// swagger:parameters getUserByID updateUser getUserOrgList getUserTeams +// swagger:parameters setPassword setPermissions deleteUser getAuthTokens logoutUser revokeAuthToken +// swagger:parameters syncLDAPUser disableUser enableUser getUserQuota updateUserQuota +// swagger:parameters updateOrgUser deleteOrgUser adminUpdateOrgUser adminDeleteOrgUser +// swagger:parameters updateTeamMember removeTeamMember +// swagger:parameters listUserRoles addUserRole +// swagger:parameters listUserRoles addUserRole removeUserRole setUserRoles listUserRoles +type UserIDParam struct { + // in:path + // required:true + UserID int64 `json:"user_id"` +} + +// swagger:parameters getUserByLoginOrEmail +type GetUserByLoginOrEmailParam struct { + // loginOrEmail of the user + // in:query + // required:true + LoginOrEmail string `json:"loginOrEmail"` +} + +// swagger:parameters updateUser updateSignedInUser +type UpdateUserParam struct { + // To change the email, name, login, theme, provide another one. + // in:body + // required:true + Body models.UpdateUserCommand `json:"body"` +} + +// swagger:response searchUsersResponse +type SearchUsersResponse struct { + // The response message + // in: body + Body models.SearchUserQueryResult `json:"body"` +} + +// swagger:response userResponse +type UserResponse struct { + // The response message + // in: body + Body models.UserProfileDTO `json:"body"` +} + +// swagger:response getUserOrgListResponse +type GetUserOrgListResponse struct { + // The response message + // in: body + Body []*models.UserOrgDTO `json:"body"` +} + +// swagger:response getUserTeamsResponse +type GetUserTeamsResponse struct { + // The response message + // in: body + Body []*models.TeamDTO `json:"body"` +} diff --git a/pkg/api/docs/merge/merge_specs.go b/pkg/api/docs/merge/merge_specs.go new file mode 100644 index 00000000000..05fcc7d82b3 --- /dev/null +++ b/pkg/api/docs/merge/merge_specs.go @@ -0,0 +1,108 @@ +package main + +import ( + "bytes" + _ "embed" + "encoding/json" + "flag" + "fmt" + "io/ioutil" + "os" + "strings" + + "github.com/go-openapi/loads" + "github.com/go-openapi/spec" +) + +// 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) + } + + //TODO: consumes, produces, schemes + + //TODO: check for conflicts + for k, d := range additionalSpec.OrigSpec().SwaggerProps.Definitions { + specOSS.SwaggerProps.Definitions[k] = d + } + + for k, r := range additionalSpec.OrigSpec().SwaggerProps.Responses { + specOSS.SwaggerProps.Responses[k] = r + } + + 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/api/docs/tags.json b/pkg/api/docs/tags.json new file mode 100644 index 00000000000..30c103748f6 --- /dev/null +++ b/pkg/api/docs/tags.json @@ -0,0 +1,84 @@ +{ + "tags": [ + { + "name": "datasources", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required." + }, + { + "name": "folders", + "description": "Folders are identified by the identifier (id) and the unique identifier (uid).\nThe identifier (id) of a folder is an auto-incrementing numeric value and is only unique per Grafana install.\nThe unique identifier (uid) of a folder can be used for uniquely identify folders between multiple Grafana installs. It’s automatically generated if not provided when creating a folder. The uid allows having consistent URLs for accessing folders and when syncing folders between multiple Grafana installs. This means that changing the title of a folder will not break any bookmarked links to that folder.\nThe uid can have a maximum length of 40 characters.\n\nThe General folder (id=0) is special and is not part of the Folder API which means that you cannot use this API for retrieving information about the General folder." + }, + { + "name": "folder_permissions", + "description": "Permissions with `folderId=-1` are the default permissions for users with the Viewer and Editor roles. Permissions can be set for a user, a team or a role (Viewer or Editor). Permissions cannot be set for Admins - they always have access to everything." + }, + { + "name": "admin", + "description": "The Admin HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission. (The default admin user is called admin and has permission to use this API.)" + }, + { + "name": "legacy_alerts", + "description": "You can use the Alerting API to get information about legacy dashboard alerts and their states but this API cannot be used to modify the alert. To create new alerts or modify them you need to update the dashboard JSON that contains the alerts.\nThis topic is relevant for the legacy dashboard alerts only.\nYou can find Grafana 8 alerts API specification details [here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/grafana/grafana/main/pkg/services/ngalert/api/tooling/post.json)." + }, + { + "name": "legacy_alerts_notification_channels", + "description": "The identifier (id) of a notification channel is an auto-incrementing numeric value and is only unique per Grafana install.\nThe unique identifier (uid) of a notification channel can be used for uniquely identify a notification channel between multiple Grafana installs. It’s automatically generated if not provided when creating a notification channel. The uid allows having consistent URLs for accessing notification channels and when syncing notification channels between multiple Grafana installations, refer to alert notification channel provisioning.\nThe uid can have a maximum length of 40 characters." + }, + { + "name": "annotations", + "description": "Grafana Annotations feature released in Grafana 4.6. Annotations are saved in the Grafana database (sqlite, mysql or postgres). Annotations can be global annotations that can be shown on any dashboard by configuring an annotation data source - they are filtered by tags. Or they can be tied to a panel on a dashboard and are then only shown on that panel." + }, + { + "name": "library_elements", + "description": "The identifier (ID) of a library element is an auto-incrementing numeric value that is unique per Grafana install.\nThe unique identifier (UID) of a library element uniquely identifies library elements between multiple Grafana installs. It’s automatically generated unless you specify it during library element creation. The UID provides consistent URLs for accessing library elements and when syncing library elements between multiple Grafana installs.\nThe maximum length of a UID is 40 characters." + }, + { + "name": "orgs", + "description": "The Admin Organizations HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission (The default admin user is called `admin` and has permission to use this API)." + }, + { + "name": "current_org_details", + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required." + }, + { + "name": "teams", + "description": "This API can be used to create/update/delete Teams and to add/remove users to Teams. All actions require that the user has the Admin role for the organization." + }, + { + "name": "datasource_permissions", + "description": "This API can be used to enable, disable, list, add and remove permissions for a data source.\nPermissions can be set for a user or a team. Permissions cannot be set for Admins - they always have access to everything.\nThis is only available in Grafana Enterprise\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required." + }, + { + "name": "enterprise", + "description": "These are only available in Grafana Enterprise" + }, + { + "name": "access_control", + "description": "The API can be used to create, update, get and list roles, and create or remove built-in role assignments. To use the API, you would need to enable fine-grained access control.\nThis only available in Grafana Enterprise.\nThe API does not currently work with an API Token. So in order to use these API endpoints you will have to use Basic auth." + }, + { + "name": "licensing", + "description": "Licensing is only available in Grafana Enterprise. Read more about Grafana Enterprise.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required." + }, + { + "name": "reports", + "description": "This API allows you to interact programmatically with the Reporting feature.\nReporting is only available in Grafana Enterprise. Read more about Grafana Enterprise.\nIf you have Fine-grained access Control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required." + }, + { + "name": "alertmanager", + "description": "Grafana Alerting Alertmanager-compatible endpoints" + }, + { + "name": "ruler", + "description": "Grafana Alerting endpoints for managing rules" + }, + { + "name": "testing", + "description": "Grafana Alerting testing endpoints" + }, + { + "name": "prometheus", + "description": "Grafana Alerting Prometheus-compatible endpoints" + } + ] +} \ No newline at end of file diff --git a/pkg/api/dtos/acl.go b/pkg/api/dtos/acl.go index 7e39cdb4604..c163569193f 100644 --- a/pkg/api/dtos/acl.go +++ b/pkg/api/dtos/acl.go @@ -2,13 +2,21 @@ package dtos import "github.com/grafana/grafana/pkg/models" +// swagger:model type UpdateDashboardAclCommand struct { Items []DashboardAclUpdateItem `json:"items"` } +// swagger:model type DashboardAclUpdateItem struct { - UserID int64 `json:"userId"` - TeamID int64 `json:"teamId"` - Role *models.RoleType `json:"role,omitempty"` + UserID int64 `json:"userId"` + TeamID int64 `json:"teamId"` + Role *models.RoleType `json:"role,omitempty"` + // Permission level + // Description: + // * `1` - View + // * `2` - Edit + // * `4` - Admin + // Enum: 1,2,4 Permission models.PermissionType `json:"permission"` } diff --git a/pkg/api/dtos/models.go b/pkg/api/dtos/models.go index b1886d85e1a..81adfe5cc99 100644 --- a/pkg/api/dtos/models.go +++ b/pkg/api/dtos/models.go @@ -48,11 +48,25 @@ type CurrentUser struct { type UserPermissionsMap map[string]bool +// swagger:model type MetricRequest struct { - From string `json:"from"` - To string `json:"to"` + // From Start time in epoch timestamps in milliseconds or relative using Grafana time units. + // required: true + // example: now-1h + From string `json:"from"` + // To End time in epoch timestamps in milliseconds or relative using Grafana time units. + // required: true + // example: now + To string `json:"to"` + // queries.refId – Specifies an identifier of the query. Is optional and default to “A”. + // queries.datasourceId – Specifies the data source to be queried. Each query in the request must have an unique datasourceId. + // queries.maxDataPoints - Species maximum amount of data points that dashboard panel can render. Is optional and default to 100. + // queries.intervalMs - Specifies the time interval in milliseconds of time series. Is optional and defaults to 1000. + // required: true + // example: [ { "refId": "A", "intervalMs": 86400000, "maxDataPoints": 1092, "datasourceId": 86, "rawSql": "SELECT 1 as valueOne, 2 as valueTwo", "format": "table" } ] Queries []*simplejson.Json `json:"queries"` - Debug bool `json:"debug"` + // required: false + Debug bool `json:"debug"` } func GetGravatarUrl(text string) string { diff --git a/pkg/api/dtos/prefs.go b/pkg/api/dtos/prefs.go index 5ee5e878938..bb513f5b416 100644 --- a/pkg/api/dtos/prefs.go +++ b/pkg/api/dtos/prefs.go @@ -7,9 +7,14 @@ type Prefs struct { WeekStart string `json:"weekStart"` } +// swagger:model type UpdatePrefsCmd struct { - Theme string `json:"theme"` - HomeDashboardID int64 `json:"homeDashboardId"` - Timezone string `json:"timezone"` - WeekStart string `json:"weekStart"` + // Enum: light,dark + Theme string `json:"theme"` + // The numerical :id of a favorited dashboard + // Default:0 + HomeDashboardID int64 `json:"homeDashboardId"` + // Enum: utc,browser + Timezone string `json:"timezone"` + WeekStart string `json:"weekStart"` } diff --git a/pkg/api/http_server.go b/pkg/api/http_server.go index b0bf64917b2..31dd4e6a561 100644 --- a/pkg/api/http_server.go +++ b/pkg/api/http_server.go @@ -446,7 +446,7 @@ func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() { m.Use(middleware.Recovery(hs.Cfg)) hs.mapStatic(m, hs.Cfg.StaticRootPath, "build", "public/build") - hs.mapStatic(m, hs.Cfg.StaticRootPath, "", "public") + hs.mapStatic(m, hs.Cfg.StaticRootPath, "", "public", "/public/views/swagger.html") hs.mapStatic(m, hs.Cfg.StaticRootPath, "robots.txt", "robots.txt") if hs.Cfg.ImageUploadProvider == "local" { @@ -553,7 +553,7 @@ func (hs *HTTPServer) apiHealthHandler(ctx *web.Context) { } } -func (hs *HTTPServer) mapStatic(m *web.Mux, rootDir string, dir string, prefix string) { +func (hs *HTTPServer) mapStatic(m *web.Mux, rootDir string, dir string, prefix string, exclude ...string) { headers := func(c *web.Context) { c.Resp.Header().Set("Cache-Control", "public, max-age=3600") } @@ -576,6 +576,7 @@ func (hs *HTTPServer) mapStatic(m *web.Mux, rootDir string, dir string, prefix s SkipLogging: true, Prefix: prefix, AddHeaders: headers, + Exclude: exclude, }, )) } diff --git a/pkg/api/static/static.go b/pkg/api/static/static.go index f08091fb516..786cc5c55ba 100644 --- a/pkg/api/static/static.go +++ b/pkg/api/static/static.go @@ -52,6 +52,8 @@ type StaticOptions struct { AddHeaders func(ctx *web.Context) // FileSystem is the interface for supporting any implementation of file system. FileSystem http.FileSystem + // Exclude paths from being served + Exclude []string } // FIXME: to be deleted. @@ -121,6 +123,12 @@ func staticHandler(ctx *web.Context, log log.Logger, opt StaticOptions) bool { } file := ctx.Req.URL.Path + for _, p := range opt.Exclude { + if file == p { + return false + } + } + // if we have a prefix, filter requests by stripping the prefix if opt.Prefix != "" { if !strings.HasPrefix(file, opt.Prefix) { diff --git a/pkg/api/swagger.go b/pkg/api/swagger.go new file mode 100644 index 00000000000..37d88541e72 --- /dev/null +++ b/pkg/api/swagger.go @@ -0,0 +1,7 @@ +package api + +import "github.com/grafana/grafana/pkg/models" + +func swaggerUI(c *models.ReqContext) { + c.HTML(200, "swagger", nil) +} diff --git a/pkg/models/alert_notifications.go b/pkg/models/alert_notifications.go index b7c20b142ce..2d23339d177 100644 --- a/pkg/models/alert_notifications.go +++ b/pkg/models/alert_notifications.go @@ -55,7 +55,7 @@ type CreateAlertNotificationCommand struct { OrgId int64 `json:"-"` EncryptedSecureSettings map[string][]byte `json:"-"` - Result *AlertNotification + Result *AlertNotification `json:"-"` } type UpdateAlertNotificationCommand struct { @@ -73,7 +73,7 @@ type UpdateAlertNotificationCommand struct { OrgId int64 `json:"-"` EncryptedSecureSettings map[string][]byte `json:"-"` - Result *AlertNotification + Result *AlertNotification `json:"-"` } type UpdateAlertNotificationWithUidCommand struct { @@ -88,8 +88,8 @@ type UpdateAlertNotificationWithUidCommand struct { Settings *simplejson.Json `json:"settings" binding:"Required"` SecureSettings map[string]string `json:"secureSettings"` - OrgId int64 - Result *AlertNotification + OrgId int64 `json:"-"` + Result *AlertNotification `json:"-"` } type DeleteAlertNotificationCommand struct { diff --git a/pkg/models/dashboard_snapshot.go b/pkg/models/dashboard_snapshot.go index 64ff5321783..c86fe395d70 100644 --- a/pkg/models/dashboard_snapshot.go +++ b/pkg/models/dashboard_snapshot.go @@ -44,17 +44,32 @@ type DashboardSnapshotDTO struct { // ----------------- // COMMANDS +// swagger:model type CreateDashboardSnapshotCommand struct { + // The complete dashboard model. + // required:true Dashboard *simplejson.Json `json:"dashboard" binding:"Required"` - Name string `json:"name"` - Expires int64 `json:"expires"` + // Snapshot name + // required:false + Name string `json:"name"` + // When the snapshot should expire in seconds in seconds. Default is never to expire. + // required:false + // default:0 + Expires int64 `json:"expires"` // these are passed when storing an external snapshot ref + // Save the snapshot on an external server rather than locally. + // required:false + // default: false External bool `json:"external"` ExternalUrl string `json:"-"` ExternalDeleteUrl string `json:"-"` - Key string `json:"key"` + // Define the unique key. Required if `external` is `true`. + // required:false + Key string `json:"key"` + // Unique key used to delete the snapshot. It is different from the `key` so that only the creator can delete the snapshot. Required if `external` is `true`. + // required:false DeleteKey string `json:"deleteKey"` OrgId int64 `json:"-"` diff --git a/pkg/models/dashboards.go b/pkg/models/dashboards.go index 11d8473b6e8..008ecf2c022 100644 --- a/pkg/models/dashboards.go +++ b/pkg/models/dashboards.go @@ -349,13 +349,13 @@ type SaveDashboardCommand struct { UpdatedAt time.Time - Result *Dashboard + Result *Dashboard `json:"-"` } type TrimDashboardCommand struct { Dashboard *simplejson.Json `json:"dashboard" binding:"Required"` Meta *simplejson.Json `json:"meta"` - Result *Dashboard + Result *Dashboard `json:"-"` } type DashboardProvisioning struct { diff --git a/pkg/models/datasource.go b/pkg/models/datasource.go index ba4184a848f..30f63fde5ab 100644 --- a/pkg/models/datasource.go +++ b/pkg/models/datasource.go @@ -92,7 +92,7 @@ type AddDataSourceCommand struct { ReadOnly bool `json:"-"` EncryptedSecureJsonData map[string][]byte `json:"-"` - Result *DataSource + Result *DataSource `json:"-"` } // Also acts as api DTO @@ -119,7 +119,7 @@ type UpdateDataSourceCommand struct { ReadOnly bool `json:"-"` EncryptedSecureJsonData map[string][]byte `json:"-"` - Result *DataSource + Result *DataSource `json:"-"` } // DeleteDataSourceCommand will delete a DataSource based on OrgID as well as the UID (preferred), ID, or Name. @@ -171,6 +171,12 @@ type GetDataSourceQuery struct { // Permissions // --------------------- +// Datasource permission +// Description: +// * `0` - No Access +// * `1` - Query +// Enum: 0,1 +// swagger:model type DsPermissionType int const ( diff --git a/pkg/models/folders.go b/pkg/models/folders.go index faa0af947fc..56fe0cfec99 100644 --- a/pkg/models/folders.go +++ b/pkg/models/folders.go @@ -62,7 +62,7 @@ type CreateFolderCommand struct { Uid string `json:"uid"` Title string `json:"title"` - Result *Folder + Result *Folder `json:"-"` } type UpdateFolderCommand struct { @@ -71,7 +71,7 @@ type UpdateFolderCommand struct { Version int `json:"version"` Overwrite bool `json:"overwrite"` - Result *Folder + Result *Folder `json:"-"` } // diff --git a/pkg/server/server.go b/pkg/server/server.go index ee975ba3431..92a2839db8b 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -15,6 +15,7 @@ import ( "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/api" + _ "github.com/grafana/grafana/pkg/api/docs/definitions" _ "github.com/grafana/grafana/pkg/extensions" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/metrics" diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 8a4f30a4854..f8c8da1790f 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -116,6 +116,11 @@ var ( State: FeatureStateAlpha, RequiresDevMode: true, }, + { + Name: "swaggerUi", + Description: "Serves swagger UI", + State: FeatureStateBeta, + }, { Name: "featureHighlights", Description: "Highlight Enterprise features", diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index b95fddff591..632119bab60 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -87,6 +87,10 @@ const ( // only execute the query saved in a panel FlagValidatedQueries = "validatedQueries" + // FlagSwaggerUi + // Serves swagger UI + FlagSwaggerUi = "swaggerUi" + // FlagFeatureHighlights // Highlight Enterprise features FlagFeatureHighlights = "featureHighlights" diff --git a/pkg/services/libraryelements/api.go b/pkg/services/libraryelements/api.go index ea9ac0994a2..8babbe60046 100644 --- a/pkg/services/libraryelements/api.go +++ b/pkg/services/libraryelements/api.go @@ -83,7 +83,7 @@ func (l *LibraryElementService) getAllHandler(c *models.ReqContext) response.Res // patchHandler handles PATCH /api/library-elements/:uid func (l *LibraryElementService) patchHandler(c *models.ReqContext) response.Response { - cmd := patchLibraryElementCommand{} + cmd := PatchLibraryElementCommand{} if err := web.Bind(c.Req, &cmd); err != nil { return response.Error(http.StatusBadRequest, "bad request data", err) } diff --git a/pkg/services/libraryelements/database.go b/pkg/services/libraryelements/database.go index 98ccfdf485e..88b95a957ee 100644 --- a/pkg/services/libraryelements/database.go +++ b/pkg/services/libraryelements/database.go @@ -436,7 +436,7 @@ func (l *LibraryElementService) handleFolderIDPatches(ctx context.Context, eleme } // patchLibraryElement updates a Library Element. -func (l *LibraryElementService) patchLibraryElement(c context.Context, signedInUser *models.SignedInUser, cmd patchLibraryElementCommand, uid string) (LibraryElementDTO, error) { +func (l *LibraryElementService) patchLibraryElement(c context.Context, signedInUser *models.SignedInUser, cmd PatchLibraryElementCommand, uid string) (LibraryElementDTO, error) { var dto LibraryElementDTO if err := l.requireSupportedElementKind(cmd.Kind); err != nil { return LibraryElementDTO{}, err diff --git a/pkg/services/libraryelements/libraryelements_patch_test.go b/pkg/services/libraryelements/libraryelements_patch_test.go index a20f7d499b6..0633a014593 100644 --- a/pkg/services/libraryelements/libraryelements_patch_test.go +++ b/pkg/services/libraryelements/libraryelements_patch_test.go @@ -14,7 +14,7 @@ import ( func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel that does not exist, it should fail", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{Kind: int64(models.PanelElement), Version: 1} + cmd := PatchLibraryElementCommand{Kind: int64(models.PanelElement), Version: 1} sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": "unknown"}) sc.reqContext.Req.Body = mockRequestBody(cmd) resp := sc.service.patchHandler(sc.reqContext) @@ -24,7 +24,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel that exists, it should succeed", func(t *testing.T, sc scenarioContext) { newFolder := createFolderWithACL(t, sc.sqlStore, "NewFolder", sc.user, []folderACLItem{}) - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: newFolder.Id, Name: "Panel - New name", Model: []byte(` @@ -87,7 +87,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with folder only, it should change folder successfully and return correct result", func(t *testing.T, sc scenarioContext) { newFolder := createFolderWithACL(t, sc.sqlStore, "NewFolder", sc.user, []folderACLItem{}) - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: newFolder.Id, Kind: int64(models.PanelElement), Version: 1, @@ -109,7 +109,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with name only, it should change name successfully and return correct result", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, Name: "New Name", Kind: int64(models.PanelElement), @@ -132,7 +132,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with a nonexistent UID, it should change UID successfully and return correct result", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, UID: util.GenerateShortUID(), Kind: int64(models.PanelElement), @@ -155,7 +155,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with an invalid UID, it should fail", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, UID: "Testing an invalid UID", Kind: int64(models.PanelElement), @@ -169,7 +169,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with an UID that is too long, it should fail", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, UID: "j6T00KRZzj6T00KRZzj6T00KRZzj6T00KRZzj6T00K", Kind: int64(models.PanelElement), @@ -188,7 +188,7 @@ func TestPatchLibraryElement(t *testing.T) { sc.reqContext.Req.Body = mockRequestBody(command) resp := sc.service.createHandler(sc.reqContext) require.Equal(t, 200, resp.Status()) - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, UID: command.UID, Kind: int64(models.PanelElement), @@ -202,7 +202,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with model only, it should change model successfully, sync type and description fields and return correct result", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, Model: []byte(`{ "title": "New Model Title", "name": "New Model Name", "type":"graph", "description": "New description" }`), Kind: int64(models.PanelElement), @@ -231,7 +231,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with model.description only, it should change model successfully, sync type and description fields and return correct result", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, Model: []byte(`{ "description": "New description" }`), Kind: int64(models.PanelElement), @@ -258,7 +258,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with model.type only, it should change model successfully, sync type and description fields and return correct result", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: -1, Model: []byte(`{ "type": "graph" }`), Kind: int64(models.PanelElement), @@ -285,7 +285,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When another admin tries to patch a library panel, it should change UpdatedBy successfully and return correct result", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{FolderID: -1, Version: 1, Kind: int64(models.PanelElement)} + cmd := PatchLibraryElementCommand{FolderID: -1, Version: 1, Kind: int64(models.PanelElement)} sc.reqContext.UserId = 2 sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": sc.initialResult.Result.UID}) sc.ctx.Req.Body = mockRequestBody(cmd) @@ -307,7 +307,7 @@ func TestPatchLibraryElement(t *testing.T) { sc.ctx.Req.Body = mockRequestBody(command) resp := sc.service.createHandler(sc.reqContext) var result = validateAndUnMarshalResponse(t, resp) - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ Name: "Text - Library Panel", Version: 1, Kind: int64(models.PanelElement), @@ -325,7 +325,7 @@ func TestPatchLibraryElement(t *testing.T) { sc.ctx.Req.Body = mockRequestBody(command) resp := sc.service.createHandler(sc.reqContext) var result = validateAndUnMarshalResponse(t, resp) - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: 1, Version: 1, Kind: int64(models.PanelElement), @@ -338,7 +338,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel in another org, it should fail", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: sc.folder.Id, Version: 1, Kind: int64(models.PanelElement), @@ -352,7 +352,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with an old version number, it should fail", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: sc.folder.Id, Version: 1, Kind: int64(models.PanelElement), @@ -368,7 +368,7 @@ func TestPatchLibraryElement(t *testing.T) { scenarioWithPanel(t, "When an admin tries to patch a library panel with an other kind, it should succeed but panel should not change", func(t *testing.T, sc scenarioContext) { - cmd := patchLibraryElementCommand{ + cmd := PatchLibraryElementCommand{ FolderID: sc.folder.Id, Version: 1, Kind: int64(models.VariableElement), diff --git a/pkg/services/libraryelements/libraryelements_permissions_test.go b/pkg/services/libraryelements/libraryelements_permissions_test.go index ce959d5df9a..362b98cd093 100644 --- a/pkg/services/libraryelements/libraryelements_permissions_test.go +++ b/pkg/services/libraryelements/libraryelements_permissions_test.go @@ -86,7 +86,7 @@ func TestLibraryElementPermissions(t *testing.T) { toFolder := createFolderWithACL(t, sc.sqlStore, "Folder", sc.user, testCase.items) sc.reqContext.SignedInUser.OrgRole = testCase.role - cmd := patchLibraryElementCommand{FolderID: toFolder.Id, Version: 1, Kind: int64(models.PanelElement)} + cmd := PatchLibraryElementCommand{FolderID: toFolder.Id, Version: 1, Kind: int64(models.PanelElement)} sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID}) sc.reqContext.Req.Body = mockRequestBody(cmd) resp = sc.service.patchHandler(sc.reqContext) @@ -103,7 +103,7 @@ func TestLibraryElementPermissions(t *testing.T) { toFolder := createFolderWithACL(t, sc.sqlStore, "Folder", sc.user, everyonePermissions) sc.reqContext.SignedInUser.OrgRole = testCase.role - cmd := patchLibraryElementCommand{FolderID: toFolder.Id, Version: 1, Kind: int64(models.PanelElement)} + cmd := PatchLibraryElementCommand{FolderID: toFolder.Id, Version: 1, Kind: int64(models.PanelElement)} sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID}) sc.reqContext.Req.Body = mockRequestBody(cmd) resp = sc.service.patchHandler(sc.reqContext) @@ -154,7 +154,7 @@ func TestLibraryElementPermissions(t *testing.T) { result := validateAndUnMarshalResponse(t, resp) sc.reqContext.SignedInUser.OrgRole = testCase.role - cmd := patchLibraryElementCommand{FolderID: 0, Version: 1, Kind: int64(models.PanelElement)} + cmd := PatchLibraryElementCommand{FolderID: 0, Version: 1, Kind: int64(models.PanelElement)} sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID}) sc.ctx.Req.Body = mockRequestBody(cmd) resp = sc.service.patchHandler(sc.reqContext) @@ -170,7 +170,7 @@ func TestLibraryElementPermissions(t *testing.T) { result := validateAndUnMarshalResponse(t, resp) sc.reqContext.SignedInUser.OrgRole = testCase.role - cmd := patchLibraryElementCommand{FolderID: folder.Id, Version: 1, Kind: int64(models.PanelElement)} + cmd := PatchLibraryElementCommand{FolderID: folder.Id, Version: 1, Kind: int64(models.PanelElement)} sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID}) sc.ctx.Req.Body = mockRequestBody(cmd) resp = sc.service.patchHandler(sc.reqContext) @@ -219,7 +219,7 @@ func TestLibraryElementPermissions(t *testing.T) { result := validateAndUnMarshalResponse(t, resp) sc.reqContext.SignedInUser.OrgRole = testCase.role - cmd := patchLibraryElementCommand{FolderID: -100, Version: 1, Kind: int64(models.PanelElement)} + cmd := PatchLibraryElementCommand{FolderID: -100, Version: 1, Kind: int64(models.PanelElement)} sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": result.Result.UID}) sc.reqContext.Req.Body = mockRequestBody(cmd) resp = sc.service.patchHandler(sc.reqContext) diff --git a/pkg/services/libraryelements/models.go b/pkg/services/libraryelements/models.go index a5ae10fac99..3765141c792 100644 --- a/pkg/services/libraryelements/models.go +++ b/pkg/services/libraryelements/models.go @@ -158,22 +158,43 @@ var ( // Commands // CreateLibraryElementCommand is the command for adding a LibraryElement +// swagger:model type CreateLibraryElementCommand struct { - FolderID int64 `json:"folderId"` - Name string `json:"name"` - Model json.RawMessage `json:"model"` - Kind int64 `json:"kind" binding:"Required"` - UID string `json:"uid"` + // ID of the folder where the library element is stored. + FolderID int64 `json:"folderId"` + // Name of the library element. + Name string `json:"name"` + // The JSON model for the library element. + // swagger:type object + Model json.RawMessage `json:"model"` + // Kind of element to create, Use 1 for library panels or 2 for c. + // Description: + // * 1 - library panels + // * 2 - library variables + // Enum: 1,2 + Kind int64 `json:"kind" binding:"Required"` + // required: false + UID string `json:"uid"` } -// patchLibraryElementCommand is the command for patching a LibraryElement -type patchLibraryElementCommand struct { - FolderID int64 `json:"folderId" binding:"Default(-1)"` - Name string `json:"name"` - Model json.RawMessage `json:"model,omitempty"` - Kind int64 `json:"kind" binding:"Required"` - Version int64 `json:"version" binding:"Required"` - UID string `json:"uid"` +// PatchLibraryElementCommand is the command for patching a LibraryElement +type PatchLibraryElementCommand struct { + // ID of the folder where the library element is stored. + FolderID int64 `json:"folderId" binding:"Default(-1)"` + // Name of the library element. + Name string `json:"name"` + // The JSON model for the library element. + Model json.RawMessage `json:"model,omitempty"` + // Kind of element to create, Use 1 for library panels or 2 for c. + // Description: + // * 1 - library panels + // * 2 - library variables + // Enum: 1,2 + Kind int64 `json:"kind" binding:"Required"` + // Version of the library element you are updating. + Version int64 `json:"version" binding:"Required"` + // required: false + UID string `json:"uid"` } // searchLibraryElementsQuery is the query used for searching for Elements diff --git a/pkg/services/ngalert/api/tooling/post.json b/pkg/services/ngalert/api/tooling/post.json index d3599cc3a15..729eaf5476a 100644 --- a/pkg/services/ngalert/api/tooling/post.json +++ b/pkg/services/ngalert/api/tooling/post.json @@ -341,6 +341,108 @@ "type": "object", "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" }, + "CreateDashboardSnapshotCommand": { + "properties": { + "Result": { + "$ref": "#/definitions/DashboardSnapshot" + }, + "dashboard": { + "$ref": "#/definitions/Json" + }, + "deleteKey": { + "description": "Unique key used to delete the snapshot. It is different from the `key` so that only the creator can delete the snapshot. Required if `external` is `true`.", + "type": "string", + "x-go-name": "DeleteKey" + }, + "expires": { + "default": 0, + "description": "When the snapshot should expire in seconds in seconds. Default is never to expire.", + "format": "int64", + "type": "integer", + "x-go-name": "Expires" + }, + "external": { + "default": false, + "description": "these are passed when storing an external snapshot ref\nSave the snapshot on an external server rather than locally.", + "type": "boolean", + "x-go-name": "External" + }, + "key": { + "description": "Define the unique key. Required if `external` is `true`.", + "type": "string", + "x-go-name": "Key" + }, + "name": { + "description": "Snapshot name", + "type": "string", + "x-go-name": "Name" + } + }, + "required": [ + "dashboard" + ], + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardSnapshot": { + "description": "DashboardSnapshot model", + "properties": { + "Created": { + "format": "date-time", + "type": "string" + }, + "Dashboard": { + "$ref": "#/definitions/Json" + }, + "DashboardEncrypted": { + "items": { + "format": "uint8", + "type": "integer" + }, + "type": "array" + }, + "DeleteKey": { + "type": "string" + }, + "Expires": { + "format": "date-time", + "type": "string" + }, + "External": { + "type": "boolean" + }, + "ExternalDeleteUrl": { + "type": "string" + }, + "ExternalUrl": { + "type": "string" + }, + "Id": { + "format": "int64", + "type": "integer" + }, + "Key": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "OrgId": { + "format": "int64", + "type": "integer" + }, + "Updated": { + "format": "date-time", + "type": "string" + }, + "UserId": { + "format": "int64", + "type": "integer" + } + }, + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, "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.", "format": "date-time", @@ -382,6 +484,12 @@ "type": "object", "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" }, + "DsPermissionType": { + "description": "Datasource permission\nDescription:\n`0` - No Access\n`1` - Query\nEnum: 0,1", + "format": "int64", + "type": "integer", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, "Duration": { "format": "int64", "title": "Duration is a type used for marshalling durations.", @@ -2908,7 +3016,6 @@ "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" }, "alertGroup": { - "description": "AlertGroup alert group", "properties": { "alerts": { "description": "alerts", @@ -2930,7 +3037,9 @@ "labels", "receiver" ], - "type": "object" + "type": "object", + "x-go-name": "AlertGroup", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" }, "alertGroups": { "items": { @@ -3183,11 +3292,12 @@ "type": "object" }, "gettableSilences": { - "description": "GettableSilences gettable silences", "items": { "$ref": "#/definitions/gettableSilence" }, - "type": "array" + "type": "array", + "x-go-name": "GettableSilences", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" }, "labelSet": { "additionalProperties": { diff --git a/pkg/services/ngalert/api/tooling/spec.json b/pkg/services/ngalert/api/tooling/spec.json index bd59fc86e74..ff865cbd238 100644 --- a/pkg/services/ngalert/api/tooling/spec.json +++ b/pkg/services/ngalert/api/tooling/spec.json @@ -2089,6 +2089,108 @@ }, "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" }, + "CreateDashboardSnapshotCommand": { + "type": "object", + "required": [ + "dashboard" + ], + "properties": { + "Result": { + "$ref": "#/definitions/DashboardSnapshot" + }, + "dashboard": { + "$ref": "#/definitions/Json" + }, + "deleteKey": { + "description": "Unique key used to delete the snapshot. It is different from the `key` so that only the creator can delete the snapshot. Required if `external` is `true`.", + "type": "string", + "x-go-name": "DeleteKey" + }, + "expires": { + "description": "When the snapshot should expire in seconds in seconds. Default is never to expire.", + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "Expires" + }, + "external": { + "description": "these are passed when storing an external snapshot ref\nSave the snapshot on an external server rather than locally.", + "type": "boolean", + "default": false, + "x-go-name": "External" + }, + "key": { + "description": "Define the unique key. Required if `external` is `true`.", + "type": "string", + "x-go-name": "Key" + }, + "name": { + "description": "Snapshot name", + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardSnapshot": { + "description": "DashboardSnapshot model", + "type": "object", + "properties": { + "Created": { + "type": "string", + "format": "date-time" + }, + "Dashboard": { + "$ref": "#/definitions/Json" + }, + "DashboardEncrypted": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + }, + "DeleteKey": { + "type": "string" + }, + "Expires": { + "type": "string", + "format": "date-time" + }, + "External": { + "type": "boolean" + }, + "ExternalDeleteUrl": { + "type": "string" + }, + "ExternalUrl": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Key": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "OrgId": { + "type": "integer", + "format": "int64" + }, + "Updated": { + "type": "string", + "format": "date-time" + }, + "UserId": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, "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", @@ -2130,6 +2232,12 @@ }, "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" }, + "DsPermissionType": { + "description": "Datasource permission\nDescription:\n`0` - No Access\n`1` - Query\nEnum: 0,1", + "type": "integer", + "format": "int64", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, "Duration": { "type": "integer", "format": "int64", @@ -4660,7 +4768,6 @@ "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" }, "alertGroup": { - "description": "AlertGroup alert group", "type": "object", "required": [ "alerts", @@ -4683,6 +4790,8 @@ "$ref": "#/definitions/receiver" } }, + "x-go-name": "AlertGroup", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models", "$ref": "#/definitions/alertGroup" }, "alertGroups": { @@ -4939,11 +5048,12 @@ "$ref": "#/definitions/gettableSilence" }, "gettableSilences": { - "description": "GettableSilences gettable silences", "type": "array", "items": { "$ref": "#/definitions/gettableSilence" }, + "x-go-name": "GettableSilences", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models", "$ref": "#/definitions/gettableSilences" }, "labelSet": { diff --git a/public/api-merged.json b/public/api-merged.json new file mode 100644 index 00000000000..1fd92a6d730 --- /dev/null +++ b/public/api-merged.json @@ -0,0 +1,17498 @@ +{ + "consumes": ["application/json"], + "produces": ["application/json"], + "schemes": ["http", "https"], + "swagger": "2.0", + "info": { + "description": "The Grafana backend exposes an HTTP API, the same API is used by the frontend to do\neverything from saving dashboards, creating users and updating data sources.", + "title": "Grafana HTTP API.", + "contact": { + "name": "Grafana Labs", + "url": "https://grafana.com", + "email": "hello@grafana.com" + }, + "license": { + "name": "GNU Affero General Public License v3.0", + "url": "https://www.gnu.org/licenses/agpl-3.0.en.html" + }, + "version": "0.0.1" + }, + "basePath": "/api", + "paths": { + "/access-control/builtin-roles": { + "get": { + "description": "You need to have a permission with action `roles.builtin:list` with scope `roles:*`.", + "tags": ["access_control", "enterprise"], + "summary": "Get all built-in role assignments.", + "operationId": "listBuiltinRoles", + "responses": { + "200": { + "$ref": "#/responses/listBuiltinRolesResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You need to have a permission with action `roles.builtin:add` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only create built-in role assignments with the roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to create a built-in role assignment which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Create a built-in role assignment.", + "operationId": "addBuiltinRole", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddBuiltInRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/builtin-roles/{builtinRole}/roles/{roleUID}": { + "delete": { + "description": "Deletes a built-in role assignment (for one of Viewer, Editor, Admin, or Grafana Admin) to the role with the provided UID.\n\nYou need to have a permission with action `roles.builtin:remove` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only remove built-in role assignments with the roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to remove a built-in role assignment which allows to do that.", + "tags": ["access_control", "enterprise"], + "summary": "Remove a built-in role assignment.", + "operationId": "removeBuiltinRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "RoleUID", + "name": "builtinRole", + "in": "path", + "required": true + }, + { + "type": "boolean", + "x-go-name": "Global", + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", + "name": "global", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/roles": { + "get": { + "description": "Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in.\n\nYou need to have a permission with action `roles:list` and scope `roles:*`.", + "tags": ["access_control", "enterprise"], + "summary": "Get all roles.", + "operationId": "getAllRoles", + "responses": { + "200": { + "$ref": "#/responses/getAllRolesResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates a new custom role and maps given permissions to that role. Note that roles with the same prefix as Fixed Roles can’t be created.\n\nYou need to have a permission with action `roles:write` and scope `permissions:delegate`. `permission:delegate`` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.\nFor example, if a user does not have required permissions for creating users, they won’t be able to create a custom role which allows to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Create a new custom role.", + "operationId": "createRoleWithPermissions", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SetUserRolesCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/roles/{roleUID}": { + "get": { + "description": "Get a role for the given UID.\n\nYou need to have a permission with action `roles:read` and scope `roles:*`.", + "tags": ["access_control", "enterprise"], + "summary": "Get a role.", + "operationId": "getRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `roles:write` and scope `permissions:delegate`. `permission:delegate`` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.", + "tags": ["access_control", "enterprise"], + "summary": "Update a custom role.", + "operationId": "updateRoleWithPermissions", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Delete a role with the given UID, and it’s permissions. If the role is assigned to a built-in role, the deletion operation will fail, unless force query param is set to true, and in that case all assignments will also be deleted.\n\nYou need to have a permission with action `roles:delete` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only delete a custom role with the same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to delete a custom role which allows to do that.", + "tags": ["access_control", "enterprise"], + "summary": "Delete a custom role.", + "operationId": "deleteCustomRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/status": { + "get": { + "description": "Returns an indicator to check if fine-grained access control is enabled or not.\n\nYou need to have a permission with action `status:accesscontrol` and scope `services:accesscontrol`.", + "tags": ["access_control", "enterprise"], + "summary": "Get status.", + "operationId": "getAccessControlStatus", + "responses": { + "200": { + "$ref": "#/responses/getAccessControlStatusResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles": { + "get": { + "description": "You need to have a permission with action `teams.roles:list` and scope `teams:id:\u003cteam ID\u003e`.", + "tags": ["access_control", "enterprise"], + "summary": "Get team roles.", + "operationId": "listTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:delegate` for each.", + "tags": ["access_control", "enterprise"], + "summary": "Update team role.", + "operationId": "setTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You need to have a permission with action `teams.roles:add` and scope `permissions:delegate`.", + "tags": ["access_control", "enterprise"], + "summary": "Add team role.", + "operationId": "addTeamRole", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTeamRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles/{roleUID}": { + "delete": { + "description": "You need to have a permission with action `teams.roles:remove` and scope `permissions:delegate`.", + "tags": ["access_control", "enterprise"], + "summary": "Remove team role.", + "operationId": "removeTeamRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{user_id}/roles": { + "get": { + "description": "Lists the roles that have been directly assigned to a given user. The list does not include built-in roles (Viewer, Editor, Admin or Grafana Admin), and it does not include roles that have been inherited from a team.\n\nYou need to have a permission with action `users.roles:list` and scope `users:id:\u003cuser ID\u003e`.", + "tags": ["access_control", "enterprise"], + "summary": "List roles assigned to a user.", + "operationId": "listUserRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAllRolesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Update the user’s role assignments to match the provided set of UIDs. This will remove any assigned roles that aren’t in the request and add roles that are in the set but are not already assigned to the user.\nIf you want to add or remove a single role, consider using Add a user role assignment or Remove a user role assignment instead.\n\nYou need to have a permission with action `users.roles:add` and `users.roles:remove` and scope `permissions:delegate` for each. `permission:delegate` scope ensures that users can only assign or unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign or unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Set user role assignments.", + "operationId": "setUserRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Assign a role to a specific user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:add` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only assign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Add a user role assignment.", + "operationId": "addUserRole", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddUserRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{user_id}/roles/{roleUID}": { + "delete": { + "description": "Revoke a role from a user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:remove` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Remove a user role assignment.", + "operationId": "removeUserRole", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "boolean", + "x-go-name": "Global", + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", + "name": "global", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap-sync-status": { + "get": { + "description": "You need to have a permission with action `ldap.status:read`.", + "tags": ["ldap_debug"], + "summary": "Available to grafana admins.", + "operationId": "getLDAPSyncStatus", + "responses": { + "200": { + "$ref": "#/responses/getLDAPSyncStatusResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.", + "tags": ["admin_ldap"], + "summary": "Reloads the LDAP configuration.", + "operationId": "reloadLDAP", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/status": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`.", + "tags": ["admin_ldap"], + "summary": "Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.", + "operationId": "getLDAPStatus", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/sync/{user_id}": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`.", + "tags": ["admin_ldap"], + "summary": "Enables a single Grafana user to be synchronized against LDAP.", + "operationId": "syncLDAPUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/{user_name}": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`.", + "tags": ["admin_ldap"], + "summary": "Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.", + "operationId": "getLDAPUser", + "parameters": [ + { + "type": "string", + "x-go-name": "UserID", + "name": "user_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/pause-all-alerts": { + "post": { + "security": [ + { + "basic": [] + } + ], + "tags": ["admin"], + "summary": "Pause/unpause all (legacy) alerts.", + "operationId": "pauseAllAlerts", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PauseAllAlertsCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/pauseAlertsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/access-control/reload": { + "post": { + "tags": ["access_control_provisioning", "enterprise"], + "summary": "You need to have a permission with action `provisioning:reload` with scope `provisioners:accesscontrol`.", + "operationId": "adminProvisioningReloadAccessControl", + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + } + } + } + }, + "/admin/provisioning/accesscontrol/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for access control again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:accesscontrol`.", + "tags": ["admin_provisioning"], + "summary": "Reload access control provisioning configurations.", + "operationId": "reloadProvisionedAccessControl", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/dashboards/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`.", + "tags": ["admin_provisioning"], + "summary": "Reload dashboard provisioning configurations.", + "operationId": "reloadProvisionedDashboards", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/datasources/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for datasources again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:datasources`.", + "tags": ["admin_provisioning"], + "summary": "Reload datasource provisioning configurations.", + "operationId": "reloadProvisionedDatasources", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/notifications/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for legacy alert notifiers again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:notifications`.", + "tags": ["admin_provisioning"], + "summary": "Reload legacy alert notifier provisioning configurations.", + "operationId": "reloadProvisionedAlertNotifiers", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/plugins/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for plugins again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:plugin`.", + "tags": ["admin_provisioning"], + "summary": "Reload plugin provisioning configurations.", + "operationId": "reloadProvisionedPlugins", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/settings": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `settings:read` and scopes: `settings:*`, `settings:auth.saml:` and `settings:auth.saml:enabled` (property level).", + "tags": ["admin"], + "summary": "Fetch settings.", + "operationId": "getSettings", + "responses": { + "200": { + "$ref": "#/responses/getSettingsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + } + } + } + }, + "/admin/stats": { + "get": { + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `server:stats:read`.", + "tags": ["admin"], + "summary": "Fetch Grafana Stats.", + "operationId": "getStats", + "responses": { + "200": { + "$ref": "#/responses/getStatsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:create`.\nNote that OrgId is an optional parameter that can be used to assign a new user to a different organization when `auto_assign_org` is set to `true`.", + "tags": ["admin_users"], + "summary": "Create new user.", + "operationId": "createUser", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminCreateUserForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createUserResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}": { + "delete": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:delete` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Delete global User.", + "operationId": "deleteUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/auth-tokens": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:list` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Return a list of all auth tokens (devices) that the user currently have logged in from.", + "operationId": "getAuthTokens", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAuthTokensResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/disable": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:disable` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Disable user.", + "operationId": "disableUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/enable": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:enable` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Enable user.", + "operationId": "enableUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/logout": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.logout` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity.", + "operationId": "logoutUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "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" + } + } + } + }, + "/admin/users/{user_id}/password": { + "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 `users.password:update` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Set password for user.", + "operationId": "setPassword", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUpdateUserPasswordForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/permissions": { + "put": { + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.permissions:update` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Set permissions for user.", + "operationId": "setPermissions", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUpdateUserPermissionsForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/quotas": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Fetch user quota.", + "operationId": "getUserQuota", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_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 `users.quotas:update` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Update user quota.", + "operationId": "updateUserQuota", + "parameters": [ + { + "type": "string", + "x-go-name": "QuotaTarget", + "name": "quota_target", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserQuotaCmd" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/revoke-auth-token": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:update` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Revoke auth token for user.", + "operationId": "revokeAuthToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RevokeAuthTokenCmd" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "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" + } + } + } + }, + "/alert-notifications": { + "get": { + "description": "Returns all notification channels that the authenticated user has permission to view.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get all notification channels.", + "operationId": "getAlertNotificationChannels", + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You can find the full list of [supported notifiers](https://grafana.com/docs/grafana/latest/alerting/old-alerting/notifications/#list-of-supported-notifiers) on the alert notifiers page.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Create notification channel.", + "operationId": "createAlertNotificationChannel", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateAlertNotificationCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/lookup": { + "get": { + "description": "Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get all notification channels (lookup)", + "operationId": "lookupAlertNotificationChannels", + "responses": { + "200": { + "$ref": "#/responses/lookupAlertNotificationChannelsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/test": { + "post": { + "description": "Sends a test notification to the channel.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Test notification channel.", + "operationId": "notificationChannelTest", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/NotificationTestCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "412": { + "$ref": "#/responses/SMTPNotEnabledError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/uid/{notification_channel_uid}": { + "get": { + "description": "Returns the notification channel given the notification channel UID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get notification channel by UID", + "operationId": "getAlertNotificationChannelByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "NotificationUID", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Updates an existing notification channel identified by uid.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Update notification channel by UID.", + "operationId": "updateAlertNotificationChannelBYUID", + "parameters": [ + { + "type": "string", + "x-go-name": "NotificationUID", + "name": "notification_channel_uid", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAlertNotificationWithUidCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing notification channel identified by UID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Delete alert notification by UID.", + "operationId": "deleteAlertNotificationChannelByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "NotificationUID", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/{notification_channel_id}": { + "get": { + "description": "Returns the notification channel given the notification channel ID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get notification channel by ID.", + "operationId": "getAlertNotificationChannelByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "NotificationID", + "name": "notification_channel_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Updates an existing notification channel identified by ID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Update notification channel by ID.", + "operationId": "updateAlertNotificationChannel", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "NotificationID", + "name": "notification_channel_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAlertNotificationCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing notification channel identified by ID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Delete alert notification by ID.", + "operationId": "deleteAlertNotificationChannel", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "NotificationID", + "name": "notification_channel_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alertmanager/{Recipient}/api/v2/alerts": { + "get": { + "description": "get alertmanager alerts", + "tags": ["alertmanager"], + "operationId": "RouteGetAMAlerts", + "parameters": [ + { + "type": "boolean", + "default": true, + "x-go-name": "Active", + "description": "Show active alerts", + "name": "active", + "in": "query" + }, + { + "type": "boolean", + "default": true, + "x-go-name": "Silenced", + "description": "Show silenced alerts", + "name": "silenced", + "in": "query" + }, + { + "type": "boolean", + "default": true, + "x-go-name": "Inhibited", + "description": "Show inhibited alerts", + "name": "inhibited", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Matchers", + "description": "A list of matchers to filter alerts by", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Receivers", + "description": "A regex matching receivers to filter alerts by", + "name": "receiver", + "in": "query" + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "gettableAlerts", + "schema": { + "$ref": "#/definitions/gettableAlerts" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "post": { + "description": "create alertmanager alerts", + "tags": ["alertmanager"], + "operationId": "RoutePostAMAlerts", + "parameters": [ + { + "name": "PostableAlerts", + "in": "body", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/postableAlert" + } + } + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/alertmanager/{Recipient}/api/v2/alerts/groups": { + "get": { + "description": "get alertmanager alerts", + "tags": ["alertmanager"], + "operationId": "RouteGetAMAlertGroups", + "parameters": [ + { + "type": "boolean", + "default": true, + "x-go-name": "Active", + "description": "Show active alerts", + "name": "active", + "in": "query" + }, + { + "type": "boolean", + "default": true, + "x-go-name": "Silenced", + "description": "Show silenced alerts", + "name": "silenced", + "in": "query" + }, + { + "type": "boolean", + "default": true, + "x-go-name": "Inhibited", + "description": "Show inhibited alerts", + "name": "inhibited", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Matchers", + "description": "A list of matchers to filter alerts by", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Receivers", + "description": "A regex matching receivers to filter alerts by", + "name": "receiver", + "in": "query" + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "alertGroups", + "schema": { + "$ref": "#/definitions/alertGroups" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/alertmanager/{Recipient}/api/v2/silence/{SilenceId}": { + "get": { + "description": "get silence", + "tags": ["alertmanager"], + "operationId": "RouteGetSilence", + "parameters": [ + { + "type": "string", + "name": "SilenceId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "gettableSilence", + "schema": { + "$ref": "#/definitions/gettableSilence" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "description": "delete silence", + "tags": ["alertmanager"], + "operationId": "RouteDeleteSilence", + "parameters": [ + { + "type": "string", + "name": "SilenceId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/alertmanager/{Recipient}/api/v2/silences": { + "get": { + "description": "get silences", + "tags": ["alertmanager"], + "operationId": "RouteGetSilences", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Filter", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "gettableSilences", + "schema": { + "$ref": "#/definitions/gettableSilences" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "post": { + "description": "create silence", + "tags": ["alertmanager"], + "operationId": "RouteCreateSilence", + "parameters": [ + { + "name": "Silence", + "in": "body", + "schema": { + "$ref": "#/definitions/postableSilence" + } + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "gettableSilence", + "schema": { + "$ref": "#/definitions/gettableSilence" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/alertmanager/{Recipient}/api/v2/status": { + "get": { + "description": "get alertmanager status and configuration", + "tags": ["alertmanager"], + "operationId": "RouteGetAMStatus", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "GettableStatus", + "schema": { + "$ref": "#/definitions/GettableStatus" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/alertmanager/{Recipient}/config/api/v1/alerts": { + "get": { + "description": "gets an Alerting config", + "tags": ["alertmanager"], + "operationId": "RouteGetAlertingConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "GettableUserConfig", + "schema": { + "$ref": "#/definitions/GettableUserConfig" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "post": { + "description": "sets an Alerting config", + "tags": ["alertmanager"], + "operationId": "RoutePostAlertingConfig", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/PostableUserConfig" + } + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "description": "deletes the Alerting config for a tenant", + "tags": ["alertmanager"], + "operationId": "RouteDeleteAlertingConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + } + }, + "/alertmanager/{Recipient}/config/api/v1/receivers/test": { + "post": { + "tags": ["alertmanager"], + "summary": "Test Grafana managed receivers without saving them.", + "operationId": "RoutePostTestReceivers", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/TestReceiversConfigBodyParams" + } + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "207": { + "description": "MultiStatus", + "schema": { + "$ref": "#/definitions/MultiStatus" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "403": { + "description": "PermissionDenied", + "schema": { + "$ref": "#/definitions/PermissionDenied" + } + }, + "404": { + "description": "AlertManagerNotFound", + "schema": { + "$ref": "#/definitions/AlertManagerNotFound" + } + }, + "408": { + "description": "Failure", + "schema": { + "$ref": "#/definitions/Failure" + } + }, + "409": { + "description": "AlertManagerNotReady", + "schema": { + "$ref": "#/definitions/AlertManagerNotReady" + } + } + } + } + }, + "/alerts": { + "get": { + "tags": ["legacy_alerts"], + "summary": "Get legacy alerts.", + "operationId": "getAlerts", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "DashboardID", + "description": "Limit response to alerts in specified dashboard(s). You can specify multiple dashboards.", + "name": "dashboardId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "PanelID", + "description": "Limit response to alert for a specified panel on a dashboard.", + "name": "panelId", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Query", + "description": "Limit response to alerts having a name like this value.", + "name": "query", + "in": "query" + }, + { + "enum": ["all", "no_data", "paused", "alerting", "ok", "pending", "unknown"], + "type": "string", + "x-go-name": "State", + "description": "Return alerts with one or more of the following alert states", + "name": "state", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "description": "Limit response to X number of alerts.", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "FolderID", + "description": "Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders", + "name": "folderId", + "in": "query" + }, + { + "type": "string", + "x-go-name": "DashboardQuery", + "description": "Limit response to alerts having a dashboard name like this value./ Limit response to alerts having a dashboard name like this value.", + "name": "dashboardQuery", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "DashboardTag", + "description": "Limit response to alerts of dashboards with specified tags. To do an “AND” filtering with multiple tags, specify the tags parameter multiple times", + "name": "dashboardTag", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/states-for-dashboard": { + "get": { + "tags": ["legacy_alerts"], + "summary": "Get alert states for a dashboard.", + "operationId": "getDashboardStates", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID", + "name": "dashboardId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardStatesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/test": { + "post": { + "tags": ["legacy_alerts"], + "summary": "Test alert.", + "operationId": "testAlert", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AlertTestCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/testAlertResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}": { + "get": { + "description": "“evalMatches” data in the response is cached in the db when and only when the state of the alert changes (e.g. transitioning from “ok” to “alerting” state).\nIf data from one server triggers the alert first and, before that server is seen leaving alerting state, a second server also enters a state that would trigger the alert, the second server will not be visible in “evalMatches” data.", + "tags": ["legacy_alerts"], + "summary": "Get alert by ID.", + "operationId": "getAlertByID", + "parameters": [ + { + "type": "string", + "x-go-name": "AlertID", + "name": "alert_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}/pause": { + "post": { + "tags": ["legacy_alerts"], + "summary": "Pause/unpause alert by id.", + "operationId": "pauseAlert", + "parameters": [ + { + "type": "string", + "x-go-name": "AlertID", + "name": "alert_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PauseAlertCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/pauseAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations": { + "get": { + "description": "Starting in Grafana v6.4 regions annotations are now returned in one entity that now includes the timeEnd property.", + "tags": ["annotations"], + "summary": "Find Annotations.", + "operationId": "getAnnotations", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "From", + "description": "Find annotations created after specific epoch datetime in milliseconds.", + "name": "from", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "To", + "description": "Find annotations created before specific epoch datetime in milliseconds.", + "name": "to", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "description": "Limit response to annotations created by specific user.", + "name": "userId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "AlertID", + "description": "Find annotations for a specified alert.", + "name": "alertId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID", + "description": "Find annotations that are scoped to a specific dashboard", + "name": "dashboardId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "PanelID", + "description": "Find annotations that are scoped to a specific panel", + "name": "panelId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "description": "Max limit for results returned.", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "Tags", + "description": "Use this to filter global annotations. Global annotations are annotations from an annotation data source that are not connected specifically to a dashboard or panel. You can filter by multiple tags.", + "name": "tags", + "in": "query" + }, + { + "enum": ["alert", "annotation"], + "type": "string", + "x-go-name": "Type", + "description": "Return alerts or user created annotations", + "name": "type", + "in": "query" + }, + { + "type": "boolean", + "x-go-name": "MatchAny", + "description": "Match any or all tags", + "name": "matchAny", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAnnotationsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates an annotation in the Grafana database. The dashboardId and panelId fields are optional. If they are not specified then a global annotation is created and can be queried in any dashboard that adds the Grafana annotations data source. When creating a region annotation include the timeEnd property.\nThe format for `time` and `timeEnd` should be epoch numbers in millisecond resolution.\nThe response for this HTTP request is slightly different in versions prior to v6.4. In prior versions you would also get an endId if you where creating a region. But in 6.4 regions are represented using a single event with time and timeEnd properties.", + "tags": ["annotations"], + "summary": "Create Annotation.", + "operationId": "createAnnotation", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createAnnotationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/graphite": { + "post": { + "description": "Creates an annotation by using Graphite-compatible event format. The `when` and `data` fields are optional. If `when` is not specified then the current time will be used as annotation’s timestamp. The `tags` field can also be in prior to Graphite `0.10.0` format (string with multiple tags being separated by a space).", + "tags": ["annotations"], + "summary": "Create Annotation in Graphite format.", + "operationId": "createGraphiteAnnotation", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostGraphiteAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createAnnotationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/mass-delete": { + "post": { + "tags": ["annotations"], + "summary": "Delete multiple annotations.", + "operationId": "massDeleteAnnotations", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/tags": { + "get": { + "description": "Find all the event tags created in the annotations.", + "tags": ["annotations"], + "summary": "Find Annotations Tags.", + "operationId": "getAnnotationTags", + "parameters": [ + { + "type": "string", + "x-go-name": "Tag", + "description": "Tag is a string that you can use to filter tags.", + "name": "tag", + "in": "query" + }, + { + "type": "string", + "default": "100", + "x-go-name": "Limit", + "description": "Max limit for results returned.", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAnnotationTagsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/{annotation_id}": { + "put": { + "description": "Updates all properties of an annotation that matches the specified id. To only update certain property, consider using the Patch Annotation operation.", + "tags": ["annotations"], + "summary": "Update Annotation.", + "operationId": "updateAnnotation", + "parameters": [ + { + "type": "string", + "x-go-name": "AnnotationID", + "name": "annotation_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes the annotation that matches the specified ID.", + "tags": ["annotations"], + "summary": "Delete Annotation By ID.", + "operationId": "deleteAnnotation", + "parameters": [ + { + "type": "string", + "x-go-name": "AnnotationID", + "name": "annotation_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "patch": { + "description": "Updates one or more properties of an annotation that matches the specified ID.\nThis operation currently supports updating of the `text`, `tags`, `time` and `timeEnd` properties.\nThis is available in Grafana 6.0.0-beta2 and above.", + "tags": ["annotations"], + "summary": "Patch Annotation", + "operationId": "patchAnnotation", + "parameters": [ + { + "type": "string", + "x-go-name": "AnnotationID", + "name": "annotation_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/auth/keys": { + "get": { + "description": "Will return auth keys.", + "tags": ["api_keys"], + "summary": "Get auth keys.", + "operationId": "getAPIkeys", + "parameters": [ + { + "type": "boolean", + "default": false, + "x-go-name": "IncludeExpired", + "description": "Show expired keys", + "name": "includeExpired", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAPIkeyResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Will return details of the created API key", + "tags": ["api_keys"], + "summary": "Creates an API key.", + "operationId": "addAPIkey", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddApiKeyCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postAPIkeyResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/auth/keys/{id}": { + "delete": { + "tags": ["api_keys"], + "summary": "Delete API key.", + "operationId": "deleteAPIkey", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboard/snapshots": { + "get": { + "tags": ["snapshots"], + "summary": "List snapshots.", + "operationId": "getSnapshots", + "parameters": [ + { + "type": "string", + "x-go-name": "Query", + "description": "Search Query", + "name": "query", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "Limit", + "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": [ + { + "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"], + "x-go-name": "DiffType" + }, + "new": { + "$ref": "#/definitions/CalculateDiffTarget" + } + } + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardDiffResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/db": { + "post": { + "description": "Creates a new dashboard or updates an existing dashboard.", + "tags": ["dashboards"], + "summary": "Create / Update dashboard", + "operationId": "postDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SaveDashboardCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/home": { + "get": { + "tags": ["dashboards"], + "summary": "Get home dashboard.", + "operationId": "getHomeDashboard", + "responses": { + "200": { + "$ref": "#/responses/getHomeDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/permissions": { + "get": { + "tags": ["dashboard_permissions"], + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissions", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardPermissionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "This operation will remove existing permissions if they’re not included in the request.", + "tags": ["dashboard_permissions"], + "summary": "Updates permissions for a dashboard.", + "operationId": "postDashboardPermissions", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardAclCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/restore": { + "post": { + "tags": ["dashboard_versions"], + "summary": "Restore a dashboard to a given dashboard version.", + "operationId": "restoreDashboardVersion", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/postDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/versions": { + "get": { + "tags": ["dashboard_versions"], + "summary": "Gets all existing versions for the dashboard.", + "operationId": "getDashboardVersions", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "Limit", + "description": "Maximum number of results to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "Start", + "description": "Version to start from when returning queries", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + "get": { + "tags": ["dashboard_versions"], + "summary": "Get a specific dashboard version.", + "operationId": "getDashboardVersion", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/import": { + "post": { + "tags": ["dashboards"], + "summary": "Import dashboard.", + "operationId": "importDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ImportDashboardRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/importDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/tags": { + "get": { + "tags": ["dashboards"], + "summary": "Get all dashboards tags of an organisation.", + "operationId": "getDashboardTags", + "responses": { + "200": { + "$ref": "#/responses/dashboardsTagsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/trim": { + "post": { + "tags": ["dashboards"], + "summary": "Trim defaults from dashboard.", + "operationId": "trimDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TrimDashboardCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/trimDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/uid/{uid}": { + "get": { + "description": "Will return the dashboard given the dashboard unique identifier (uid).", + "tags": ["dashboards"], + "summary": "Get dashboard by uid.", + "operationId": "getDashboardByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Will delete the dashboard given the specified unique identifier (uid).", + "tags": ["dashboards"], + "summary": "Delete dashboard by uid.", + "operationId": "deleteDashboardByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scope: `datasources:*`.", + "tags": ["datasources"], + "summary": "Get all data sources.", + "operationId": "getDatasources", + "responses": { + "200": { + "$ref": "#/responses/getDatasourcesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", + "tags": ["datasources"], + "summary": "Create a data source.", + "operationId": "addDatasource", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddDataSourceCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/id/{datasource_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", + "x-go-name": "DatasourceName", + "name": "datasource_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceIDresponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/name/{datasource_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", + "x-go-name": "DatasourceName", + "name": "datasource_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceResponse" + }, + "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:name:*` and `datasources:name:test_datasource` (single data source).", + "tags": ["datasources"], + "summary": "Delete an existing data source by name.", + "operationId": "deleteDatasourceByName", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceName", + "name": "datasource_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteDatasourceByNameResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/proxy/{datasource_id}/{datasource_proxy_route}": { + "get": { + "description": "Proxies all calls to the actual data source.", + "tags": ["datasources"], + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETcalls", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "DatasourceProxyRoute", + "name": "datasource_proxy_route", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", + "tags": ["datasources"], + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTcalls", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "DatasourceProxyRoute", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "name": "DatasourceProxyParam", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "201": { + "description": "" + }, + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Proxies all calls to the actual data source.", + "tags": ["datasources"], + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEcalls", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "DatasourceProxyRoute", + "name": "datasource_proxy_route", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/uid/{datasource_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": [ + { + "type": "string", + "x-go-name": "DatasourceUID", + "name": "datasource_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + "tags": ["datasources"], + "summary": "Delete an existing data source by UID.", + "operationId": "deleteDatasourceByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceUID", + "name": "datasource_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" + } + } + } + }, + "/datasources/{datasource_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).", + "tags": ["datasources"], + "summary": "Get a single data source by Id.", + "operationId": "getDatasourceByID", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).", + "tags": ["datasources"], + "summary": "Update an existing data source.", + "operationId": "updateDatasource", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDataSourceCommand" + } + } + ], + "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:id:*` and `datasources:id:1` (single data source).", + "tags": ["datasources"], + "summary": "Delete an existing data source by id.", + "operationId": "deleteDatasourceByID", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getPermissionseResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "PermissionID", + "name": "permissionId", + "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" + } + } + } + }, + "/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": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MetricRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/queryDataResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders": { + "get": { + "description": "Returns all folders that the authenticated user has permission to view.", + "tags": ["folders"], + "summary": "Get all folders.", + "operationId": "getFolders", + "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "Limit", + "description": "Limit the maximum number of folders to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "description": "Page index for starting fetching folders", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getFoldersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["folders"], + "summary": "Create folder.", + "operationId": "createFolder", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateFolderCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/folderResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders/id/{folder_id}": { + "get": { + "description": "Returns the folder identified by id.", + "tags": ["folders"], + "summary": "Get folder by id.", + "operationId": "getFolderByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "FolderID", + "name": "folder_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/folderResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders/{folder_uid}": { + "get": { + "tags": ["folders"], + "summary": "Get folder by uid.", + "operationId": "getFolderByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["folders"], + "summary": "Update folder.", + "operationId": "updateFolder", + "parameters": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "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" + }, + "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": { + "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": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + }, + { + "type": "boolean", + "default": false, + "x-go-name": "ForceDeleteRules", + "description": "If `true` any Grafana 8 Alerts under this folder will be deleted.\nSet to `false` so that the request will fail if the folder contains any Grafana 8 Alerts.", + "name": "forceDeleteRules", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteFolderResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders/{folder_uid}/permissions": { + "get": { + "tags": ["folder_permissions"], + "summary": "Gets all existing permissions for the folder with the given `uid`.", + "operationId": "getFolderPermissions", + "parameters": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardPermissionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$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", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardAclCommand" + } + }, + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_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" + } + } + } + }, + "/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": [ + { + "type": "string", + "x-go-name": "SearchString", + "description": "Part of the name or description searched for.", + "name": "searchString", + "in": "query" + }, + { + "enum": [1, 2], + "type": "integer", + "format": "int64", + "x-go-name": "Kind", + "description": "Kind of element to search for.", + "name": "kind", + "in": "query" + }, + { + "enum": ["alpha-asc", "alpha-desc"], + "type": "string", + "x-go-name": "SortDirection", + "description": "Sort order of elements.", + "name": "sortDirection", + "in": "query" + }, + { + "type": "string", + "x-go-name": "TypeFilter", + "description": "A comma separated list of types to filter the elements by", + "name": "typeFilter", + "in": "query" + }, + { + "type": "string", + "x-go-name": "ExcludeUID", + "description": "Element UID to exclude from search results.", + "name": "excludeUid", + "in": "query" + }, + { + "type": "string", + "x-go-name": "FolderFilter", + "description": "A comma separated list of folder ID(s) to filter the elements by.", + "name": "folderFilter", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 100, + "x-go-name": "PerPage", + "description": "The number of results per page.", + "name": "perPage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates a new library element.", + "tags": ["library_elements"], + "summary": "Create library element.", + "operationId": "createLibraryElement", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateLibraryElementCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "Name", + "name": "library_element_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/library-elements/{library_element_uid}": { + "get": { + "description": "Returns a library element with the given UID.", + "tags": ["library_elements"], + "summary": "Get library element by UID.", + "operationId": "getLibraryElementByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing library element as specified by the UID. This operation cannot be reverted.\nYou cannot delete a library element that is connected. This operation cannot be reverted.", + "tags": ["library_elements"], + "summary": "Delete library element.", + "operationId": "deleteLibraryElementByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "patch": { + "description": "Updates an existing library element identified by uid.", + "tags": ["library_elements"], + "summary": "Update library element.", + "operationId": "updateLibraryElement", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchLibraryElementCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/library-elements/{library_element_uid}/connections/": { + "get": { + "description": "Returns a list of connections for a library element based on the UID specified.", + "tags": ["library_elements"], + "summary": "Get library element connections.", + "operationId": "getLibraryElementConnections", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementConnectionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/custom-permissions-csv": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "produces": ["text/csv"], + "tags": ["licensing", "enterprise"], + "summary": "Get custom permissions report in CSV format.", + "operationId": "getCustomPermissionsCSV", + "responses": { + "200": { + "$ref": "#/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/refresh-stats": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": ["licensing", "enterprise"], + "summary": "Refresh license stats.", + "operationId": "refreshLicenseStats", + "responses": { + "200": { + "$ref": "#/responses/refreshLicenseStatsResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": ["licensing", "enterprise"], + "summary": "Get license token.", + "operationId": "getLicenseToken", + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + } + } + }, + "post": { + "description": "You need to have a permission with action `licensing:update`.", + "tags": ["licensing", "enterprise"], + "summary": "Create license token.", + "operationId": "postLicenseToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + } + } + }, + "delete": { + "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", + "tags": ["licensing", "enterprise"], + "summary": "Remove license from database.", + "operationId": "deleteLicenseToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token/renew": { + "post": { + "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + "tags": ["licensing", "enterprise"], + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postRenewLicenseTokenResponse" + }, + "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": "" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/logout/saml": { + "get": { + "tags": ["saml", "enterprise"], + "summary": "GetLogout initiates single logout process.", + "operationId": "getSAMLLogout", + "responses": { + "302": { + "description": "" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org": { + "get": { + "description": "Get current Organization", + "tags": ["current_org_details"], + "operationId": "getOrg", + "responses": { + "200": { + "$ref": "#/responses/getOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["current_org_details"], + "summary": "Update current Organization.", + "operationId": "updateOrg", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/address": { + "put": { + "tags": ["current_org_details"], + "summary": "Update current Organization's address.", + "operationId": "updateOrgAddress", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/invites": { + "get": { + "tags": ["org_invites"], + "summary": "Get pending invites.", + "operationId": "getInvites", + "responses": { + "200": { + "$ref": "#/responses/getInvitesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["org_invites"], + "summary": "Add invite.", + "operationId": "addInvite", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddInviteForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/addOrgUser" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "412": { + "$ref": "#/responses/SMTPNotEnabledError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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" + } + } + }, + "put": { + "tags": ["org_preferences"], + "summary": "Update Current Org Prefs.", + "operationId": "updateOrgPreferences", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/addOrgUser" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/users": { + "get": { + "description": "Returns all org users within the current organization. Accessible to users with org admin role.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", + "tags": ["current_org_details"], + "summary": "Get all users within the current organization.", + "operationId": "getOrgUsers", + "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": ["current_org_details"], + "summary": "Add a new user to the current organization", + "operationId": "addOrgUser", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddOrgUserCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/users/lookup": { + "get": { + "description": "Returns all org users within the current organization, but with less detailed information.\nAccessible to users with org admin role, admin in any folder or admin of any team.\nMainly used by Grafana UI for providing list of users when adding team members and when editing folder/dashboard permissions.", + "tags": ["current_org_details"], + "summary": "Get all users within the current organization (lookup)", + "operationId": "lookupOrgUsers", + "parameters": [ + { + "type": "string", + "x-go-name": "Query", + "name": "query", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/lookupOrgUsersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + "tags": ["current_org_details"], + "summary": "Delete user in current organization", + "operationId": "deleteOrgUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgUserCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/{invitation_code}/invites": { + "delete": { + "tags": ["org_invites"], + "summary": "Revoke invite.", + "operationId": "revokeInvite", + "parameters": [ + { + "type": "string", + "x-go-name": "Code", + "name": "invitation_code", + "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" + } + } + } + }, + "/orgs": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "Search all Organizations", + "tags": ["orgs"], + "operationId": "searchOrg", + "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "PerPage", + "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", + "x-go-name": "Name", + "name": "name", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Query", + "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/searchOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", + "tags": ["orgs"], + "summary": "Create Organization.", + "operationId": "createOrg", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrgCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "OrgName", + "name": "org_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}": { + "get": { + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Get Organization by ID.", + "operationId": "getOrgByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Update Organization.", + "operationId": "adminUpdateOrg", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Delete Organization.", + "operationId": "adminDeleteOrg", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/address": { + "put": { + "tags": ["orgs"], + "summary": "Update Organization's address.", + "operationId": "adminUpdateOrgAddress", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/quotas/{quota_target}": { + "put": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).", + "tags": ["orgs"], + "summary": "Update user quota.", + "operationId": "updateOrgQuota", + "parameters": [ + { + "type": "string", + "x-go-name": "QuotaTarget", + "name": "quota_target", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgQuotaCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/users": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", + "tags": ["orgs"], + "summary": "Get Users in Organization.", + "operationId": "adminGetOrgUsers", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "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", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddOrgUserCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + "tags": ["orgs"], + "summary": "Delete user in current organization", + "operationId": "adminDeleteOrgUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgUserCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/prometheus/{Recipient}/api/v1/alerts": { + "get": { + "description": "gets the current alerts", + "tags": ["prometheus"], + "operationId": "RouteGetAlertStatuses", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "AlertResponse", + "schema": { + "$ref": "#/definitions/AlertResponse" + } + } + } + } + }, + "/prometheus/{Recipient}/api/v1/rules": { + "get": { + "description": "gets the evaluation statuses of all rules", + "tags": ["prometheus"], + "operationId": "RouteGetRuleStatuses", + "parameters": [ + { + "type": "string", + "name": "DashboardUID", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "name": "PanelID", + "in": "query" + }, + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "RuleResponse", + "schema": { + "$ref": "#/definitions/RuleResponse" + } + } + } + } + }, + "/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" + } + } + }, + "put": { + "tags": ["recording_rules", "enterprise"], + "summary": "Update a recording rule.", + "operationId": "updateRecordingRule", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Create a new recording rule.", + "operationId": "createRecordingRule", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/test": { + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Test a recording rule.", + "operationId": "testCreateRecordingRule", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/writer": { + "get": { + "tags": ["recording_rules", "enterprise"], + "summary": "Get the write target.", + "operationId": "getRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Create a new write target.", + "operationId": "createRecordingRuleWriteTarget", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": ["recording_rules", "enterprise"], + "summary": "Delete the write target.", + "operationId": "deleteRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/{recordingRuleID}": { + "delete": { + "tags": ["recording_rules", "enterprise"], + "summary": "Delete a recording rule.", + "operationId": "deleteRecordingRule", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "RecordingRuleID", + "name": "recordingRuleID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", + "tags": ["reports", "enterprise"], + "summary": "List reports.", + "operationId": "getReports", + "responses": { + "200": { + "$ref": "#/responses/getReportsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "tags": ["reports", "enterprise"], + "summary": "Create a report.", + "operationId": "createReport", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/email": { + "post": { + "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", + "tags": ["reports", "enterprise"], + "summary": "Send a report.", + "operationId": "sendReport", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportEmailDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/render/pdf/{DashboardID}": { + "get": { + "description": "Available to all users and with a valid license.", + "produces": ["application/pdf"], + "tags": ["reports", "enterprise"], + "summary": "Render report for dashboard.", + "operationId": "renderReportPDF", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/settings": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:read`x.", + "tags": ["reports", "enterprise"], + "summary": "Get settings.", + "operationId": "getReportSettings", + "responses": { + "200": { + "$ref": "#/responses/getReportSettingsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:write`xx.", + "tags": ["reports", "enterprise"], + "summary": "Save settings.", + "operationId": "saveReportSettings", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/test-email": { + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", + "tags": ["reports", "enterprise"], + "summary": "Send test report via email.", + "operationId": "sendTestEmail", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/{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", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "ReportID", + "name": "reportID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", + "tags": ["reports", "enterprise"], + "summary": "Update a report.", + "operationId": "updateReport", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "ReportID", + "name": "reportID", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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", + "x-go-name": "ReportID", + "name": "reportID", + "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" + } + } + } + }, + "/ruler/{Recipient}/api/v1/rules": { + "get": { + "description": "List rule groups", + "produces": ["application/json"], + "tags": ["ruler"], + "operationId": "RouteGetRulesConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "DashboardUID", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "name": "PanelID", + "in": "query" + } + ], + "responses": { + "202": { + "description": "NamespaceConfigResponse", + "schema": { + "$ref": "#/definitions/NamespaceConfigResponse" + } + } + } + } + }, + "/ruler/{Recipient}/api/v1/rules/{Namespace}": { + "get": { + "description": "Get rule groups by namespace", + "produces": ["application/json"], + "tags": ["ruler"], + "operationId": "RouteGetNamespaceRulesConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Namespace", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "NamespaceConfigResponse", + "schema": { + "$ref": "#/definitions/NamespaceConfigResponse" + } + } + } + }, + "post": { + "description": "Creates or updates a rule group", + "consumes": ["application/json", "application/yaml"], + "tags": ["ruler"], + "operationId": "RoutePostNameRulesConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Namespace", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/PostableRuleGroupConfig" + } + } + ], + "responses": { + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + } + } + }, + "delete": { + "description": "Delete namespace", + "tags": ["ruler"], + "operationId": "RouteDeleteNamespaceRulesConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Namespace", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + } + } + } + }, + "/ruler/{Recipient}/api/v1/rules/{Namespace}/{Groupname}": { + "get": { + "description": "Get rule group", + "produces": ["application/json"], + "tags": ["ruler"], + "operationId": "RouteGetRulegGroupConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Namespace", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Groupname", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "RuleGroupConfigResponse", + "schema": { + "$ref": "#/definitions/RuleGroupConfigResponse" + } + } + } + }, + "delete": { + "description": "Delete rule group", + "tags": ["ruler"], + "operationId": "RouteDeleteRuleGroupConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Namespace", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Groupname", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + } + } + } + }, + "/saml/acs": { + "post": { + "tags": ["saml", "enterprise"], + "summary": "It performs assertion Consumer Service (ACS).", + "operationId": "postACS", + "parameters": [ + { + "type": "string", + "name": "RelayState", + "in": "query" + } + ], + "responses": { + "302": { + "description": "" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/saml/metadata": { + "get": { + "produces": ["application/xml;application/samlmetadata+xml"], + "tags": ["saml", "enterprise"], + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "operationId": "getSAMLMetadata", + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + } + } + } + }, + "/saml/slo": { + "post": { + "tags": ["saml", "enterprise"], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", + "parameters": [ + { + "type": "string", + "name": "SAMLRequest", + "in": "query" + }, + { + "type": "string", + "name": "SAMLResponse", + "in": "query" + } + ], + "responses": { + "302": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/search": { + "get": { + "tags": ["search"], + "operationId": "search", + "parameters": [ + { + "type": "string", + "x-go-name": "Query", + "description": "Search Query", + "name": "query", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "Tag", + "description": "List of tags to search for", + "name": "tag", + "in": "query" + }, + { + "enum": ["dash-folder", "dash-db"], + "type": "string", + "x-go-name": "Type", + "description": "Type to search for, dash-folder or dash-db", + "name": "type", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "DashboardIds", + "description": "List of dashboard id’s to search for", + "name": "dashboardIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "FolderIds", + "description": "List of folder id’s to search in for dashboards", + "name": "folderIds", + "in": "query" + }, + { + "type": "boolean", + "x-go-name": "Starred", + "description": "Flag indicating if only starred Dashboards should be returned", + "name": "starred", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "description": "Limit the number of returned results (max 5000)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Page", + "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size. Only available in Grafana v6.2+.", + "name": "page", + "in": "query" + }, + { + "enum": ["Edit", "View"], + "type": "string", + "default": "View", + "x-go-name": "Permission", + "description": "Set to `Edit` to return dashboards/folders that the user can edit", + "name": "permission", + "in": "query" + }, + { + "enum": ["alpha-asc", "alpha-desc"], + "type": "string", + "default": "alpha-asc", + "x-go-name": "Sort", + "description": "Sort method; for listing all the possible sort methods use the search sorting endpoint.", + "name": "sort", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/searchResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/search/sorting": { + "get": { + "description": "List search sorting options", + "tags": ["search"], + "operationId": "searchSorting", + "responses": { + "200": { + "$ref": "#/responses/searchSortingResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + } + } + } + }, + "/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": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateDashboardSnapshotCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createSnapshotResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/snapshots-delete/{deleteKey}": { + "get": { + "description": "Snapshot public mode should be enabled or authentication is required.", + "tags": ["snapshots"], + "summary": "Delete Snapshot by deleteKey.", + "operationId": "deleteSnapshotByDeleteKey", + "parameters": [ + { + "type": "string", + "x-go-name": "DeleteKey", + "name": "deleteKey", + "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" + } + } + } + }, + "/snapshots/{key}": { + "get": { + "tags": ["snapshots"], + "summary": "Get Snapshot by Key.", + "operationId": "getSnapshotByKey", + "parameters": [ + { + "type": "string", + "x-go-name": "Key", + "name": "key", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/snapshotResponse" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": ["snapshots"], + "summary": "Delete Snapshot by Key.", + "operationId": "deleteSnapshotByKey", + "parameters": [ + { + "type": "string", + "x-go-name": "Key", + "name": "key", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams": { + "post": { + "tags": ["teams"], + "summary": "Add Team.", + "operationId": "createTeam", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateTeamCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createTeamResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/search": { + "get": { + "tags": ["teams"], + "summary": "Team Search With Paging.", + "operationId": "searchTeams", + "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "PerPage", + "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", + "x-go-name": "Name", + "name": "name", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Query", + "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/searchTeamsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{teamId}/groups": { + "get": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Get External Groups.", + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Add External Group.", + "operationId": "addTeamGroupApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamGroupMapping" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{teamId}/groups/{groupId}": { + "delete": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Remove External Group.", + "operationId": "removeTeamGroupApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "GroupID", + "name": "groupId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}": { + "get": { + "tags": ["teams"], + "summary": "Get Team By ID.", + "operationId": "getTeam", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["teams"], + "summary": "Update Team.", + "operationId": "updateTeam", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTeamCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}/members": { + "get": { + "tags": ["teams"], + "summary": "Get Team Members.", + "operationId": "getTeamMembers", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["teams"], + "summary": "Add Team Member.", + "operationId": "addTeamMember", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}/members/{user_id}": { + "put": { + "tags": ["teams"], + "summary": "Update Team Member.", + "operationId": "updateTeamMember", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTeamMemberCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": ["teams"], + "summary": "Remove Member From Team.", + "operationId": "removeTeamMember", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}/preferences": { + "get": { + "tags": ["teams"], + "summary": "Get Team Preferences.", + "operationId": "getTeamPreferences", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getPreferencesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["teams"], + "summary": "Update Team Preferences.", + "operationId": "updateTeamPreferences", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/tsdb/query": { + "post": { + "description": "Queries a data source having backend implementation.\n\nMost of Grafana’s builtin data sources have backend implementation.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:query`.", + "tags": ["datasources"], + "summary": "Query metrics.", + "operationId": "queryDatasource", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MetricRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/queryDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user": { + "get": { + "tags": ["signed_in_user"], + "summary": "Get signed in User.", + "operationId": "getSignedInUser", + "responses": { + "200": { + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["signed_in_user"], + "summary": "Update signed in User.", + "operationId": "updateSignedInUser", + "parameters": [ + { + "x-go-name": "Body", + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/auth-tokens": { + "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" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/helpflags/clear": { + "get": { + "tags": ["signed_in_user"], + "summary": "Clear user help flag.", + "operationId": "clearHelpFlags", + "responses": { + "200": { + "$ref": "#/responses/helpFlagResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/helpflags/{flag_id}": { + "put": { + "tags": ["signed_in_user"], + "summary": "Set user help flag.", + "operationId": "setHelpFlag", + "parameters": [ + { + "type": "string", + "x-go-name": "FlagID", + "name": "flag_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/helpFlagResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/orgs": { + "get": { + "security": [ + { + "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" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "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", + "parameters": [ + { + "x-go-name": "Body", + "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/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/preferences": { + "get": { + "tags": ["user_preferences"], + "summary": "Get user preferences.", + "operationId": "getUserPreferences", + "responses": { + "200": { + "$ref": "#/responses/getPreferencesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/quotas": { + "get": { + "tags": ["signed_in_user"], + "summary": "Fetch user quota.", + "operationId": "getUserQuotas", + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$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": "revokeSignedINAuthTokenCmd", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RevokeAuthTokenCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "DashboardID", + "name": "dashboard_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "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", + "x-go-name": "DashboardID", + "name": "dashboard_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/teams": { + "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", + "responses": { + "200": { + "$ref": "#/responses/getUserOrgListResponse" + }, + "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", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "Limit", + "description": "Limit the maximum number of users to return per page", + "name": "perpage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "description": "Page index for starting fetching users", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/searchUsersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/users/lookup": { + "get": { + "tags": ["users"], + "summary": "Get user by login or email.", + "operationId": "getUserByLoginOrEmail", + "parameters": [ + { + "type": "string", + "x-go-name": "LoginOrEmail", + "description": "loginOrEmail of the user", + "name": "loginOrEmail", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/users/search": { + "get": { + "tags": ["users"], + "summary": "Get users with paging.", + "operationId": "searchUsersWithPaging", + "responses": { + "200": { + "$ref": "#/responses/searchUsersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/users/{user_id}": { + "get": { + "tags": ["users"], + "summary": "Get user by id.", + "operationId": "getUserByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "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" + } + } + }, + "put": { + "description": "Update the user identified by id.", + "tags": ["users"], + "summary": "Update user.", + "operationId": "updateUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserCommand" + } + } + ], + "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": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getUserOrgListResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getUserTeamsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/v1/eval": { + "post": { + "description": "Test rule", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["testing"], + "operationId": "RouteEvalQueries", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/EvalQueriesPayload" + } + } + ], + "responses": { + "200": { + "description": "EvalQueriesResponse", + "schema": { + "$ref": "#/definitions/EvalQueriesResponse" + } + } + } + } + }, + "/v1/ngalert/admin_config": { + "get": { + "produces": ["application/json"], + "tags": ["configuration"], + "summary": "Get the NGalert configuration of the user's organization, returns 404 if no configuration is present.", + "operationId": "RouteGetNGalertConfig", + "responses": { + "200": { + "description": "GettableNGalertConfig", + "schema": { + "$ref": "#/definitions/GettableNGalertConfig" + } + }, + "404": { + "description": "Failure", + "schema": { + "$ref": "#/definitions/Failure" + } + }, + "500": { + "description": "Failure", + "schema": { + "$ref": "#/definitions/Failure" + } + } + } + }, + "post": { + "consumes": ["application/json"], + "tags": ["configuration"], + "summary": "Creates or updates the NGalert configuration of the user's organization. If no value is sent for alertmanagersChoice, it defaults to \"all\".", + "operationId": "RoutePostNGalertConfig", + "parameters": [ + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/PostableNGalertConfig" + } + } + ], + "responses": { + "201": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "400": { + "description": "ValidationError", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + } + }, + "delete": { + "consumes": ["application/json"], + "tags": ["configuration"], + "summary": "Deletes the NGalert configuration of the user's organization.", + "operationId": "RouteDeleteNGalertConfig", + "responses": { + "200": { + "description": "Ack", + "schema": { + "$ref": "#/definitions/Ack" + } + }, + "500": { + "description": "Failure", + "schema": { + "$ref": "#/definitions/Failure" + } + } + } + } + }, + "/v1/ngalert/alertmanagers": { + "get": { + "produces": ["application/json"], + "tags": ["configuration"], + "summary": "Get the discovered and dropped Alertmanagers of the user's organization based on the specified configuration.", + "operationId": "RouteGetAlertmanagers", + "responses": { + "200": { + "description": "GettableAlertmanagers", + "schema": { + "$ref": "#/definitions/GettableAlertmanagers" + } + } + } + } + }, + "/v1/rule/test/{Recipient}": { + "post": { + "description": "Test rule", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["testing"], + "operationId": "RouteTestRuleConfig", + "parameters": [ + { + "type": "string", + "description": "Recipient should be \"grafana\" for requests to be handled by grafana\nand the numeric datasource id for requests to be forwarded to a datasource", + "name": "Recipient", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/TestRulePayload" + } + } + ], + "responses": { + "200": { + "description": "TestRuleResponse", + "schema": { + "$ref": "#/definitions/TestRuleResponse" + } + } + } + } + } + }, + "definitions": { + "Ack": { + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "ActiveSyncStatusDTO": { + "description": "ActiveSyncStatusDTO holds the information for LDAP background Sync", + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "x-go-name": "Enabled" + }, + "nextSync": { + "type": "string", + "format": "date-time", + "x-go-name": "NextSync" + }, + "prevSync": { + "$ref": "#/definitions/SyncResult" + }, + "schedule": { + "type": "string", + "x-go-name": "Schedule" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/ldapdebug" + }, + "ActiveUserStats": { + "type": "object", + "properties": { + "active_admins_and_editors": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveAdminsAndEditors" + }, + "active_users": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveUsers" + }, + "active_viewers": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveViewers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "AddApiKeyCommand": { + "description": "COMMANDS", + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "secondsToLive": { + "type": "integer", + "format": "int64", + "x-go-name": "SecondsToLive" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddBuiltInRoleCommand": { + "type": "object", + "properties": { + "builtInRole": { + "type": "string", + "enum": ["Viewer", " Editor", " Admin", " Grafana Admin"], + "x-go-name": "BuiltinRole" + }, + "global": { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to create organization local assignment. Refer to the Built-in role assignments for more information.", + "type": "boolean", + "x-go-name": "Global" + }, + "roleUid": { + "type": "string", + "x-go-name": "RoleUID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "AddDataSourceCommand": { + "description": "Also acts as api DTO", + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "basicAuthPassword": { + "type": "string", + "x-go-name": "BasicAuthPassword" + }, + "basicAuthUser": { + "type": "string", + "x-go-name": "BasicAuthUser" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "secureJsonData": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureJsonData" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + }, + "withCredentials": { + "type": "boolean", + "x-go-name": "WithCredentials" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddInviteForm": { + "type": "object", + "properties": { + "loginOrEmail": { + "type": "string", + "x-go-name": "LoginOrEmail" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "sendEmail": { + "type": "boolean", + "x-go-name": "SendEmail" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AddOrgUserCommand": { + "type": "object", + "properties": { + "loginOrEmail": { + "type": "string", + "x-go-name": "LoginOrEmail" + }, + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddPermissionDTO": { + "type": "object", + "properties": { + "builtinRole": { + "type": "string", + "x-go-name": "BuiltinRole" + }, + "permission": { + "$ref": "#/definitions/DsPermissionType" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/dspermissions" + }, + "AddTeamMemberCommand": { + "type": "object", + "properties": { + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddTeamRoleCommand": { + "type": "object", + "properties": { + "roleUid": { + "type": "string", + "x-go-name": "RoleUID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "AddUserRoleCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean", + "x-go-name": "Global" + }, + "roleUid": { + "type": "string", + "x-go-name": "RoleUID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "Address": { + "type": "object", + "properties": { + "address1": { + "type": "string", + "x-go-name": "Address1" + }, + "address2": { + "type": "string", + "x-go-name": "Address2" + }, + "city": { + "type": "string", + "x-go-name": "City" + }, + "country": { + "type": "string", + "x-go-name": "Country" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "zipCode": { + "type": "string", + "x-go-name": "ZipCode" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AdminCreateUserForm": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "password": { + "type": "string", + "x-go-name": "Password" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AdminStats": { + "type": "object", + "properties": { + "activeAdmins": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveAdmins" + }, + "activeEditors": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveEditors" + }, + "activeSessions": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveSessions" + }, + "activeUsers": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveUsers" + }, + "activeViewers": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveViewers" + }, + "admins": { + "type": "integer", + "format": "int64", + "x-go-name": "Admins" + }, + "alerts": { + "type": "integer", + "format": "int64", + "x-go-name": "Alerts" + }, + "dailyActiveAdmins": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveAdmins" + }, + "dailyActiveEditors": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveEditors" + }, + "dailyActiveSessions": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveSessions" + }, + "dailyActiveUsers": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveUsers" + }, + "dailyActiveViewers": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveViewers" + }, + "dashboards": { + "type": "integer", + "format": "int64", + "x-go-name": "Dashboards" + }, + "datasources": { + "type": "integer", + "format": "int64", + "x-go-name": "Datasources" + }, + "editors": { + "type": "integer", + "format": "int64", + "x-go-name": "Editors" + }, + "monthlyActiveUsers": { + "type": "integer", + "format": "int64", + "x-go-name": "MonthlyActiveUsers" + }, + "orgs": { + "type": "integer", + "format": "int64", + "x-go-name": "Orgs" + }, + "playlists": { + "type": "integer", + "format": "int64", + "x-go-name": "Playlists" + }, + "snapshots": { + "type": "integer", + "format": "int64", + "x-go-name": "Snapshots" + }, + "stars": { + "type": "integer", + "format": "int64", + "x-go-name": "Stars" + }, + "tags": { + "type": "integer", + "format": "int64", + "x-go-name": "Tags" + }, + "users": { + "type": "integer", + "format": "int64", + "x-go-name": "Users" + }, + "viewers": { + "type": "integer", + "format": "int64", + "x-go-name": "Viewers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AdminUpdateUserPasswordForm": { + "type": "object", + "properties": { + "password": { + "type": "string", + "x-go-name": "Password" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AdminUpdateUserPermissionsForm": { + "type": "object", + "properties": { + "isGrafanaAdmin": { + "type": "boolean", + "x-go-name": "IsGrafanaAdmin" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "Alert": { + "type": "object", + "title": "Alert has info for an alert.", + "required": ["labels", "annotations", "state", "value"], + "properties": { + "activeAt": { + "type": "string", + "format": "date-time", + "x-go-name": "ActiveAt" + }, + "annotations": { + "$ref": "#/definitions/overrideLabels" + }, + "labels": { + "$ref": "#/definitions/overrideLabels" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "value": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "AlertDiscovery": { + "type": "object", + "title": "AlertDiscovery has info for all active alerts.", + "required": ["alerts"], + "properties": { + "alerts": { + "type": "array", + "items": { + "$ref": "#/definitions/Alert" + }, + "x-go-name": "Alerts" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "AlertInstancesResponse": { + "type": "object", + "properties": { + "instances": { + "description": "Instances is an array of arrow encoded dataframes\neach frame has a single row, and a column for each instance (alert identified by unique labels) with a boolean value (firing/not firing)", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + }, + "x-go-name": "Instances" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "AlertListItemDTO": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "dashboardSlug": { + "type": "string", + "x-go-name": "DashboardSlug" + }, + "dashboardUid": { + "type": "string", + "x-go-name": "DashboardUid" + }, + "evalData": { + "$ref": "#/definitions/Json" + }, + "evalDate": { + "type": "string", + "format": "date-time", + "x-go-name": "EvalDate" + }, + "executionError": { + "type": "string", + "x-go-name": "ExecutionError" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "newStateDate": { + "type": "string", + "format": "date-time", + "x-go-name": "NewStateDate" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "state": { + "$ref": "#/definitions/AlertStateType" + }, + "url": { + "type": "string", + "x-go-name": "Url" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AlertManager": { + "type": "object", + "title": "AlertManager models a configured Alert Manager.", + "properties": { + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "github.com/prometheus/client_golang/api/prometheus/v1" + }, + "AlertManagerNotFound": { + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "AlertManagerNotReady": { + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "AlertManagersResult": { + "type": "object", + "title": "AlertManagersResult contains the result from querying the alertmanagers endpoint.", + "properties": { + "activeAlertManagers": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertManager" + }, + "x-go-name": "Active" + }, + "droppedAlertManagers": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertManager" + }, + "x-go-name": "Dropped" + } + }, + "x-go-package": "github.com/prometheus/client_golang/api/prometheus/v1" + }, + "AlertNotification": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureFields": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "SecureFields" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertNotificationLookup": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertQuery": { + "type": "object", + "title": "AlertQuery represents a single query associated with an alert definition.", + "properties": { + "datasourceUid": { + "description": "Grafana data source unique identifier; it should be '-100' for a Server Side Expression operation.", + "type": "string", + "x-go-name": "DatasourceUID" + }, + "model": { + "description": "JSON is the raw JSON query and includes the above properties as well as custom properties.", + "type": "object", + "x-go-name": "Model" + }, + "queryType": { + "description": "QueryType is an optional identifier for the type of query.\nIt can be used to distinguish different types of queries.", + "type": "string", + "x-go-name": "QueryType" + }, + "refId": { + "description": "RefID is the unique identifier of the query, set by the frontend call.", + "type": "string", + "x-go-name": "RefID" + }, + "relativeTimeRange": { + "$ref": "#/definitions/RelativeTimeRange" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/models" + }, + "AlertResponse": { + "type": "object", + "required": ["status"], + "properties": { + "data": { + "$ref": "#/definitions/AlertDiscovery" + }, + "error": { + "type": "string", + "x-go-name": "Error" + }, + "errorType": { + "$ref": "#/definitions/ErrorType" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "AlertStateInfoDTO": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "newStateDate": { + "type": "string", + "format": "date-time", + "x-go-name": "NewStateDate" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "state": { + "$ref": "#/definitions/AlertStateType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AlertStateType": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AlertTestCommand": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertTestResult": { + "type": "object", + "properties": { + "conditionEvals": { + "type": "string", + "x-go-name": "ConditionEvals" + }, + "error": { + "type": "string", + "x-go-name": "Error" + }, + "firing": { + "type": "boolean", + "x-go-name": "Firing" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertTestResultLog" + }, + "x-go-name": "Logs" + }, + "matches": { + "type": "array", + "items": { + "$ref": "#/definitions/EvalMatch" + }, + "x-go-name": "EvalMatches" + }, + "state": { + "$ref": "#/definitions/AlertStateType" + }, + "timeMs": { + "type": "string", + "x-go-name": "TimeMs" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertTestResultLog": { + "type": "object", + "properties": { + "data": { + "type": "object", + "x-go-name": "Data" + }, + "message": { + "type": "string", + "x-go-name": "Message" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertingRule": { + "description": "adapted from cortex", + "type": "object", + "required": ["name", "query", "health", "type", "state", "annotations", "alerts"], + "properties": { + "alerts": { + "type": "array", + "items": { + "$ref": "#/definitions/Alert" + }, + "x-go-name": "Alerts" + }, + "annotations": { + "$ref": "#/definitions/overrideLabels" + }, + "duration": { + "type": "number", + "format": "double", + "x-go-name": "Duration" + }, + "evaluationTime": { + "type": "number", + "format": "double", + "x-go-name": "EvaluationTime" + }, + "health": { + "type": "string", + "x-go-name": "Health" + }, + "labels": { + "$ref": "#/definitions/overrideLabels" + }, + "lastError": { + "type": "string", + "x-go-name": "LastError" + }, + "lastEvaluation": { + "type": "string", + "format": "date-time", + "x-go-name": "LastEvaluation" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "query": { + "type": "string", + "x-go-name": "Query" + }, + "state": { + "description": "State can be \"pending\", \"firing\", \"inactive\".", + "type": "string", + "x-go-name": "State" + }, + "type": { + "$ref": "#/definitions/RuleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "ApiKeyDTO": { + "type": "object", + "properties": { + "expiration": { + "type": "string", + "format": "date-time", + "x-go-name": "Expiration" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "ApiRuleNode": { + "type": "object", + "properties": { + "alert": { + "type": "string", + "x-go-name": "Alert" + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Annotations" + }, + "expr": { + "type": "string", + "x-go-name": "Expr" + }, + "for": { + "$ref": "#/definitions/Duration" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Labels" + }, + "record": { + "type": "string", + "x-go-name": "Record" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "Authorization": { + "type": "object", + "title": "Authorization contains HTTP authorization credentials.", + "properties": { + "credentials": { + "$ref": "#/definitions/Secret" + }, + "credentials_file": { + "type": "string", + "x-go-name": "CredentialsFile" + }, + "type": { + "type": "string", + "x-go-name": "Type" + } + }, + "x-go-package": "github.com/prometheus/common/config" + }, + "BasicAuth": { + "type": "object", + "title": "BasicAuth contains basic HTTP authentication credentials.", + "properties": { + "password": { + "$ref": "#/definitions/Secret" + }, + "password_file": { + "type": "string", + "x-go-name": "PasswordFile" + }, + "username": { + "type": "string", + "x-go-name": "Username" + } + }, + "x-go-package": "github.com/prometheus/common/config" + }, + "BrandingOptions": { + "type": "object", + "properties": { + "emailFooterLink": { + "type": "string", + "x-go-name": "EmailFooterLink" + }, + "emailFooterMode": { + "type": "string", + "x-go-name": "EmailFooterMode" + }, + "emailFooterText": { + "type": "string", + "x-go-name": "EmailFooterText" + }, + "emailLogoUrl": { + "type": "string", + "x-go-name": "EmailLogo" + }, + "reportLogoUrl": { + "type": "string", + "x-go-name": "ReportLogo" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "CalculateDiffTarget": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "unsavedDashboard": { + "$ref": "#/definitions/Json" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "ChangeUserPasswordCommand": { + "type": "object", + "properties": { + "newPassword": { + "type": "string", + "x-go-name": "NewPassword" + }, + "oldPassword": { + "type": "string", + "x-go-name": "OldPassword" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Config": { + "type": "object", + "title": "Config is the top-level configuration for Alertmanager's config files.", + "properties": { + "global": { + "$ref": "#/definitions/GlobalConfig" + }, + "inhibit_rules": { + "type": "array", + "items": { + "$ref": "#/definitions/InhibitRule" + }, + "x-go-name": "InhibitRules" + }, + "mute_time_intervals": { + "type": "array", + "items": { + "$ref": "#/definitions/MuteTimeInterval" + }, + "x-go-name": "MuteTimeIntervals" + }, + "route": { + "$ref": "#/definitions/Route" + }, + "templates": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Templates" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "ConfigDTO": { + "description": "ConfigDTO is model representation in transfer", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID" + }, + "dashboardName": { + "type": "string", + "x-go-name": "DashboardName" + }, + "dashboardUid": { + "type": "string", + "x-go-name": "DashboardUID" + }, + "enableCsv": { + "type": "boolean", + "x-go-name": "EnableCSV" + }, + "enableDashboardUrl": { + "type": "boolean", + "x-go-name": "EnableDashboardURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "options": { + "$ref": "#/definitions/ReportOptions" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "recipients": { + "type": "string", + "x-go-name": "Recipients" + }, + "replyTo": { + "type": "string", + "x-go-name": "ReplyTo" + }, + "schedule": { + "$ref": "#/definitions/Schedule" + }, + "state": { + "$ref": "#/definitions/State" + }, + "templateVars": { + "type": "object", + "x-go-name": "TemplateVars" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "CreateAlertNotificationCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateDashboardSnapshotCommand": { + "type": "object", + "required": ["dashboard"], + "properties": { + "Result": { + "$ref": "#/definitions/DashboardSnapshot" + }, + "dashboard": { + "$ref": "#/definitions/Json" + }, + "deleteKey": { + "description": "Unique key used to delete the snapshot. It is different from the `key` so that only the creator can delete the snapshot. Required if `external` is `true`.", + "type": "string", + "x-go-name": "DeleteKey" + }, + "expires": { + "description": "When the snapshot should expire in seconds in seconds. Default is never to expire.", + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "Expires" + }, + "external": { + "description": "these are passed when storing an external snapshot ref\nSave the snapshot on an external server rather than locally.", + "type": "boolean", + "default": false, + "x-go-name": "External" + }, + "key": { + "description": "Define the unique key. Required if `external` is `true`.", + "type": "string", + "x-go-name": "Key" + }, + "name": { + "description": "Snapshot name", + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateFolderCommand": { + "type": "object", + "properties": { + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateLibraryElementCommand": { + "description": "CreateLibraryElementCommand is the command for adding a LibraryElement", + "type": "object", + "properties": { + "folderId": { + "description": "ID of the folder where the library element is stored.", + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "kind": { + "description": "Kind of element to create, Use 1 for library panels or 2 for c.\nDescription:\n1 - library panels\n2 - library variables", + "type": "integer", + "format": "int64", + "enum": [1, 2], + "x-go-name": "Kind" + }, + "model": { + "description": "The JSON model for the library element.", + "type": "object", + "x-go-name": "Model" + }, + "name": { + "description": "Name of the library element.", + "type": "string", + "x-go-name": "Name" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "CreateOrUpdateConfigCmd": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID" + }, + "dashboardUid": { + "type": "string", + "x-go-name": "DashboardUID" + }, + "enableCsv": { + "type": "boolean", + "x-go-name": "EnableCSV" + }, + "enableDashboardUrl": { + "type": "boolean", + "x-go-name": "EnableDashboardURL" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "options": { + "$ref": "#/definitions/ReportOptions" + }, + "recipients": { + "type": "string", + "x-go-name": "Recipients" + }, + "replyTo": { + "type": "string", + "x-go-name": "ReplyTo" + }, + "schedule": { + "$ref": "#/definitions/Schedule" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "templateVars": { + "type": "object", + "x-go-name": "TemplateVars" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "CreateOrgCommand": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateRoleWithPermissionsCommand": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "group": { + "type": "string", + "x-go-name": "Group" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + }, + "x-go-name": "Permissions" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "CreateTeamCommand": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CustomPermissionsRecordDTO": { + "type": "object", + "properties": { + "customPermissions": { + "type": "string", + "x-go-name": "CustomPermissions" + }, + "granteeName": { + "type": "string", + "x-go-name": "GranteeName" + }, + "granteeType": { + "type": "string", + "x-go-name": "GranteeType" + }, + "granteeUrl": { + "type": "string", + "x-go-name": "GranteeURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "orgRole": { + "type": "string", + "x-go-name": "OrgRole" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "usersCount": { + "type": "integer", + "format": "int64", + "x-go-name": "UsersCount" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "DashboardAclInfoDTO": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "inherited": { + "type": "boolean", + "x-go-name": "Inherited" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "permission": { + "$ref": "#/definitions/PermissionType" + }, + "permissionName": { + "type": "string", + "x-go-name": "PermissionName" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "team": { + "type": "string", + "x-go-name": "Team" + }, + "teamAvatarUrl": { + "type": "string", + "x-go-name": "TeamAvatarUrl" + }, + "teamEmail": { + "type": "string", + "x-go-name": "TeamEmail" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "userAvatarUrl": { + "type": "string", + "x-go-name": "UserAvatarUrl" + }, + "userEmail": { + "type": "string", + "x-go-name": "UserEmail" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + }, + "userLogin": { + "type": "string", + "x-go-name": "UserLogin" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardAclUpdateItem": { + "type": "object", + "properties": { + "permission": { + "$ref": "#/definitions/PermissionType" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardFullWithMeta": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/DashboardMeta" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardMeta": { + "type": "object", + "properties": { + "canAdmin": { + "type": "boolean", + "x-go-name": "CanAdmin" + }, + "canEdit": { + "type": "boolean", + "x-go-name": "CanEdit" + }, + "canSave": { + "type": "boolean", + "x-go-name": "CanSave" + }, + "canStar": { + "type": "boolean", + "x-go-name": "CanStar" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "expires": { + "type": "string", + "format": "date-time", + "x-go-name": "Expires" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "folderTitle": { + "type": "string", + "x-go-name": "FolderTitle" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUid" + }, + "folderUrl": { + "type": "string", + "x-go-name": "FolderUrl" + }, + "hasAcl": { + "type": "boolean", + "x-go-name": "HasAcl" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "isHome": { + "type": "boolean", + "x-go-name": "IsHome" + }, + "isSnapshot": { + "type": "boolean", + "x-go-name": "IsSnapshot" + }, + "isStarred": { + "type": "boolean", + "x-go-name": "IsStarred" + }, + "provisioned": { + "type": "boolean", + "x-go-name": "Provisioned" + }, + "provisionedExternalId": { + "type": "string", + "x-go-name": "ProvisionedExternalId" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "updatedBy": { + "type": "string", + "x-go-name": "UpdatedBy" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardRedirect": { + "type": "object", + "properties": { + "redirectUri": { + "type": "string", + "x-go-name": "RedirectUri" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardSnapshot": { + "description": "DashboardSnapshot model", + "type": "object", + "properties": { + "Created": { + "type": "string", + "format": "date-time" + }, + "Dashboard": { + "$ref": "#/definitions/Json" + }, + "DashboardEncrypted": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + }, + "DeleteKey": { + "type": "string" + }, + "Expires": { + "type": "string", + "format": "date-time" + }, + "External": { + "type": "boolean" + }, + "ExternalDeleteUrl": { + "type": "string" + }, + "ExternalUrl": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Key": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "OrgId": { + "type": "integer", + "format": "int64" + }, + "Updated": { + "type": "string", + "format": "date-time" + }, + "UserId": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardSnapshotDTO": { + "description": "DashboardSnapshotDTO without dashboard map", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "expires": { + "type": "string", + "format": "date-time", + "x-go-name": "Expires" + }, + "external": { + "type": "boolean", + "x-go-name": "External" + }, + "externalUrl": { + "type": "string", + "x-go-name": "ExternalUrl" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardTagCloudItem": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int64", + "x-go-name": "Count" + }, + "term": { + "type": "string", + "x-go-name": "Term" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardVersionDTO": { + "description": "DashboardVersionDTO represents a dashboard version, without the dashboard\nmap.", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "parentVersion": { + "type": "integer", + "format": "int64", + "x-go-name": "ParentVersion" + }, + "restoredFrom": { + "type": "integer", + "format": "int64", + "x-go-name": "RestoredFrom" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardVersionMeta": { + "description": "DashboardVersionMeta extends the dashboard version model with the names\nassociated with the UserIds, overriding the field with the same name from\nthe DashboardVersion model.", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "data": { + "$ref": "#/definitions/Json" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "parentVersion": { + "type": "integer", + "format": "int64", + "x-go-name": "ParentVersion" + }, + "restoredFrom": { + "type": "integer", + "format": "int64", + "x-go-name": "RestoredFrom" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DataFrames": { + "description": "See NewDecodedDataFrames and NewEncodedDataFrames for more information.", + "type": "object", + "title": "DataFrames is an interface for retrieving encoded and decoded data frames.", + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataQueryResult": { + "description": "Deprecated: DataQueryResult should use backend.QueryDataResponse", + "type": "object", + "properties": { + "dataframes": { + "$ref": "#/definitions/DataFrames" + }, + "error": { + "type": "string", + "x-go-name": "ErrorString" + }, + "meta": { + "$ref": "#/definitions/Json" + }, + "refId": { + "type": "string", + "x-go-name": "RefID" + }, + "series": { + "$ref": "#/definitions/DataTimeSeriesSlice" + }, + "tables": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTable" + }, + "x-go-name": "Tables" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataResponse": { + "description": "Deprecated: DataResponse -- this structure is deprecated, all new work should use backend.QueryDataResponse", + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "results": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/DataQueryResult" + }, + "x-go-name": "Results" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataRowValues": { + "type": "array", + "items": { + "type": "object" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataSource": { + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "accessControl": { + "$ref": "#/definitions/Metadata" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "basicAuthPassword": { + "type": "string", + "x-go-name": "BasicAuthPassword" + }, + "basicAuthUser": { + "type": "string", + "x-go-name": "BasicAuthUser" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "readOnly": { + "type": "boolean", + "x-go-name": "ReadOnly" + }, + "secureJsonFields": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "SecureJsonFields" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "typeLogoUrl": { + "type": "string", + "x-go-name": "TypeLogoUrl" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + }, + "withCredentials": { + "type": "boolean", + "x-go-name": "WithCredentials" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DataSourceList": { + "type": "array", + "items": { + "$ref": "#/definitions/DataSourceListItemDTO" + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DataSourceListItemDTO": { + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "readOnly": { + "type": "boolean", + "x-go-name": "ReadOnly" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "typeLogoUrl": { + "type": "string", + "x-go-name": "TypeLogoUrl" + }, + "typeName": { + "type": "string", + "x-go-name": "TypeName" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DataTable": { + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTableColumn" + }, + "x-go-name": "Columns" + }, + "rows": { + "type": "array", + "items": { + "$ref": "#/definitions/DataRowValues" + }, + "x-go-name": "Rows" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTableColumn": { + "type": "object", + "properties": { + "text": { + "type": "string", + "x-go-name": "Text" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimePoint": { + "type": "array", + "items": { + "$ref": "#/definitions/Float" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimeSeries": { + "description": "DataTimeSeries -- this structure is deprecated, all new work should use DataFrames from the SDK", + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "points": { + "$ref": "#/definitions/DataTimeSeriesPoints" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Tags" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimeSeriesPoints": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTimePoint" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimeSeriesSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTimeSeries" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "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", + "format": "date-time", + "x-go-package": "github.com/go-openapi/strfmt" + }, + "DayOfMonthRange": { + "type": "object", + "title": "A DayOfMonthRange is an inclusive range that may have negative Beginning/End values that represent distance from the End of the month Beginning at -1.", + "properties": { + "Begin": { + "type": "integer", + "format": "int64" + }, + "End": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/timeinterval" + }, + "DeleteAnnotationsCmd": { + "type": "object", + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertId" + }, + "annotationId": { + "type": "integer", + "format": "int64", + "x-go-name": "AnnotationId" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DeleteTokenCommand": { + "type": "object", + "properties": { + "instance": { + "type": "string", + "x-go-name": "Instance" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "DiscoveryBase": { + "type": "object", + "required": ["status"], + "properties": { + "error": { + "type": "string", + "x-go-name": "Error" + }, + "errorType": { + "$ref": "#/definitions/ErrorType" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "DsAccess": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DsPermissionType": { + "description": "Datasource permission\nDescription:\n`0` - No Access\n`1` - Query\nEnum: 0,1", + "type": "integer", + "format": "int64", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Duration": { + "type": "integer", + "format": "int64", + "title": "Duration is a type used for marshalling durations." + }, + "EmailConfig": { + "type": "object", + "title": "EmailConfig configures notifications via mail.", + "properties": { + "auth_identity": { + "type": "string", + "x-go-name": "AuthIdentity" + }, + "auth_password": { + "$ref": "#/definitions/Secret" + }, + "auth_secret": { + "$ref": "#/definitions/Secret" + }, + "auth_username": { + "type": "string", + "x-go-name": "AuthUsername" + }, + "from": { + "type": "string", + "x-go-name": "From" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Headers" + }, + "hello": { + "type": "string", + "x-go-name": "Hello" + }, + "html": { + "type": "string", + "x-go-name": "HTML" + }, + "require_tls": { + "type": "boolean", + "x-go-name": "RequireTLS" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "smarthost": { + "$ref": "#/definitions/HostPort" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "tls_config": { + "$ref": "#/definitions/TLSConfig" + }, + "to": { + "description": "Email address to notify.", + "type": "string", + "x-go-name": "To" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "ErrorResponseBody": { + "type": "object", + "required": ["message"], + "properties": { + "error": { + "description": "Error An optional detailed description of the actual error. Only included if running in developer mode.", + "type": "string", + "x-go-name": "Error" + }, + "message": { + "description": "a human readable version of the error", + "type": "string", + "x-go-name": "Message" + }, + "status": { + "description": "Status An optional status to denote the cause of the error.\n\nFor example, a 412 Precondition Failed error may include additional information of why that error happened.", + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/docs/definitions" + }, + "ErrorType": { + "type": "string", + "title": "ErrorType models the different API error types.", + "x-go-package": "github.com/prometheus/client_golang/api/prometheus/v1" + }, + "EvalAlertConditionCommand": { + "description": "EvalAlertConditionCommand is the command for evaluating a condition", + "type": "object", + "properties": { + "condition": { + "type": "string", + "x-go-name": "Condition" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertQuery" + }, + "x-go-name": "Data" + }, + "now": { + "type": "string", + "format": "date-time", + "x-go-name": "Now" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/models" + }, + "EvalMatch": { + "type": "object", + "properties": { + "metric": { + "type": "string", + "x-go-name": "Metric" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "value": { + "$ref": "#/definitions/Float" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "EvalQueriesPayload": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertQuery" + }, + "x-go-name": "Data" + }, + "now": { + "type": "string", + "format": "date-time", + "x-go-name": "Now" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "EvalQueriesResponse": {}, + "ExtendedReceiver": { + "type": "object", + "properties": { + "email_configs": { + "$ref": "#/definitions/EmailConfig" + }, + "grafana_managed_receiver": { + "$ref": "#/definitions/PostableGrafanaReceiver" + }, + "opsgenie_configs": { + "$ref": "#/definitions/OpsGenieConfig" + }, + "pagerduty_configs": { + "$ref": "#/definitions/PagerdutyConfig" + }, + "pushover_configs": { + "$ref": "#/definitions/PushoverConfig" + }, + "slack_configs": { + "$ref": "#/definitions/SlackConfig" + }, + "victorops_configs": { + "$ref": "#/definitions/VictorOpsConfig" + }, + "webhook_configs": { + "$ref": "#/definitions/WebhookConfig" + }, + "wechat_configs": { + "$ref": "#/definitions/WechatConfig" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "FailedUser": { + "description": "FailedUser holds the information of an user that failed", + "type": "object", + "properties": { + "Error": { + "type": "string" + }, + "Login": { + "type": "string" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/ldapsync" + }, + "Failure": { + "$ref": "#/definitions/ResponseDetails" + }, + "FindTagsResult": { + "type": "object", + "title": "FindTagsResult is the result of a tags search.", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/TagsDTO" + }, + "x-go-name": "Tags" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "Float": { + "description": "It does not consider zero values to be null.\nIt will decode to null, not zero, if null.", + "type": "object", + "title": "Float is a nullable float64.", + "properties": { + "Float64": { + "type": "number", + "format": "double" + }, + "Valid": { + "type": "boolean" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/components/null" + }, + "Folder": { + "type": "object", + "properties": { + "canAdmin": { + "type": "boolean", + "x-go-name": "CanAdmin" + }, + "canEdit": { + "type": "boolean", + "x-go-name": "CanEdit" + }, + "canSave": { + "type": "boolean", + "x-go-name": "CanSave" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "hasAcl": { + "type": "boolean", + "x-go-name": "HasAcl" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "updatedBy": { + "type": "string", + "x-go-name": "UpdatedBy" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "FolderSearchHit": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "GetAnnotationTagsResponse": { + "type": "object", + "title": "GetAnnotationTagsResponse is a response struct for FindTagsResult.", + "properties": { + "result": { + "$ref": "#/definitions/FindTagsResult" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "GetHomeDashboardResponse": { + "title": "Get home dashboard response.", + "allOf": [ + { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/DashboardMeta" + } + } + }, + { + "type": "object", + "properties": { + "redirectUri": { + "type": "string", + "x-go-name": "RedirectUri" + } + } + } + ], + "x-go-name": "GetHomeDashboardResponseBody", + "x-go-package": "github.com/grafana/grafana/pkg/api/docs/definitions" + }, + "GettableAlertmanagers": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/AlertManagersResult" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableApiAlertingConfig": { + "type": "object", + "properties": { + "global": { + "$ref": "#/definitions/GlobalConfig" + }, + "inhibit_rules": { + "type": "array", + "items": { + "$ref": "#/definitions/InhibitRule" + }, + "x-go-name": "InhibitRules" + }, + "mute_time_intervals": { + "type": "array", + "items": { + "$ref": "#/definitions/MuteTimeInterval" + }, + "x-go-name": "MuteTimeIntervals" + }, + "receivers": { + "description": "Override with our superset receiver type", + "type": "array", + "items": { + "$ref": "#/definitions/GettableApiReceiver" + }, + "x-go-name": "Receivers" + }, + "route": { + "$ref": "#/definitions/Route" + }, + "templates": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Templates" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableApiReceiver": { + "type": "object", + "properties": { + "email_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/EmailConfig" + }, + "x-go-name": "EmailConfigs" + }, + "grafana_managed_receiver_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/GettableGrafanaReceiver" + }, + "x-go-name": "GrafanaManagedReceivers" + }, + "name": { + "description": "A unique identifier for this receiver.", + "type": "string", + "x-go-name": "Name" + }, + "opsgenie_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/OpsGenieConfig" + }, + "x-go-name": "OpsGenieConfigs" + }, + "pagerduty_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PagerdutyConfig" + }, + "x-go-name": "PagerdutyConfigs" + }, + "pushover_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PushoverConfig" + }, + "x-go-name": "PushoverConfigs" + }, + "slack_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/SlackConfig" + }, + "x-go-name": "SlackConfigs" + }, + "sns_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/SNSConfig" + }, + "x-go-name": "SNSConfigs" + }, + "victorops_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/VictorOpsConfig" + }, + "x-go-name": "VictorOpsConfigs" + }, + "webhook_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookConfig" + }, + "x-go-name": "WebhookConfigs" + }, + "wechat_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/WechatConfig" + }, + "x-go-name": "WechatConfigs" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableExtendedRuleNode": { + "type": "object", + "properties": { + "alert": { + "type": "string", + "x-go-name": "Alert" + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Annotations" + }, + "expr": { + "type": "string", + "x-go-name": "Expr" + }, + "for": { + "$ref": "#/definitions/Duration" + }, + "grafana_alert": { + "$ref": "#/definitions/GettableGrafanaRule" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Labels" + }, + "record": { + "type": "string", + "x-go-name": "Record" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableGrafanaReceiver": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureFields": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "SecureFields" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableGrafanaReceivers": { + "type": "object", + "properties": { + "grafana_managed_receiver_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/GettableGrafanaReceiver" + }, + "x-go-name": "GrafanaManagedReceivers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableGrafanaRule": { + "type": "object", + "properties": { + "condition": { + "type": "string", + "x-go-name": "Condition" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertQuery" + }, + "x-go-name": "Data" + }, + "exec_err_state": { + "type": "string", + "enum": ["Alerting"], + "x-go-enum-desc": "Alerting AlertingErrState", + "x-go-name": "ExecErrState" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "intervalSeconds": { + "type": "integer", + "format": "int64", + "x-go-name": "IntervalSeconds" + }, + "namespace_id": { + "type": "integer", + "format": "int64", + "x-go-name": "NamespaceID" + }, + "namespace_uid": { + "type": "string", + "x-go-name": "NamespaceUID" + }, + "no_data_state": { + "type": "string", + "enum": ["Alerting", "NoData", "OK"], + "x-go-enum-desc": "Alerting Alerting\nNoData NoData\nOK OK", + "x-go-name": "NoDataState" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "rule_group": { + "type": "string", + "x-go-name": "RuleGroup" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableNGalertConfig": { + "type": "object", + "properties": { + "alertmanagers": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Alertmanagers" + }, + "alertmanagersChoice": { + "type": "string", + "enum": ["all", "internal", "external"], + "x-go-enum-desc": "all AllAlertmanagers\ninternal InternalAlertmanager\nexternal ExternalAlertmanagers", + "x-go-name": "AlertmanagersChoice" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableRuleGroupConfig": { + "type": "object", + "properties": { + "interval": { + "$ref": "#/definitions/Duration" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/definitions/GettableExtendedRuleNode" + }, + "x-go-name": "Rules" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableStatus": { + "type": "object", + "required": ["cluster", "config", "uptime", "versionInfo"], + "properties": { + "cluster": { + "$ref": "#/definitions/clusterStatus" + }, + "config": { + "$ref": "#/definitions/PostableApiAlertingConfig" + }, + "uptime": { + "description": "uptime", + "type": "string", + "format": "date-time", + "x-go-name": "Uptime" + }, + "versionInfo": { + "$ref": "#/definitions/versionInfo" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GettableUserConfig": { + "type": "object", + "properties": { + "alertmanager_config": { + "$ref": "#/definitions/GettableApiAlertingConfig" + }, + "template_files": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "TemplateFiles" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "GlobalConfig": { + "description": "GlobalConfig defines configuration parameters that are valid globally\nunless overwritten.", + "type": "object", + "properties": { + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "opsgenie_api_key": { + "$ref": "#/definitions/Secret" + }, + "opsgenie_api_key_file": { + "type": "string", + "x-go-name": "OpsGenieAPIKeyFile" + }, + "opsgenie_api_url": { + "$ref": "#/definitions/URL" + }, + "pagerduty_url": { + "$ref": "#/definitions/URL" + }, + "resolve_timeout": { + "$ref": "#/definitions/Duration" + }, + "slack_api_url": { + "$ref": "#/definitions/SecretURL" + }, + "slack_api_url_file": { + "type": "string", + "x-go-name": "SlackAPIURLFile" + }, + "smtp_auth_identity": { + "type": "string", + "x-go-name": "SMTPAuthIdentity" + }, + "smtp_auth_password": { + "$ref": "#/definitions/Secret" + }, + "smtp_auth_secret": { + "$ref": "#/definitions/Secret" + }, + "smtp_auth_username": { + "type": "string", + "x-go-name": "SMTPAuthUsername" + }, + "smtp_from": { + "type": "string", + "x-go-name": "SMTPFrom" + }, + "smtp_hello": { + "type": "string", + "x-go-name": "SMTPHello" + }, + "smtp_require_tls": { + "type": "boolean", + "x-go-name": "SMTPRequireTLS" + }, + "smtp_smarthost": { + "$ref": "#/definitions/HostPort" + }, + "victorops_api_key": { + "$ref": "#/definitions/Secret" + }, + "victorops_api_url": { + "$ref": "#/definitions/URL" + }, + "wechat_api_corp_id": { + "type": "string", + "x-go-name": "WeChatAPICorpID" + }, + "wechat_api_secret": { + "$ref": "#/definitions/Secret" + }, + "wechat_api_url": { + "$ref": "#/definitions/URL" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "HTTPClientConfig": { + "type": "object", + "title": "HTTPClientConfig configures an HTTP client.", + "properties": { + "authorization": { + "$ref": "#/definitions/Authorization" + }, + "basic_auth": { + "$ref": "#/definitions/BasicAuth" + }, + "bearer_token": { + "$ref": "#/definitions/Secret" + }, + "bearer_token_file": { + "description": "The bearer token file for the targets. Deprecated in favour of\nAuthorization.CredentialsFile.", + "type": "string", + "x-go-name": "BearerTokenFile" + }, + "follow_redirects": { + "description": "FollowRedirects specifies whether the client should follow HTTP 3xx redirects.\nThe omitempty flag is not set, because it would be hidden from the\nmarshalled configuration when set to false.", + "type": "boolean", + "x-go-name": "FollowRedirects" + }, + "oauth2": { + "$ref": "#/definitions/OAuth2" + }, + "proxy_url": { + "$ref": "#/definitions/URL" + }, + "tls_config": { + "$ref": "#/definitions/TLSConfig" + } + }, + "x-go-package": "github.com/prometheus/common/config" + }, + "Hit": { + "type": "object", + "properties": { + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "folderTitle": { + "type": "string", + "x-go-name": "FolderTitle" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUID" + }, + "folderUrl": { + "type": "string", + "x-go-name": "FolderURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "isStarred": { + "type": "boolean", + "x-go-name": "IsStarred" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "sortMeta": { + "type": "integer", + "format": "int64", + "x-go-name": "SortMeta" + }, + "sortMetaName": { + "type": "string", + "x-go-name": "SortMetaName" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "type": { + "$ref": "#/definitions/HitType" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "uri": { + "type": "string", + "x-go-name": "URI" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/search" + }, + "HitList": { + "type": "array", + "items": { + "$ref": "#/definitions/Hit" + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/search" + }, + "HitType": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/services/search" + }, + "HostPort": { + "type": "object", + "title": "HostPort represents a \"host:port\" network address.", + "properties": { + "Host": { + "type": "string" + }, + "Port": { + "type": "string" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "ImportDashboardInput": { + "type": "object", + "title": "ImportDashboardInput definition of input parameters when importing a dashboard.", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "pluginId": { + "type": "string", + "x-go-name": "PluginId" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "value": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/dashboardimport" + }, + "ImportDashboardRequest": { + "type": "object", + "title": "ImportDashboardRequest request object for importing a dashboard.", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUid" + }, + "inputs": { + "type": "array", + "items": { + "$ref": "#/definitions/ImportDashboardInput" + }, + "x-go-name": "Inputs" + }, + "overwrite": { + "type": "boolean", + "x-go-name": "Overwrite" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "pluginId": { + "type": "string", + "x-go-name": "PluginId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/dashboardimport" + }, + "ImportDashboardResponse": { + "type": "object", + "title": "ImportDashboardResponse response object returned when importing a dashboard.", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "imported": { + "type": "boolean", + "x-go-name": "Imported" + }, + "importedRevision": { + "type": "integer", + "format": "int64", + "x-go-name": "ImportedRevision" + }, + "importedUri": { + "type": "string", + "x-go-name": "ImportedUri" + }, + "importedUrl": { + "type": "string", + "x-go-name": "ImportedUrl" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "pluginId": { + "type": "string", + "x-go-name": "PluginId" + }, + "removed": { + "type": "boolean", + "x-go-name": "Removed" + }, + "revision": { + "type": "integer", + "format": "int64", + "x-go-name": "Revision" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/dashboardimport" + }, + "InclusiveRange": { + "type": "object", + "title": "InclusiveRange is used to hold the Beginning and End values of many time interval components.", + "properties": { + "Begin": { + "type": "integer", + "format": "int64" + }, + "End": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/timeinterval" + }, + "InhibitRule": { + "description": "InhibitRule defines an inhibition rule that mutes alerts that match the\ntarget labels if an alert matching the source labels exists.\nBoth alerts have to have a set of labels being equal.", + "type": "object", + "properties": { + "equal": { + "$ref": "#/definitions/LabelNames" + }, + "source_match": { + "description": "SourceMatch defines a set of labels that have to equal the given\nvalue for source alerts. Deprecated. Remove before v1.0 release.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SourceMatch" + }, + "source_match_re": { + "$ref": "#/definitions/MatchRegexps" + }, + "source_matchers": { + "$ref": "#/definitions/Matchers" + }, + "target_match": { + "description": "TargetMatch defines a set of labels that have to equal the given\nvalue for target alerts. Deprecated. Remove before v1.0 release.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "TargetMatch" + }, + "target_match_re": { + "$ref": "#/definitions/MatchRegexps" + }, + "target_matchers": { + "$ref": "#/definitions/Matchers" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "ItemDTO": { + "type": "object", + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertId" + }, + "alertName": { + "type": "string", + "x-go-name": "AlertName" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "created": { + "type": "integer", + "format": "int64", + "x-go-name": "Created" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "data": { + "$ref": "#/definitions/Json" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "newState": { + "type": "string", + "x-go-name": "NewState" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "prevState": { + "type": "string", + "x-go-name": "PrevState" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + }, + "updated": { + "type": "integer", + "format": "int64", + "x-go-name": "Updated" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "Json": { + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/components/simplejson" + }, + "Label": { + "type": "object", + "title": "Label is a key/value pair of strings.", + "properties": { + "Name": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/prometheus/prometheus/pkg/labels" + }, + "LabelName": { + "description": "A LabelName is a key for a LabelSet or Metric. It has a value associated\ntherewith.", + "type": "string", + "x-go-package": "github.com/prometheus/common/model" + }, + "LabelNames": { + "type": "array", + "title": "LabelNames is a sortable LabelName slice. In implements sort.Interface.", + "items": { + "$ref": "#/definitions/LabelName" + }, + "x-go-package": "github.com/prometheus/common/model" + }, + "LabelSet": { + "description": "A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet\nmay be fully-qualified down to the point where it may resolve to a single\nMetric in the data store or not. All operations that occur within the realm\nof a LabelSet can emit a vector of Metric entities to which the LabelSet may\nmatch.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/LabelValue" + }, + "x-go-package": "github.com/prometheus/common/model" + }, + "LabelValue": { + "type": "string", + "title": "A LabelValue is an associated value for a LabelName.", + "x-go-package": "github.com/prometheus/common/model" + }, + "Labels": { + "description": "Labels is a sorted set of labels. Order has to be guaranteed upon\ninstantiation.", + "type": "array", + "items": { + "$ref": "#/definitions/Label" + }, + "x-go-package": "github.com/prometheus/prometheus/pkg/labels" + }, + "LibraryElementConnectionDTO": { + "type": "object", + "title": "LibraryElementConnectionDTO is the frontend DTO for element connections.", + "properties": { + "connectionId": { + "type": "integer", + "format": "int64", + "x-go-name": "ConnectionID" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "$ref": "#/definitions/LibraryElementDTOMetaUser" + }, + "elementId": { + "type": "integer", + "format": "int64", + "x-go-name": "ElementID" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "kind": { + "type": "integer", + "format": "int64", + "x-go-name": "Kind" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementConnectionsResponse": { + "type": "object", + "title": "LibraryElementConnectionsResponse is a response struct for an array of LibraryElementConnectionDTO.", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/LibraryElementConnectionDTO" + }, + "x-go-name": "Result" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementDTO": { + "type": "object", + "title": "LibraryElementDTO is the frontend DTO for entities.", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "kind": { + "type": "integer", + "format": "int64", + "x-go-name": "Kind" + }, + "meta": { + "$ref": "#/definitions/LibraryElementDTOMeta" + }, + "model": { + "type": "object", + "x-go-name": "Model" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementDTOMeta": { + "type": "object", + "title": "LibraryElementDTOMeta is the meta information for LibraryElementDTO.", + "properties": { + "connectedDashboards": { + "type": "integer", + "format": "int64", + "x-go-name": "ConnectedDashboards" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "$ref": "#/definitions/LibraryElementDTOMetaUser" + }, + "folderName": { + "type": "string", + "x-go-name": "FolderName" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUID" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "updatedBy": { + "$ref": "#/definitions/LibraryElementDTOMetaUser" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementDTOMetaUser": { + "type": "object", + "title": "LibraryElementDTOMetaUser is the meta information for user that creates/changes the library element.", + "properties": { + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementResponse": { + "type": "object", + "title": "LibraryElementResponse is a response struct for LibraryElementDTO.", + "properties": { + "result": { + "$ref": "#/definitions/LibraryElementDTO" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementSearchResponse": { + "type": "object", + "title": "LibraryElementSearchResponse is a response struct for LibraryElementSearchResult.", + "properties": { + "result": { + "$ref": "#/definitions/LibraryElementSearchResult" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementSearchResult": { + "type": "object", + "title": "LibraryElementSearchResult is the search result for entities.", + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/definitions/LibraryElementDTO" + }, + "x-go-name": "Elements" + }, + "page": { + "type": "integer", + "format": "int64", + "x-go-name": "Page" + }, + "perPage": { + "type": "integer", + "format": "int64", + "x-go-name": "PerPage" + }, + "totalCount": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "MatchRegexps": { + "type": "object", + "title": "MatchRegexps represents a map of Regexp.", + "additionalProperties": { + "$ref": "#/definitions/Regexp" + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "MatchType": { + "type": "integer", + "format": "int64", + "title": "MatchType is an enum for label matching types.", + "x-go-package": "github.com/prometheus/alertmanager/pkg/labels" + }, + "Matcher": { + "type": "object", + "title": "Matcher models the matching of a label.", + "properties": { + "Name": { + "type": "string" + }, + "Type": { + "$ref": "#/definitions/MatchType" + }, + "Value": { + "type": "string" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/pkg/labels" + }, + "Matchers": { + "description": "Matchers is a slice of Matchers that is sortable, implements Stringer, and\nprovides a Matches method to match a LabelSet against all Matchers in the\nslice. Note that some users of Matchers might require it to be sorted.", + "type": "array", + "items": { + "$ref": "#/definitions/Matcher" + } + }, + "Metadata": { + "description": "Metadata contains user accesses for a given resource\nEx: map[string]bool{\"create\":true, \"delete\": true}", + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/accesscontrol" + }, + "MetricRequest": { + "type": "object", + "required": ["from", "to", "queries"], + "properties": { + "debug": { + "type": "boolean", + "x-go-name": "Debug" + }, + "from": { + "description": "From Start time in epoch timestamps in milliseconds or relative using Grafana time units.", + "type": "string", + "x-go-name": "From", + "example": "now-1h" + }, + "queries": { + "description": "queries.refId – Specifies an identifier of the query. Is optional and default to “A”.\nqueries.datasourceId – Specifies the data source to be queried. Each query in the request must have an unique datasourceId.\nqueries.maxDataPoints - Species maximum amount of data points that dashboard panel can render. Is optional and default to 100.\nqueries.intervalMs - Specifies the time interval in milliseconds of time series. Is optional and defaults to 1000.", + "type": "array", + "items": { + "$ref": "#/definitions/Json" + }, + "x-go-name": "Queries", + "example": [ + { + "datasourceId": 86, + "format": "table", + "intervalMs": 86400000, + "maxDataPoints": 1092, + "rawSql": "SELECT 1 as valueOne, 2 as valueTwo", + "refId": "A" + } + ] + }, + "to": { + "description": "To End time in epoch timestamps in milliseconds or relative using Grafana time units.", + "type": "string", + "x-go-name": "To", + "example": "now" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "MonthRange": { + "type": "object", + "title": "A MonthRange is an inclusive range between [1, 12] where 1 = January.", + "properties": { + "Begin": { + "type": "integer", + "format": "int64" + }, + "End": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/timeinterval" + }, + "MultiStatus": { + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "MuteTimeInterval": { + "type": "object", + "title": "MuteTimeInterval represents a named set of time intervals for which a route should be muted.", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "time_intervals": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeInterval" + }, + "x-go-name": "TimeIntervals" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "NamespaceConfigResponse": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/GettableRuleGroupConfig" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "NewApiKeyResult": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "NotificationTestCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "NotifierConfig": { + "type": "object", + "title": "NotifierConfig contains base options common across all notifier configurations.", + "properties": { + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "OAuth2": { + "type": "object", + "title": "OAuth2 is the oauth2 client configuration.", + "properties": { + "TLSConfig": { + "$ref": "#/definitions/TLSConfig" + }, + "client_id": { + "type": "string", + "x-go-name": "ClientID" + }, + "client_secret": { + "$ref": "#/definitions/Secret" + }, + "client_secret_file": { + "type": "string", + "x-go-name": "ClientSecretFile" + }, + "endpoint_params": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "EndpointParams" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Scopes" + }, + "token_url": { + "type": "string", + "x-go-name": "TokenURL" + } + }, + "x-go-package": "github.com/prometheus/common/config" + }, + "ObjectMatchers": { + "description": "ObjectMatchers is Matchers with a different Unmarshal and Marshal methods that accept matchers as objects\nthat have already been parsed.", + "$ref": "#/definitions/Matchers" + }, + "OpsGenieConfig": { + "type": "object", + "title": "OpsGenieConfig configures notifications via OpsGenie.", + "properties": { + "actions": { + "type": "string", + "x-go-name": "Actions" + }, + "api_key": { + "$ref": "#/definitions/Secret" + }, + "api_key_file": { + "type": "string", + "x-go-name": "APIKeyFile" + }, + "api_url": { + "$ref": "#/definitions/URL" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "details": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Details" + }, + "entity": { + "type": "string", + "x-go-name": "Entity" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "note": { + "type": "string", + "x-go-name": "Note" + }, + "priority": { + "type": "string", + "x-go-name": "Priority" + }, + "responders": { + "type": "array", + "items": { + "$ref": "#/definitions/OpsGenieConfigResponder" + }, + "x-go-name": "Responders" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "source": { + "type": "string", + "x-go-name": "Source" + }, + "tags": { + "type": "string", + "x-go-name": "Tags" + }, + "update_alerts": { + "type": "boolean", + "x-go-name": "UpdateAlerts" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "OpsGenieConfigResponder": { + "type": "object", + "properties": { + "id": { + "description": "One of those 3 should be filled.", + "type": "string", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "type": { + "description": "team, user, escalation, schedule etc.", + "type": "string", + "x-go-name": "Type" + }, + "username": { + "type": "string", + "x-go-name": "Username" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "OrgDTO": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "OrgDetailsDTO": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "OrgUserDTO": { + "type": "object", + "properties": { + "accessControl": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "AccessControl" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "lastSeenAt": { + "type": "string", + "format": "date-time", + "x-go-name": "LastSeenAt" + }, + "lastSeenAtAge": { + "type": "string", + "x-go-name": "LastSeenAtAge" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "role": { + "type": "string", + "x-go-name": "Role" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "PagerdutyConfig": { + "type": "object", + "title": "PagerdutyConfig configures notifications via PagerDuty.", + "properties": { + "class": { + "type": "string", + "x-go-name": "Class" + }, + "client": { + "type": "string", + "x-go-name": "Client" + }, + "client_url": { + "type": "string", + "x-go-name": "ClientURL" + }, + "component": { + "type": "string", + "x-go-name": "Component" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "details": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Details" + }, + "group": { + "type": "string", + "x-go-name": "Group" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/PagerdutyImage" + }, + "x-go-name": "Images" + }, + "links": { + "type": "array", + "items": { + "$ref": "#/definitions/PagerdutyLink" + }, + "x-go-name": "Links" + }, + "routing_key": { + "$ref": "#/definitions/Secret" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "service_key": { + "$ref": "#/definitions/Secret" + }, + "severity": { + "type": "string", + "x-go-name": "Severity" + }, + "url": { + "$ref": "#/definitions/URL" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "PagerdutyImage": { + "description": "PagerdutyImage is an image", + "type": "object", + "properties": { + "alt": { + "type": "string", + "x-go-name": "Alt" + }, + "href": { + "type": "string", + "x-go-name": "Href" + }, + "src": { + "type": "string", + "x-go-name": "Src" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "PagerdutyLink": { + "description": "PagerdutyLink is a link", + "type": "object", + "properties": { + "href": { + "type": "string", + "x-go-name": "Href" + }, + "text": { + "type": "string", + "x-go-name": "Text" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "PatchAnnotationsCmd": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PatchLibraryElementCommand": { + "description": "PatchLibraryElementCommand is the command for patching a LibraryElement", + "type": "object", + "properties": { + "folderId": { + "description": "ID of the folder where the library element is stored.", + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "kind": { + "description": "Kind of element to create, Use 1 for library panels or 2 for c.\nDescription:\n1 - library panels\n2 - library variables", + "type": "integer", + "format": "int64", + "enum": [1, 2], + "x-go-name": "Kind" + }, + "model": { + "description": "The JSON model for the library element.", + "type": "object", + "x-go-name": "Model" + }, + "name": { + "description": "Name of the library element.", + "type": "string", + "x-go-name": "Name" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "version": { + "description": "Version of the library element you are updating.", + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "PauseAlertCommand": { + "type": "object", + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertId" + }, + "paused": { + "type": "boolean", + "x-go-name": "Paused" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PauseAllAlertsCommand": { + "type": "object", + "properties": { + "paused": { + "type": "boolean", + "x-go-name": "Paused" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "Permission": { + "type": "object", + "title": "Permission is the model for access control permissions.", + "properties": { + "action": { + "type": "string", + "x-go-name": "Action" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "scope": { + "type": "string", + "x-go-name": "Scope" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/accesscontrol" + }, + "PermissionDenied": { + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PermissionType": { + "type": "integer", + "format": "int64", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Point": { + "type": "object", + "title": "Point represents a single data point for a given timestamp.", + "properties": { + "T": { + "type": "integer", + "format": "int64" + }, + "V": { + "type": "number", + "format": "double" + } + }, + "x-go-package": "github.com/prometheus/prometheus/promql" + }, + "PostAnnotationsCmd": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "data": { + "$ref": "#/definitions/Json" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PostGraphiteAnnotationsCmd": { + "type": "object", + "properties": { + "data": { + "type": "string", + "x-go-name": "Data" + }, + "tags": { + "type": "object", + "x-go-name": "Tags" + }, + "what": { + "type": "string", + "x-go-name": "What" + }, + "when": { + "type": "integer", + "format": "int64", + "x-go-name": "When" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PostableApiAlertingConfig": { + "type": "object", + "properties": { + "global": { + "$ref": "#/definitions/GlobalConfig" + }, + "inhibit_rules": { + "type": "array", + "items": { + "$ref": "#/definitions/InhibitRule" + }, + "x-go-name": "InhibitRules" + }, + "mute_time_intervals": { + "type": "array", + "items": { + "$ref": "#/definitions/MuteTimeInterval" + }, + "x-go-name": "MuteTimeIntervals" + }, + "receivers": { + "description": "Override with our superset receiver type", + "type": "array", + "items": { + "$ref": "#/definitions/PostableApiReceiver" + }, + "x-go-name": "Receivers" + }, + "route": { + "$ref": "#/definitions/Route" + }, + "templates": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Templates" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableApiReceiver": { + "type": "object", + "properties": { + "email_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/EmailConfig" + }, + "x-go-name": "EmailConfigs" + }, + "grafana_managed_receiver_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PostableGrafanaReceiver" + }, + "x-go-name": "GrafanaManagedReceivers" + }, + "name": { + "description": "A unique identifier for this receiver.", + "type": "string", + "x-go-name": "Name" + }, + "opsgenie_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/OpsGenieConfig" + }, + "x-go-name": "OpsGenieConfigs" + }, + "pagerduty_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PagerdutyConfig" + }, + "x-go-name": "PagerdutyConfigs" + }, + "pushover_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PushoverConfig" + }, + "x-go-name": "PushoverConfigs" + }, + "slack_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/SlackConfig" + }, + "x-go-name": "SlackConfigs" + }, + "sns_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/SNSConfig" + }, + "x-go-name": "SNSConfigs" + }, + "victorops_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/VictorOpsConfig" + }, + "x-go-name": "VictorOpsConfigs" + }, + "webhook_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookConfig" + }, + "x-go-name": "WebhookConfigs" + }, + "wechat_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/WechatConfig" + }, + "x-go-name": "WechatConfigs" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableExtendedRuleNode": { + "type": "object", + "properties": { + "alert": { + "type": "string", + "x-go-name": "Alert" + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Annotations" + }, + "expr": { + "type": "string", + "x-go-name": "Expr" + }, + "for": { + "$ref": "#/definitions/Duration" + }, + "grafana_alert": { + "$ref": "#/definitions/PostableGrafanaRule" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Labels" + }, + "record": { + "type": "string", + "x-go-name": "Record" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableGrafanaReceiver": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableGrafanaReceivers": { + "type": "object", + "properties": { + "grafana_managed_receiver_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PostableGrafanaReceiver" + }, + "x-go-name": "GrafanaManagedReceivers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableGrafanaRule": { + "type": "object", + "properties": { + "condition": { + "type": "string", + "x-go-name": "Condition" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertQuery" + }, + "x-go-name": "Data" + }, + "exec_err_state": { + "type": "string", + "enum": ["Alerting"], + "x-go-enum-desc": "Alerting AlertingErrState", + "x-go-name": "ExecErrState" + }, + "no_data_state": { + "type": "string", + "enum": ["Alerting", "NoData", "OK"], + "x-go-enum-desc": "Alerting Alerting\nNoData NoData\nOK OK", + "x-go-name": "NoDataState" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableNGalertConfig": { + "type": "object", + "properties": { + "alertmanagers": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Alertmanagers" + }, + "alertmanagersChoice": { + "type": "string", + "enum": ["all", "internal", "external"], + "x-go-enum-desc": "all AllAlertmanagers\ninternal InternalAlertmanager\nexternal ExternalAlertmanagers", + "x-go-name": "AlertmanagersChoice" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableRuleGroupConfig": { + "type": "object", + "properties": { + "interval": { + "$ref": "#/definitions/Duration" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/definitions/PostableExtendedRuleNode" + }, + "x-go-name": "Rules" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "PostableUserConfig": { + "type": "object", + "properties": { + "alertmanager_config": { + "$ref": "#/definitions/PostableApiAlertingConfig" + }, + "template_files": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "TemplateFiles" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "Prefs": { + "type": "object", + "properties": { + "homeDashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "HomeDashboardID" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "timezone": { + "type": "string", + "x-go-name": "Timezone" + }, + "weekStart": { + "type": "string", + "x-go-name": "WeekStart" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PrometheusRemoteWriteTargetJSON": { + "type": "object", + "properties": { + "data_source_uid": { + "type": "string", + "x-go-name": "DatasourceUID" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "remote_write_path": { + "type": "string", + "x-go-name": "WritePath" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/recordedqueries/api" + }, + "PushoverConfig": { + "type": "object", + "properties": { + "expire": { + "$ref": "#/definitions/duration" + }, + "html": { + "type": "boolean", + "x-go-name": "HTML" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "priority": { + "type": "string", + "x-go-name": "Priority" + }, + "retry": { + "$ref": "#/definitions/duration" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "sound": { + "type": "string", + "x-go-name": "Sound" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "token": { + "$ref": "#/definitions/Secret" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "url_title": { + "type": "string", + "x-go-name": "URLTitle" + }, + "user_key": { + "$ref": "#/definitions/Secret" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "QueryDataResponse": { + "description": "It is the return type of a QueryData call.", + "type": "object", + "title": "QueryDataResponse contains the results from a QueryDataRequest.", + "properties": { + "Responses": { + "$ref": "#/definitions/Responses" + } + }, + "x-go-package": "github.com/grafana/grafana-plugin-sdk-go/backend" + }, + "Receiver": { + "type": "object", + "title": "Receiver configuration provides configuration on how to contact a receiver.", + "properties": { + "email_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/EmailConfig" + }, + "x-go-name": "EmailConfigs" + }, + "name": { + "description": "A unique identifier for this receiver.", + "type": "string", + "x-go-name": "Name" + }, + "opsgenie_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/OpsGenieConfig" + }, + "x-go-name": "OpsGenieConfigs" + }, + "pagerduty_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PagerdutyConfig" + }, + "x-go-name": "PagerdutyConfigs" + }, + "pushover_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/PushoverConfig" + }, + "x-go-name": "PushoverConfigs" + }, + "slack_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/SlackConfig" + }, + "x-go-name": "SlackConfigs" + }, + "sns_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/SNSConfig" + }, + "x-go-name": "SNSConfigs" + }, + "victorops_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/VictorOpsConfig" + }, + "x-go-name": "VictorOpsConfigs" + }, + "webhook_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookConfig" + }, + "x-go-name": "WebhookConfigs" + }, + "wechat_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/WechatConfig" + }, + "x-go-name": "WechatConfigs" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "RecordingRuleJSON": { + "description": "RecordingRuleJSON is the external representation of a recording rule", + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-go-name": "Active" + }, + "count": { + "type": "boolean", + "x-go-name": "Count" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "dest_data_source_uid": { + "type": "string", + "x-go-name": "DestDataSourceUID" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "interval": { + "type": "integer", + "format": "int64", + "x-go-name": "Interval" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "prom_name": { + "type": "string", + "x-go-name": "PromName" + }, + "queries": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "x-go-name": "Queries" + }, + "range": { + "type": "integer", + "format": "int64", + "x-go-name": "Range" + }, + "target_ref_id": { + "type": "string", + "x-go-name": "TargetRefID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/recordedqueries/api" + }, + "Regexp": { + "description": "A Regexp is safe for concurrent use by multiple goroutines,\nexcept for configuration methods, such as Longest.", + "type": "object", + "title": "Regexp is the representation of a compiled regular expression.", + "x-go-package": "regexp" + }, + "RelativeTimeRange": { + "description": "RelativeTimeRange is the per query start and end time\nfor requests.", + "type": "object", + "properties": { + "from": { + "$ref": "#/definitions/Duration" + }, + "to": { + "$ref": "#/definitions/Duration" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/models" + }, + "ReportEmailDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "emails": { + "description": "Comma-separated list of emails to which to send the report to.", + "type": "string", + "x-go-name": "Emails" + }, + "id": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "string", + "format": "int64", + "x-go-name": "Id" + }, + "useEmailsFromReport": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "boolean", + "x-go-name": "UseEmailsFromReport" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "ReportOptions": { + "type": "object", + "properties": { + "layout": { + "type": "string", + "x-go-name": "Layout" + }, + "orientation": { + "type": "string", + "x-go-name": "Orientation" + }, + "timeRange": { + "$ref": "#/definitions/TimeRangeDTO" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "ResponseDetails": { + "type": "object", + "properties": { + "msg": { + "type": "string", + "x-go-name": "Msg" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "Responses": { + "description": "The QueryData method the QueryDataHandler method will set the RefId\nproperty on the DataRespones' frames based on these RefIDs.", + "type": "object", + "title": "Responses is a map of RefIDs (Unique Query ID) to DataResponses.", + "additionalProperties": { + "$ref": "#/definitions/DataResponse" + }, + "x-go-package": "github.com/grafana/grafana-plugin-sdk-go/backend" + }, + "RevokeAuthTokenCmd": { + "type": "object", + "properties": { + "authTokenId": { + "type": "integer", + "format": "int64", + "x-go-name": "AuthTokenId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "RoleDTO": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "delegatable": { + "type": "boolean", + "x-go-name": "Delegatable" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "group": { + "type": "string", + "x-go-name": "Group" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + }, + "x-go-name": "Permissions" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/accesscontrol" + }, + "RoleType": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Route": { + "description": "A Route is a node that contains definitions of how to handle alerts. This is modified\nfrom the upstream alertmanager in that it adds the ObjectMatchers property.", + "type": "object", + "properties": { + "continue": { + "type": "boolean", + "x-go-name": "Continue" + }, + "group_by": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "GroupByStr" + }, + "group_interval": { + "$ref": "#/definitions/Duration" + }, + "group_wait": { + "$ref": "#/definitions/Duration" + }, + "match": { + "description": "Deprecated. Remove before v1.0 release.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Match" + }, + "match_re": { + "$ref": "#/definitions/MatchRegexps" + }, + "matchers": { + "$ref": "#/definitions/Matchers" + }, + "mute_time_intervals": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MuteTimeIntervals" + }, + "object_matchers": { + "$ref": "#/definitions/ObjectMatchers" + }, + "receiver": { + "type": "string", + "x-go-name": "Receiver" + }, + "repeat_interval": { + "$ref": "#/definitions/Duration" + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/Route" + }, + "x-go-name": "Routes" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "Rule": { + "description": "adapted from cortex", + "type": "object", + "required": ["name", "query", "health", "type"], + "properties": { + "evaluationTime": { + "type": "number", + "format": "double", + "x-go-name": "EvaluationTime" + }, + "health": { + "type": "string", + "x-go-name": "Health" + }, + "labels": { + "$ref": "#/definitions/overrideLabels" + }, + "lastError": { + "type": "string", + "x-go-name": "LastError" + }, + "lastEvaluation": { + "type": "string", + "format": "date-time", + "x-go-name": "LastEvaluation" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "query": { + "type": "string", + "x-go-name": "Query" + }, + "type": { + "$ref": "#/definitions/RuleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "RuleDiscovery": { + "type": "object", + "required": ["groups"], + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/definitions/RuleGroup" + }, + "x-go-name": "RuleGroups" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "RuleGroup": { + "type": "object", + "required": ["name", "file", "rules", "interval"], + "properties": { + "evaluationTime": { + "type": "number", + "format": "double", + "x-go-name": "EvaluationTime" + }, + "file": { + "type": "string", + "x-go-name": "File" + }, + "interval": { + "type": "number", + "format": "double", + "x-go-name": "Interval" + }, + "lastEvaluation": { + "type": "string", + "format": "date-time", + "x-go-name": "LastEvaluation" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "rules": { + "description": "In order to preserve rule ordering, while exposing type (alerting or recording)\nspecific properties, both alerting and recording rules are exposed in the\nsame array.", + "type": "array", + "items": { + "$ref": "#/definitions/AlertingRule" + }, + "x-go-name": "Rules" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "RuleGroupConfigResponse": { + "type": "object", + "properties": { + "interval": { + "$ref": "#/definitions/Duration" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/definitions/GettableExtendedRuleNode" + }, + "x-go-name": "Rules" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "RuleResponse": { + "type": "object", + "required": ["status"], + "properties": { + "data": { + "$ref": "#/definitions/RuleDiscovery" + }, + "error": { + "type": "string", + "x-go-name": "Error" + }, + "errorType": { + "$ref": "#/definitions/ErrorType" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "RuleType": { + "type": "string", + "title": "RuleType models the type of a rule.", + "x-go-package": "github.com/prometheus/client_golang/api/prometheus/v1" + }, + "SNSConfig": { + "type": "object", + "properties": { + "api_url": { + "type": "string", + "x-go-name": "APIUrl" + }, + "attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Attributes" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "phone_number": { + "type": "string", + "x-go-name": "PhoneNumber" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "sigv4": { + "$ref": "#/definitions/SigV4Config" + }, + "subject": { + "type": "string", + "x-go-name": "Subject" + }, + "target_arn": { + "type": "string", + "x-go-name": "TargetARN" + }, + "topic_arn": { + "type": "string", + "x-go-name": "TopicARN" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "Sample": { + "type": "object", + "title": "Sample is a single sample belonging to a metric.", + "properties": { + "Metric": { + "$ref": "#/definitions/Labels" + }, + "T": { + "type": "integer", + "format": "int64" + }, + "V": { + "type": "number", + "format": "double" + } + }, + "x-go-package": "github.com/prometheus/prometheus/promql" + }, + "SaveDashboardCommand": { + "type": "object", + "properties": { + "UpdatedAt": { + "type": "string", + "format": "date-time" + }, + "dashboard": { + "$ref": "#/definitions/Json" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUid" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "overwrite": { + "type": "boolean", + "x-go-name": "Overwrite" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Schedule": { + "type": "object", + "properties": { + "day": { + "type": "string", + "x-go-name": "Day" + }, + "dayOfMonth": { + "type": "string", + "x-go-name": "DayOfMonth" + }, + "endDate": { + "type": "string", + "format": "date-time", + "x-go-name": "EndDate" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "hour": { + "type": "integer", + "format": "int64", + "x-go-name": "Hour" + }, + "intervalAmount": { + "type": "integer", + "format": "int64", + "x-go-name": "IntervalAmount" + }, + "intervalFrequency": { + "type": "string", + "x-go-name": "IntervalFrequency" + }, + "minute": { + "type": "integer", + "format": "int64", + "x-go-name": "Minute" + }, + "startDate": { + "type": "string", + "format": "date-time", + "x-go-name": "StartDate" + }, + "timeZone": { + "type": "string", + "x-go-name": "TimeZone" + }, + "workdaysOnly": { + "type": "boolean", + "x-go-name": "WorkdaysOnly" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "SearchTeamQueryResult": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int64", + "x-go-name": "Page" + }, + "perPage": { + "type": "integer", + "format": "int64", + "x-go-name": "PerPage" + }, + "teams": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamDTO" + }, + "x-go-name": "Teams" + }, + "totalCount": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "SearchUserQueryResult": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int64", + "x-go-name": "Page" + }, + "perPage": { + "type": "integer", + "format": "int64", + "x-go-name": "PerPage" + }, + "totalCount": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/UserSearchHitDTO" + }, + "x-go-name": "Users" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Secret": { + "type": "string", + "title": "Secret special type for storing secrets.", + "x-go-package": "github.com/prometheus/common/config" + }, + "SecretURL": { + "title": "SecretURL is a URL that must not be revealed on marshaling.", + "$ref": "#/definitions/URL" + }, + "SetUserRolesCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean", + "x-go-name": "Global" + }, + "roleUids": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "RoleUIDs" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "SettingsBag": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/setting" + }, + "SettingsDTO": { + "type": "object", + "properties": { + "branding": { + "$ref": "#/definitions/BrandingOptions" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "SigV4Config": { + "description": "SigV4Config is the configuration for signing remote write requests with\nAWS's SigV4 verification process. Empty values will be retrieved using the\nAWS default credentials chain.", + "type": "object", + "properties": { + "AccessKey": { + "type": "string" + }, + "Profile": { + "type": "string" + }, + "Region": { + "type": "string" + }, + "RoleARN": { + "type": "string" + }, + "SecretKey": { + "$ref": "#/definitions/Secret" + } + }, + "x-go-package": "github.com/prometheus/common/sigv4" + }, + "SlackAction": { + "description": "See https://api.slack.com/docs/message-attachments#action_fields and https://api.slack.com/docs/message-buttons\nfor more information.", + "type": "object", + "title": "SlackAction configures a single Slack action that is sent with each notification.", + "properties": { + "confirm": { + "$ref": "#/definitions/SlackConfirmationField" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "style": { + "type": "string", + "x-go-name": "Style" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "value": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "SlackConfig": { + "type": "object", + "title": "SlackConfig configures notifications via Slack.", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/SlackAction" + }, + "x-go-name": "Actions" + }, + "api_url": { + "$ref": "#/definitions/SecretURL" + }, + "api_url_file": { + "type": "string", + "x-go-name": "APIURLFile" + }, + "callback_id": { + "type": "string", + "x-go-name": "CallbackID" + }, + "channel": { + "description": "Slack channel override, (like #other-channel or @username).", + "type": "string", + "x-go-name": "Channel" + }, + "color": { + "type": "string", + "x-go-name": "Color" + }, + "fallback": { + "type": "string", + "x-go-name": "Fallback" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/SlackField" + }, + "x-go-name": "Fields" + }, + "footer": { + "type": "string", + "x-go-name": "Footer" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "icon_emoji": { + "type": "string", + "x-go-name": "IconEmoji" + }, + "icon_url": { + "type": "string", + "x-go-name": "IconURL" + }, + "image_url": { + "type": "string", + "x-go-name": "ImageURL" + }, + "link_names": { + "type": "boolean", + "x-go-name": "LinkNames" + }, + "mrkdwn_in": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MrkdwnIn" + }, + "pretext": { + "type": "string", + "x-go-name": "Pretext" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "short_fields": { + "type": "boolean", + "x-go-name": "ShortFields" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "thumb_url": { + "type": "string", + "x-go-name": "ThumbURL" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "title_link": { + "type": "string", + "x-go-name": "TitleLink" + }, + "username": { + "type": "string", + "x-go-name": "Username" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "SlackConfirmationField": { + "description": "SlackConfirmationField protect users from destructive actions or particularly distinguished decisions\nby asking them to confirm their button click one more time.\nSee https://api.slack.com/docs/interactive-message-field-guide#confirmation_fields for more information.", + "type": "object", + "properties": { + "dismiss_text": { + "type": "string", + "x-go-name": "DismissText" + }, + "ok_text": { + "type": "string", + "x-go-name": "OkText" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "SlackField": { + "description": "Each field must contain a title, value, and optionally, a boolean value to indicate if the field\nis short enough to be displayed next to other fields designated as short.\nSee https://api.slack.com/docs/message-attachments#fields for more information.", + "type": "object", + "title": "SlackField configures a single Slack field that is sent with each notification.", + "properties": { + "short": { + "type": "boolean", + "x-go-name": "Short" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "value": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "SmtpNotEnabled": { + "$ref": "#/definitions/ResponseDetails" + }, + "State": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "Status": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "x-go-name": "Enabled" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "Success": { + "$ref": "#/definitions/ResponseDetails" + }, + "SuccessResponseBody": { + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/docs/definitions" + }, + "SyncResult": { + "type": "object", + "title": "SyncResult holds the result of a sync with LDAP. This gives us information on which users were updated and how.", + "properties": { + "Elapsed": { + "$ref": "#/definitions/Duration" + }, + "FailedUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/FailedUser" + } + }, + "MissingUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "Started": { + "type": "string", + "format": "date-time" + }, + "UpdatedUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/ldapsync" + }, + "TLSConfig": { + "type": "object", + "title": "TLSConfig configures the options for TLS connections.", + "properties": { + "ca_file": { + "description": "The CA cert to use for the targets.", + "type": "string", + "x-go-name": "CAFile" + }, + "cert_file": { + "description": "The client cert file for the targets.", + "type": "string", + "x-go-name": "CertFile" + }, + "insecure_skip_verify": { + "description": "Disable target certificate validation.", + "type": "boolean", + "x-go-name": "InsecureSkipVerify" + }, + "key_file": { + "description": "The client key file for the targets.", + "type": "string", + "x-go-name": "KeyFile" + }, + "server_name": { + "description": "Used to verify the hostname for the targets.", + "type": "string", + "x-go-name": "ServerName" + } + }, + "x-go-package": "github.com/prometheus/common/config" + }, + "TagsDTO": { + "type": "object", + "title": "TagsDTO is the frontend DTO for Tag.", + "properties": { + "count": { + "type": "integer", + "format": "int64", + "x-go-name": "Count" + }, + "tag": { + "type": "string", + "x-go-name": "Tag" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "TeamDTO": { + "type": "object", + "properties": { + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "memberCount": { + "type": "integer", + "format": "int64", + "x-go-name": "MemberCount" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "permission": { + "$ref": "#/definitions/PermissionType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TeamGroupDTO": { + "type": "object", + "properties": { + "groupId": { + "type": "string", + "x-go-name": "GroupId" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/teamgroupsync/models" + }, + "TeamGroupMapping": { + "type": "object", + "properties": { + "groupId": { + "type": "string", + "x-go-name": "GroupId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/teamgroupsync/models" + }, + "TeamMemberDTO": { + "type": "object", + "properties": { + "auth_module": { + "type": "string", + "x-go-name": "AuthModule" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Labels" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "permission": { + "$ref": "#/definitions/PermissionType" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TempUserDTO": { + "type": "object", + "properties": { + "code": { + "type": "string", + "x-go-name": "Code" + }, + "createdOn": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "emailSent": { + "type": "boolean", + "x-go-name": "EmailSent" + }, + "emailSentOn": { + "type": "string", + "format": "date-time", + "x-go-name": "EmailSentOn" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "invitedByEmail": { + "type": "string", + "x-go-name": "InvitedByEmail" + }, + "invitedByLogin": { + "type": "string", + "x-go-name": "InvitedByLogin" + }, + "invitedByName": { + "type": "string", + "x-go-name": "InvitedByName" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "status": { + "$ref": "#/definitions/TempUserStatus" + }, + "url": { + "type": "string", + "x-go-name": "Url" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TempUserStatus": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TestReceiverConfigResult": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-go-name": "Error" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "status": { + "type": "string", + "x-go-name": "Status" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "TestReceiverResult": { + "type": "object", + "properties": { + "grafana_managed_receiver_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/TestReceiverConfigResult" + }, + "x-go-name": "Configs" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "TestReceiversConfigAlertParams": { + "type": "object", + "properties": { + "annotations": { + "$ref": "#/definitions/LabelSet" + }, + "labels": { + "$ref": "#/definitions/LabelSet" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "TestReceiversConfigBodyParams": { + "type": "object", + "properties": { + "alert": { + "$ref": "#/definitions/TestReceiversConfigAlertParams" + }, + "receivers": { + "type": "array", + "items": { + "$ref": "#/definitions/PostableApiReceiver" + }, + "x-go-name": "Receivers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "TestReceiversResult": { + "type": "object", + "properties": { + "alert": { + "$ref": "#/definitions/TestReceiversConfigAlertParams" + }, + "notified_at": { + "type": "string", + "format": "date-time", + "x-go-name": "NotifiedAt" + }, + "receivers": { + "type": "array", + "items": { + "$ref": "#/definitions/TestReceiverResult" + }, + "x-go-name": "Receivers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "TestRulePayload": { + "type": "object", + "properties": { + "expr": { + "type": "string", + "x-go-name": "Expr", + "example": "(node_filesystem_avail_bytes{fstype!=\"\",job=\"integrations/node_exporter\"} node_filesystem_size_bytes{fstype!=\"\",job=\"integrations/node_exporter\"} * 100 \u003c 5 and node_filesystem_readonly{fstype!=\"\",job=\"integrations/node_exporter\"} == 0)" + }, + "grafana_condition": { + "$ref": "#/definitions/EvalAlertConditionCommand" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "TestRuleResponse": { + "type": "object", + "properties": { + "alerts": { + "$ref": "#/definitions/Vector" + }, + "grafana_alert_instances": { + "$ref": "#/definitions/AlertInstancesResponse" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "TimeInterval": { + "description": "TimeInterval describes intervals of time. ContainsTime will tell you if a golang time is contained\nwithin the interval.", + "type": "object", + "properties": { + "days_of_month": { + "type": "array", + "items": { + "$ref": "#/definitions/DayOfMonthRange" + }, + "x-go-name": "DaysOfMonth" + }, + "months": { + "type": "array", + "items": { + "$ref": "#/definitions/MonthRange" + }, + "x-go-name": "Months" + }, + "times": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeRange" + }, + "x-go-name": "Times" + }, + "weekdays": { + "type": "array", + "items": { + "$ref": "#/definitions/WeekdayRange" + }, + "x-go-name": "Weekdays" + }, + "years": { + "type": "array", + "items": { + "$ref": "#/definitions/YearRange" + }, + "x-go-name": "Years" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/timeinterval" + }, + "TimeRange": { + "description": "For example, 4:00PM to End of the day would Begin at 1020 and End at 1440.", + "type": "object", + "title": "TimeRange represents a range of minutes within a 1440 minute day, exclusive of the End minute. A day consists of 1440 minutes.", + "properties": { + "EndMinute": { + "type": "integer", + "format": "int64" + }, + "StartMinute": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/timeinterval" + }, + "TimeRangeDTO": { + "type": "object", + "properties": { + "from": { + "type": "string", + "x-go-name": "From" + }, + "to": { + "type": "string", + "x-go-name": "To" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "Token": { + "type": "object", + "properties": { + "account": { + "type": "string", + "x-go-name": "Account" + }, + "company": { + "type": "string", + "x-go-name": "Company" + }, + "details_url": { + "type": "string", + "x-go-name": "DetailsUrl" + }, + "exp": { + "type": "integer", + "format": "int64", + "x-go-name": "Expires" + }, + "iat": { + "type": "integer", + "format": "int64", + "x-go-name": "Issued" + }, + "included_admins": { + "type": "integer", + "format": "int64", + "x-go-name": "IncludedAdmins" + }, + "included_users": { + "type": "integer", + "format": "int64", + "x-go-name": "IncludedUsers" + }, + "included_viewers": { + "type": "integer", + "format": "int64", + "x-go-name": "IncludedViewers" + }, + "iss": { + "type": "string", + "x-go-name": "Issuer" + }, + "jti": { + "type": "string", + "x-go-name": "Id" + }, + "lexp": { + "type": "integer", + "format": "int64", + "x-go-name": "LicenseExpires" + }, + "lic_exp_warn_days": { + "type": "integer", + "format": "int64", + "x-go-name": "LicenseExpiresWarnDays" + }, + "lid": { + "type": "string", + "x-go-name": "LicenseId" + }, + "limit_by": { + "type": "string", + "x-go-name": "LimitBy" + }, + "max_concurrent_user_sessions": { + "type": "integer", + "format": "int64", + "x-go-name": "MaxConcurrentUserSessions" + }, + "nbf": { + "type": "integer", + "format": "int64", + "x-go-name": "LicenseIssued" + }, + "prod": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Products" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "status": { + "$ref": "#/definitions/TokenStatus" + }, + "sub": { + "type": "string", + "x-go-name": "Subject" + }, + "tok_exp_warn_days": { + "type": "integer", + "format": "int64", + "x-go-name": "TokenExpiresWarnDays" + }, + "update_days": { + "type": "integer", + "format": "int64", + "x-go-name": "UpdateDays" + }, + "usage_billing": { + "type": "boolean", + "x-go-name": "UsageBilling" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "TokenStatus": { + "type": "integer", + "format": "int64", + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "TrimDashboardCommand": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/Json" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TrimDashboardFullWithMeta": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/Json" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "URL": { + "type": "object", + "title": "URL is a custom URL type that allows validation at configuration load time.", + "properties": { + "ForceQuery": { + "type": "boolean" + }, + "Fragment": { + "type": "string" + }, + "Host": { + "type": "string" + }, + "Opaque": { + "type": "string" + }, + "Path": { + "type": "string" + }, + "RawFragment": { + "type": "string" + }, + "RawPath": { + "type": "string" + }, + "RawQuery": { + "type": "string" + }, + "Scheme": { + "type": "string" + }, + "User": { + "$ref": "#/definitions/Userinfo" + } + }, + "x-go-package": "github.com/prometheus/common/config" + }, + "UpdateAlertNotificationCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateAlertNotificationWithUidCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "NewUid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateAnnotationsCmd": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateDashboardAclCommand": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardAclUpdateItem" + }, + "x-go-name": "Items" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateDataSourceCommand": { + "description": "Also acts as api DTO", + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "basicAuthPassword": { + "type": "string", + "x-go-name": "BasicAuthPassword" + }, + "basicAuthUser": { + "type": "string", + "x-go-name": "BasicAuthUser" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "secureJsonData": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureJsonData" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + }, + "withCredentials": { + "type": "boolean", + "x-go-name": "WithCredentials" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateFolderCommand": { + "type": "object", + "properties": { + "overwrite": { + "type": "boolean", + "x-go-name": "Overwrite" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateOrgAddressForm": { + "type": "object", + "properties": { + "address1": { + "type": "string", + "x-go-name": "Address1" + }, + "address2": { + "type": "string", + "x-go-name": "Address2" + }, + "city": { + "type": "string", + "x-go-name": "City" + }, + "country": { + "type": "string", + "x-go-name": "Country" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "zipcode": { + "type": "string", + "x-go-name": "ZipCode" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateOrgForm": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateOrgQuotaCmd": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int64", + "x-go-name": "Limit" + }, + "target": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateOrgUserCommand": { + "type": "object", + "properties": { + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdatePrefsCmd": { + "type": "object", + "properties": { + "homeDashboardId": { + "description": "The numerical :id of a favorited dashboard", + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "HomeDashboardID" + }, + "theme": { + "type": "string", + "enum": ["light", "dark"], + "x-go-name": "Theme" + }, + "timezone": { + "type": "string", + "enum": ["utc", "browser"], + "x-go-name": "Timezone" + }, + "weekStart": { + "type": "string", + "x-go-name": "WeekStart" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateRoleCommand": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "global": { + "type": "boolean", + "x-go-name": "Global" + }, + "group": { + "type": "string", + "x-go-name": "Group" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + }, + "x-go-name": "Permissions" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "UpdateTeamCommand": { + "type": "object", + "properties": { + "Email": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Name": { + "type": "string" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateTeamMemberCommand": { + "type": "object", + "properties": { + "permission": { + "$ref": "#/definitions/PermissionType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateUserCommand": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateUserQuotaCmd": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int64", + "x-go-name": "Limit" + }, + "target": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserIdDTO": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "message": { + "type": "string", + "x-go-name": "Message" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserLookupDTO": { + "type": "object", + "properties": { + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarURL" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UserOrgDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserProfileDTO": { + "type": "object", + "properties": { + "accessControl": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "AccessControl" + }, + "authLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "AuthLabels" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDisabled": { + "type": "boolean", + "x-go-name": "IsDisabled" + }, + "isExternal": { + "type": "boolean", + "x-go-name": "IsExternal" + }, + "isGrafanaAdmin": { + "type": "boolean", + "x-go-name": "IsGrafanaAdmin" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserQuotaDTO": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int64", + "x-go-name": "Limit" + }, + "target": { + "type": "string", + "x-go-name": "Target" + }, + "used": { + "type": "integer", + "format": "int64", + "x-go-name": "Used" + }, + "user_id": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserSearchHitDTO": { + "type": "object", + "properties": { + "authLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "AuthLabels" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isAdmin": { + "type": "boolean", + "x-go-name": "IsAdmin" + }, + "isDisabled": { + "type": "boolean", + "x-go-name": "IsDisabled" + }, + "lastSeenAt": { + "type": "string", + "format": "date-time", + "x-go-name": "LastSeenAt" + }, + "lastSeenAtAge": { + "type": "string", + "x-go-name": "LastSeenAtAge" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserToken": { + "description": "UserToken represents a user token", + "type": "object", + "properties": { + "AuthToken": { + "type": "string" + }, + "AuthTokenSeen": { + "type": "boolean" + }, + "ClientIp": { + "type": "string" + }, + "CreatedAt": { + "type": "integer", + "format": "int64" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "PrevAuthToken": { + "type": "string" + }, + "RevokedAt": { + "type": "integer", + "format": "int64" + }, + "RotatedAt": { + "type": "integer", + "format": "int64" + }, + "SeenAt": { + "type": "integer", + "format": "int64" + }, + "UnhashedToken": { + "type": "string" + }, + "UpdatedAt": { + "type": "integer", + "format": "int64" + }, + "UserAgent": { + "type": "string" + }, + "UserId": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Userinfo": { + "description": "The Userinfo type is an immutable encapsulation of username and\npassword details for a URL. An existing Userinfo value is guaranteed\nto have a username set (potentially empty, as allowed by RFC 2396),\nand optionally a password.", + "type": "object", + "x-go-package": "net/url" + }, + "ValidationError": { + "type": "object", + "properties": { + "msg": { + "type": "string", + "x-go-name": "Msg" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "Vector": { + "description": "Vector is basically only an alias for model.Samples, but the\ncontract is that in a Vector, all Samples have the same timestamp.", + "type": "array", + "items": { + "$ref": "#/definitions/Sample" + }, + "x-go-package": "github.com/prometheus/prometheus/promql" + }, + "VictorOpsConfig": { + "type": "object", + "title": "VictorOpsConfig configures notifications via VictorOps.", + "properties": { + "api_key": { + "$ref": "#/definitions/Secret" + }, + "api_key_file": { + "$ref": "#/definitions/Secret" + }, + "api_url": { + "$ref": "#/definitions/URL" + }, + "custom_fields": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "CustomFields" + }, + "entity_display_name": { + "type": "string", + "x-go-name": "EntityDisplayName" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "message_type": { + "type": "string", + "x-go-name": "MessageType" + }, + "monitoring_tool": { + "type": "string", + "x-go-name": "MonitoringTool" + }, + "routing_key": { + "type": "string", + "x-go-name": "RoutingKey" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "state_message": { + "type": "string", + "x-go-name": "StateMessage" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "WebhookConfig": { + "type": "object", + "title": "WebhookConfig configures notifications via a generic webhook.", + "properties": { + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "max_alerts": { + "description": "MaxAlerts is the maximum number of alerts to be sent per webhook message.\nAlerts exceeding this threshold will be truncated. Setting this to 0\nallows an unlimited number of alerts.", + "type": "integer", + "format": "uint64", + "x-go-name": "MaxAlerts" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "url": { + "$ref": "#/definitions/URL" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "WechatConfig": { + "type": "object", + "title": "WechatConfig configures notifications via Wechat.", + "properties": { + "agent_id": { + "type": "string", + "x-go-name": "AgentID" + }, + "api_secret": { + "$ref": "#/definitions/Secret" + }, + "api_url": { + "$ref": "#/definitions/URL" + }, + "corp_id": { + "type": "string", + "x-go-name": "CorpID" + }, + "http_config": { + "$ref": "#/definitions/HTTPClientConfig" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "message_type": { + "type": "string", + "x-go-name": "MessageType" + }, + "send_resolved": { + "type": "boolean", + "x-go-name": "VSendResolved" + }, + "to_party": { + "type": "string", + "x-go-name": "ToParty" + }, + "to_tag": { + "type": "string", + "x-go-name": "ToTag" + }, + "to_user": { + "type": "string", + "x-go-name": "ToUser" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/config" + }, + "WeekdayRange": { + "type": "object", + "title": "A WeekdayRange is an inclusive range between [0, 6] where 0 = Sunday.", + "properties": { + "Begin": { + "type": "integer", + "format": "int64" + }, + "End": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/timeinterval" + }, + "YearRange": { + "type": "object", + "title": "A YearRange is a positive inclusive range.", + "properties": { + "Begin": { + "type": "integer", + "format": "int64" + }, + "End": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/prometheus/alertmanager/timeinterval" + }, + "alert": { + "description": "Alert alert", + "type": "object", + "required": ["labels"], + "properties": { + "generatorURL": { + "description": "generator URL\nFormat: uri", + "type": "string", + "format": "uri", + "x-go-name": "GeneratorURL" + }, + "labels": { + "$ref": "#/definitions/labelSet" + } + }, + "x-go-name": "Alert", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "alertGroup": { + "type": "object", + "required": ["alerts", "labels", "receiver"], + "properties": { + "alerts": { + "description": "alerts", + "type": "array", + "items": { + "$ref": "#/definitions/gettableAlert" + }, + "x-go-name": "Alerts" + }, + "labels": { + "$ref": "#/definitions/labelSet" + }, + "receiver": { + "$ref": "#/definitions/receiver" + } + }, + "x-go-name": "AlertGroup", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "alertGroups": { + "type": "array", + "items": { + "$ref": "#/definitions/alertGroup" + }, + "x-go-name": "AlertGroups", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "alertStatus": { + "description": "AlertStatus alert status", + "type": "object", + "required": ["inhibitedBy", "silencedBy", "state"], + "properties": { + "inhibitedBy": { + "description": "inhibited by", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "InhibitedBy" + }, + "silencedBy": { + "description": "silenced by", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "SilencedBy" + }, + "state": { + "description": "state", + "type": "string", + "enum": ["[unprocessed active suppressed]"], + "x-go-name": "State" + } + }, + "x-go-name": "AlertStatus", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "alertmanagerConfig": { + "description": "AlertmanagerConfig alertmanager config", + "type": "object", + "required": ["original"], + "properties": { + "original": { + "description": "original", + "type": "string", + "x-go-name": "Original" + } + }, + "x-go-name": "AlertmanagerConfig", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "alertmanagerStatus": { + "description": "AlertmanagerStatus alertmanager status", + "type": "object", + "required": ["cluster", "config", "uptime", "versionInfo"], + "properties": { + "cluster": { + "$ref": "#/definitions/clusterStatus" + }, + "config": { + "$ref": "#/definitions/alertmanagerConfig" + }, + "uptime": { + "description": "uptime", + "type": "string", + "format": "date-time", + "x-go-name": "Uptime" + }, + "versionInfo": { + "$ref": "#/definitions/versionInfo" + } + }, + "x-go-name": "AlertmanagerStatus", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "clusterStatus": { + "description": "ClusterStatus cluster status", + "type": "object", + "required": ["status"], + "properties": { + "name": { + "description": "name", + "type": "string", + "x-go-name": "Name" + }, + "peers": { + "description": "peers", + "type": "array", + "items": { + "$ref": "#/definitions/peerStatus" + }, + "x-go-name": "Peers" + }, + "status": { + "description": "status", + "type": "string", + "enum": ["[ready settling disabled]"], + "x-go-name": "Status" + } + }, + "x-go-name": "ClusterStatus", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "duration": { + "$ref": "#/definitions/Duration" + }, + "gettableAlert": { + "description": "GettableAlert gettable alert", + "type": "object", + "required": ["labels", "annotations", "endsAt", "fingerprint", "receivers", "startsAt", "status", "updatedAt"], + "properties": { + "annotations": { + "$ref": "#/definitions/labelSet" + }, + "endsAt": { + "description": "ends at", + "type": "string", + "format": "date-time", + "x-go-name": "EndsAt" + }, + "fingerprint": { + "description": "fingerprint", + "type": "string", + "x-go-name": "Fingerprint" + }, + "generatorURL": { + "description": "generator URL\nFormat: uri", + "type": "string", + "format": "uri", + "x-go-name": "GeneratorURL" + }, + "labels": { + "$ref": "#/definitions/labelSet" + }, + "receivers": { + "description": "receivers", + "type": "array", + "items": { + "$ref": "#/definitions/receiver" + }, + "x-go-name": "Receivers" + }, + "startsAt": { + "description": "starts at", + "type": "string", + "format": "date-time", + "x-go-name": "StartsAt" + }, + "status": { + "$ref": "#/definitions/alertStatus" + }, + "updatedAt": { + "description": "updated at", + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + } + } + }, + "gettableAlerts": { + "type": "array", + "items": { + "$ref": "#/definitions/gettableAlert" + }, + "x-go-name": "GettableAlerts", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "gettableSilence": { + "description": "GettableSilence gettable silence", + "type": "object", + "required": ["comment", "createdBy", "endsAt", "matchers", "startsAt", "id", "status", "updatedAt"], + "properties": { + "comment": { + "description": "comment", + "type": "string", + "x-go-name": "Comment" + }, + "createdBy": { + "description": "created by", + "type": "string", + "x-go-name": "CreatedBy" + }, + "endsAt": { + "description": "ends at", + "type": "string", + "format": "date-time", + "x-go-name": "EndsAt" + }, + "id": { + "description": "id", + "type": "string", + "x-go-name": "ID" + }, + "matchers": { + "$ref": "#/definitions/matchers" + }, + "startsAt": { + "description": "starts at", + "type": "string", + "format": "date-time", + "x-go-name": "StartsAt" + }, + "status": { + "$ref": "#/definitions/silenceStatus" + }, + "updatedAt": { + "description": "updated at", + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + } + } + }, + "gettableSilences": { + "type": "array", + "items": { + "$ref": "#/definitions/gettableSilence" + }, + "x-go-name": "GettableSilences", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "labelSet": { + "description": "LabelSet label set", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "LabelSet", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "matcher": { + "description": "Matcher matcher", + "type": "object", + "required": ["isRegex", "name", "value"], + "properties": { + "isEqual": { + "description": "is equal", + "type": "boolean", + "x-go-name": "IsEqual" + }, + "isRegex": { + "description": "is regex", + "type": "boolean", + "x-go-name": "IsRegex" + }, + "name": { + "description": "name", + "type": "string", + "x-go-name": "Name" + }, + "value": { + "description": "value", + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-name": "Matcher", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "matchers": { + "description": "Matchers matchers", + "type": "array", + "items": { + "$ref": "#/definitions/matcher" + }, + "x-go-name": "Matchers", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "overrideLabels": { + "description": "The custom marshaling for labels.Labels ends up doing this anyways.", + "type": "object", + "title": "override the labels type with a map for generation.", + "additionalProperties": { + "type": "string" + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" + }, + "peerStatus": { + "description": "PeerStatus peer status", + "type": "object", + "required": ["address", "name"], + "properties": { + "address": { + "description": "address", + "type": "string", + "x-go-name": "Address" + }, + "name": { + "description": "name", + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-name": "PeerStatus", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "postableAlert": { + "description": "PostableAlert postable alert", + "type": "object", + "required": ["labels"], + "properties": { + "annotations": { + "$ref": "#/definitions/labelSet" + }, + "endsAt": { + "description": "ends at\nFormat: date-time", + "type": "string", + "format": "date-time", + "x-go-name": "EndsAt" + }, + "generatorURL": { + "description": "generator URL\nFormat: uri", + "type": "string", + "format": "uri", + "x-go-name": "GeneratorURL" + }, + "labels": { + "$ref": "#/definitions/labelSet" + }, + "startsAt": { + "description": "starts at\nFormat: date-time", + "type": "string", + "format": "date-time", + "x-go-name": "StartsAt" + } + }, + "x-go-name": "PostableAlert", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "postableAlerts": { + "description": "PostableAlerts postable alerts", + "type": "array", + "items": { + "$ref": "#/definitions/postableAlert" + }, + "x-go-name": "PostableAlerts", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "postableSilence": { + "description": "PostableSilence postable silence", + "type": "object", + "required": ["comment", "createdBy", "endsAt", "matchers", "startsAt"], + "properties": { + "comment": { + "description": "comment", + "type": "string", + "x-go-name": "Comment" + }, + "createdBy": { + "description": "created by", + "type": "string", + "x-go-name": "CreatedBy" + }, + "endsAt": { + "description": "ends at", + "type": "string", + "format": "date-time", + "x-go-name": "EndsAt" + }, + "id": { + "description": "id", + "type": "string", + "x-go-name": "ID" + }, + "matchers": { + "$ref": "#/definitions/matchers" + }, + "startsAt": { + "description": "starts at", + "type": "string", + "format": "date-time", + "x-go-name": "StartsAt" + } + } + }, + "receiver": { + "description": "Receiver receiver", + "type": "object", + "required": ["name"], + "properties": { + "name": { + "description": "name", + "type": "string", + "x-go-name": "Name" + } + } + }, + "silence": { + "description": "Silence silence", + "type": "object", + "required": ["comment", "createdBy", "endsAt", "matchers", "startsAt"], + "properties": { + "comment": { + "description": "comment", + "type": "string", + "x-go-name": "Comment" + }, + "createdBy": { + "description": "created by", + "type": "string", + "x-go-name": "CreatedBy" + }, + "endsAt": { + "description": "ends at", + "type": "string", + "format": "date-time", + "x-go-name": "EndsAt" + }, + "matchers": { + "$ref": "#/definitions/matchers" + }, + "startsAt": { + "description": "starts at", + "type": "string", + "format": "date-time", + "x-go-name": "StartsAt" + } + }, + "x-go-name": "Silence", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "silenceStatus": { + "description": "SilenceStatus silence status", + "type": "object", + "required": ["state"], + "properties": { + "state": { + "description": "state", + "type": "string", + "enum": ["[expired active pending]"], + "x-go-name": "State" + } + }, + "x-go-name": "SilenceStatus", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + }, + "versionInfo": { + "description": "VersionInfo version info", + "type": "object", + "required": ["branch", "buildDate", "buildUser", "goVersion", "revision", "version"], + "properties": { + "branch": { + "description": "branch", + "type": "string", + "x-go-name": "Branch" + }, + "buildDate": { + "description": "build date", + "type": "string", + "x-go-name": "BuildDate" + }, + "buildUser": { + "description": "build user", + "type": "string", + "x-go-name": "BuildUser" + }, + "goVersion": { + "description": "go version", + "type": "string", + "x-go-name": "GoVersion" + }, + "revision": { + "description": "revision", + "type": "string", + "x-go-name": "Revision" + }, + "version": { + "description": "version", + "type": "string", + "x-go-name": "Version" + } + }, + "x-go-name": "VersionInfo", + "x-go-package": "github.com/prometheus/alertmanager/api/v2/models" + } + }, + "responses": { + "SMTPNotEnabledError": { + "description": "" + }, + "acceptedResponse": { + "description": "AcceptedResponse", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "addOrgUser": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the added user.", + "type": "integer", + "format": "int64", + "x-go-name": "UsedID", + "example": 65 + }, + "message": { + "description": "Message Message of the added user.", + "type": "string", + "x-go-name": "Message", + "example": "Data source added" + } + } + } + }, + "badRequestError": { + "description": "BadRequestError is returned when the request is invalid and it cannot be processed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "conflictError": { + "description": "ConflictError", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "contentResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, + "createAnnotationResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the created annotation.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the created annotation.", + "type": "string", + "x-go-name": "Message" + } + } + } + }, + "createOrUpdateDatasourceResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "name", "message", "datasource"], + "properties": { + "datasource": { + "$ref": "#/definitions/DataSource" + }, + "id": { + "description": "ID Identifier of the new data source.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted dashboard.", + "type": "string", + "x-go-name": "Message", + "example": "Data source added" + }, + "name": { + "description": "Name of the new data source.", + "type": "string", + "x-go-name": "Name", + "example": "My Data source" + } + } + } + }, + "createOrgResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["orgId", "message"], + "properties": { + "message": { + "description": "Message Message of the created org.", + "type": "string", + "x-go-name": "Message", + "example": "Data source added" + }, + "orgId": { + "description": "ID Identifier of the created org.", + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "example": 65 + } + } + } + }, + "createReportResponse": { + "description": "", + "schema": { + "type": "object" + } + }, + "createSnapshotResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "deleteKey": { + "description": "Unique key used to delete the snapshot. It is different from the key so that only the creator can delete the snapshot.", + "type": "string", + "x-go-name": "DeleteKey" + }, + "deleteUrl": { + "type": "string", + "x-go-name": "DeleteUrl" + }, + "id": { + "description": "Snapshot id", + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "key": { + "description": "Unique key", + "type": "string", + "x-go-name": "Key" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + } + } + }, + "createTeamResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + } + } + } + }, + "createUserResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/UserIdDTO" + } + }, + "dashboardDiffResponse": { + "description": "Calculate dashboard diff response.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, + "dashboardResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DashboardFullWithMeta" + } + }, + "dashboardVersionResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DashboardVersionMeta" + } + }, + "dashboardVersionsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardVersionDTO" + } + } + }, + "dashboardsTagsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardTagCloudItem" + } + } + }, + "deleteAlertNotificationChannelResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted notification channel.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted notificatiton channel.", + "type": "string", + "x-go-name": "Message" + } + } + } + }, + "deleteDashboardResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "title", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted dashboard.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted dashboard.", + "type": "string", + "x-go-name": "Message", + "example": "Dashboard My Dashboard deleted" + }, + "title": { + "description": "Title Title of the deleted dashboard.", + "type": "string", + "x-go-name": "Title", + "example": "My Dashboard" + } + } + } + }, + "deleteDatasourceByNameResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted data source.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted dashboard.", + "type": "string", + "x-go-name": "Message", + "example": "Dashboard My Dashboard deleted" + } + } + } + }, + "deleteFolderResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "title", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted folder.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted folder.", + "type": "string", + "x-go-name": "Message", + "example": "Folder My Folder deleted" + }, + "title": { + "description": "Title of the deleted folder.", + "type": "string", + "x-go-name": "Title", + "example": "My Folder" + } + } + } + }, + "folderResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Folder" + } + }, + "forbiddenError": { + "description": "ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "genericError": { + "description": "A GenericError is the default error message that is generated.\nFor certain status codes there are more appropriate error structures.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "getAPIkeyResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ApiKeyDTO" + } + } + }, + "getAccessControlStatusResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Status" + } + }, + "getAlertNotificationChannelResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AlertNotification" + } + }, + "getAlertNotificationChannelsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertNotification" + } + } + }, + "getAlertResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Alert" + } + } + }, + "getAlertsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertListItemDTO" + } + } + }, + "getAllRolesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + }, + "getAnnotationTagsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/GetAnnotationTagsResponse" + } + }, + "getAnnotationsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ItemDTO" + } + } + }, + "getAuthTokensResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserToken" + } + } + }, + "getCustomPermissionsReportResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomPermissionsRecordDTO" + } + } + }, + "getDashboardPermissionsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardAclInfoDTO" + } + } + }, + "getDashboardStatesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertStateInfoDTO" + } + } + }, + "getDatasourceIDresponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id"], + "properties": { + "id": { + "description": "ID Identifier of the data source.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + } + } + } + }, + "getDatasourceResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DataSource" + } + }, + "getDatasourcesResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DataSourceList" + } + }, + "getFoldersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/FolderSearchHit" + } + } + }, + "getHomeDashboardResponse": { + "description": "Home dashboard response.", + "schema": { + "$ref": "#/definitions/GetHomeDashboardResponse" + } + }, + "getInvitesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TempUserDTO" + } + } + }, + "getLDAPSyncStatusResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ActiveSyncStatusDTO" + } + }, + "getLibraryElementConnectionsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/LibraryElementConnectionsResponse" + } + }, + "getLibraryElementResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/LibraryElementResponse" + } + }, + "getLibraryElementsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/LibraryElementSearchResponse" + } + }, + "getLicenseStatusResponse": { + "description": "" + }, + "getLicenseTokenResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Token" + } + }, + "getOrgResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/OrgDetailsDTO" + } + }, + "getOrgUsersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/OrgUserDTO" + } + } + }, + "getPermissionseResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AddPermissionDTO" + } + }, + "getPreferencesResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Prefs" + } + }, + "getQuotaResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserQuotaDTO" + } + } + }, + "getReportResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ConfigDTO" + } + }, + "getReportSettingsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + }, + "getReportsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigDTO" + } + } + }, + "getRoleResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RoleDTO" + } + }, + "getSettingsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SettingsBag" + } + }, + "getSnapshotSharingOptionsResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "externalEnabled": { + "type": "boolean", + "x-go-name": "ExternalEnabled" + }, + "externalSnapshotName": { + "type": "string", + "x-go-name": "ExternalSnapshotName" + }, + "externalSnapshotURL": { + "type": "string", + "x-go-name": "ExternalSnapshotURL" + } + } + } + }, + "getSnapshotsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardSnapshotDTO" + } + } + }, + "getStatsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AdminStats" + } + }, + "getTeamGroupsApiResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamGroupDTO" + } + } + }, + "getTeamMembersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamMemberDTO" + } + } + }, + "getTeamResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/TeamDTO" + } + }, + "getUserOrgListResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserOrgDTO" + } + } + }, + "getUserTeamsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamDTO" + } + } + }, + "helpFlagResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "helpFlags1": { + "type": "integer", + "format": "int64", + "x-go-name": "HelpFlags1" + }, + "message": { + "type": "string", + "x-go-name": "Message" + } + } + } + }, + "importDashboardResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ImportDashboardResponse" + } + }, + "internalServerError": { + "description": "InternalServerError is a general error indicating something went wrong internally.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "listBuiltinRolesResponse": { + "description": "", + "schema": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + } + }, + "listRecordingRulesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + }, + "lookupAlertNotificationChannelsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertNotificationLookup" + } + } + }, + "lookupOrgUsersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserLookupDTO" + } + } + }, + "notFoundError": { + "description": "NotFoundError is returned when the requested resource was not found.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "okResponse": { + "description": "An OKResponse is returned if the request was successful.", + "schema": { + "$ref": "#/definitions/SuccessResponseBody" + } + }, + "pauseAlertResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["alertId", "message"], + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertID" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "state": { + "description": "Alert result state\nrequired true", + "type": "string", + "x-go-name": "State" + } + } + } + }, + "pauseAlertsResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["alertsAffected", "message"], + "properties": { + "alertsAffected": { + "description": "AlertsAffected is the number of the affected alerts.", + "type": "integer", + "format": "int64", + "x-go-name": "AlertsAffected" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "state": { + "description": "Alert result state\nrequired true", + "type": "string", + "x-go-name": "State" + } + } + } + }, + "postAPIkeyResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/NewApiKeyResult" + } + }, + "postDashboardResponse": { + "description": "Create/update dashboard response.", + "schema": { + "type": "object", + "required": ["status", "title", "version", "id", "uid", "url"], + "properties": { + "id": { + "description": "ID The unique identifier (id) of the created/updated dashboard.", + "type": "string", + "x-go-name": "ID", + "example": "1" + }, + "status": { + "description": "Status status of the response.", + "type": "string", + "x-go-name": "Status", + "example": "success" + }, + "title": { + "description": "Slug The slug of the dashboard.", + "type": "string", + "x-go-name": "Slug", + "example": "my-dashboard" + }, + "uid": { + "description": "UID The unique identifier (uid) of the created/updated dashboard.", + "type": "string", + "x-go-name": "UID", + "example": "nHz3SXiiz" + }, + "url": { + "description": "URL The relative URL for accessing the created/updated dashboard.", + "type": "string", + "x-go-name": "URL", + "example": "/d/nHz3SXiiz/my-dashboard" + }, + "version": { + "description": "Version The version of the dashboard.", + "type": "integer", + "format": "int64", + "x-go-name": "Verion", + "example": 2 + } + } + } + }, + "postRenewLicenseTokenResponse": { + "description": "" + }, + "preconditionFailedError": { + "description": "PreconditionFailedError", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "queryDataResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/QueryDataResponse" + } + }, + "queryDatasourceResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DataResponse" + } + }, + "recordingRuleResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + }, + "recordingRuleWriteTargetResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + }, + "refreshLicenseStatsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ActiveUserStats" + } + }, + "searchOrgResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/OrgDTO" + } + } + }, + "searchResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/HitList" + } + }, + "searchSortingResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "meta": { + "type": "string", + "x-go-name": "Meta" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + } + } + }, + "searchTeamsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SearchTeamQueryResult" + } + }, + "searchUsersResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SearchUserQueryResult" + } + }, + "snapshotResponse": { + "description": "" + }, + "testAlertResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AlertTestResult" + } + }, + "trimDashboardResponse": { + "description": "Trimmed dashboard response.", + "schema": { + "$ref": "#/definitions/TrimDashboardFullWithMeta" + } + }, + "unauthorisedError": { + "description": "UnauthorizedError is returned when the request is not authenticated.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "unprocessableEntityError": { + "description": "UnprocessableEntityError", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "userResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/UserProfileDTO" + } + } + }, + "securityDefinitions": { + "api_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + }, + "basic": { + "type": "basic" + } + }, + "security": [ + { + "basic": [] + }, + { + "api_key": [] + } + ], + "tags": [ + { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "datasources" + }, + { + "description": "Folders are identified by the identifier (id) and the unique identifier (uid).\nThe identifier (id) of a folder is an auto-incrementing numeric value and is only unique per Grafana install.\nThe unique identifier (uid) of a folder can be used for uniquely identify folders between multiple Grafana installs. It’s automatically generated if not provided when creating a folder. The uid allows having consistent URLs for accessing folders and when syncing folders between multiple Grafana installs. This means that changing the title of a folder will not break any bookmarked links to that folder.\nThe uid can have a maximum length of 40 characters.\n\nThe General folder (id=0) is special and is not part of the Folder API which means that you cannot use this API for retrieving information about the General folder.", + "name": "folders" + }, + { + "description": "Permissions with `folderId=-1` are the default permissions for users with the Viewer and Editor roles. Permissions can be set for a user, a team or a role (Viewer or Editor). Permissions cannot be set for Admins - they always have access to everything.", + "name": "folder_permissions" + }, + { + "description": "The Admin HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission. (The default admin user is called admin and has permission to use this API.)", + "name": "admin" + }, + { + "description": "You can use the Alerting API to get information about legacy dashboard alerts and their states but this API cannot be used to modify the alert. To create new alerts or modify them you need to update the dashboard JSON that contains the alerts.\nThis topic is relevant for the legacy dashboard alerts only.\nYou can find Grafana 8 alerts API specification details [here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/grafana/grafana/main/pkg/services/ngalert/api/tooling/post.json).", + "name": "legacy_alerts" + }, + { + "description": "The identifier (id) of a notification channel is an auto-incrementing numeric value and is only unique per Grafana install.\nThe unique identifier (uid) of a notification channel can be used for uniquely identify a notification channel between multiple Grafana installs. It’s automatically generated if not provided when creating a notification channel. The uid allows having consistent URLs for accessing notification channels and when syncing notification channels between multiple Grafana installations, refer to alert notification channel provisioning.\nThe uid can have a maximum length of 40 characters.", + "name": "legacy_alerts_notification_channels" + }, + { + "description": "Grafana Annotations feature released in Grafana 4.6. Annotations are saved in the Grafana database (sqlite, mysql or postgres). Annotations can be global annotations that can be shown on any dashboard by configuring an annotation data source - they are filtered by tags. Or they can be tied to a panel on a dashboard and are then only shown on that panel.", + "name": "annotations" + }, + { + "description": "The identifier (ID) of a library element is an auto-incrementing numeric value that is unique per Grafana install.\nThe unique identifier (UID) of a library element uniquely identifies library elements between multiple Grafana installs. It’s automatically generated unless you specify it during library element creation. The UID provides consistent URLs for accessing library elements and when syncing library elements between multiple Grafana installs.\nThe maximum length of a UID is 40 characters.", + "name": "library_elements" + }, + { + "description": "The Admin Organizations HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission (The default admin user is called `admin` and has permission to use this API).", + "name": "orgs" + }, + { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "current_org_details" + }, + { + "description": "This API can be used to create/update/delete Teams and to add/remove users to Teams. All actions require that the user has the Admin role for the organization.", + "name": "teams" + }, + { + "description": "This API can be used to enable, disable, list, add and remove permissions for a data source.\nPermissions can be set for a user or a team. Permissions cannot be set for Admins - they always have access to everything.\nThis is only available in Grafana Enterprise\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "datasource_permissions" + }, + { + "description": "These are only available in Grafana Enterprise", + "name": "enterprise" + }, + { + "description": "The API can be used to create, update, get and list roles, and create or remove built-in role assignments. To use the API, you would need to enable fine-grained access control.\nThis only available in Grafana Enterprise.\nThe API does not currently work with an API Token. So in order to use these API endpoints you will have to use Basic auth.", + "name": "access_control" + }, + { + "description": "Licensing is only available in Grafana Enterprise. Read more about Grafana Enterprise.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "licensing" + }, + { + "description": "This API allows you to interact programmatically with the Reporting feature.\nReporting is only available in Grafana Enterprise. Read more about Grafana Enterprise.\nIf you have Fine-grained access Control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "reports" + }, + { + "description": "Grafana Alerting Alertmanager-compatible endpoints", + "name": "alertmanager" + }, + { + "description": "Grafana Alerting endpoints for managing rules", + "name": "ruler" + }, + { + "description": "Grafana Alerting testing endpoints", + "name": "testing" + }, + { + "description": "Grafana Alerting Prometheus-compatible endpoints", + "name": "prometheus" + } + ] +} diff --git a/public/api-spec.json b/public/api-spec.json new file mode 100644 index 00000000000..0952bb16b08 --- /dev/null +++ b/public/api-spec.json @@ -0,0 +1,13316 @@ +{ + "consumes": ["application/json"], + "produces": ["application/json"], + "schemes": ["http", "https"], + "swagger": "2.0", + "info": { + "description": "The Grafana backend exposes an HTTP API, the same API is used by the frontend to do\neverything from saving dashboards, creating users and updating data sources.", + "title": "Grafana HTTP API.", + "contact": { + "name": "Grafana Labs", + "url": "https://grafana.com", + "email": "hello@grafana.com" + }, + "license": { + "name": "GNU Affero General Public License v3.0", + "url": "https://www.gnu.org/licenses/agpl-3.0.en.html" + }, + "version": "0.0.1" + }, + "basePath": "/api", + "paths": { + "/access-control/builtin-roles": { + "get": { + "description": "You need to have a permission with action `roles.builtin:list` with scope `roles:*`.", + "tags": ["access_control", "enterprise"], + "summary": "Get all built-in role assignments.", + "operationId": "listBuiltinRoles", + "responses": { + "200": { + "$ref": "#/responses/listBuiltinRolesResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You need to have a permission with action `roles.builtin:add` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only create built-in role assignments with the roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to create a built-in role assignment which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Create a built-in role assignment.", + "operationId": "addBuiltinRole", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddBuiltInRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/builtin-roles/{builtinRole}/roles/{roleUID}": { + "delete": { + "description": "Deletes a built-in role assignment (for one of Viewer, Editor, Admin, or Grafana Admin) to the role with the provided UID.\n\nYou need to have a permission with action `roles.builtin:remove` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only remove built-in role assignments with the roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to remove a built-in role assignment which allows to do that.", + "tags": ["access_control", "enterprise"], + "summary": "Remove a built-in role assignment.", + "operationId": "removeBuiltinRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "RoleUID", + "name": "builtinRole", + "in": "path", + "required": true + }, + { + "type": "boolean", + "x-go-name": "Global", + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", + "name": "global", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/roles": { + "get": { + "description": "Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in.\n\nYou need to have a permission with action `roles:list` and scope `roles:*`.", + "tags": ["access_control", "enterprise"], + "summary": "Get all roles.", + "operationId": "getAllRoles", + "responses": { + "200": { + "$ref": "#/responses/getAllRolesResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates a new custom role and maps given permissions to that role. Note that roles with the same prefix as Fixed Roles can’t be created.\n\nYou need to have a permission with action `roles:write` and scope `permissions:delegate`. `permission:delegate`` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.\nFor example, if a user does not have required permissions for creating users, they won’t be able to create a custom role which allows to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Create a new custom role.", + "operationId": "createRoleWithPermissions", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SetUserRolesCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/roles/{roleUID}": { + "get": { + "description": "Get a role for the given UID.\n\nYou need to have a permission with action `roles:read` and scope `roles:*`.", + "tags": ["access_control", "enterprise"], + "summary": "Get a role.", + "operationId": "getRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `roles:write` and scope `permissions:delegate`. `permission:delegate`` scope ensures that users can only create custom roles with the same, or a subset of permissions which the user has.", + "tags": ["access_control", "enterprise"], + "summary": "Update a custom role.", + "operationId": "updateRoleWithPermissions", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getRoleResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Delete a role with the given UID, and it’s permissions. If the role is assigned to a built-in role, the deletion operation will fail, unless force query param is set to true, and in that case all assignments will also be deleted.\n\nYou need to have a permission with action `roles:delete` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only delete a custom role with the same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to delete a custom role which allows to do that.", + "tags": ["access_control", "enterprise"], + "summary": "Delete a custom role.", + "operationId": "deleteCustomRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/status": { + "get": { + "description": "Returns an indicator to check if fine-grained access control is enabled or not.\n\nYou need to have a permission with action `status:accesscontrol` and scope `services:accesscontrol`.", + "tags": ["access_control", "enterprise"], + "summary": "Get status.", + "operationId": "getAccessControlStatus", + "responses": { + "200": { + "$ref": "#/responses/getAccessControlStatusResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles": { + "get": { + "description": "You need to have a permission with action `teams.roles:list` and scope `teams:id:\u003cteam ID\u003e`.", + "tags": ["access_control", "enterprise"], + "summary": "Get team roles.", + "operationId": "listTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "You need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:delegate` for each.", + "tags": ["access_control", "enterprise"], + "summary": "Update team role.", + "operationId": "setTeamRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You need to have a permission with action `teams.roles:add` and scope `permissions:delegate`.", + "tags": ["access_control", "enterprise"], + "summary": "Add team role.", + "operationId": "addTeamRole", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTeamRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/teams/{teamId}/roles/{roleUID}": { + "delete": { + "description": "You need to have a permission with action `teams.roles:remove` and scope `permissions:delegate`.", + "tags": ["access_control", "enterprise"], + "summary": "Remove team role.", + "operationId": "removeTeamRole", + "parameters": [ + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{user_id}/roles": { + "get": { + "description": "Lists the roles that have been directly assigned to a given user. The list does not include built-in roles (Viewer, Editor, Admin or Grafana Admin), and it does not include roles that have been inherited from a team.\n\nYou need to have a permission with action `users.roles:list` and scope `users:id:\u003cuser ID\u003e`.", + "tags": ["access_control", "enterprise"], + "summary": "List roles assigned to a user.", + "operationId": "listUserRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAllRolesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Update the user’s role assignments to match the provided set of UIDs. This will remove any assigned roles that aren’t in the request and add roles that are in the set but are not already assigned to the user.\nIf you want to add or remove a single role, consider using Add a user role assignment or Remove a user role assignment instead.\n\nYou need to have a permission with action `users.roles:add` and `users.roles:remove` and scope `permissions:delegate` for each. `permission:delegate` scope ensures that users can only assign or unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign or unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Set user role assignments.", + "operationId": "setUserRoles", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Assign a role to a specific user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:add` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only assign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to assign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Add a user role assignment.", + "operationId": "addUserRole", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddUserRoleCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/access-control/users/{user_id}/roles/{roleUID}": { + "delete": { + "description": "Revoke a role from a user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:remove` and scope `permissions:delegate`. `permission:delegate` scope ensures that users can only unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they won’t be able to unassign a role which will allow to do that. This is done to prevent escalation of privileges.", + "tags": ["access_control", "enterprise"], + "summary": "Remove a user role assignment.", + "operationId": "removeUserRole", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "RoleUID", + "name": "roleUID", + "in": "path", + "required": true + }, + { + "type": "boolean", + "x-go-name": "Global", + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", + "name": "global", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap-sync-status": { + "get": { + "description": "You need to have a permission with action `ldap.status:read`.", + "tags": ["ldap_debug"], + "summary": "Available to grafana admins.", + "operationId": "getLDAPSyncStatus", + "responses": { + "200": { + "$ref": "#/responses/getLDAPSyncStatusResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.", + "tags": ["admin_ldap"], + "summary": "Reloads the LDAP configuration.", + "operationId": "reloadLDAP", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/status": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`.", + "tags": ["admin_ldap"], + "summary": "Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.", + "operationId": "getLDAPStatus", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/sync/{user_id}": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`.", + "tags": ["admin_ldap"], + "summary": "Enables a single Grafana user to be synchronized against LDAP.", + "operationId": "syncLDAPUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/ldap/{user_name}": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`.", + "tags": ["admin_ldap"], + "summary": "Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.", + "operationId": "getLDAPUser", + "parameters": [ + { + "type": "string", + "x-go-name": "UserID", + "name": "user_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/pause-all-alerts": { + "post": { + "security": [ + { + "basic": [] + } + ], + "tags": ["admin"], + "summary": "Pause/unpause all (legacy) alerts.", + "operationId": "pauseAllAlerts", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PauseAllAlertsCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/pauseAlertsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/access-control/reload": { + "post": { + "tags": ["access_control_provisioning", "enterprise"], + "summary": "You need to have a permission with action `provisioning:reload` with scope `provisioners:accesscontrol`.", + "operationId": "adminProvisioningReloadAccessControl", + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + } + } + } + }, + "/admin/provisioning/accesscontrol/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for access control again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:accesscontrol`.", + "tags": ["admin_provisioning"], + "summary": "Reload access control provisioning configurations.", + "operationId": "reloadProvisionedAccessControl", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/dashboards/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for dashboards again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:dashboards`.", + "tags": ["admin_provisioning"], + "summary": "Reload dashboard provisioning configurations.", + "operationId": "reloadProvisionedDashboards", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/datasources/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for datasources again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:datasources`.", + "tags": ["admin_provisioning"], + "summary": "Reload datasource provisioning configurations.", + "operationId": "reloadProvisionedDatasources", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/notifications/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for legacy alert notifiers again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:notifications`.", + "tags": ["admin_provisioning"], + "summary": "Reload legacy alert notifier provisioning configurations.", + "operationId": "reloadProvisionedAlertNotifiers", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/provisioning/plugins/reload": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Reloads the provisioning config files for plugins again. It won’t return until the new provisioned entities are already stored in the database. In case of dashboards, it will stop polling for changes in dashboard files and then restart it with new configurations after returning.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `provisioning:reload` and scope `provisioners:plugin`.", + "tags": ["admin_provisioning"], + "summary": "Reload plugin provisioning configurations.", + "operationId": "reloadProvisionedPlugins", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/settings": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `settings:read` and scopes: `settings:*`, `settings:auth.saml:` and `settings:auth.saml:enabled` (property level).", + "tags": ["admin"], + "summary": "Fetch settings.", + "operationId": "getSettings", + "responses": { + "200": { + "$ref": "#/responses/getSettingsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + } + } + } + }, + "/admin/stats": { + "get": { + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `server:stats:read`.", + "tags": ["admin"], + "summary": "Fetch Grafana Stats.", + "operationId": "getStats", + "responses": { + "200": { + "$ref": "#/responses/getStatsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:create`.\nNote that OrgId is an optional parameter that can be used to assign a new user to a different organization when `auto_assign_org` is set to `true`.", + "tags": ["admin_users"], + "summary": "Create new user.", + "operationId": "createUser", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminCreateUserForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createUserResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}": { + "delete": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:delete` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Delete global User.", + "operationId": "deleteUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/auth-tokens": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:list` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Return a list of all auth tokens (devices) that the user currently have logged in from.", + "operationId": "getAuthTokens", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAuthTokensResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/disable": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:disable` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Disable user.", + "operationId": "disableUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/enable": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users:enable` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Enable user.", + "operationId": "enableUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/logout": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.logout` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity.", + "operationId": "logoutUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "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" + } + } + } + }, + "/admin/users/{user_id}/password": { + "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 `users.password:update` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Set password for user.", + "operationId": "setPassword", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUpdateUserPasswordForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/permissions": { + "put": { + "description": "Only works with Basic Authentication (username and password). See introduction for an explanation.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.permissions:update` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Set permissions for user.", + "operationId": "setPermissions", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUpdateUserPermissionsForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/quotas": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.quotas:list` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Fetch user quota.", + "operationId": "getUserQuota", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_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 `users.quotas:update` and scope `global:users:1` (userIDScope).", + "tags": ["admin_users"], + "summary": "Update user quota.", + "operationId": "updateUserQuota", + "parameters": [ + { + "type": "string", + "x-go-name": "QuotaTarget", + "name": "quota_target", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserQuotaCmd" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/admin/users/{user_id}/revoke-auth-token": { + "post": { + "security": [ + { + "basic": [] + } + ], + "description": "Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `users.authtoken:update` and scope `global:users:*`.", + "tags": ["admin_users"], + "summary": "Revoke auth token for user.", + "operationId": "revokeAuthToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RevokeAuthTokenCmd" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "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" + } + } + } + }, + "/alert-notifications": { + "get": { + "description": "Returns all notification channels that the authenticated user has permission to view.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get all notification channels.", + "operationId": "getAlertNotificationChannels", + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "You can find the full list of [supported notifiers](https://grafana.com/docs/grafana/latest/alerting/old-alerting/notifications/#list-of-supported-notifiers) on the alert notifiers page.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Create notification channel.", + "operationId": "createAlertNotificationChannel", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateAlertNotificationCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/lookup": { + "get": { + "description": "Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get all notification channels (lookup)", + "operationId": "lookupAlertNotificationChannels", + "responses": { + "200": { + "$ref": "#/responses/lookupAlertNotificationChannelsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/test": { + "post": { + "description": "Sends a test notification to the channel.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Test notification channel.", + "operationId": "notificationChannelTest", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/NotificationTestCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "412": { + "$ref": "#/responses/SMTPNotEnabledError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/uid/{notification_channel_uid}": { + "get": { + "description": "Returns the notification channel given the notification channel UID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get notification channel by UID", + "operationId": "getAlertNotificationChannelByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "NotificationUID", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Updates an existing notification channel identified by uid.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Update notification channel by UID.", + "operationId": "updateAlertNotificationChannelBYUID", + "parameters": [ + { + "type": "string", + "x-go-name": "NotificationUID", + "name": "notification_channel_uid", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAlertNotificationWithUidCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing notification channel identified by UID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Delete alert notification by UID.", + "operationId": "deleteAlertNotificationChannelByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "NotificationUID", + "name": "notification_channel_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alert-notifications/{notification_channel_id}": { + "get": { + "description": "Returns the notification channel given the notification channel ID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Get notification channel by ID.", + "operationId": "getAlertNotificationChannelByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "NotificationID", + "name": "notification_channel_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Updates an existing notification channel identified by ID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Update notification channel by ID.", + "operationId": "updateAlertNotificationChannel", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "NotificationID", + "name": "notification_channel_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAlertNotificationCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertNotificationChannelResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing notification channel identified by ID.", + "tags": ["legacy_alerts_notification_channels"], + "summary": "Delete alert notification by ID.", + "operationId": "deleteAlertNotificationChannel", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "NotificationID", + "name": "notification_channel_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts": { + "get": { + "tags": ["legacy_alerts"], + "summary": "Get legacy alerts.", + "operationId": "getAlerts", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "DashboardID", + "description": "Limit response to alerts in specified dashboard(s). You can specify multiple dashboards.", + "name": "dashboardId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "PanelID", + "description": "Limit response to alert for a specified panel on a dashboard.", + "name": "panelId", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Query", + "description": "Limit response to alerts having a name like this value.", + "name": "query", + "in": "query" + }, + { + "enum": ["all", "no_data", "paused", "alerting", "ok", "pending", "unknown"], + "type": "string", + "x-go-name": "State", + "description": "Return alerts with one or more of the following alert states", + "name": "state", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "description": "Limit response to X number of alerts.", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "FolderID", + "description": "Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders", + "name": "folderId", + "in": "query" + }, + { + "type": "string", + "x-go-name": "DashboardQuery", + "description": "Limit response to alerts having a dashboard name like this value./ Limit response to alerts having a dashboard name like this value.", + "name": "dashboardQuery", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "DashboardTag", + "description": "Limit response to alerts of dashboards with specified tags. To do an “AND” filtering with multiple tags, specify the tags parameter multiple times", + "name": "dashboardTag", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/states-for-dashboard": { + "get": { + "tags": ["legacy_alerts"], + "summary": "Get alert states for a dashboard.", + "operationId": "getDashboardStates", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID", + "name": "dashboardId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardStatesResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/test": { + "post": { + "tags": ["legacy_alerts"], + "summary": "Test alert.", + "operationId": "testAlert", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AlertTestCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/testAlertResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}": { + "get": { + "description": "“evalMatches” data in the response is cached in the db when and only when the state of the alert changes (e.g. transitioning from “ok” to “alerting” state).\nIf data from one server triggers the alert first and, before that server is seen leaving alerting state, a second server also enters a state that would trigger the alert, the second server will not be visible in “evalMatches” data.", + "tags": ["legacy_alerts"], + "summary": "Get alert by ID.", + "operationId": "getAlertByID", + "parameters": [ + { + "type": "string", + "x-go-name": "AlertID", + "name": "alert_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/alerts/{alert_id}/pause": { + "post": { + "tags": ["legacy_alerts"], + "summary": "Pause/unpause alert by id.", + "operationId": "pauseAlert", + "parameters": [ + { + "type": "string", + "x-go-name": "AlertID", + "name": "alert_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PauseAlertCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/pauseAlertResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations": { + "get": { + "description": "Starting in Grafana v6.4 regions annotations are now returned in one entity that now includes the timeEnd property.", + "tags": ["annotations"], + "summary": "Find Annotations.", + "operationId": "getAnnotations", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "From", + "description": "Find annotations created after specific epoch datetime in milliseconds.", + "name": "from", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "To", + "description": "Find annotations created before specific epoch datetime in milliseconds.", + "name": "to", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "description": "Limit response to annotations created by specific user.", + "name": "userId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "AlertID", + "description": "Find annotations for a specified alert.", + "name": "alertId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID", + "description": "Find annotations that are scoped to a specific dashboard", + "name": "dashboardId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "PanelID", + "description": "Find annotations that are scoped to a specific panel", + "name": "panelId", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "description": "Max limit for results returned.", + "name": "limit", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "Tags", + "description": "Use this to filter global annotations. Global annotations are annotations from an annotation data source that are not connected specifically to a dashboard or panel. You can filter by multiple tags.", + "name": "tags", + "in": "query" + }, + { + "enum": ["alert", "annotation"], + "type": "string", + "x-go-name": "Type", + "description": "Return alerts or user created annotations", + "name": "type", + "in": "query" + }, + { + "type": "boolean", + "x-go-name": "MatchAny", + "description": "Match any or all tags", + "name": "matchAny", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAnnotationsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates an annotation in the Grafana database. The dashboardId and panelId fields are optional. If they are not specified then a global annotation is created and can be queried in any dashboard that adds the Grafana annotations data source. When creating a region annotation include the timeEnd property.\nThe format for `time` and `timeEnd` should be epoch numbers in millisecond resolution.\nThe response for this HTTP request is slightly different in versions prior to v6.4. In prior versions you would also get an endId if you where creating a region. But in 6.4 regions are represented using a single event with time and timeEnd properties.", + "tags": ["annotations"], + "summary": "Create Annotation.", + "operationId": "createAnnotation", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createAnnotationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/graphite": { + "post": { + "description": "Creates an annotation by using Graphite-compatible event format. The `when` and `data` fields are optional. If `when` is not specified then the current time will be used as annotation’s timestamp. The `tags` field can also be in prior to Graphite `0.10.0` format (string with multiple tags being separated by a space).", + "tags": ["annotations"], + "summary": "Create Annotation in Graphite format.", + "operationId": "createGraphiteAnnotation", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostGraphiteAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createAnnotationResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/mass-delete": { + "post": { + "tags": ["annotations"], + "summary": "Delete multiple annotations.", + "operationId": "massDeleteAnnotations", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/tags": { + "get": { + "description": "Find all the event tags created in the annotations.", + "tags": ["annotations"], + "summary": "Find Annotations Tags.", + "operationId": "getAnnotationTags", + "parameters": [ + { + "type": "string", + "x-go-name": "Tag", + "description": "Tag is a string that you can use to filter tags.", + "name": "tag", + "in": "query" + }, + { + "type": "string", + "default": "100", + "x-go-name": "Limit", + "description": "Max limit for results returned.", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAnnotationTagsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/annotations/{annotation_id}": { + "put": { + "description": "Updates all properties of an annotation that matches the specified id. To only update certain property, consider using the Patch Annotation operation.", + "tags": ["annotations"], + "summary": "Update Annotation.", + "operationId": "updateAnnotation", + "parameters": [ + { + "type": "string", + "x-go-name": "AnnotationID", + "name": "annotation_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes the annotation that matches the specified ID.", + "tags": ["annotations"], + "summary": "Delete Annotation By ID.", + "operationId": "deleteAnnotation", + "parameters": [ + { + "type": "string", + "x-go-name": "AnnotationID", + "name": "annotation_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "patch": { + "description": "Updates one or more properties of an annotation that matches the specified ID.\nThis operation currently supports updating of the `text`, `tags`, `time` and `timeEnd` properties.\nThis is available in Grafana 6.0.0-beta2 and above.", + "tags": ["annotations"], + "summary": "Patch Annotation", + "operationId": "patchAnnotation", + "parameters": [ + { + "type": "string", + "x-go-name": "AnnotationID", + "name": "annotation_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchAnnotationsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/auth/keys": { + "get": { + "description": "Will return auth keys.", + "tags": ["api_keys"], + "summary": "Get auth keys.", + "operationId": "getAPIkeys", + "parameters": [ + { + "type": "boolean", + "default": false, + "x-go-name": "IncludeExpired", + "description": "Show expired keys", + "name": "includeExpired", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getAPIkeyResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Will return details of the created API key", + "tags": ["api_keys"], + "summary": "Creates an API key.", + "operationId": "addAPIkey", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddApiKeyCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postAPIkeyResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/auth/keys/{id}": { + "delete": { + "tags": ["api_keys"], + "summary": "Delete API key.", + "operationId": "deleteAPIkey", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboard/snapshots": { + "get": { + "tags": ["snapshots"], + "summary": "List snapshots.", + "operationId": "getSnapshots", + "parameters": [ + { + "type": "string", + "x-go-name": "Query", + "description": "Search Query", + "name": "query", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "Limit", + "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": [ + { + "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"], + "x-go-name": "DiffType" + }, + "new": { + "$ref": "#/definitions/CalculateDiffTarget" + } + } + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardDiffResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/db": { + "post": { + "description": "Creates a new dashboard or updates an existing dashboard.", + "tags": ["dashboards"], + "summary": "Create / Update dashboard", + "operationId": "postDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SaveDashboardCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/home": { + "get": { + "tags": ["dashboards"], + "summary": "Get home dashboard.", + "operationId": "getHomeDashboard", + "responses": { + "200": { + "$ref": "#/responses/getHomeDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/permissions": { + "get": { + "tags": ["dashboard_permissions"], + "summary": "Gets all existing permissions for the given dashboard.", + "operationId": "getDashboardPermissions", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardPermissionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "This operation will remove existing permissions if they’re not included in the request.", + "tags": ["dashboard_permissions"], + "summary": "Updates permissions for a dashboard.", + "operationId": "postDashboardPermissions", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardAclCommand" + } + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/restore": { + "post": { + "tags": ["dashboard_versions"], + "summary": "Restore a dashboard to a given dashboard version.", + "operationId": "restoreDashboardVersion", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/postDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/versions": { + "get": { + "tags": ["dashboard_versions"], + "summary": "Gets all existing versions for the dashboard.", + "operationId": "getDashboardVersions", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "Limit", + "description": "Maximum number of results to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "Start", + "description": "Version to start from when returning queries", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/id/{DashboardID}/versions/{DashboardVersionID}": { + "get": { + "tags": ["dashboard_versions"], + "summary": "Get a specific dashboard version.", + "operationId": "getDashboardVersion", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "DashboardVersionID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardVersionResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/import": { + "post": { + "tags": ["dashboards"], + "summary": "Import dashboard.", + "operationId": "importDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ImportDashboardRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/importDashboardResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/tags": { + "get": { + "tags": ["dashboards"], + "summary": "Get all dashboards tags of an organisation.", + "operationId": "getDashboardTags", + "responses": { + "200": { + "$ref": "#/responses/dashboardsTagsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/trim": { + "post": { + "tags": ["dashboards"], + "summary": "Trim defaults from dashboard.", + "operationId": "trimDashboard", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TrimDashboardCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/trimDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/dashboards/uid/{uid}": { + "get": { + "description": "Will return the dashboard given the dashboard unique identifier (uid).", + "tags": ["dashboards"], + "summary": "Get dashboard by uid.", + "operationId": "getDashboardByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/dashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Will delete the dashboard given the specified unique identifier (uid).", + "tags": ["dashboards"], + "summary": "Delete dashboard by uid.", + "operationId": "deleteDashboardByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteDashboardResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources": { + "get": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:read` and scope: `datasources:*`.", + "tags": ["datasources"], + "summary": "Get all data sources.", + "operationId": "getDatasources", + "responses": { + "200": { + "$ref": "#/responses/getDatasourcesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "By defining `password` and `basicAuthPassword` under secureJsonData property\nGrafana encrypts them securely as an encrypted blob in the database.\nThe response then lists the encrypted fields under secureJsonFields.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:create`", + "tags": ["datasources"], + "summary": "Create a data source.", + "operationId": "addDatasource", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddDataSourceCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/id/{datasource_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", + "x-go-name": "DatasourceName", + "name": "datasource_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceIDresponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/name/{datasource_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", + "x-go-name": "DatasourceName", + "name": "datasource_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceResponse" + }, + "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:name:*` and `datasources:name:test_datasource` (single data source).", + "tags": ["datasources"], + "summary": "Delete an existing data source by name.", + "operationId": "deleteDatasourceByName", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceName", + "name": "datasource_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteDatasourceByNameResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/proxy/{datasource_id}/{datasource_proxy_route}": { + "get": { + "description": "Proxies all calls to the actual data source.", + "tags": ["datasources"], + "summary": "Data source proxy GET calls.", + "operationId": "datasourceProxyGETcalls", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "DatasourceProxyRoute", + "name": "datasource_proxy_route", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Proxies all calls to the actual data source. The data source should support POST methods for the specific path and role as defined", + "tags": ["datasources"], + "summary": "Data source proxy POST calls.", + "operationId": "datasourceProxyPOSTcalls", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "DatasourceProxyRoute", + "name": "datasource_proxy_route", + "in": "path", + "required": true + }, + { + "name": "DatasourceProxyParam", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "201": { + "description": "" + }, + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Proxies all calls to the actual data source.", + "tags": ["datasources"], + "summary": "Data source proxy DELETE calls.", + "operationId": "datasourceProxyDELETEcalls", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "DatasourceProxyRoute", + "name": "datasource_proxy_route", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/uid/{datasource_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": [ + { + "type": "string", + "x-go-name": "DatasourceUID", + "name": "datasource_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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:uid:*` and `datasources:uid:kLtEtcRGk` (single data source).", + "tags": ["datasources"], + "summary": "Delete an existing data source by UID.", + "operationId": "deleteDatasourceByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceUID", + "name": "datasource_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" + } + } + } + }, + "/datasources/{datasource_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).", + "tags": ["datasources"], + "summary": "Get a single data source by Id.", + "operationId": "getDatasourceByID", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Similar to creating a data source, `password` and `basicAuthPassword` should be defined under\nsecureJsonData in order to be stored securely as an encrypted blob in the database. Then, the\nencrypted fields are listed under secureJsonFields section in the response.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:write` and scopes: `datasources:*`, `datasources:id:*` and `datasources:id:1` (single data source).", + "tags": ["datasources"], + "summary": "Update an existing data source.", + "operationId": "updateDatasource", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDataSourceCommand" + } + } + ], + "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:id:*` and `datasources:id:1` (single data source).", + "tags": ["datasources"], + "summary": "Delete an existing data source by id.", + "operationId": "deleteDatasourceByID", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrUpdateDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "parameters": [ + { + "type": "string", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getPermissionseResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/datasources/{datasource_id}/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", + "x-go-name": "DatasourceID", + "name": "datasource_id", + "in": "path", + "required": true + }, + { + "type": "string", + "x-go-name": "PermissionID", + "name": "permissionId", + "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" + } + } + } + }, + "/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": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MetricRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/queryDataResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders": { + "get": { + "description": "Returns all folders that the authenticated user has permission to view.", + "tags": ["folders"], + "summary": "Get all folders.", + "operationId": "getFolders", + "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "Limit", + "description": "Limit the maximum number of folders to return", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "description": "Page index for starting fetching folders", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getFoldersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["folders"], + "summary": "Create folder.", + "operationId": "createFolder", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateFolderCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/folderResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders/id/{folder_id}": { + "get": { + "description": "Returns the folder identified by id.", + "tags": ["folders"], + "summary": "Get folder by id.", + "operationId": "getFolderByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "FolderID", + "name": "folder_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/folderResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders/{folder_uid}": { + "get": { + "tags": ["folders"], + "summary": "Get folder by uid.", + "operationId": "getFolderByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["folders"], + "summary": "Update folder.", + "operationId": "updateFolder", + "parameters": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "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" + }, + "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": { + "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": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + }, + { + "type": "boolean", + "default": false, + "x-go-name": "ForceDeleteRules", + "description": "If `true` any Grafana 8 Alerts under this folder will be deleted.\nSet to `false` so that the request will fail if the folder contains any Grafana 8 Alerts.", + "name": "forceDeleteRules", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/deleteFolderResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/folders/{folder_uid}/permissions": { + "get": { + "tags": ["folder_permissions"], + "summary": "Gets all existing permissions for the folder with the given `uid`.", + "operationId": "getFolderPermissions", + "parameters": [ + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getDashboardPermissionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$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", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateDashboardAclCommand" + } + }, + { + "type": "string", + "x-go-name": "FolderUID", + "name": "folder_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" + } + } + } + }, + "/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": [ + { + "type": "string", + "x-go-name": "SearchString", + "description": "Part of the name or description searched for.", + "name": "searchString", + "in": "query" + }, + { + "enum": [1, 2], + "type": "integer", + "format": "int64", + "x-go-name": "Kind", + "description": "Kind of element to search for.", + "name": "kind", + "in": "query" + }, + { + "enum": ["alpha-asc", "alpha-desc"], + "type": "string", + "x-go-name": "SortDirection", + "description": "Sort order of elements.", + "name": "sortDirection", + "in": "query" + }, + { + "type": "string", + "x-go-name": "TypeFilter", + "description": "A comma separated list of types to filter the elements by", + "name": "typeFilter", + "in": "query" + }, + { + "type": "string", + "x-go-name": "ExcludeUID", + "description": "Element UID to exclude from search results.", + "name": "excludeUid", + "in": "query" + }, + { + "type": "string", + "x-go-name": "FolderFilter", + "description": "A comma separated list of folder ID(s) to filter the elements by.", + "name": "folderFilter", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 100, + "x-go-name": "PerPage", + "description": "The number of results per page.", + "name": "perPage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "description": "The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Creates a new library element.", + "tags": ["library_elements"], + "summary": "Create library element.", + "operationId": "createLibraryElement", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateLibraryElementCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "Name", + "name": "library_element_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/library-elements/{library_element_uid}": { + "get": { + "description": "Returns a library element with the given UID.", + "tags": ["library_elements"], + "summary": "Get library element by UID.", + "operationId": "getLibraryElementByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "description": "Deletes an existing library element as specified by the UID. This operation cannot be reverted.\nYou cannot delete a library element that is connected. This operation cannot be reverted.", + "tags": ["library_elements"], + "summary": "Delete library element.", + "operationId": "deleteLibraryElementByUID", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "patch": { + "description": "Updates an existing library element identified by uid.", + "tags": ["library_elements"], + "summary": "Update library element.", + "operationId": "updateLibraryElement", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchLibraryElementCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "412": { + "$ref": "#/responses/preconditionFailedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/library-elements/{library_element_uid}/connections/": { + "get": { + "description": "Returns a list of connections for a library element based on the UID specified.", + "tags": ["library_elements"], + "summary": "Get library element connections.", + "operationId": "getLibraryElementConnections", + "parameters": [ + { + "type": "string", + "x-go-name": "UID", + "name": "library_element_uid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLibraryElementConnectionsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/custom-permissions-csv": { + "get": { + "description": "You need to have a permission with action `licensing.reports:read`.", + "produces": ["text/csv"], + "tags": ["licensing", "enterprise"], + "summary": "Get custom permissions report in CSV format.", + "operationId": "getCustomPermissionsCSV", + "responses": { + "200": { + "$ref": "#/responses/getCustomPermissionsReportResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/refresh-stats": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": ["licensing", "enterprise"], + "summary": "Refresh license stats.", + "operationId": "refreshLicenseStats", + "responses": { + "200": { + "$ref": "#/responses/refreshLicenseStatsResponse" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token": { + "get": { + "description": "You need to have a permission with action `licensing:read`.", + "tags": ["licensing", "enterprise"], + "summary": "Get license token.", + "operationId": "getLicenseToken", + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + } + } + }, + "post": { + "description": "You need to have a permission with action `licensing:update`.", + "tags": ["licensing", "enterprise"], + "summary": "Create license token.", + "operationId": "postLicenseToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/getLicenseTokenResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + } + } + }, + "delete": { + "description": "Removes the license stored in the Grafana database. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:delete`.", + "tags": ["licensing", "enterprise"], + "summary": "Remove license from database.", + "operationId": "deleteLicenseToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteTokenCommand" + } + } + ], + "responses": { + "202": { + "$ref": "#/responses/acceptedResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/licensing/token/renew": { + "post": { + "description": "Manually ask license issuer for a new token. Available in Grafana Enterprise v7.4+.\n\nYou need to have a permission with action `licensing:update`.", + "tags": ["licensing", "enterprise"], + "summary": "Manually force license refresh.", + "operationId": "postRenewLicenseToken", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/postRenewLicenseTokenResponse" + }, + "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": "" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/logout/saml": { + "get": { + "tags": ["saml", "enterprise"], + "summary": "GetLogout initiates single logout process.", + "operationId": "getSAMLLogout", + "responses": { + "302": { + "description": "" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org": { + "get": { + "description": "Get current Organization", + "tags": ["current_org_details"], + "operationId": "getOrg", + "responses": { + "200": { + "$ref": "#/responses/getOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["current_org_details"], + "summary": "Update current Organization.", + "operationId": "updateOrg", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/address": { + "put": { + "tags": ["current_org_details"], + "summary": "Update current Organization's address.", + "operationId": "updateOrgAddress", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/invites": { + "get": { + "tags": ["org_invites"], + "summary": "Get pending invites.", + "operationId": "getInvites", + "responses": { + "200": { + "$ref": "#/responses/getInvitesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["org_invites"], + "summary": "Add invite.", + "operationId": "addInvite", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddInviteForm" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/addOrgUser" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "412": { + "$ref": "#/responses/SMTPNotEnabledError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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" + } + } + }, + "put": { + "tags": ["org_preferences"], + "summary": "Update Current Org Prefs.", + "operationId": "updateOrgPreferences", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/addOrgUser" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/users": { + "get": { + "description": "Returns all org users within the current organization. Accessible to users with org admin role.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", + "tags": ["current_org_details"], + "summary": "Get all users within the current organization.", + "operationId": "getOrgUsers", + "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": ["current_org_details"], + "summary": "Add a new user to the current organization", + "operationId": "addOrgUser", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddOrgUserCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/users/lookup": { + "get": { + "description": "Returns all org users within the current organization, but with less detailed information.\nAccessible to users with org admin role, admin in any folder or admin of any team.\nMainly used by Grafana UI for providing list of users when adding team members and when editing folder/dashboard permissions.", + "tags": ["current_org_details"], + "summary": "Get all users within the current organization (lookup)", + "operationId": "lookupOrgUsers", + "parameters": [ + { + "type": "string", + "x-go-name": "Query", + "name": "query", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/lookupOrgUsersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + "tags": ["current_org_details"], + "summary": "Delete user in current organization", + "operationId": "deleteOrgUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgUserCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/org/{invitation_code}/invites": { + "delete": { + "tags": ["org_invites"], + "summary": "Revoke invite.", + "operationId": "revokeInvite", + "parameters": [ + { + "type": "string", + "x-go-name": "Code", + "name": "invitation_code", + "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" + } + } + } + }, + "/orgs": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "Search all Organizations", + "tags": ["orgs"], + "operationId": "searchOrg", + "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "PerPage", + "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", + "x-go-name": "Name", + "name": "name", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Query", + "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/searchOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Only works if [users.allow_org_create](https://grafana.com/docs/grafana/latest/administration/configuration/#allow_org_create) is set.", + "tags": ["orgs"], + "summary": "Create Organization.", + "operationId": "createOrg", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrgCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "OrgName", + "name": "org_name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}": { + "get": { + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Get Organization by ID.", + "operationId": "getOrgByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getOrgResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Update Organization.", + "operationId": "adminUpdateOrg", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "security": [ + { + "basic": [] + } + ], + "tags": ["orgs"], + "summary": "Delete Organization.", + "operationId": "adminDeleteOrg", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/address": { + "put": { + "tags": ["orgs"], + "summary": "Update Organization's address.", + "operationId": "adminUpdateOrgAddress", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgAddressForm" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/quotas/{quota_target}": { + "put": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).", + "tags": ["orgs"], + "summary": "Update user quota.", + "operationId": "updateOrgQuota", + "parameters": [ + { + "type": "string", + "x-go-name": "QuotaTarget", + "name": "quota_target", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgQuotaCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/users": { + "get": { + "security": [ + { + "basic": [] + } + ], + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:read` with scope `users:*`.", + "tags": ["orgs"], + "summary": "Get Users in Organization.", + "operationId": "adminGetOrgUsers", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "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", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddOrgUserCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/orgs/{org_id}/users/{user_id}": { + "delete": { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `org.users:remove` with scope `users:*`.", + "tags": ["orgs"], + "summary": "Delete user in current organization", + "operationId": "adminDeleteOrgUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrgUserCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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" + } + } + }, + "put": { + "tags": ["recording_rules", "enterprise"], + "summary": "Update a recording rule.", + "operationId": "updateRecordingRule", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Create a new recording rule.", + "operationId": "createRecordingRule", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/test": { + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Test a recording rule.", + "operationId": "testCreateRecordingRule", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/writer": { + "get": { + "tags": ["recording_rules", "enterprise"], + "summary": "Get the write target.", + "operationId": "getRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["recording_rules", "enterprise"], + "summary": "Create a new write target.", + "operationId": "createRecordingRuleWriteTarget", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/recordingRuleWriteTargetResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": ["recording_rules", "enterprise"], + "summary": "Delete the write target.", + "operationId": "deleteRecordingRuleWriteTarget", + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/recording-rules/{recordingRuleID}": { + "delete": { + "tags": ["recording_rules", "enterprise"], + "summary": "Delete a recording rule.", + "operationId": "deleteRecordingRule", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "RecordingRuleID", + "name": "recordingRuleID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports:read` with scope `reports:*`.", + "tags": ["reports", "enterprise"], + "summary": "List reports.", + "operationId": "getReports", + "responses": { + "200": { + "$ref": "#/responses/getReportsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports.admin:create`.", + "tags": ["reports", "enterprise"], + "summary": "Create a report.", + "operationId": "createReport", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/email": { + "post": { + "description": "Generate and send a report. This API waits for the report to be generated before returning. We recommend that you set the client’s timeout to at least 60 seconds. Available to org admins only and with a valid license.\n\nOnly available in Grafana Enterprise v7.0+.\nThis API endpoint is experimental and may be deprecated in a future release. On deprecation, a migration strategy will be provided and the endpoint will remain functional until the next major release of Grafana.\n\nYou need to have a permission with action `reports:send`.", + "tags": ["reports", "enterprise"], + "summary": "Send a report.", + "operationId": "sendReport", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportEmailDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/render/pdf/{DashboardID}": { + "get": { + "description": "Available to all users and with a valid license.", + "produces": ["application/pdf"], + "tags": ["reports", "enterprise"], + "summary": "Render report for dashboard.", + "operationId": "renderReportPDF", + "parameters": [ + { + "type": "integer", + "format": "int64", + "name": "DashboardID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/settings": { + "get": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:read`x.", + "tags": ["reports", "enterprise"], + "summary": "Get settings.", + "operationId": "getReportSettings", + "responses": { + "200": { + "$ref": "#/responses/getReportSettingsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.settings:write`xx.", + "tags": ["reports", "enterprise"], + "summary": "Save settings.", + "operationId": "saveReportSettings", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/test-email": { + "post": { + "description": "Available to org admins only and with a valid license.\n\nYou need to have a permission with action `reports:send`.", + "tags": ["reports", "enterprise"], + "summary": "Send test report via email.", + "operationId": "sendTestEmail", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/reports/{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", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "ReportID", + "name": "reportID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getReportResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "description": "Available to org admins only and with a valid or expired license\n\nYou need to have a permission with action `reports.admin:write` with scope `reports:id:\u003creport ID\u003e`.", + "tags": ["reports", "enterprise"], + "summary": "Update a report.", + "operationId": "updateReport", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "ReportID", + "name": "reportID", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateOrUpdateConfigCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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", + "x-go-name": "ReportID", + "name": "reportID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/saml/acs": { + "post": { + "tags": ["saml", "enterprise"], + "summary": "It performs assertion Consumer Service (ACS).", + "operationId": "postACS", + "parameters": [ + { + "type": "string", + "name": "RelayState", + "in": "query" + } + ], + "responses": { + "302": { + "description": "" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/saml/metadata": { + "get": { + "produces": ["application/xml;application/samlmetadata+xml"], + "tags": ["saml", "enterprise"], + "summary": "It exposes the SP (Grafana's) metadata for the IdP's consumption.", + "operationId": "getSAMLMetadata", + "responses": { + "200": { + "$ref": "#/responses/contentResponse" + } + } + } + }, + "/saml/slo": { + "post": { + "tags": ["saml", "enterprise"], + "summary": "It performs Single Logout (SLO) callback.", + "operationId": "postSLO", + "parameters": [ + { + "type": "string", + "name": "SAMLRequest", + "in": "query" + }, + { + "type": "string", + "name": "SAMLResponse", + "in": "query" + } + ], + "responses": { + "302": { + "description": "" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/search": { + "get": { + "tags": ["search"], + "operationId": "search", + "parameters": [ + { + "type": "string", + "x-go-name": "Query", + "description": "Search Query", + "name": "query", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-go-name": "Tag", + "description": "List of tags to search for", + "name": "tag", + "in": "query" + }, + { + "enum": ["dash-folder", "dash-db"], + "type": "string", + "x-go-name": "Type", + "description": "Type to search for, dash-folder or dash-db", + "name": "type", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "DashboardIds", + "description": "List of dashboard id’s to search for", + "name": "dashboardIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "x-go-name": "FolderIds", + "description": "List of folder id’s to search in for dashboards", + "name": "folderIds", + "in": "query" + }, + { + "type": "boolean", + "x-go-name": "Starred", + "description": "Flag indicating if only starred Dashboards should be returned", + "name": "starred", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Limit", + "description": "Limit the number of returned results (max 5000)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "Page", + "description": "Use this parameter to access hits beyond limit. Numbering starts at 1. limit param acts as page size. Only available in Grafana v6.2+.", + "name": "page", + "in": "query" + }, + { + "enum": ["Edit", "View"], + "type": "string", + "default": "View", + "x-go-name": "Permission", + "description": "Set to `Edit` to return dashboards/folders that the user can edit", + "name": "permission", + "in": "query" + }, + { + "enum": ["alpha-asc", "alpha-desc"], + "type": "string", + "default": "alpha-asc", + "x-go-name": "Sort", + "description": "Sort method; for listing all the possible sort methods use the search sorting endpoint.", + "name": "sort", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/searchResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "422": { + "$ref": "#/responses/unprocessableEntityError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/search/sorting": { + "get": { + "description": "List search sorting options", + "tags": ["search"], + "operationId": "searchSorting", + "responses": { + "200": { + "$ref": "#/responses/searchSortingResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + } + } + } + }, + "/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": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateDashboardSnapshotCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createSnapshotResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/snapshots-delete/{deleteKey}": { + "get": { + "description": "Snapshot public mode should be enabled or authentication is required.", + "tags": ["snapshots"], + "summary": "Delete Snapshot by deleteKey.", + "operationId": "deleteSnapshotByDeleteKey", + "parameters": [ + { + "type": "string", + "x-go-name": "DeleteKey", + "name": "deleteKey", + "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" + } + } + } + }, + "/snapshots/{key}": { + "get": { + "tags": ["snapshots"], + "summary": "Get Snapshot by Key.", + "operationId": "getSnapshotByKey", + "parameters": [ + { + "type": "string", + "x-go-name": "Key", + "name": "key", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/snapshotResponse" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": ["snapshots"], + "summary": "Delete Snapshot by Key.", + "operationId": "deleteSnapshotByKey", + "parameters": [ + { + "type": "string", + "x-go-name": "Key", + "name": "key", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams": { + "post": { + "tags": ["teams"], + "summary": "Add Team.", + "operationId": "createTeam", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateTeamCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/createTeamResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "409": { + "$ref": "#/responses/conflictError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/search": { + "get": { + "tags": ["teams"], + "summary": "Team Search With Paging.", + "operationId": "searchTeams", + "parameters": [ + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "PerPage", + "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", + "x-go-name": "Name", + "name": "name", + "in": "query" + }, + { + "type": "string", + "x-go-name": "Query", + "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/searchTeamsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{teamId}/groups": { + "get": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Get External Groups.", + "operationId": "getTeamGroupsApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamGroupsApiResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Add External Group.", + "operationId": "addTeamGroupApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamGroupMapping" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{teamId}/groups/{groupId}": { + "delete": { + "tags": ["sync_team_groups", "enterprise"], + "summary": "Remove External Group.", + "operationId": "removeTeamGroupApi", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID", + "name": "teamId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "GroupID", + "name": "groupId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}": { + "get": { + "tags": ["teams"], + "summary": "Get Team By ID.", + "operationId": "getTeam", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getTeamResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["teams"], + "summary": "Update Team.", + "operationId": "updateTeam", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTeamCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}/members": { + "get": { + "tags": ["teams"], + "summary": "Get Team Members.", + "operationId": "getTeamMembers", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "post": { + "tags": ["teams"], + "summary": "Add Team Member.", + "operationId": "addTeamMember", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}/members/{user_id}": { + "put": { + "tags": ["teams"], + "summary": "Update Team Member.", + "operationId": "updateTeamMember", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateTeamMemberCommand" + } + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "tags": ["teams"], + "summary": "Remove Member From Team.", + "operationId": "removeTeamMember", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/teams/{team_id}/preferences": { + "get": { + "tags": ["teams"], + "summary": "Get Team Preferences.", + "operationId": "getTeamPreferences", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getPreferencesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["teams"], + "summary": "Update Team Preferences.", + "operationId": "updateTeamPreferences", + "parameters": [ + { + "type": "string", + "x-go-name": "TeamID", + "name": "team_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/tsdb/query": { + "post": { + "description": "Queries a data source having backend implementation.\n\nMost of Grafana’s builtin data sources have backend implementation.\n\nIf you are running Grafana Enterprise and have Fine-grained access control enabled\nyou need to have a permission with action: `datasources:query`.", + "tags": ["datasources"], + "summary": "Query metrics.", + "operationId": "queryDatasource", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MetricRequest" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/queryDatasourceResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user": { + "get": { + "tags": ["signed_in_user"], + "summary": "Get signed in User.", + "operationId": "getSignedInUser", + "responses": { + "200": { + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "put": { + "tags": ["signed_in_user"], + "summary": "Update signed in User.", + "operationId": "updateSignedInUser", + "parameters": [ + { + "x-go-name": "Body", + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserCommand" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/auth-tokens": { + "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" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/helpflags/clear": { + "get": { + "tags": ["signed_in_user"], + "summary": "Clear user help flag.", + "operationId": "clearHelpFlags", + "responses": { + "200": { + "$ref": "#/responses/helpFlagResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/helpflags/{flag_id}": { + "put": { + "tags": ["signed_in_user"], + "summary": "Set user help flag.", + "operationId": "setHelpFlag", + "parameters": [ + { + "type": "string", + "x-go-name": "FlagID", + "name": "flag_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/helpFlagResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/orgs": { + "get": { + "security": [ + { + "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" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "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", + "parameters": [ + { + "x-go-name": "Body", + "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/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/preferences": { + "get": { + "tags": ["user_preferences"], + "summary": "Get user preferences.", + "operationId": "getUserPreferences", + "responses": { + "200": { + "$ref": "#/responses/getPreferencesResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "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", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePrefsCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/quotas": { + "get": { + "tags": ["signed_in_user"], + "summary": "Fetch user quota.", + "operationId": "getUserQuotas", + "responses": { + "200": { + "$ref": "#/responses/getQuotaResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$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": "revokeSignedINAuthTokenCmd", + "parameters": [ + { + "x-go-name": "Body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RevokeAuthTokenCmd" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "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", + "parameters": [ + { + "type": "string", + "x-go-name": "DashboardID", + "name": "dashboard_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + }, + "delete": { + "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", + "x-go-name": "DashboardID", + "name": "dashboard_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/user/teams": { + "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", + "responses": { + "200": { + "$ref": "#/responses/getUserOrgListResponse" + }, + "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", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "name": "org_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/okResponse" + }, + "400": { + "$ref": "#/responses/badRequestError" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/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": "integer", + "format": "int64", + "default": 1000, + "x-go-name": "Limit", + "description": "Limit the maximum number of users to return per page", + "name": "perpage", + "in": "query" + }, + { + "type": "integer", + "format": "int64", + "default": 1, + "x-go-name": "Page", + "description": "Page index for starting fetching users", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/searchUsersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/users/lookup": { + "get": { + "tags": ["users"], + "summary": "Get user by login or email.", + "operationId": "getUserByLoginOrEmail", + "parameters": [ + { + "type": "string", + "x-go-name": "LoginOrEmail", + "description": "loginOrEmail of the user", + "name": "loginOrEmail", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/userResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/users/search": { + "get": { + "tags": ["users"], + "summary": "Get users with paging.", + "operationId": "searchUsersWithPaging", + "responses": { + "200": { + "$ref": "#/responses/searchUsersResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + }, + "/users/{user_id}": { + "get": { + "tags": ["users"], + "summary": "Get user by id.", + "operationId": "getUserByID", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "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" + } + } + }, + "put": { + "description": "Update the user identified by id.", + "tags": ["users"], + "summary": "Update user.", + "operationId": "updateUser", + "parameters": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "x-go-name": "Body", + "description": "To change the email, name, login, theme, provide another one.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserCommand" + } + } + ], + "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": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getUserOrgListResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "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": [ + { + "type": "integer", + "format": "int64", + "x-go-name": "UserID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/getUserTeamsResponse" + }, + "401": { + "$ref": "#/responses/unauthorisedError" + }, + "403": { + "$ref": "#/responses/forbiddenError" + }, + "404": { + "$ref": "#/responses/notFoundError" + }, + "500": { + "$ref": "#/responses/internalServerError" + } + } + } + } + }, + "definitions": { + "ActiveSyncStatusDTO": { + "description": "ActiveSyncStatusDTO holds the information for LDAP background Sync", + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "x-go-name": "Enabled" + }, + "nextSync": { + "type": "string", + "format": "date-time", + "x-go-name": "NextSync" + }, + "prevSync": { + "$ref": "#/definitions/SyncResult" + }, + "schedule": { + "type": "string", + "x-go-name": "Schedule" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/ldapdebug" + }, + "ActiveUserStats": { + "type": "object", + "properties": { + "active_admins_and_editors": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveAdminsAndEditors" + }, + "active_users": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveUsers" + }, + "active_viewers": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveViewers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "AddApiKeyCommand": { + "description": "COMMANDS", + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "secondsToLive": { + "type": "integer", + "format": "int64", + "x-go-name": "SecondsToLive" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddBuiltInRoleCommand": { + "type": "object", + "properties": { + "builtInRole": { + "type": "string", + "enum": ["Viewer", " Editor", " Admin", " Grafana Admin"], + "x-go-name": "BuiltinRole" + }, + "global": { + "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to create organization local assignment. Refer to the Built-in role assignments for more information.", + "type": "boolean", + "x-go-name": "Global" + }, + "roleUid": { + "type": "string", + "x-go-name": "RoleUID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "AddDataSourceCommand": { + "description": "Also acts as api DTO", + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "basicAuthPassword": { + "type": "string", + "x-go-name": "BasicAuthPassword" + }, + "basicAuthUser": { + "type": "string", + "x-go-name": "BasicAuthUser" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "secureJsonData": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureJsonData" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + }, + "withCredentials": { + "type": "boolean", + "x-go-name": "WithCredentials" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddInviteForm": { + "type": "object", + "properties": { + "loginOrEmail": { + "type": "string", + "x-go-name": "LoginOrEmail" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "sendEmail": { + "type": "boolean", + "x-go-name": "SendEmail" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AddOrgUserCommand": { + "type": "object", + "properties": { + "loginOrEmail": { + "type": "string", + "x-go-name": "LoginOrEmail" + }, + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddPermissionDTO": { + "type": "object", + "properties": { + "builtinRole": { + "type": "string", + "x-go-name": "BuiltinRole" + }, + "permission": { + "$ref": "#/definitions/DsPermissionType" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/dspermissions" + }, + "AddTeamMemberCommand": { + "type": "object", + "properties": { + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AddTeamRoleCommand": { + "type": "object", + "properties": { + "roleUid": { + "type": "string", + "x-go-name": "RoleUID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "AddUserRoleCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean", + "x-go-name": "Global" + }, + "roleUid": { + "type": "string", + "x-go-name": "RoleUID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "Address": { + "type": "object", + "properties": { + "address1": { + "type": "string", + "x-go-name": "Address1" + }, + "address2": { + "type": "string", + "x-go-name": "Address2" + }, + "city": { + "type": "string", + "x-go-name": "City" + }, + "country": { + "type": "string", + "x-go-name": "Country" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "zipCode": { + "type": "string", + "x-go-name": "ZipCode" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AdminCreateUserForm": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "password": { + "type": "string", + "x-go-name": "Password" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AdminStats": { + "type": "object", + "properties": { + "activeAdmins": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveAdmins" + }, + "activeEditors": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveEditors" + }, + "activeSessions": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveSessions" + }, + "activeUsers": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveUsers" + }, + "activeViewers": { + "type": "integer", + "format": "int64", + "x-go-name": "ActiveViewers" + }, + "admins": { + "type": "integer", + "format": "int64", + "x-go-name": "Admins" + }, + "alerts": { + "type": "integer", + "format": "int64", + "x-go-name": "Alerts" + }, + "dailyActiveAdmins": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveAdmins" + }, + "dailyActiveEditors": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveEditors" + }, + "dailyActiveSessions": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveSessions" + }, + "dailyActiveUsers": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveUsers" + }, + "dailyActiveViewers": { + "type": "integer", + "format": "int64", + "x-go-name": "DailyActiveViewers" + }, + "dashboards": { + "type": "integer", + "format": "int64", + "x-go-name": "Dashboards" + }, + "datasources": { + "type": "integer", + "format": "int64", + "x-go-name": "Datasources" + }, + "editors": { + "type": "integer", + "format": "int64", + "x-go-name": "Editors" + }, + "monthlyActiveUsers": { + "type": "integer", + "format": "int64", + "x-go-name": "MonthlyActiveUsers" + }, + "orgs": { + "type": "integer", + "format": "int64", + "x-go-name": "Orgs" + }, + "playlists": { + "type": "integer", + "format": "int64", + "x-go-name": "Playlists" + }, + "snapshots": { + "type": "integer", + "format": "int64", + "x-go-name": "Snapshots" + }, + "stars": { + "type": "integer", + "format": "int64", + "x-go-name": "Stars" + }, + "tags": { + "type": "integer", + "format": "int64", + "x-go-name": "Tags" + }, + "users": { + "type": "integer", + "format": "int64", + "x-go-name": "Users" + }, + "viewers": { + "type": "integer", + "format": "int64", + "x-go-name": "Viewers" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AdminUpdateUserPasswordForm": { + "type": "object", + "properties": { + "password": { + "type": "string", + "x-go-name": "Password" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AdminUpdateUserPermissionsForm": { + "type": "object", + "properties": { + "isGrafanaAdmin": { + "type": "boolean", + "x-go-name": "IsGrafanaAdmin" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "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" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AlertListItemDTO": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "dashboardSlug": { + "type": "string", + "x-go-name": "DashboardSlug" + }, + "dashboardUid": { + "type": "string", + "x-go-name": "DashboardUid" + }, + "evalData": { + "$ref": "#/definitions/Json" + }, + "evalDate": { + "type": "string", + "format": "date-time", + "x-go-name": "EvalDate" + }, + "executionError": { + "type": "string", + "x-go-name": "ExecutionError" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "newStateDate": { + "type": "string", + "format": "date-time", + "x-go-name": "NewStateDate" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "state": { + "$ref": "#/definitions/AlertStateType" + }, + "url": { + "type": "string", + "x-go-name": "Url" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AlertNotification": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureFields": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "SecureFields" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertNotificationLookup": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertStateInfoDTO": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "newStateDate": { + "type": "string", + "format": "date-time", + "x-go-name": "NewStateDate" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "state": { + "$ref": "#/definitions/AlertStateType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AlertStateType": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "AlertTestCommand": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertTestResult": { + "type": "object", + "properties": { + "conditionEvals": { + "type": "string", + "x-go-name": "ConditionEvals" + }, + "error": { + "type": "string", + "x-go-name": "Error" + }, + "firing": { + "type": "boolean", + "x-go-name": "Firing" + }, + "logs": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertTestResultLog" + }, + "x-go-name": "Logs" + }, + "matches": { + "type": "array", + "items": { + "$ref": "#/definitions/EvalMatch" + }, + "x-go-name": "EvalMatches" + }, + "state": { + "$ref": "#/definitions/AlertStateType" + }, + "timeMs": { + "type": "string", + "x-go-name": "TimeMs" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "AlertTestResultLog": { + "type": "object", + "properties": { + "data": { + "type": "object", + "x-go-name": "Data" + }, + "message": { + "type": "string", + "x-go-name": "Message" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "ApiKeyDTO": { + "type": "object", + "properties": { + "expiration": { + "type": "string", + "format": "date-time", + "x-go-name": "Expiration" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "BrandingOptions": { + "type": "object", + "properties": { + "emailFooterLink": { + "type": "string", + "x-go-name": "EmailFooterLink" + }, + "emailFooterMode": { + "type": "string", + "x-go-name": "EmailFooterMode" + }, + "emailFooterText": { + "type": "string", + "x-go-name": "EmailFooterText" + }, + "emailLogoUrl": { + "type": "string", + "x-go-name": "EmailLogo" + }, + "reportLogoUrl": { + "type": "string", + "x-go-name": "ReportLogo" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "CalculateDiffTarget": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "unsavedDashboard": { + "$ref": "#/definitions/Json" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "ChangeUserPasswordCommand": { + "type": "object", + "properties": { + "newPassword": { + "type": "string", + "x-go-name": "NewPassword" + }, + "oldPassword": { + "type": "string", + "x-go-name": "OldPassword" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "ConfigDTO": { + "description": "ConfigDTO is model representation in transfer", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID" + }, + "dashboardName": { + "type": "string", + "x-go-name": "DashboardName" + }, + "dashboardUid": { + "type": "string", + "x-go-name": "DashboardUID" + }, + "enableCsv": { + "type": "boolean", + "x-go-name": "EnableCSV" + }, + "enableDashboardUrl": { + "type": "boolean", + "x-go-name": "EnableDashboardURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "options": { + "$ref": "#/definitions/ReportOptions" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "recipients": { + "type": "string", + "x-go-name": "Recipients" + }, + "replyTo": { + "type": "string", + "x-go-name": "ReplyTo" + }, + "schedule": { + "$ref": "#/definitions/Schedule" + }, + "state": { + "$ref": "#/definitions/State" + }, + "templateVars": { + "type": "object", + "x-go-name": "TemplateVars" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "CreateAlertNotificationCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateDashboardSnapshotCommand": { + "type": "object", + "required": ["dashboard"], + "properties": { + "Result": { + "$ref": "#/definitions/DashboardSnapshot" + }, + "dashboard": { + "$ref": "#/definitions/Json" + }, + "deleteKey": { + "description": "Unique key used to delete the snapshot. It is different from the `key` so that only the creator can delete the snapshot. Required if `external` is `true`.", + "type": "string", + "x-go-name": "DeleteKey" + }, + "expires": { + "description": "When the snapshot should expire in seconds in seconds. Default is never to expire.", + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "Expires" + }, + "external": { + "description": "these are passed when storing an external snapshot ref\nSave the snapshot on an external server rather than locally.", + "type": "boolean", + "default": false, + "x-go-name": "External" + }, + "key": { + "description": "Define the unique key. Required if `external` is `true`.", + "type": "string", + "x-go-name": "Key" + }, + "name": { + "description": "Snapshot name", + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateFolderCommand": { + "type": "object", + "properties": { + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateLibraryElementCommand": { + "description": "CreateLibraryElementCommand is the command for adding a LibraryElement", + "type": "object", + "properties": { + "folderId": { + "description": "ID of the folder where the library element is stored.", + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "kind": { + "description": "Kind of element to create, Use 1 for library panels or 2 for c.\nDescription:\n1 - library panels\n2 - library variables", + "type": "integer", + "format": "int64", + "enum": [1, 2], + "x-go-name": "Kind" + }, + "model": { + "description": "The JSON model for the library element.", + "type": "object", + "x-go-name": "Model" + }, + "name": { + "description": "Name of the library element.", + "type": "string", + "x-go-name": "Name" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "CreateOrUpdateConfigCmd": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardID" + }, + "dashboardUid": { + "type": "string", + "x-go-name": "DashboardUID" + }, + "enableCsv": { + "type": "boolean", + "x-go-name": "EnableCSV" + }, + "enableDashboardUrl": { + "type": "boolean", + "x-go-name": "EnableDashboardURL" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "options": { + "$ref": "#/definitions/ReportOptions" + }, + "recipients": { + "type": "string", + "x-go-name": "Recipients" + }, + "replyTo": { + "type": "string", + "x-go-name": "ReplyTo" + }, + "schedule": { + "$ref": "#/definitions/Schedule" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "templateVars": { + "type": "object", + "x-go-name": "TemplateVars" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "CreateOrgCommand": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CreateRoleWithPermissionsCommand": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "group": { + "type": "string", + "x-go-name": "Group" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + }, + "x-go-name": "Permissions" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "CreateTeamCommand": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "CustomPermissionsRecordDTO": { + "type": "object", + "properties": { + "customPermissions": { + "type": "string", + "x-go-name": "CustomPermissions" + }, + "granteeName": { + "type": "string", + "x-go-name": "GranteeName" + }, + "granteeType": { + "type": "string", + "x-go-name": "GranteeType" + }, + "granteeUrl": { + "type": "string", + "x-go-name": "GranteeURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "orgRole": { + "type": "string", + "x-go-name": "OrgRole" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "url": { + "type": "string", + "x-go-name": "URL" + }, + "usersCount": { + "type": "integer", + "format": "int64", + "x-go-name": "UsersCount" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "DashboardAclInfoDTO": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "inherited": { + "type": "boolean", + "x-go-name": "Inherited" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "permission": { + "$ref": "#/definitions/PermissionType" + }, + "permissionName": { + "type": "string", + "x-go-name": "PermissionName" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "team": { + "type": "string", + "x-go-name": "Team" + }, + "teamAvatarUrl": { + "type": "string", + "x-go-name": "TeamAvatarUrl" + }, + "teamEmail": { + "type": "string", + "x-go-name": "TeamEmail" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "userAvatarUrl": { + "type": "string", + "x-go-name": "UserAvatarUrl" + }, + "userEmail": { + "type": "string", + "x-go-name": "UserEmail" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + }, + "userLogin": { + "type": "string", + "x-go-name": "UserLogin" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardAclUpdateItem": { + "type": "object", + "properties": { + "permission": { + "$ref": "#/definitions/PermissionType" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardFullWithMeta": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/DashboardMeta" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardMeta": { + "type": "object", + "properties": { + "canAdmin": { + "type": "boolean", + "x-go-name": "CanAdmin" + }, + "canEdit": { + "type": "boolean", + "x-go-name": "CanEdit" + }, + "canSave": { + "type": "boolean", + "x-go-name": "CanSave" + }, + "canStar": { + "type": "boolean", + "x-go-name": "CanStar" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "expires": { + "type": "string", + "format": "date-time", + "x-go-name": "Expires" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "folderTitle": { + "type": "string", + "x-go-name": "FolderTitle" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUid" + }, + "folderUrl": { + "type": "string", + "x-go-name": "FolderUrl" + }, + "hasAcl": { + "type": "boolean", + "x-go-name": "HasAcl" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "isHome": { + "type": "boolean", + "x-go-name": "IsHome" + }, + "isSnapshot": { + "type": "boolean", + "x-go-name": "IsSnapshot" + }, + "isStarred": { + "type": "boolean", + "x-go-name": "IsStarred" + }, + "provisioned": { + "type": "boolean", + "x-go-name": "Provisioned" + }, + "provisionedExternalId": { + "type": "string", + "x-go-name": "ProvisionedExternalId" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "updatedBy": { + "type": "string", + "x-go-name": "UpdatedBy" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardRedirect": { + "type": "object", + "properties": { + "redirectUri": { + "type": "string", + "x-go-name": "RedirectUri" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DashboardSnapshot": { + "description": "DashboardSnapshot model", + "type": "object", + "properties": { + "Created": { + "type": "string", + "format": "date-time" + }, + "Dashboard": { + "$ref": "#/definitions/Json" + }, + "DashboardEncrypted": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + }, + "DeleteKey": { + "type": "string" + }, + "Expires": { + "type": "string", + "format": "date-time" + }, + "External": { + "type": "boolean" + }, + "ExternalDeleteUrl": { + "type": "string" + }, + "ExternalUrl": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Key": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "OrgId": { + "type": "integer", + "format": "int64" + }, + "Updated": { + "type": "string", + "format": "date-time" + }, + "UserId": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardSnapshotDTO": { + "description": "DashboardSnapshotDTO without dashboard map", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "expires": { + "type": "string", + "format": "date-time", + "x-go-name": "Expires" + }, + "external": { + "type": "boolean", + "x-go-name": "External" + }, + "externalUrl": { + "type": "string", + "x-go-name": "ExternalUrl" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardTagCloudItem": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int64", + "x-go-name": "Count" + }, + "term": { + "type": "string", + "x-go-name": "Term" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardVersionDTO": { + "description": "DashboardVersionDTO represents a dashboard version, without the dashboard\nmap.", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "parentVersion": { + "type": "integer", + "format": "int64", + "x-go-name": "ParentVersion" + }, + "restoredFrom": { + "type": "integer", + "format": "int64", + "x-go-name": "RestoredFrom" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DashboardVersionMeta": { + "description": "DashboardVersionMeta extends the dashboard version model with the names\nassociated with the UserIds, overriding the field with the same name from\nthe DashboardVersion model.", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "data": { + "$ref": "#/definitions/Json" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "parentVersion": { + "type": "integer", + "format": "int64", + "x-go-name": "ParentVersion" + }, + "restoredFrom": { + "type": "integer", + "format": "int64", + "x-go-name": "RestoredFrom" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DataFrames": { + "description": "See NewDecodedDataFrames and NewEncodedDataFrames for more information.", + "type": "object", + "title": "DataFrames is an interface for retrieving encoded and decoded data frames.", + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataQueryResult": { + "description": "Deprecated: DataQueryResult should use backend.QueryDataResponse", + "type": "object", + "properties": { + "dataframes": { + "$ref": "#/definitions/DataFrames" + }, + "error": { + "type": "string", + "x-go-name": "ErrorString" + }, + "meta": { + "$ref": "#/definitions/Json" + }, + "refId": { + "type": "string", + "x-go-name": "RefID" + }, + "series": { + "$ref": "#/definitions/DataTimeSeriesSlice" + }, + "tables": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTable" + }, + "x-go-name": "Tables" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataResponse": { + "description": "Deprecated: DataResponse -- this structure is deprecated, all new work should use backend.QueryDataResponse", + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "results": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/DataQueryResult" + }, + "x-go-name": "Results" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataRowValues": { + "type": "array", + "items": { + "type": "object" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataSource": { + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "accessControl": { + "$ref": "#/definitions/Metadata" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "basicAuthPassword": { + "type": "string", + "x-go-name": "BasicAuthPassword" + }, + "basicAuthUser": { + "type": "string", + "x-go-name": "BasicAuthUser" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "readOnly": { + "type": "boolean", + "x-go-name": "ReadOnly" + }, + "secureJsonFields": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "SecureJsonFields" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "typeLogoUrl": { + "type": "string", + "x-go-name": "TypeLogoUrl" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + }, + "withCredentials": { + "type": "boolean", + "x-go-name": "WithCredentials" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DataSourceList": { + "type": "array", + "items": { + "$ref": "#/definitions/DataSourceListItemDTO" + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DataSourceListItemDTO": { + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "readOnly": { + "type": "boolean", + "x-go-name": "ReadOnly" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "typeLogoUrl": { + "type": "string", + "x-go-name": "TypeLogoUrl" + }, + "typeName": { + "type": "string", + "x-go-name": "TypeName" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DataTable": { + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTableColumn" + }, + "x-go-name": "Columns" + }, + "rows": { + "type": "array", + "items": { + "$ref": "#/definitions/DataRowValues" + }, + "x-go-name": "Rows" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTableColumn": { + "type": "object", + "properties": { + "text": { + "type": "string", + "x-go-name": "Text" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimePoint": { + "type": "array", + "items": { + "$ref": "#/definitions/Float" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimeSeries": { + "description": "DataTimeSeries -- this structure is deprecated, all new work should use DataFrames from the SDK", + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "points": { + "$ref": "#/definitions/DataTimeSeriesPoints" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Tags" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimeSeriesPoints": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTimePoint" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DataTimeSeriesSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/DataTimeSeries" + }, + "x-go-package": "github.com/grafana/grafana/pkg/tsdb/legacydata" + }, + "DeleteAnnotationsCmd": { + "type": "object", + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertId" + }, + "annotationId": { + "type": "integer", + "format": "int64", + "x-go-name": "AnnotationId" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "DeleteTokenCommand": { + "type": "object", + "properties": { + "instance": { + "type": "string", + "x-go-name": "Instance" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "DsAccess": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "DsPermissionType": { + "description": "Datasource permission\nDescription:\n`0` - No Access\n`1` - Query\nEnum: 0,1", + "type": "integer", + "format": "int64", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "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", + "x-go-package": "time" + }, + "ErrorResponseBody": { + "type": "object", + "required": ["message"], + "properties": { + "error": { + "description": "Error An optional detailed description of the actual error. Only included if running in developer mode.", + "type": "string", + "x-go-name": "Error" + }, + "message": { + "description": "a human readable version of the error", + "type": "string", + "x-go-name": "Message" + }, + "status": { + "description": "Status An optional status to denote the cause of the error.\n\nFor example, a 412 Precondition Failed error may include additional information of why that error happened.", + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/docs/definitions" + }, + "EvalMatch": { + "type": "object", + "properties": { + "metric": { + "type": "string", + "x-go-name": "Metric" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "value": { + "$ref": "#/definitions/Float" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "FailedUser": { + "description": "FailedUser holds the information of an user that failed", + "type": "object", + "properties": { + "Error": { + "type": "string" + }, + "Login": { + "type": "string" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/ldapsync" + }, + "FindTagsResult": { + "type": "object", + "title": "FindTagsResult is the result of a tags search.", + "properties": { + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/TagsDTO" + }, + "x-go-name": "Tags" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "Float": { + "description": "It does not consider zero values to be null.\nIt will decode to null, not zero, if null.", + "type": "object", + "title": "Float is a nullable float64.", + "properties": { + "Float64": { + "type": "number", + "format": "double" + }, + "Valid": { + "type": "boolean" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/components/null" + }, + "Folder": { + "type": "object", + "properties": { + "canAdmin": { + "type": "boolean", + "x-go-name": "CanAdmin" + }, + "canEdit": { + "type": "boolean", + "x-go-name": "CanEdit" + }, + "canSave": { + "type": "boolean", + "x-go-name": "CanSave" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "type": "string", + "x-go-name": "CreatedBy" + }, + "hasAcl": { + "type": "boolean", + "x-go-name": "HasAcl" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "updatedBy": { + "type": "string", + "x-go-name": "UpdatedBy" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "FolderSearchHit": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "GetAnnotationTagsResponse": { + "type": "object", + "title": "GetAnnotationTagsResponse is a response struct for FindTagsResult.", + "properties": { + "result": { + "$ref": "#/definitions/FindTagsResult" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "GetHomeDashboardResponse": { + "title": "Get home dashboard response.", + "allOf": [ + { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/DashboardMeta" + } + } + }, + { + "type": "object", + "properties": { + "redirectUri": { + "type": "string", + "x-go-name": "RedirectUri" + } + } + } + ], + "x-go-name": "GetHomeDashboardResponseBody", + "x-go-package": "github.com/grafana/grafana/pkg/api/docs/definitions" + }, + "Hit": { + "type": "object", + "properties": { + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "folderTitle": { + "type": "string", + "x-go-name": "FolderTitle" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUID" + }, + "folderUrl": { + "type": "string", + "x-go-name": "FolderURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "isStarred": { + "type": "boolean", + "x-go-name": "IsStarred" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "sortMeta": { + "type": "integer", + "format": "int64", + "x-go-name": "SortMeta" + }, + "sortMetaName": { + "type": "string", + "x-go-name": "SortMetaName" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "type": { + "$ref": "#/definitions/HitType" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "uri": { + "type": "string", + "x-go-name": "URI" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/search" + }, + "HitList": { + "type": "array", + "items": { + "$ref": "#/definitions/Hit" + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/search" + }, + "HitType": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/services/search" + }, + "ImportDashboardInput": { + "type": "object", + "title": "ImportDashboardInput definition of input parameters when importing a dashboard.", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "pluginId": { + "type": "string", + "x-go-name": "PluginId" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "value": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/dashboardimport" + }, + "ImportDashboardRequest": { + "type": "object", + "title": "ImportDashboardRequest request object for importing a dashboard.", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUid" + }, + "inputs": { + "type": "array", + "items": { + "$ref": "#/definitions/ImportDashboardInput" + }, + "x-go-name": "Inputs" + }, + "overwrite": { + "type": "boolean", + "x-go-name": "Overwrite" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "pluginId": { + "type": "string", + "x-go-name": "PluginId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/dashboardimport" + }, + "ImportDashboardResponse": { + "type": "object", + "title": "ImportDashboardResponse response object returned when importing a dashboard.", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "imported": { + "type": "boolean", + "x-go-name": "Imported" + }, + "importedRevision": { + "type": "integer", + "format": "int64", + "x-go-name": "ImportedRevision" + }, + "importedUri": { + "type": "string", + "x-go-name": "ImportedUri" + }, + "importedUrl": { + "type": "string", + "x-go-name": "ImportedUrl" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "pluginId": { + "type": "string", + "x-go-name": "PluginId" + }, + "removed": { + "type": "boolean", + "x-go-name": "Removed" + }, + "revision": { + "type": "integer", + "format": "int64", + "x-go-name": "Revision" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/dashboardimport" + }, + "ItemDTO": { + "type": "object", + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertId" + }, + "alertName": { + "type": "string", + "x-go-name": "AlertName" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "created": { + "type": "integer", + "format": "int64", + "x-go-name": "Created" + }, + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "data": { + "$ref": "#/definitions/Json" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "newState": { + "type": "string", + "x-go-name": "NewState" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "prevState": { + "type": "string", + "x-go-name": "PrevState" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + }, + "updated": { + "type": "integer", + "format": "int64", + "x-go-name": "Updated" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "Json": { + "type": "object", + "x-go-package": "github.com/grafana/grafana/pkg/components/simplejson" + }, + "LibraryElementConnectionDTO": { + "type": "object", + "title": "LibraryElementConnectionDTO is the frontend DTO for element connections.", + "properties": { + "connectionId": { + "type": "integer", + "format": "int64", + "x-go-name": "ConnectionID" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "$ref": "#/definitions/LibraryElementDTOMetaUser" + }, + "elementId": { + "type": "integer", + "format": "int64", + "x-go-name": "ElementID" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "kind": { + "type": "integer", + "format": "int64", + "x-go-name": "Kind" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementConnectionsResponse": { + "type": "object", + "title": "LibraryElementConnectionsResponse is a response struct for an array of LibraryElementConnectionDTO.", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/LibraryElementConnectionDTO" + }, + "x-go-name": "Result" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementDTO": { + "type": "object", + "title": "LibraryElementDTO is the frontend DTO for entities.", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "kind": { + "type": "integer", + "format": "int64", + "x-go-name": "Kind" + }, + "meta": { + "$ref": "#/definitions/LibraryElementDTOMeta" + }, + "model": { + "type": "object", + "x-go-name": "Model" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementDTOMeta": { + "type": "object", + "title": "LibraryElementDTOMeta is the meta information for LibraryElementDTO.", + "properties": { + "connectedDashboards": { + "type": "integer", + "format": "int64", + "x-go-name": "ConnectedDashboards" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "createdBy": { + "$ref": "#/definitions/LibraryElementDTOMetaUser" + }, + "folderName": { + "type": "string", + "x-go-name": "FolderName" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUID" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "updatedBy": { + "$ref": "#/definitions/LibraryElementDTOMetaUser" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementDTOMetaUser": { + "type": "object", + "title": "LibraryElementDTOMetaUser is the meta information for user that creates/changes the library element.", + "properties": { + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementResponse": { + "type": "object", + "title": "LibraryElementResponse is a response struct for LibraryElementDTO.", + "properties": { + "result": { + "$ref": "#/definitions/LibraryElementDTO" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementSearchResponse": { + "type": "object", + "title": "LibraryElementSearchResponse is a response struct for LibraryElementSearchResult.", + "properties": { + "result": { + "$ref": "#/definitions/LibraryElementSearchResult" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "LibraryElementSearchResult": { + "type": "object", + "title": "LibraryElementSearchResult is the search result for entities.", + "properties": { + "elements": { + "type": "array", + "items": { + "$ref": "#/definitions/LibraryElementDTO" + }, + "x-go-name": "Elements" + }, + "page": { + "type": "integer", + "format": "int64", + "x-go-name": "Page" + }, + "perPage": { + "type": "integer", + "format": "int64", + "x-go-name": "PerPage" + }, + "totalCount": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "Metadata": { + "description": "Metadata contains user accesses for a given resource\nEx: map[string]bool{\"create\":true, \"delete\": true}", + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/accesscontrol" + }, + "MetricRequest": { + "type": "object", + "required": ["from", "to", "queries"], + "properties": { + "debug": { + "type": "boolean", + "x-go-name": "Debug" + }, + "from": { + "description": "From Start time in epoch timestamps in milliseconds or relative using Grafana time units.", + "type": "string", + "x-go-name": "From", + "example": "now-1h" + }, + "queries": { + "description": "queries.refId – Specifies an identifier of the query. Is optional and default to “A”.\nqueries.datasourceId – Specifies the data source to be queried. Each query in the request must have an unique datasourceId.\nqueries.maxDataPoints - Species maximum amount of data points that dashboard panel can render. Is optional and default to 100.\nqueries.intervalMs - Specifies the time interval in milliseconds of time series. Is optional and defaults to 1000.", + "type": "array", + "items": { + "$ref": "#/definitions/Json" + }, + "x-go-name": "Queries", + "example": [ + { + "datasourceId": 86, + "format": "table", + "intervalMs": 86400000, + "maxDataPoints": 1092, + "rawSql": "SELECT 1 as valueOne, 2 as valueTwo", + "refId": "A" + } + ] + }, + "to": { + "description": "To End time in epoch timestamps in milliseconds or relative using Grafana time units.", + "type": "string", + "x-go-name": "To", + "example": "now" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "NewApiKeyResult": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "NotificationTestCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "OrgDTO": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "OrgDetailsDTO": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "OrgUserDTO": { + "type": "object", + "properties": { + "accessControl": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "AccessControl" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "lastSeenAt": { + "type": "string", + "format": "date-time", + "x-go-name": "LastSeenAt" + }, + "lastSeenAtAge": { + "type": "string", + "x-go-name": "LastSeenAtAge" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "role": { + "type": "string", + "x-go-name": "Role" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "PatchAnnotationsCmd": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PatchLibraryElementCommand": { + "description": "PatchLibraryElementCommand is the command for patching a LibraryElement", + "type": "object", + "properties": { + "folderId": { + "description": "ID of the folder where the library element is stored.", + "type": "integer", + "format": "int64", + "x-go-name": "FolderID" + }, + "kind": { + "description": "Kind of element to create, Use 1 for library panels or 2 for c.\nDescription:\n1 - library panels\n2 - library variables", + "type": "integer", + "format": "int64", + "enum": [1, 2], + "x-go-name": "Kind" + }, + "model": { + "description": "The JSON model for the library element.", + "type": "object", + "x-go-name": "Model" + }, + "name": { + "description": "Name of the library element.", + "type": "string", + "x-go-name": "Name" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "version": { + "description": "Version of the library element you are updating.", + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/libraryelements" + }, + "PauseAlertCommand": { + "type": "object", + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertId" + }, + "paused": { + "type": "boolean", + "x-go-name": "Paused" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PauseAllAlertsCommand": { + "type": "object", + "properties": { + "paused": { + "type": "boolean", + "x-go-name": "Paused" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "Permission": { + "type": "object", + "title": "Permission is the model for access control permissions.", + "properties": { + "action": { + "type": "string", + "x-go-name": "Action" + }, + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "scope": { + "type": "string", + "x-go-name": "Scope" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/accesscontrol" + }, + "PermissionType": { + "type": "integer", + "format": "int64", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "PostAnnotationsCmd": { + "type": "object", + "properties": { + "dashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "DashboardId" + }, + "data": { + "$ref": "#/definitions/Json" + }, + "panelId": { + "type": "integer", + "format": "int64", + "x-go-name": "PanelId" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PostGraphiteAnnotationsCmd": { + "type": "object", + "properties": { + "data": { + "type": "string", + "x-go-name": "Data" + }, + "tags": { + "type": "object", + "x-go-name": "Tags" + }, + "what": { + "type": "string", + "x-go-name": "What" + }, + "when": { + "type": "integer", + "format": "int64", + "x-go-name": "When" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "Prefs": { + "type": "object", + "properties": { + "homeDashboardId": { + "type": "integer", + "format": "int64", + "x-go-name": "HomeDashboardID" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "timezone": { + "type": "string", + "x-go-name": "Timezone" + }, + "weekStart": { + "type": "string", + "x-go-name": "WeekStart" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "PrometheusRemoteWriteTargetJSON": { + "type": "object", + "properties": { + "data_source_uid": { + "type": "string", + "x-go-name": "DatasourceUID" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "remote_write_path": { + "type": "string", + "x-go-name": "WritePath" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/recordedqueries/api" + }, + "QueryDataResponse": { + "description": "It is the return type of a QueryData call.", + "type": "object", + "title": "QueryDataResponse contains the results from a QueryDataRequest.", + "properties": { + "Responses": { + "$ref": "#/definitions/Responses" + } + }, + "x-go-package": "github.com/grafana/grafana-plugin-sdk-go/backend" + }, + "RecordingRuleJSON": { + "description": "RecordingRuleJSON is the external representation of a recording rule", + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-go-name": "Active" + }, + "count": { + "type": "boolean", + "x-go-name": "Count" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "dest_data_source_uid": { + "type": "string", + "x-go-name": "DestDataSourceUID" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "interval": { + "type": "integer", + "format": "int64", + "x-go-name": "Interval" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "prom_name": { + "type": "string", + "x-go-name": "PromName" + }, + "queries": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "x-go-name": "Queries" + }, + "range": { + "type": "integer", + "format": "int64", + "x-go-name": "Range" + }, + "target_ref_id": { + "type": "string", + "x-go-name": "TargetRefID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/recordedqueries/api" + }, + "ReportEmailDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "emails": { + "description": "Comma-separated list of emails to which to send the report to.", + "type": "string", + "x-go-name": "Emails" + }, + "id": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "string", + "format": "int64", + "x-go-name": "Id" + }, + "useEmailsFromReport": { + "description": "Send the report to the emails specified in the report. Required if emails is not present.", + "type": "boolean", + "x-go-name": "UseEmailsFromReport" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "ReportOptions": { + "type": "object", + "properties": { + "layout": { + "type": "string", + "x-go-name": "Layout" + }, + "orientation": { + "type": "string", + "x-go-name": "Orientation" + }, + "timeRange": { + "$ref": "#/definitions/TimeRangeDTO" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "Responses": { + "description": "The QueryData method the QueryDataHandler method will set the RefId\nproperty on the DataRespones' frames based on these RefIDs.", + "type": "object", + "title": "Responses is a map of RefIDs (Unique Query ID) to DataResponses.", + "additionalProperties": { + "$ref": "#/definitions/DataResponse" + }, + "x-go-package": "github.com/grafana/grafana-plugin-sdk-go/backend" + }, + "RevokeAuthTokenCmd": { + "type": "object", + "properties": { + "authTokenId": { + "type": "integer", + "format": "int64", + "x-go-name": "AuthTokenId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "RoleDTO": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "delegatable": { + "type": "boolean", + "x-go-name": "Delegatable" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "group": { + "type": "string", + "x-go-name": "Group" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + }, + "x-go-name": "Permissions" + }, + "uid": { + "type": "string", + "x-go-name": "UID" + }, + "updated": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/accesscontrol" + }, + "RoleType": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "SaveDashboardCommand": { + "type": "object", + "properties": { + "UpdatedAt": { + "type": "string", + "format": "date-time" + }, + "dashboard": { + "$ref": "#/definitions/Json" + }, + "folderId": { + "type": "integer", + "format": "int64", + "x-go-name": "FolderId" + }, + "folderUid": { + "type": "string", + "x-go-name": "FolderUid" + }, + "isFolder": { + "type": "boolean", + "x-go-name": "IsFolder" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "overwrite": { + "type": "boolean", + "x-go-name": "Overwrite" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "Schedule": { + "type": "object", + "properties": { + "day": { + "type": "string", + "x-go-name": "Day" + }, + "dayOfMonth": { + "type": "string", + "x-go-name": "DayOfMonth" + }, + "endDate": { + "type": "string", + "format": "date-time", + "x-go-name": "EndDate" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "hour": { + "type": "integer", + "format": "int64", + "x-go-name": "Hour" + }, + "intervalAmount": { + "type": "integer", + "format": "int64", + "x-go-name": "IntervalAmount" + }, + "intervalFrequency": { + "type": "string", + "x-go-name": "IntervalFrequency" + }, + "minute": { + "type": "integer", + "format": "int64", + "x-go-name": "Minute" + }, + "startDate": { + "type": "string", + "format": "date-time", + "x-go-name": "StartDate" + }, + "timeZone": { + "type": "string", + "x-go-name": "TimeZone" + }, + "workdaysOnly": { + "type": "boolean", + "x-go-name": "WorkdaysOnly" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "SearchTeamQueryResult": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int64", + "x-go-name": "Page" + }, + "perPage": { + "type": "integer", + "format": "int64", + "x-go-name": "PerPage" + }, + "teams": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamDTO" + }, + "x-go-name": "Teams" + }, + "totalCount": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "SearchUserQueryResult": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int64", + "x-go-name": "Page" + }, + "perPage": { + "type": "integer", + "format": "int64", + "x-go-name": "PerPage" + }, + "totalCount": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/UserSearchHitDTO" + }, + "x-go-name": "Users" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "SetUserRolesCommand": { + "type": "object", + "properties": { + "global": { + "type": "boolean", + "x-go-name": "Global" + }, + "roleUids": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "RoleUIDs" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "SettingsBag": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/setting" + }, + "SettingsDTO": { + "type": "object", + "properties": { + "branding": { + "$ref": "#/definitions/BrandingOptions" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgID" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "State": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "Status": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "x-go-name": "Enabled" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "SuccessResponseBody": { + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/docs/definitions" + }, + "SyncResult": { + "type": "object", + "title": "SyncResult holds the result of a sync with LDAP. This gives us information on which users were updated and how.", + "properties": { + "Elapsed": { + "$ref": "#/definitions/Duration" + }, + "FailedUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/FailedUser" + } + }, + "MissingUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "Started": { + "type": "string", + "format": "date-time" + }, + "UpdatedUserIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/ldapsync" + }, + "TagsDTO": { + "type": "object", + "title": "TagsDTO is the frontend DTO for Tag.", + "properties": { + "count": { + "type": "integer", + "format": "int64", + "x-go-name": "Count" + }, + "tag": { + "type": "string", + "x-go-name": "Tag" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/services/annotations" + }, + "TeamDTO": { + "type": "object", + "properties": { + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "memberCount": { + "type": "integer", + "format": "int64", + "x-go-name": "MemberCount" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "permission": { + "$ref": "#/definitions/PermissionType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TeamGroupDTO": { + "type": "object", + "properties": { + "groupId": { + "type": "string", + "x-go-name": "GroupId" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/teamgroupsync/models" + }, + "TeamGroupMapping": { + "type": "object", + "properties": { + "groupId": { + "type": "string", + "x-go-name": "GroupId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/teamgroupsync/models" + }, + "TeamMemberDTO": { + "type": "object", + "properties": { + "auth_module": { + "type": "string", + "x-go-name": "AuthModule" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Labels" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "permission": { + "$ref": "#/definitions/PermissionType" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TempUserDTO": { + "type": "object", + "properties": { + "code": { + "type": "string", + "x-go-name": "Code" + }, + "createdOn": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "emailSent": { + "type": "boolean", + "x-go-name": "EmailSent" + }, + "emailSentOn": { + "type": "string", + "format": "date-time", + "x-go-name": "EmailSentOn" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "invitedByEmail": { + "type": "string", + "x-go-name": "InvitedByEmail" + }, + "invitedByLogin": { + "type": "string", + "x-go-name": "InvitedByLogin" + }, + "invitedByName": { + "type": "string", + "x-go-name": "InvitedByName" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "role": { + "$ref": "#/definitions/RoleType" + }, + "status": { + "$ref": "#/definitions/TempUserStatus" + }, + "url": { + "type": "string", + "x-go-name": "Url" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TempUserStatus": { + "type": "string", + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TimeRangeDTO": { + "type": "object", + "properties": { + "from": { + "type": "string", + "x-go-name": "From" + }, + "to": { + "type": "string", + "x-go-name": "To" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/report" + }, + "Token": { + "type": "object", + "properties": { + "account": { + "type": "string", + "x-go-name": "Account" + }, + "company": { + "type": "string", + "x-go-name": "Company" + }, + "details_url": { + "type": "string", + "x-go-name": "DetailsUrl" + }, + "exp": { + "type": "integer", + "format": "int64", + "x-go-name": "Expires" + }, + "iat": { + "type": "integer", + "format": "int64", + "x-go-name": "Issued" + }, + "included_admins": { + "type": "integer", + "format": "int64", + "x-go-name": "IncludedAdmins" + }, + "included_users": { + "type": "integer", + "format": "int64", + "x-go-name": "IncludedUsers" + }, + "included_viewers": { + "type": "integer", + "format": "int64", + "x-go-name": "IncludedViewers" + }, + "iss": { + "type": "string", + "x-go-name": "Issuer" + }, + "jti": { + "type": "string", + "x-go-name": "Id" + }, + "lexp": { + "type": "integer", + "format": "int64", + "x-go-name": "LicenseExpires" + }, + "lic_exp_warn_days": { + "type": "integer", + "format": "int64", + "x-go-name": "LicenseExpiresWarnDays" + }, + "lid": { + "type": "string", + "x-go-name": "LicenseId" + }, + "limit_by": { + "type": "string", + "x-go-name": "LimitBy" + }, + "max_concurrent_user_sessions": { + "type": "integer", + "format": "int64", + "x-go-name": "MaxConcurrentUserSessions" + }, + "nbf": { + "type": "integer", + "format": "int64", + "x-go-name": "LicenseIssued" + }, + "prod": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Products" + }, + "slug": { + "type": "string", + "x-go-name": "Slug" + }, + "status": { + "$ref": "#/definitions/TokenStatus" + }, + "sub": { + "type": "string", + "x-go-name": "Subject" + }, + "tok_exp_warn_days": { + "type": "integer", + "format": "int64", + "x-go-name": "TokenExpiresWarnDays" + }, + "update_days": { + "type": "integer", + "format": "int64", + "x-go-name": "UpdateDays" + }, + "usage_billing": { + "type": "boolean", + "x-go-name": "UsageBilling" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "TokenStatus": { + "type": "integer", + "format": "int64", + "x-go-package": "github.com/grafana/grafana/pkg/extensions/licensing" + }, + "TrimDashboardCommand": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/Json" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "TrimDashboardFullWithMeta": { + "type": "object", + "properties": { + "dashboard": { + "$ref": "#/definitions/Json" + }, + "meta": { + "$ref": "#/definitions/Json" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateAlertNotificationCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateAlertNotificationWithUidCommand": { + "type": "object", + "properties": { + "disableResolveMessage": { + "type": "boolean", + "x-go-name": "DisableResolveMessage" + }, + "frequency": { + "type": "string", + "x-go-name": "Frequency" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "secureSettings": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureSettings" + }, + "sendReminder": { + "type": "boolean", + "x-go-name": "SendReminder" + }, + "settings": { + "$ref": "#/definitions/Json" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "NewUid" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateAnnotationsCmd": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "text": { + "type": "string", + "x-go-name": "Text" + }, + "time": { + "type": "integer", + "format": "int64", + "x-go-name": "Time" + }, + "timeEnd": { + "type": "integer", + "format": "int64", + "x-go-name": "TimeEnd" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateDashboardAclCommand": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardAclUpdateItem" + }, + "x-go-name": "Items" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateDataSourceCommand": { + "description": "Also acts as api DTO", + "type": "object", + "properties": { + "access": { + "$ref": "#/definitions/DsAccess" + }, + "basicAuth": { + "type": "boolean", + "x-go-name": "BasicAuth" + }, + "basicAuthPassword": { + "type": "string", + "x-go-name": "BasicAuthPassword" + }, + "basicAuthUser": { + "type": "string", + "x-go-name": "BasicAuthUser" + }, + "database": { + "type": "string", + "x-go-name": "Database" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "jsonData": { + "$ref": "#/definitions/Json" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "password": { + "type": "string", + "x-go-name": "Password" + }, + "secureJsonData": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "SecureJsonData" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "url": { + "type": "string", + "x-go-name": "Url" + }, + "user": { + "type": "string", + "x-go-name": "User" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + }, + "withCredentials": { + "type": "boolean", + "x-go-name": "WithCredentials" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateFolderCommand": { + "type": "object", + "properties": { + "overwrite": { + "type": "boolean", + "x-go-name": "Overwrite" + }, + "title": { + "type": "string", + "x-go-name": "Title" + }, + "uid": { + "type": "string", + "x-go-name": "Uid" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateOrgAddressForm": { + "type": "object", + "properties": { + "address1": { + "type": "string", + "x-go-name": "Address1" + }, + "address2": { + "type": "string", + "x-go-name": "Address2" + }, + "city": { + "type": "string", + "x-go-name": "City" + }, + "country": { + "type": "string", + "x-go-name": "Country" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "zipcode": { + "type": "string", + "x-go-name": "ZipCode" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateOrgForm": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateOrgQuotaCmd": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int64", + "x-go-name": "Limit" + }, + "target": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateOrgUserCommand": { + "type": "object", + "properties": { + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdatePrefsCmd": { + "type": "object", + "properties": { + "homeDashboardId": { + "description": "The numerical :id of a favorited dashboard", + "type": "integer", + "format": "int64", + "default": 0, + "x-go-name": "HomeDashboardID" + }, + "theme": { + "type": "string", + "enum": ["light", "dark"], + "x-go-name": "Theme" + }, + "timezone": { + "type": "string", + "enum": ["utc", "browser"], + "x-go-name": "Timezone" + }, + "weekStart": { + "type": "string", + "x-go-name": "WeekStart" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UpdateRoleCommand": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "global": { + "type": "boolean", + "x-go-name": "Global" + }, + "group": { + "type": "string", + "x-go-name": "Group" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + }, + "x-go-name": "Permissions" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/extensions/accesscontrol" + }, + "UpdateTeamCommand": { + "type": "object", + "properties": { + "Email": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Name": { + "type": "string" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateTeamMemberCommand": { + "type": "object", + "properties": { + "permission": { + "$ref": "#/definitions/PermissionType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateUserCommand": { + "type": "object", + "properties": { + "email": { + "type": "string", + "x-go-name": "Email" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UpdateUserQuotaCmd": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int64", + "x-go-name": "Limit" + }, + "target": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserIdDTO": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "message": { + "type": "string", + "x-go-name": "Message" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserLookupDTO": { + "type": "object", + "properties": { + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarURL" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "userId": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/api/dtos" + }, + "UserOrgDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "role": { + "$ref": "#/definitions/RoleType" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserProfileDTO": { + "type": "object", + "properties": { + "accessControl": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "x-go-name": "AccessControl" + }, + "authLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "AuthLabels" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isDisabled": { + "type": "boolean", + "x-go-name": "IsDisabled" + }, + "isExternal": { + "type": "boolean", + "x-go-name": "IsExternal" + }, + "isGrafanaAdmin": { + "type": "boolean", + "x-go-name": "IsGrafanaAdmin" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "orgId": { + "type": "integer", + "format": "int64", + "x-go-name": "OrgId" + }, + "theme": { + "type": "string", + "x-go-name": "Theme" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserQuotaDTO": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int64", + "x-go-name": "Limit" + }, + "target": { + "type": "string", + "x-go-name": "Target" + }, + "used": { + "type": "integer", + "format": "int64", + "x-go-name": "Used" + }, + "user_id": { + "type": "integer", + "format": "int64", + "x-go-name": "UserId" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserSearchHitDTO": { + "type": "object", + "properties": { + "authLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "AuthLabels" + }, + "avatarUrl": { + "type": "string", + "x-go-name": "AvatarUrl" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "Id" + }, + "isAdmin": { + "type": "boolean", + "x-go-name": "IsAdmin" + }, + "isDisabled": { + "type": "boolean", + "x-go-name": "IsDisabled" + }, + "lastSeenAt": { + "type": "string", + "format": "date-time", + "x-go-name": "LastSeenAt" + }, + "lastSeenAtAge": { + "type": "string", + "x-go-name": "LastSeenAtAge" + }, + "login": { + "type": "string", + "x-go-name": "Login" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + }, + "UserToken": { + "description": "UserToken represents a user token", + "type": "object", + "properties": { + "AuthToken": { + "type": "string" + }, + "AuthTokenSeen": { + "type": "boolean" + }, + "ClientIp": { + "type": "string" + }, + "CreatedAt": { + "type": "integer", + "format": "int64" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "PrevAuthToken": { + "type": "string" + }, + "RevokedAt": { + "type": "integer", + "format": "int64" + }, + "RotatedAt": { + "type": "integer", + "format": "int64" + }, + "SeenAt": { + "type": "integer", + "format": "int64" + }, + "UnhashedToken": { + "type": "string" + }, + "UpdatedAt": { + "type": "integer", + "format": "int64" + }, + "UserAgent": { + "type": "string" + }, + "UserId": { + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/grafana/grafana/pkg/models" + } + }, + "responses": { + "SMTPNotEnabledError": { + "description": "" + }, + "acceptedResponse": { + "description": "AcceptedResponse", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "addOrgUser": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the added user.", + "type": "integer", + "format": "int64", + "x-go-name": "UsedID", + "example": 65 + }, + "message": { + "description": "Message Message of the added user.", + "type": "string", + "x-go-name": "Message", + "example": "Data source added" + } + } + } + }, + "badRequestError": { + "description": "BadRequestError is returned when the request is invalid and it cannot be processed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "conflictError": { + "description": "ConflictError", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "contentResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, + "createAnnotationResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the created annotation.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the created annotation.", + "type": "string", + "x-go-name": "Message" + } + } + } + }, + "createOrUpdateDatasourceResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "name", "message", "datasource"], + "properties": { + "datasource": { + "$ref": "#/definitions/DataSource" + }, + "id": { + "description": "ID Identifier of the new data source.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted dashboard.", + "type": "string", + "x-go-name": "Message", + "example": "Data source added" + }, + "name": { + "description": "Name of the new data source.", + "type": "string", + "x-go-name": "Name", + "example": "My Data source" + } + } + } + }, + "createOrgResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["orgId", "message"], + "properties": { + "message": { + "description": "Message Message of the created org.", + "type": "string", + "x-go-name": "Message", + "example": "Data source added" + }, + "orgId": { + "description": "ID Identifier of the created org.", + "type": "integer", + "format": "int64", + "x-go-name": "OrgID", + "example": 65 + } + } + } + }, + "createReportResponse": { + "description": "", + "schema": { + "type": "object" + } + }, + "createSnapshotResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "deleteKey": { + "description": "Unique key used to delete the snapshot. It is different from the key so that only the creator can delete the snapshot.", + "type": "string", + "x-go-name": "DeleteKey" + }, + "deleteUrl": { + "type": "string", + "x-go-name": "DeleteUrl" + }, + "id": { + "description": "Snapshot id", + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "key": { + "description": "Unique key", + "type": "string", + "x-go-name": "Key" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + } + } + }, + "createTeamResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "x-go-name": "Message" + }, + "teamId": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamId" + } + } + } + }, + "createUserResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/UserIdDTO" + } + }, + "dashboardDiffResponse": { + "description": "Calculate dashboard diff response.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, + "dashboardResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DashboardFullWithMeta" + } + }, + "dashboardVersionResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DashboardVersionMeta" + } + }, + "dashboardVersionsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardVersionDTO" + } + } + }, + "dashboardsTagsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardTagCloudItem" + } + } + }, + "deleteAlertNotificationChannelResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted notification channel.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted notificatiton channel.", + "type": "string", + "x-go-name": "Message" + } + } + } + }, + "deleteDashboardResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "title", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted dashboard.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted dashboard.", + "type": "string", + "x-go-name": "Message", + "example": "Dashboard My Dashboard deleted" + }, + "title": { + "description": "Title Title of the deleted dashboard.", + "type": "string", + "x-go-name": "Title", + "example": "My Dashboard" + } + } + } + }, + "deleteDatasourceByNameResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted data source.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted dashboard.", + "type": "string", + "x-go-name": "Message", + "example": "Dashboard My Dashboard deleted" + } + } + } + }, + "deleteFolderResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id", "title", "message"], + "properties": { + "id": { + "description": "ID Identifier of the deleted folder.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + }, + "message": { + "description": "Message Message of the deleted folder.", + "type": "string", + "x-go-name": "Message", + "example": "Folder My Folder deleted" + }, + "title": { + "description": "Title of the deleted folder.", + "type": "string", + "x-go-name": "Title", + "example": "My Folder" + } + } + } + }, + "folderResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Folder" + } + }, + "forbiddenError": { + "description": "ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "genericError": { + "description": "A GenericError is the default error message that is generated.\nFor certain status codes there are more appropriate error structures.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "getAPIkeyResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ApiKeyDTO" + } + } + }, + "getAccessControlStatusResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Status" + } + }, + "getAlertNotificationChannelResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AlertNotification" + } + }, + "getAlertNotificationChannelsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertNotification" + } + } + }, + "getAlertResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Alert" + } + } + }, + "getAlertsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertListItemDTO" + } + } + }, + "getAllRolesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + }, + "getAnnotationTagsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/GetAnnotationTagsResponse" + } + }, + "getAnnotationsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ItemDTO" + } + } + }, + "getAuthTokensResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserToken" + } + } + }, + "getCustomPermissionsReportResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomPermissionsRecordDTO" + } + } + }, + "getDashboardPermissionsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardAclInfoDTO" + } + } + }, + "getDashboardStatesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertStateInfoDTO" + } + } + }, + "getDatasourceIDresponse": { + "description": "", + "schema": { + "type": "object", + "required": ["id"], + "properties": { + "id": { + "description": "ID Identifier of the data source.", + "type": "integer", + "format": "int64", + "x-go-name": "ID", + "example": 65 + } + } + } + }, + "getDatasourceResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DataSource" + } + }, + "getDatasourcesResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DataSourceList" + } + }, + "getFoldersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/FolderSearchHit" + } + } + }, + "getHomeDashboardResponse": { + "description": "Home dashboard response.", + "schema": { + "$ref": "#/definitions/GetHomeDashboardResponse" + } + }, + "getInvitesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TempUserDTO" + } + } + }, + "getLDAPSyncStatusResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ActiveSyncStatusDTO" + } + }, + "getLibraryElementConnectionsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/LibraryElementConnectionsResponse" + } + }, + "getLibraryElementResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/LibraryElementResponse" + } + }, + "getLibraryElementsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/LibraryElementSearchResponse" + } + }, + "getLicenseStatusResponse": { + "description": "" + }, + "getLicenseTokenResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Token" + } + }, + "getOrgResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/OrgDetailsDTO" + } + }, + "getOrgUsersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/OrgUserDTO" + } + } + }, + "getPermissionseResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AddPermissionDTO" + } + }, + "getPreferencesResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/Prefs" + } + }, + "getQuotaResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserQuotaDTO" + } + } + }, + "getReportResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ConfigDTO" + } + }, + "getReportSettingsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SettingsDTO" + } + }, + "getReportsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigDTO" + } + } + }, + "getRoleResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RoleDTO" + } + }, + "getSettingsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SettingsBag" + } + }, + "getSnapshotSharingOptionsResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "externalEnabled": { + "type": "boolean", + "x-go-name": "ExternalEnabled" + }, + "externalSnapshotName": { + "type": "string", + "x-go-name": "ExternalSnapshotName" + }, + "externalSnapshotURL": { + "type": "string", + "x-go-name": "ExternalSnapshotURL" + } + } + } + }, + "getSnapshotsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DashboardSnapshotDTO" + } + } + }, + "getStatsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AdminStats" + } + }, + "getTeamGroupsApiResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamGroupDTO" + } + } + }, + "getTeamMembersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamMemberDTO" + } + } + }, + "getTeamResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/TeamDTO" + } + }, + "getUserOrgListResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserOrgDTO" + } + } + }, + "getUserTeamsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamDTO" + } + } + }, + "helpFlagResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "helpFlags1": { + "type": "integer", + "format": "int64", + "x-go-name": "HelpFlags1" + }, + "message": { + "type": "string", + "x-go-name": "Message" + } + } + } + }, + "importDashboardResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ImportDashboardResponse" + } + }, + "internalServerError": { + "description": "InternalServerError is a general error indicating something went wrong internally.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "listBuiltinRolesResponse": { + "description": "", + "schema": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleDTO" + } + } + } + }, + "listRecordingRulesResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/RecordingRuleJSON" + } + } + }, + "lookupAlertNotificationChannelsResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/AlertNotificationLookup" + } + } + }, + "lookupOrgUsersResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/UserLookupDTO" + } + } + }, + "notFoundError": { + "description": "NotFoundError is returned when the requested resource was not found.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "okResponse": { + "description": "An OKResponse is returned if the request was successful.", + "schema": { + "$ref": "#/definitions/SuccessResponseBody" + } + }, + "pauseAlertResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["alertId", "message"], + "properties": { + "alertId": { + "type": "integer", + "format": "int64", + "x-go-name": "AlertID" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "state": { + "description": "Alert result state\nrequired true", + "type": "string", + "x-go-name": "State" + } + } + } + }, + "pauseAlertsResponse": { + "description": "", + "schema": { + "type": "object", + "required": ["alertsAffected", "message"], + "properties": { + "alertsAffected": { + "description": "AlertsAffected is the number of the affected alerts.", + "type": "integer", + "format": "int64", + "x-go-name": "AlertsAffected" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "state": { + "description": "Alert result state\nrequired true", + "type": "string", + "x-go-name": "State" + } + } + } + }, + "postAPIkeyResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/NewApiKeyResult" + } + }, + "postDashboardResponse": { + "description": "Create/update dashboard response.", + "schema": { + "type": "object", + "required": ["status", "title", "version", "id", "uid", "url"], + "properties": { + "id": { + "description": "ID The unique identifier (id) of the created/updated dashboard.", + "type": "string", + "x-go-name": "ID", + "example": "1" + }, + "status": { + "description": "Status status of the response.", + "type": "string", + "x-go-name": "Status", + "example": "success" + }, + "title": { + "description": "Slug The slug of the dashboard.", + "type": "string", + "x-go-name": "Slug", + "example": "my-dashboard" + }, + "uid": { + "description": "UID The unique identifier (uid) of the created/updated dashboard.", + "type": "string", + "x-go-name": "UID", + "example": "nHz3SXiiz" + }, + "url": { + "description": "URL The relative URL for accessing the created/updated dashboard.", + "type": "string", + "x-go-name": "URL", + "example": "/d/nHz3SXiiz/my-dashboard" + }, + "version": { + "description": "Version The version of the dashboard.", + "type": "integer", + "format": "int64", + "x-go-name": "Verion", + "example": 2 + } + } + } + }, + "postRenewLicenseTokenResponse": { + "description": "" + }, + "preconditionFailedError": { + "description": "PreconditionFailedError", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "queryDataResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/QueryDataResponse" + } + }, + "queryDatasourceResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/DataResponse" + } + }, + "recordingRuleResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/RecordingRuleJSON" + } + }, + "recordingRuleWriteTargetResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/PrometheusRemoteWriteTargetJSON" + } + }, + "refreshLicenseStatsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ActiveUserStats" + } + }, + "searchOrgResponse": { + "description": "", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/OrgDTO" + } + } + }, + "searchResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/HitList" + } + }, + "searchSortingResponse": { + "description": "", + "schema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "displayName": { + "type": "string", + "x-go-name": "DisplayName" + }, + "meta": { + "type": "string", + "x-go-name": "Meta" + }, + "name": { + "type": "string", + "x-go-name": "Name" + } + } + } + }, + "searchTeamsResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SearchTeamQueryResult" + } + }, + "searchUsersResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/SearchUserQueryResult" + } + }, + "snapshotResponse": { + "description": "" + }, + "testAlertResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/AlertTestResult" + } + }, + "trimDashboardResponse": { + "description": "Trimmed dashboard response.", + "schema": { + "$ref": "#/definitions/TrimDashboardFullWithMeta" + } + }, + "unauthorisedError": { + "description": "UnauthorizedError is returned when the request is not authenticated.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "unprocessableEntityError": { + "description": "UnprocessableEntityError", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + }, + "userResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/UserProfileDTO" + } + } + }, + "securityDefinitions": { + "api_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + }, + "basic": { + "type": "basic" + } + }, + "security": [ + { + "basic": [] + }, + { + "api_key": [] + } + ], + "tags": [ + { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "datasources" + }, + { + "description": "Folders are identified by the identifier (id) and the unique identifier (uid).\nThe identifier (id) of a folder is an auto-incrementing numeric value and is only unique per Grafana install.\nThe unique identifier (uid) of a folder can be used for uniquely identify folders between multiple Grafana installs. It’s automatically generated if not provided when creating a folder. The uid allows having consistent URLs for accessing folders and when syncing folders between multiple Grafana installs. This means that changing the title of a folder will not break any bookmarked links to that folder.\nThe uid can have a maximum length of 40 characters.\n\nThe General folder (id=0) is special and is not part of the Folder API which means that you cannot use this API for retrieving information about the General folder.", + "name": "folders" + }, + { + "description": "Permissions with `folderId=-1` are the default permissions for users with the Viewer and Editor roles. Permissions can be set for a user, a team or a role (Viewer or Editor). Permissions cannot be set for Admins - they always have access to everything.", + "name": "folder_permissions" + }, + { + "description": "The Admin HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission. (The default admin user is called admin and has permission to use this API.)", + "name": "admin" + }, + { + "description": "You can use the Alerting API to get information about legacy dashboard alerts and their states but this API cannot be used to modify the alert. To create new alerts or modify them you need to update the dashboard JSON that contains the alerts.\nThis topic is relevant for the legacy dashboard alerts only.\nYou can find Grafana 8 alerts API specification details [here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/grafana/grafana/main/pkg/services/ngalert/api/tooling/post.json).", + "name": "legacy_alerts" + }, + { + "description": "The identifier (id) of a notification channel is an auto-incrementing numeric value and is only unique per Grafana install.\nThe unique identifier (uid) of a notification channel can be used for uniquely identify a notification channel between multiple Grafana installs. It’s automatically generated if not provided when creating a notification channel. The uid allows having consistent URLs for accessing notification channels and when syncing notification channels between multiple Grafana installations, refer to alert notification channel provisioning.\nThe uid can have a maximum length of 40 characters.", + "name": "legacy_alerts_notification_channels" + }, + { + "description": "Grafana Annotations feature released in Grafana 4.6. Annotations are saved in the Grafana database (sqlite, mysql or postgres). Annotations can be global annotations that can be shown on any dashboard by configuring an annotation data source - they are filtered by tags. Or they can be tied to a panel on a dashboard and are then only shown on that panel.", + "name": "annotations" + }, + { + "description": "The identifier (ID) of a library element is an auto-incrementing numeric value that is unique per Grafana install.\nThe unique identifier (UID) of a library element uniquely identifies library elements between multiple Grafana installs. It’s automatically generated unless you specify it during library element creation. The UID provides consistent URLs for accessing library elements and when syncing library elements between multiple Grafana installs.\nThe maximum length of a UID is 40 characters.", + "name": "library_elements" + }, + { + "description": "The Admin Organizations HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission (The default admin user is called `admin` and has permission to use this API).", + "name": "orgs" + }, + { + "description": "If you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "current_org_details" + }, + { + "description": "This API can be used to create/update/delete Teams and to add/remove users to Teams. All actions require that the user has the Admin role for the organization.", + "name": "teams" + }, + { + "description": "This API can be used to enable, disable, list, add and remove permissions for a data source.\nPermissions can be set for a user or a team. Permissions cannot be set for Admins - they always have access to everything.\nThis is only available in Grafana Enterprise\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "datasource_permissions" + }, + { + "description": "These are only available in Grafana Enterprise", + "name": "enterprise" + }, + { + "description": "The API can be used to create, update, get and list roles, and create or remove built-in role assignments. To use the API, you would need to enable fine-grained access control.\nThis only available in Grafana Enterprise.\nThe API does not currently work with an API Token. So in order to use these API endpoints you will have to use Basic auth.", + "name": "access_control" + }, + { + "description": "Licensing is only available in Grafana Enterprise. Read more about Grafana Enterprise.\nIf you are running Grafana Enterprise and have Fine-grained access control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "licensing" + }, + { + "description": "This API allows you to interact programmatically with the Reporting feature.\nReporting is only available in Grafana Enterprise. Read more about Grafana Enterprise.\nIf you have Fine-grained access Control enabled, for some endpoints you would need to have relevant permissions. Refer to specific resources to understand what permissions are required.", + "name": "reports" + }, + { + "description": "Grafana Alerting Alertmanager-compatible endpoints", + "name": "alertmanager" + }, + { + "description": "Grafana Alerting endpoints for managing rules", + "name": "ruler" + }, + { + "description": "Grafana Alerting testing endpoints", + "name": "testing" + }, + { + "description": "Grafana Alerting Prometheus-compatible endpoints", + "name": "prometheus" + } + ] +} diff --git a/public/views/swagger.html b/public/views/swagger.html new file mode 100644 index 00000000000..c12cc817aca --- /dev/null +++ b/public/views/swagger.html @@ -0,0 +1,63 @@ + + + + + + Swagger UI + + + + + + + +
+ + + + + +