UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

115 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.Report = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * **Note:** This resource is available only with Grafana Enterprise 7.+. * * * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/create-reports/) * * [HTTP API](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/api-legacy/reporting/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.oss.Dashboard("test", { * configJson: `{ * \\"uid\\": \\"report-dashboard\\", * \\"title\\": \\"report-dashboard\\" * } * `, * message: "inital commit.", * }); * const testReport = new grafana.enterprise.Report("test", { * name: "my report", * recipients: ["some@email.com"], * dashboards: [{ * uid: test.uid, * }], * schedule: { * frequency: "hourly", * }, * }); * ``` * * ## Import * * ```sh * terraform import grafana_report.name "{{ id }}" * terraform import grafana_report.name "{{ orgID }}:{{ id }}" * ``` */ class Report extends pulumi.CustomResource { /** * Get an existing Report 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 Report(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Report. 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'] === Report.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["dashboards"] = state?.dashboards; resourceInputs["formats"] = state?.formats; resourceInputs["includeDashboardLink"] = state?.includeDashboardLink; resourceInputs["includeTableCsv"] = state?.includeTableCsv; resourceInputs["layout"] = state?.layout; resourceInputs["message"] = state?.message; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["orientation"] = state?.orientation; resourceInputs["recipients"] = state?.recipients; resourceInputs["replyTo"] = state?.replyTo; resourceInputs["schedule"] = state?.schedule; } else { const args = argsOrState; if (args?.recipients === undefined && !opts.urn) { throw new Error("Missing required property 'recipients'"); } resourceInputs["dashboards"] = args?.dashboards; resourceInputs["formats"] = args?.formats; resourceInputs["includeDashboardLink"] = args?.includeDashboardLink; resourceInputs["includeTableCsv"] = args?.includeTableCsv; resourceInputs["layout"] = args?.layout; resourceInputs["message"] = args?.message; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; resourceInputs["orientation"] = args?.orientation; resourceInputs["recipients"] = args?.recipients; resourceInputs["replyTo"] = args?.replyTo; resourceInputs["schedule"] = args?.schedule; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "grafana:index/report:Report" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(Report.__pulumiType, name, resourceInputs, opts); } } exports.Report = Report; /** @internal */ Report.__pulumiType = 'grafana:enterprise/report:Report'; //# sourceMappingURL=report.js.map