### Install bingo and get swagger Source: https://github.com/grafana/grafana-openapi-client-go/blob/main/README.md Installs bingo and retrieves the specified version of swagger for consistent client generation. ```bash go install github.com/bwplotka/bingo@latest bingo get swagger ``` -------------------------------- ### Generate the client for all Grafana APIs Source: https://github.com/grafana/grafana-openapi-client-go/blob/main/README.md Generates the client for all Grafana APIs using the make command. ```bash make generate-client ``` -------------------------------- ### Generate the client for a specific Grafana API Source: https://github.com/grafana/grafana-openapi-client-go/blob/main/README.md Generates the client for a specific Grafana API by setting environment variables for API tag and model, then running the make command. ```bash export API_TAG=folders export MODEL=Folder make generate-client ``` -------------------------------- ### Grafana HTTP Client Configuration Source: https://github.com/grafana/grafana-openapi-client-go/blob/main/README.md Configuration options for the Grafana HTTP client, including host, base path, authentication, and retry settings. ```go import goapi "github.com/grafana/grafana-openapi-client-go/client" cfg := &goapi.TransportConfig{ // Host is the doman name or IP address of the host that serves the API. Host: "localhost:3000", // BasePath is the URL prefix for all API paths, relative to the host root. BasePath: "/api", // Schemes are the transfer protocols used by the API (http or https). Schemes: []string{"http"}, // APIKey is an optional API key or service account token. APIKey: os.Getenv("API_ACCESS_TOKEN"), // BasicAuth is optional basic auth credentials. BasicAuth: url.UserPassword("admin", "admin"), // OrgID provides an optional organization ID. // OrgID is only supported with BasicAuth since API keys are already org-scoped. OrgID: 1, // TLSConfig provides an optional configuration for a TLS client TLSConfig: &tls.Config{}, // NumRetries contains the optional number of attempted retries NumRetries: 3, // RetryTimeout sets an optional time to wait before retrying a request RetryTimeout: 0, // RetryStatusCodes contains the optional list of status codes to retry // Use "x" as a wildcard for a single digit (default: [429, 5xx]) RetryStatusCodes: []string{"420", "5xx"}, // HTTPHeaders contains an optional map of HTTP headers to add to each request HTTPHeaders: map[string]string{}, } client := goapi.NewHTTPClientWithConfig(strfmt.Default, cfg) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.