The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/tests/apis/openapi_snapshots
Stephanie Hingtgen 2b8c5bea1a
Revert "Schema V2: Simplify annotations v1<->v2 conversions" (#107984)
1 week ago
..
README.md Query Library: Update API client (#99382) 6 months ago
advisor.grafana.app-v0alpha1.json Advisor: Update app-sdk and regenerate code (#107786) 2 weeks ago
dashboard.grafana.app-v0alpha1.json K8s: Make v0alpha1 opt-in (#107056) 1 month ago
dashboard.grafana.app-v1beta1.json K8s/Dashboard: Promote from alpha1 to beta1 (#104009) 3 months ago
dashboard.grafana.app-v2alpha1.json Revert "Schema V2: Simplify annotations v1<->v2 conversions" (#107984) 1 week ago
folder.grafana.app-v1beta1.json NestedFolderPicker: Migrate to app platform API (#106926) 2 weeks ago
iam.grafana.app-v0alpha1.json `iam`: add description field to roles (#107888) 2 weeks ago
investigations.grafana.app-v0alpha1.json K8s: Add support for stored subresources in app runner (#105481) 2 weeks ago
notifications.alerting.grafana.app-v0alpha1.json APIServer: Exclude internal GroupVersionKind from openapi (#107551) 3 weeks ago
playlist.grafana.app-v0alpha1.json APIServer: Exclude internal GroupVersionKind from openapi (#107551) 3 weeks ago
provisioning.grafana.app-v0alpha1.json APIServer: Exclude internal GroupVersionKind from openapi (#107551) 3 weeks ago

README.md

This folder contains a rendered OpenAPI file for each group/version. The “real” OpenAPI is generated by the running server, but the files here are used to build static frontend clients.

Generating RTK API Clients

The RTK API clients are generated from processed OpenAPI files using the scripts/process-specs.ts script. The source files are in pkg/tests/apis/openapi_snapshots, and the processed files are stored in the data/openapi directory. Spec processing happens as part of yarn generate-apis task, but can also be triggered separately (see below).

To generate or update the RTK API clients:

  1. If generating or updating an RTK client for the first time, update scripts/generate-rtk-apis.js so schemaFile points to the processed spec files, for example:

    '../public/app/features/dashboards/api/endpoints.gen.ts': {
      schemaFile: '../data/openapi/dashboard.grafana.app-v0alpha1.json',
    },
    
  2. Generate or update the OpenAPI spec files by running:

    go test pkg/tests/apis/openapi_test.go
    

    If generating an RTK client for a new API, also add a new group/version of the API to the groups slice. If the API is behind a feature toggle, add the toggle to EnableFeatureToggles in pkg/tests/apis/openapi_test.go.

  3. Run:

    yarn generate-apis
    

    This command generates (or updates) the spec files in the data/openapi directory and generates the RTK API clients.

If you want to process the OpenAPI files without generating the RTK API clients (for example, if you have a separate generate-rtk-apis file), run:

yarn process-specs