import { Tree } from '@nx/devkit'; import { Dashboard, Panel } from 'grafana-dash-gen'; export declare function readGrafanaUrlFromEnv(): string; export declare function readGrafanaBearerTokenFromKubernetes(): Promise; export declare function getPanels(dashboard: typeof Dashboard): (typeof Panel)[]; /** * Calls the Grafana REST API and creates a new dashboard * * @param dashboard * @param options * @param overwrite * @param folderUid */ export declare function createDashboardApi(options: { name: string; bearerToken: string; grafanaUrl: string; }, dashboard: string, overwrite?: boolean, folderUid?: string): Promise; export declare function getDashboard(dashboardId: string, grafanaUrl: string, bearerToken: string): Promise; /** * Depending on the given options, will write the dashboard either to disk or POST it to the specified Grafana API * For more info on the REST API: https://grafana.com/docs/grafana/latest/http_api/dashboard/ * * @param host used in case the dashboard should be written to disk * @param dashboard the dashboard as JSON * @param options specifies mode of operation (to, and contains API Bearer token and URL * @param overwrite * @param folderUid */ export declare function saveDashboard(host: Tree, dashboard: typeof Dashboard, options: { destDir: string; toDisk: boolean; name: string; bearerToken: string; grafanaUrl: string; }, overwrite?: boolean, folderUid?: string): Promise; /** * Types to store the response of /api/dashboards/db * See: https://grafana.com/docs/grafana/latest/http_api/dashboard/#create--update-dashboard */ export interface GrafanaDashboardDbResponse { id: number; slug: string; status: string; uid: string; url: string; version: string; } export interface GrafanaDashboardDbError { response: { status: number; statusText: string; data: { message: string; status: string; }; }; }