UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

103 lines 4.21 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Dashboard = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages Grafana dashboards. * * * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/) * * [HTTP API (legacy API, recommended for Grafana 12 or earlier)](https://grafana.com/docs/grafana/v11.6/developers/http_api/dashboard/) * * [HTTP API (new Kubernetes-style API, recommended for Grafana 13 and later)](https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.oss.Folder("test", { * title: "My Folder", * uid: "my-folder-uid", * }); * const testDashboard = new grafana.oss.Dashboard("test", { * folder: test.uid, * configJson: JSON.stringify({ * title: "My Dashboard", * uid: "my-dashboard-uid", * }), * }); * ``` * * ## Import * * ```sh * terraform import grafana_dashboard.name "{{ uid }}" * terraform import grafana_dashboard.name "{{ orgID }}:{{ uid }}" * ``` */ class Dashboard extends pulumi.CustomResource { /** * Get an existing Dashboard resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Dashboard(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Dashboard. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Dashboard.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["configJson"] = state?.configJson; resourceInputs["dashboardId"] = state?.dashboardId; resourceInputs["folder"] = state?.folder; resourceInputs["message"] = state?.message; resourceInputs["orgId"] = state?.orgId; resourceInputs["overwrite"] = state?.overwrite; resourceInputs["uid"] = state?.uid; resourceInputs["url"] = state?.url; resourceInputs["version"] = state?.version; } else { const args = argsOrState; if (args?.configJson === undefined && !opts.urn) { throw new Error("Missing required property 'configJson'"); } resourceInputs["configJson"] = args?.configJson; resourceInputs["folder"] = args?.folder; resourceInputs["message"] = args?.message; resourceInputs["orgId"] = args?.orgId; resourceInputs["overwrite"] = args?.overwrite; resourceInputs["dashboardId"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; resourceInputs["url"] = undefined /*out*/; resourceInputs["version"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "grafana:index/dashboard:Dashboard" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(Dashboard.__pulumiType, name, resourceInputs, opts); } } exports.Dashboard = Dashboard; /** @internal */ Dashboard.__pulumiType = 'grafana:oss/dashboard:Dashboard'; //# sourceMappingURL=dashboard.js.map