UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

96 lines 3.84 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.Folder = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/manage-dashboards/) * * [HTTP API](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/folder/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const testFolder = new grafana.oss.Folder("test_folder", {title: "Terraform Test Folder"}); * const testFolderDashboard = new grafana.oss.Dashboard("test_folder", { * folder: testFolder.id, * configJson: `{ * \\"title\\": \\"Dashboard in folder\\", * \\"uid\\": \\"dashboard-in-folder\\" * } * `, * }); * const testFolderWithUid = new grafana.oss.Folder("test_folder_with_uid", { * uid: "test-folder-uid", * title: "Terraform Test Folder With UID", * }); * ``` * * ## Import * * ```sh * terraform import grafana_folder.name "{{ uid }}" * terraform import grafana_folder.name "{{ orgID }}:{{ uid }}" * ``` */ class Folder extends pulumi.CustomResource { /** * Get an existing Folder 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 Folder(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Folder. 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'] === Folder.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["orgId"] = state?.orgId; resourceInputs["parentFolderUid"] = state?.parentFolderUid; resourceInputs["preventDestroyIfNotEmpty"] = state?.preventDestroyIfNotEmpty; resourceInputs["title"] = state?.title; resourceInputs["uid"] = state?.uid; resourceInputs["url"] = state?.url; } else { const args = argsOrState; if (args?.title === undefined && !opts.urn) { throw new Error("Missing required property 'title'"); } resourceInputs["orgId"] = args?.orgId; resourceInputs["parentFolderUid"] = args?.parentFolderUid; resourceInputs["preventDestroyIfNotEmpty"] = args?.preventDestroyIfNotEmpty; resourceInputs["title"] = args?.title; resourceInputs["uid"] = args?.uid; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "grafana:index/folder:Folder" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(Folder.__pulumiType, name, resourceInputs, opts); } } exports.Folder = Folder; /** @internal */ Folder.__pulumiType = 'grafana:oss/folder:Folder'; //# sourceMappingURL=folder.js.map