@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
103 lines • 4.76 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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/developers/http_api/library_element/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
*
* const test = new grafana.LibraryPanel("test", {modelJson: JSON.stringify({
* title: "updated name",
* id: 12,
* version: 35,
* })});
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/libraryPanel:LibraryPanel panel_name {{library_panel_slug}}
* ```
*/
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, Object.assign(Object.assign({}, 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 ? state.created : undefined;
resourceInputs["dashboardIds"] = state ? state.dashboardIds : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["folderId"] = state ? state.folderId : undefined;
resourceInputs["folderName"] = state ? state.folderName : undefined;
resourceInputs["folderUid"] = state ? state.folderUid : undefined;
resourceInputs["modelJson"] = state ? state.modelJson : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["panelId"] = state ? state.panelId : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["updated"] = state ? state.updated : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.modelJson === undefined) && !opts.urn) {
throw new Error("Missing required property 'modelJson'");
}
resourceInputs["folderId"] = args ? args.folderId : undefined;
resourceInputs["modelJson"] = args ? args.modelJson : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["uid"] = args ? args.uid : undefined;
resourceInputs["created"] = undefined /*out*/;
resourceInputs["dashboardIds"] = undefined /*out*/;
resourceInputs["description"] = undefined /*out*/;
resourceInputs["folderName"] = undefined /*out*/;
resourceInputs["folderUid"] = undefined /*out*/;
resourceInputs["panelId"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
resourceInputs["updated"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LibraryPanel.__pulumiType, name, resourceInputs, opts);
}
}
exports.LibraryPanel = LibraryPanel;
/** @internal */
LibraryPanel.__pulumiType = 'grafana:index/libraryPanel:LibraryPanel';
//# sourceMappingURL=libraryPanel.js.map