UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

113 lines 4.62 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.LibraryPanel = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages Grafana library panels. * * * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-library-panels/) * * [HTTP API](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/api-legacy/library_element/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.oss.LibraryPanel("test", { * name: "panel", * modelJson: JSON.stringify({ * gridPos: { * x: 0, * y: 0, * h: 10, * w: 10, * }, * title: "panel", * type: "text", * version: 0, * }), * }); * ``` * * ## Import * * ```sh * terraform import grafana_library_panel.name "{{ uid }}" * terraform import grafana_library_panel.name "{{ orgID }}:{{ uid }}" * ``` */ class LibraryPanel extends pulumi.CustomResource { /** * Get an existing LibraryPanel 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 LibraryPanel(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of LibraryPanel. 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'] === LibraryPanel.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["created"] = state?.created; resourceInputs["dashboardIds"] = state?.dashboardIds; resourceInputs["description"] = state?.description; resourceInputs["folderName"] = state?.folderName; resourceInputs["folderUid"] = state?.folderUid; resourceInputs["modelJson"] = state?.modelJson; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["panelId"] = state?.panelId; resourceInputs["type"] = state?.type; resourceInputs["uid"] = state?.uid; resourceInputs["updated"] = state?.updated; resourceInputs["version"] = state?.version; } else { const args = argsOrState; if (args?.modelJson === undefined && !opts.urn) { throw new Error("Missing required property 'modelJson'"); } resourceInputs["folderUid"] = args?.folderUid; resourceInputs["modelJson"] = args?.modelJson; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; resourceInputs["uid"] = args?.uid; resourceInputs["created"] = undefined /*out*/; resourceInputs["dashboardIds"] = undefined /*out*/; resourceInputs["description"] = undefined /*out*/; resourceInputs["folderName"] = undefined /*out*/; resourceInputs["panelId"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; resourceInputs["updated"] = undefined /*out*/; resourceInputs["version"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "grafana:index/libraryPanel:LibraryPanel" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(LibraryPanel.__pulumiType, name, resourceInputs, opts); } } exports.LibraryPanel = LibraryPanel; /** @internal */ LibraryPanel.__pulumiType = 'grafana:oss/libraryPanel:LibraryPanel'; //# sourceMappingURL=libraryPanel.js.map