@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
135 lines (134 loc) • 4.38 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/)
* * [Folder/Dashboard Search HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/folder_dashboard_search/)
* * [Dashboard HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
* import * as grafana from "@pulumi/grafana";
*
* const test = new grafana.Dashboard("test", {configJson: JSON.stringify({
* id: 12345,
* uid: "test-ds-dashboard-uid",
* title: "Production Overview",
* tags: ["templated"],
* timezone: "browser",
* schemaVersion: 16,
* version: 0,
* refresh: "25s",
* })});
* const fromId = grafana.getDashboardOutput({
* dashboardId: test.dashboardId,
* });
* const fromUid = grafana.getDashboard({
* uid: "test-ds-dashboard-uid",
* });
* ```
*/
export declare function getDashboard(args?: GetDashboardArgs, opts?: pulumi.InvokeOptions): Promise<GetDashboardResult>;
/**
* A collection of arguments for invoking getDashboard.
*/
export interface GetDashboardArgs {
/**
* The numerical ID of the Grafana dashboard. Specify either this or `uid`. Defaults to `-1`.
*/
dashboardId?: number;
/**
* The uid of the Grafana dashboard. Specify either this or `dashboardId`. Defaults to ``.
*/
uid?: string;
}
/**
* A collection of values returned by getDashboard.
*/
export interface GetDashboardResult {
/**
* The complete dashboard model JSON.
*/
readonly configJson: string;
/**
* The numerical ID of the Grafana dashboard. Specify either this or `uid`. Defaults to `-1`.
*/
readonly dashboardId?: number;
/**
* The numerical ID of the folder where the Grafana dashboard is found.
*/
readonly folder: number;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* Whether or not the Grafana dashboard is starred. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you’re interested in.
*/
readonly isStarred: boolean;
/**
* URL slug of the dashboard (deprecated).
*/
readonly slug: string;
/**
* The title of the Grafana dashboard.
*/
readonly title: string;
/**
* The uid of the Grafana dashboard. Specify either this or `dashboardId`. Defaults to ``.
*/
readonly uid?: string;
/**
* The full URL of the dashboard.
*/
readonly url: string;
/**
* The numerical version of the Grafana dashboard.
*/
readonly version: number;
}
/**
* * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/)
* * [Folder/Dashboard Search HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/folder_dashboard_search/)
* * [Dashboard HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
* import * as grafana from "@pulumi/grafana";
*
* const test = new grafana.Dashboard("test", {configJson: JSON.stringify({
* id: 12345,
* uid: "test-ds-dashboard-uid",
* title: "Production Overview",
* tags: ["templated"],
* timezone: "browser",
* schemaVersion: 16,
* version: 0,
* refresh: "25s",
* })});
* const fromId = grafana.getDashboardOutput({
* dashboardId: test.dashboardId,
* });
* const fromUid = grafana.getDashboard({
* uid: "test-ds-dashboard-uid",
* });
* ```
*/
export declare function getDashboardOutput(args?: GetDashboardOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetDashboardResult>;
/**
* A collection of arguments for invoking getDashboard.
*/
export interface GetDashboardOutputArgs {
/**
* The numerical ID of the Grafana dashboard. Specify either this or `uid`. Defaults to `-1`.
*/
dashboardId?: pulumi.Input<number>;
/**
* The uid of the Grafana dashboard. Specify either this or `dashboardId`. Defaults to ``.
*/
uid?: pulumi.Input<string>;
}