|
Some checks failed
Backend Code Checks / Detect whether code changed (push) Has been cancelled
Backend Unit Tests / Detect whether code changed (push) Has been cancelled
Build Go (matrix) / darwin/amd64 (push) Has been cancelled
Build Go (matrix) / linux/amd64 (push) Has been cancelled
Build Go (matrix) / linux/armv6 (push) Has been cancelled
Build Go (matrix) / linux/armv7 (push) Has been cancelled
Build Go (matrix) / darwin/arm64 (push) Has been cancelled
Build Go (matrix) / linux/arm64 (push) Has been cancelled
Build Go (matrix) / windows/arm64 (push) Has been cancelled
Build Go (matrix) / linux/s390x (push) Has been cancelled
Build Go (matrix) / darwin/amd64 (enterprise) (push) Has been cancelled
Build Go (matrix) / linux/amd64 (enterprise) (push) Has been cancelled
Build Go (matrix) / linux/armv6 (enterprise) (push) Has been cancelled
Build Go (matrix) / linux/armv7 (enterprise) (push) Has been cancelled
Build Go (matrix) / darwin/arm64 (enterprise) (push) Has been cancelled
Build Go (matrix) / linux/arm64 (enterprise) (push) Has been cancelled
Build Go (matrix) / windows/arm64 (enterprise) (push) Has been cancelled
Build Go (matrix) / linux/s390x (enterprise) (push) Has been cancelled
Build Go (matrix) / verify rpm stig (linux/amd64) (push) Has been cancelled
Lint Frontend / Detect whether code changed (push) Has been cancelled
Lint Frontend / Verify API clients (push) Has been cancelled
Lint Frontend / Verify OpenAPI specs (push) Has been cancelled
Lint Frontend / Verify API clients (enterprise) (push) Has been cancelled
golangci-lint / Detect whether code changed (push) Has been cancelled
govulncheck / govulncheck (push) Has been cancelled
Verify i18n / verify-i18n (push) Has been cancelled
End-to-end tests / Detect whether code changed (push) Has been cancelled
End-to-end tests / Publish metrics (push) Has been cancelled
Frontend tests / Detect whether code changed (push) Has been cancelled
Integration Tests (pgvector) / pgvector (push) Has been cancelled
Integration Tests / Detect whether code changed (push) Has been cancelled
Integration Tests / Sqlite (1/4) (push) Has been cancelled
Integration Tests / Sqlite (2/4) (push) Has been cancelled
Integration Tests / Sqlite (3/4) (push) Has been cancelled
Integration Tests / Sqlite (4/4) (push) Has been cancelled
Integration Tests / MySQL (1/16) (push) Has been cancelled
Integration Tests / MySQL (10/16) (push) Has been cancelled
Integration Tests / MySQL (11/16) (push) Has been cancelled
Integration Tests / MySQL (12/16) (push) Has been cancelled
Integration Tests / MySQL (13/16) (push) Has been cancelled
Integration Tests / MySQL (14/16) (push) Has been cancelled
Integration Tests / MySQL (15/16) (push) Has been cancelled
Integration Tests / MySQL (16/16) (push) Has been cancelled
Integration Tests / MySQL (2/16) (push) Has been cancelled
Integration Tests / MySQL (3/16) (push) Has been cancelled
Integration Tests / MySQL (4/16) (push) Has been cancelled
Integration Tests / MySQL (5/16) (push) Has been cancelled
Integration Tests / MySQL (6/16) (push) Has been cancelled
Integration Tests / MySQL (7/16) (push) Has been cancelled
Integration Tests / MySQL (8/16) (push) Has been cancelled
Integration Tests / MySQL (9/16) (push) Has been cancelled
Integration Tests / Postgres (1/16) (push) Has been cancelled
Integration Tests / Postgres (10/16) (push) Has been cancelled
Integration Tests / Postgres (11/16) (push) Has been cancelled
Integration Tests / Postgres (12/16) (push) Has been cancelled
Integration Tests / Postgres (13/16) (push) Has been cancelled
Integration Tests / Postgres (14/16) (push) Has been cancelled
Integration Tests / Postgres (15/16) (push) Has been cancelled
Integration Tests / Postgres (16/16) (push) Has been cancelled
Integration Tests / Postgres (2/16) (push) Has been cancelled
Integration Tests / Postgres (3/16) (push) Has been cancelled
Integration Tests / Postgres (4/16) (push) Has been cancelled
Integration Tests / Postgres (5/16) (push) Has been cancelled
Integration Tests / Postgres (6/16) (push) Has been cancelled
Integration Tests / Postgres (7/16) (push) Has been cancelled
Integration Tests / Postgres (8/16) (push) Has been cancelled
Integration Tests / Postgres (9/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (1/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (10/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (11/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (12/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (13/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (14/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (15/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (16/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (2/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (3/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (4/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (5/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (6/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (7/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (8/16) (push) Has been cancelled
Integration Tests / Sqlite Enterprise (9/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (1/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (10/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (11/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (12/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (13/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (14/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (15/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (16/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (2/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (3/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (4/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (5/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (6/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (7/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (8/16) (push) Has been cancelled
Integration Tests / MySQL Enterprise (9/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (1/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (10/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (11/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (12/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (13/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (14/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (15/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (16/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (2/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (3/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (4/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (5/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (6/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (7/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (8/16) (push) Has been cancelled
Integration Tests / Postgres Enterprise (9/16) (push) Has been cancelled
Reject GitHub secrets / reject-gh-secrets (push) Has been cancelled
Build Release Packages / setup (push) Has been cancelled
Run dashboard schema v2 e2e / dashboard-schema-v2-e2e (push) Has been cancelled
Shellcheck / Shellcheck scripts (push) Has been cancelled
Run Storybook a11y tests / Detect whether code changed (push) Has been cancelled
Swagger generated code / Detect whether code changed (push) Has been cancelled
Dispatch sync to mirror / dispatch-job (push) Has been cancelled
Backend Code Checks / Validate Backend Configs (push) Has been cancelled
Backend Unit Tests / Grafana (1/8) (push) Has been cancelled
Backend Unit Tests / Grafana (2/8) (push) Has been cancelled
Backend Unit Tests / Grafana (3/8) (push) Has been cancelled
Backend Unit Tests / Grafana (4/8) (push) Has been cancelled
Backend Unit Tests / Grafana (5/8) (push) Has been cancelled
Backend Unit Tests / Grafana (6/8) (push) Has been cancelled
Backend Unit Tests / Grafana (7/8) (push) Has been cancelled
Backend Unit Tests / Grafana (8/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (1/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (2/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (3/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (4/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (5/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (6/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (7/8) (push) Has been cancelled
Backend Unit Tests / Grafana Enterprise (8/8) (push) Has been cancelled
Backend Unit Tests / All backend unit tests complete (push) Has been cancelled
Lint Frontend / Lint (push) Has been cancelled
Lint Frontend / Typecheck (push) Has been cancelled
Lint Frontend / Typecheck (TSGO/TS7) (push) Has been cancelled
Lint Frontend / Verify packed frontend packages (push) Has been cancelled
Lint Frontend / Check circular dependencies (push) Has been cancelled
Lint Frontend / Validate yarn install (push) Has been cancelled
golangci-lint / go-fmt (push) Has been cancelled
golangci-lint / lint-go (push) Has been cancelled
End-to-end tests / Build backend (push) Has been cancelled
End-to-end tests / Build frontend (push) Has been cancelled
End-to-end tests / Verify Storybook (Playwright) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (1/8) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (2/8) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (3/8) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (4/8) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (5/8) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (6/8) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (7/8) (push) Has been cancelled
End-to-end tests / Playwright E2E tests (8/8) (push) Has been cancelled
End-to-end tests / All Playwright tests complete (push) Has been cancelled
End-to-end tests / Report Playwright benchmarks (push) Has been cancelled
End-to-end tests / All E2E tests complete (push) Has been cancelled
Frontend tests / Generate golden files (push) Has been cancelled
Frontend tests / Unit tests (1 / 16) (push) Has been cancelled
Frontend tests / Unit tests (10 / 16) (push) Has been cancelled
Frontend tests / Unit tests (11 / 16) (push) Has been cancelled
Frontend tests / Unit tests (12 / 16) (push) Has been cancelled
Frontend tests / Unit tests (13 / 16) (push) Has been cancelled
Frontend tests / Unit tests (14 / 16) (push) Has been cancelled
Frontend tests / Unit tests (15 / 16) (push) Has been cancelled
Frontend tests / Unit tests (16 / 16) (push) Has been cancelled
Frontend tests / Unit tests (2 / 16) (push) Has been cancelled
Frontend tests / Unit tests (3 / 16) (push) Has been cancelled
Frontend tests / Unit tests (4 / 16) (push) Has been cancelled
Frontend tests / Unit tests (5 / 16) (push) Has been cancelled
Frontend tests / Unit tests (6 / 16) (push) Has been cancelled
Frontend tests / Unit tests (7 / 16) (push) Has been cancelled
Frontend tests / Unit tests (8 / 16) (push) Has been cancelled
Frontend tests / Unit tests (9 / 16) (push) Has been cancelled
Frontend tests / Decoupled plugin tests (push) Has been cancelled
Frontend tests / Packages unit tests (push) Has been cancelled
Frontend tests / All frontend unit tests complete (push) Has been cancelled
Frontend tests / Devenv frontend-service build (push) Has been cancelled
Build Release Packages / Dispatch grafana-enterprise build (push) Has been cancelled
Build Release Packages / build frontend (push) Has been cancelled
Build Release Packages / build backend / darwin-amd64 (push) Has been cancelled
Build Release Packages / build backend / linux-amd64 (push) Has been cancelled
Build Release Packages / build backend / windows-amd64 (push) Has been cancelled
Build Release Packages / build backend / linux-armv6 (push) Has been cancelled
Build Release Packages / build backend / linux-armv7 (push) Has been cancelled
Build Release Packages / build backend / darwin-arm64 (push) Has been cancelled
Build Release Packages / build backend / linux-arm64 (push) Has been cancelled
Build Release Packages / build backend / windows-arm64 (push) Has been cancelled
Build Release Packages / build backend / linux-s390x (push) Has been cancelled
Build Release Packages / build backend / linux-riscv64 (push) Has been cancelled
Build Release Packages / targz / darwin-amd64 (push) Has been cancelled
Build Release Packages / targz / linux-amd64 (push) Has been cancelled
Build Release Packages / targz / windows-amd64 (push) Has been cancelled
Build Release Packages / targz / linux-armv6 (push) Has been cancelled
Build Release Packages / targz / linux-armv7 (push) Has been cancelled
Build Release Packages / targz / darwin-arm64 (push) Has been cancelled
Build Release Packages / targz / linux-arm64 (push) Has been cancelled
Build Release Packages / targz / windows-arm64 (push) Has been cancelled
Build Release Packages / targz / linux-s390x (push) Has been cancelled
Build Release Packages / targz / linux-riscv64 (push) Has been cancelled
Build Release Packages / deb / rpm / linux-amd64 (push) Has been cancelled
Build Release Packages / deb / rpm / linux-armv6 (push) Has been cancelled
Build Release Packages / deb / rpm / linux-armv7 (push) Has been cancelled
Build Release Packages / deb / rpm / linux-arm64 (push) Has been cancelled
Build Release Packages / deb / rpm / linux-s390x (push) Has been cancelled
Build Release Packages / deb / rpm / linux-riscv64 (push) Has been cancelled
Build Release Packages / verify rpm stig (linux-amd64) (push) Has been cancelled
Build Release Packages / docker / linux-amd64 (push) Has been cancelled
Build Release Packages / docker / linux-arm64 (push) Has been cancelled
Build Release Packages / docker / linux-s390x (push) Has been cancelled
Build Release Packages / docker / linux-armv7 (push) Has been cancelled
Build Release Packages / verify targz (linux-amd64) (push) Has been cancelled
Build Release Packages / verify packages (linux-amd64) (push) Has been cancelled
Build Release Packages / / windows / windows-amd64 (push) Has been cancelled
Build Release Packages / / windows / windows-arm64 (push) Has been cancelled
Build Release Packages / Upload targz / darwin-amd64 (push) Has been cancelled
Build Release Packages / Upload targz / darwin-arm64 (push) Has been cancelled
Build Release Packages / Upload targz / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload targz / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload targz / linux-armv6 (push) Has been cancelled
Build Release Packages / Upload targz / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload targz / linux-s390x (push) Has been cancelled
Build Release Packages / Upload targz / linux-riscv64 (push) Has been cancelled
Build Release Packages / Upload targz / windows-amd64 (push) Has been cancelled
Build Release Packages / Upload targz / windows-arm64 (push) Has been cancelled
Build Release Packages / Upload deb/rpm / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload deb/rpm / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload deb/rpm / linux-armv6 (push) Has been cancelled
Build Release Packages / Upload deb/rpm / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload deb/rpm / linux-s390x (push) Has been cancelled
Build Release Packages / Upload deb/rpm / linux-riscv64 (push) Has been cancelled
Build Release Packages / Upload docker (alpine) / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload docker (alpine) / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload docker (alpine) / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload docker (alpine) / linux-s390x (push) Has been cancelled
Build Release Packages / Upload docker (alpine-slim) / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload docker (alpine-slim) / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload docker (alpine-slim) / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload docker (alpine-slim) / linux-s390x (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu) / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu) / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu) / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu) / linux-s390x (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu-slim) / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu-slim) / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu-slim) / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload docker (ubuntu-slim) / linux-s390x (push) Has been cancelled
Build Release Packages / Upload docker (distroless) / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload docker (distroless) / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload docker (distroless) / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload docker (distroless) / linux-s390x (push) Has been cancelled
Build Release Packages / Upload docker (distroless-slim) / linux-amd64 (push) Has been cancelled
Build Release Packages / Upload docker (distroless-slim) / linux-arm64 (push) Has been cancelled
Build Release Packages / Upload docker (distroless-slim) / linux-armv7 (push) Has been cancelled
Build Release Packages / Upload docker (distroless-slim) / linux-s390x (push) Has been cancelled
Build Release Packages / Upload windows / windows-amd64 (push) Has been cancelled
Build Release Packages / Upload windows / windows-arm64 (push) Has been cancelled
Build Release Packages / publish-dockerhub (artifacts-docker, , artifacts-docker-alpine-slim, -slim, alpine) (push) Has been cancelled
Build Release Packages / publish-dockerhub (artifacts-docker-distroless, -distroless, artifacts-docker-distroless-slim, -distroless-slim, distroless) (push) Has been cancelled
Build Release Packages / publish-dockerhub (artifacts-docker-ubuntu, -ubuntu, artifacts-docker-ubuntu-slim, -ubuntu-slim, ubuntu) (push) Has been cancelled
Build Release Packages / Run Meticulous tests (push) Has been cancelled
Build Release Packages / Dispatch publish NPM canaries (push) Has been cancelled
Build Release Packages / notify-pr (push) Has been cancelled
Run Storybook a11y tests / Run Storybook a11y tests (dark theme) (push) Has been cancelled
Run Storybook a11y tests / Run Storybook a11y tests (deut_prot_dark theme) (push) Has been cancelled
Run Storybook a11y tests / Run Storybook a11y tests (deut_prot_light theme) (push) Has been cancelled
Run Storybook a11y tests / Run Storybook a11y tests (light theme) (push) Has been cancelled
Run Storybook a11y tests / Run Storybook a11y tests (tritanopia_dark theme) (push) Has been cancelled
Run Storybook a11y tests / Run Storybook a11y tests (tritanopia_light theme) (push) Has been cancelled
Run Storybook a11y tests / Storybook a11y tests (push) Has been cancelled
Swagger generated code / Verify committed API specs match (push) Has been cancelled
|
||
|---|---|---|
| .. | ||
| apierrors | ||
| avatar | ||
| datasource | ||
| dtos | ||
| frontendlogging | ||
| pluginproxy | ||
| response | ||
| routing | ||
| static | ||
| webassets | ||
| accesscontrol.go | ||
| admin.go | ||
| admin_encryption.go | ||
| admin_provisioning.go | ||
| admin_provisioning_test.go | ||
| admin_test.go | ||
| admin_users.go | ||
| admin_users_test.go | ||
| alerting.go | ||
| annotations.go | ||
| annotations_test.go | ||
| api.go | ||
| api_test.go | ||
| basic_auth.go | ||
| basic_auth_test.go | ||
| common_test.go | ||
| dashboard.go | ||
| dashboard_permission.go | ||
| dashboard_permission_test.go | ||
| dashboard_snapshot.go | ||
| dashboard_snapshot_test.go | ||
| dashboard_test.go | ||
| dataproxy.go | ||
| datasources.go | ||
| datasources_k8s.go | ||
| datasources_k8s_test.go | ||
| datasources_test.go | ||
| ds_query.go | ||
| ds_query_test.go | ||
| fakes.go | ||
| folder.go | ||
| folder_bench_test.go | ||
| folder_permission.go | ||
| folder_permission_test.go | ||
| folder_test.go | ||
| frontend_logging.go | ||
| frontend_logging_test.go | ||
| frontend_metrics.go | ||
| frontendsettings.go | ||
| frontendsettings_test.go | ||
| grafana_com_proxy.go | ||
| health.go | ||
| health_test.go | ||
| http_server.go | ||
| http_server_test.go | ||
| index.go | ||
| live_test.go | ||
| login.go | ||
| login_oauth.go | ||
| login_oauth_test.go | ||
| login_test.go | ||
| org.go | ||
| org_invite.go | ||
| org_invite_test.go | ||
| org_test.go | ||
| org_users.go | ||
| org_users_test.go | ||
| password.go | ||
| playlist.go | ||
| plugin_checks.go | ||
| plugin_checks_test.go | ||
| plugin_dashboards.go | ||
| plugin_dashboards_test.go | ||
| plugin_metrics.go | ||
| plugin_metrics_test.go | ||
| plugin_proxy.go | ||
| plugin_proxy_test.go | ||
| plugin_resource.go | ||
| plugin_resource_test.go | ||
| plugins.go | ||
| plugins_test.go | ||
| preferences.go | ||
| preferences_test.go | ||
| quota.go | ||
| quota_test.go | ||
| README.md | ||
| render.go | ||
| search.go | ||
| short_url.go | ||
| short_url_k8s_test.go | ||
| short_url_test.go | ||
| signup.go | ||
| swagger.go | ||
| swagger_responses.go | ||
| swagger_tags.json | ||
| user.go | ||
| user_test.go | ||
| user_token.go | ||
| user_token_test.go | ||
| utils.go | ||
OpenAPI specifications
Since version 8.4, HTTP API details are specified using OpenAPI v2. Starting from version 9.1, there is also an OpenAPI v3 specification (generated by the v2 one using this script).
OpenAPI annotations
The OpenAPI v2 specification is generated automatically from the annotated Go code using go-swagger which scans the source code for annotation rules. Refer to this getting started guide for getting familiar with the toolkit.
Developers modifying the HTTP API endpoints need to make sure to add the necessary annotations so that their changes are reflected into the generated specifications.
Example of endpoint annotation
The following route defines a PATCH endpoint under the /serviceaccounts/{serviceAccountId} path with tag service_accounts (used for grouping together several routes) and operation ID updateServiceAccount (used for uniquely identifying routes and associate parameters and response with them).
For enterprise endpoints make sure you add the
enterprisetag as well.
// swagger:route PATCH /serviceaccounts/{serviceAccountId} service_accounts updateServiceAccount
//
// # Update service account
//
// Required permissions (See note in the [introduction](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api) for an explanation):
// action: `serviceaccounts:write` scope: `serviceaccounts:id:1` (single service account)
//
// Responses:
// 200: updateServiceAccountResponse
// 400: badRequestError
// 401: unauthorisedError
// 403: forbiddenError
// 404: notFoundError
// 500: internalServerError
The go-swagger can discover such annotations by scanning any code imported by pkg/server but by convention we place the endpoint annotations above the endpoint definition.
Example of endpoint parameters
The following struct defines the route parameters for the updateServiceAccount endpoint. The route expects:
- a path parameter denoting the service account identifier and
- a body parameter with the new values for the specific service account
// swagger:parameters updateServiceAccount
type UpdateServiceAccountParams struct {
// in:path
ServiceAccountId int64 `json:"serviceAccountId"`
// in:body
Body serviceaccounts.UpdateServiceAccountForm
}
Example of endpoint response
The following struct defines the response for the updateServiceAccount endpoint in case of a successful 200 response.
// swagger:response updateServiceAccountResponse
type UpdateServiceAccountResponse struct {
// in:body
Body struct {
Message string `json:"message"`
ID int64 `json:"id"`
Name string `json:"name"`
ServiceAccount *serviceaccounts.ServiceAccountProfileDTO `json:"serviceaccount"`
}
}
OpenAPI generation
Developers can re-create the OpenAPI v2 and v3 specifications using the following command:
make swagger-clean && make openapi3-gen
They can observe its output into the public/api-merged.json and public/openapi3.json files.
Finally, they can browser and try out both the OpenAPI v2 and v3 via the Swagger UI editor (served by the grafana server) by navigating to /swagger.
If there are any issues generating the specifications (e.g., diff containing unrelated changes to your PR or unusually large diff), please run the following command to ensure your Swagger version is up to date, then re-run the make commands.
go tool github.com/go-swagger/go-swagger/cmd/swagger@v0.30.6