UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

126 lines 5.78 kB
"use strict"; // *** 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.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/developers/http_api/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 * $ pulumi import grafana:index/report:Report name "{{ id }}" * ``` * * ```sh * $ pulumi import grafana:index/report:Report name "{{ orgID }}:{{ id }}" * ``` * * @deprecated grafana.index/report.Report has been deprecated in favor of grafana.enterprise/report.Report */ 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) { pulumi.log.warn("Report is deprecated: grafana.index/report.Report has been deprecated in favor of grafana.enterprise/report.Report"); return new Report(name, state, Object.assign(Object.assign({}, 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; } /** @deprecated grafana.index/report.Report has been deprecated in favor of grafana.enterprise/report.Report */ constructor(name, argsOrState, opts) { pulumi.log.warn("Report is deprecated: grafana.index/report.Report has been deprecated in favor of grafana.enterprise/report.Report"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["dashboards"] = state ? state.dashboards : undefined; resourceInputs["formats"] = state ? state.formats : undefined; resourceInputs["includeDashboardLink"] = state ? state.includeDashboardLink : undefined; resourceInputs["includeTableCsv"] = state ? state.includeTableCsv : undefined; resourceInputs["layout"] = state ? state.layout : undefined; resourceInputs["message"] = state ? state.message : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["orgId"] = state ? state.orgId : undefined; resourceInputs["orientation"] = state ? state.orientation : undefined; resourceInputs["recipients"] = state ? state.recipients : undefined; resourceInputs["replyTo"] = state ? state.replyTo : undefined; resourceInputs["schedule"] = state ? state.schedule : undefined; } else { const args = argsOrState; if ((!args || args.recipients === undefined) && !opts.urn) { throw new Error("Missing required property 'recipients'"); } if ((!args || args.schedule === undefined) && !opts.urn) { throw new Error("Missing required property 'schedule'"); } resourceInputs["dashboards"] = args ? args.dashboards : undefined; resourceInputs["formats"] = args ? args.formats : undefined; resourceInputs["includeDashboardLink"] = args ? args.includeDashboardLink : undefined; resourceInputs["includeTableCsv"] = args ? args.includeTableCsv : undefined; resourceInputs["layout"] = args ? args.layout : undefined; resourceInputs["message"] = args ? args.message : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["orgId"] = args ? args.orgId : undefined; resourceInputs["orientation"] = args ? args.orientation : undefined; resourceInputs["recipients"] = args ? args.recipients : undefined; resourceInputs["replyTo"] = args ? args.replyTo : undefined; resourceInputs["schedule"] = args ? args.schedule : undefined; } 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:index/report:Report'; //# sourceMappingURL=report.js.map