UNPKG

@lbrlabs/pulumi-grafana

Version:

A Pulumi package for creating and managing grafana.

77 lines 3.63 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.SLO = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Resource manages Grafana SLOs. * * * [Official documentation](https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/) * * [API documentation](https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/api/) * * [Additional Information On Alerting Rule Annotations and Labels](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/#templating/) * * ## Example Usage */ class SLO extends pulumi.CustomResource { /** * Get an existing SLO 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 SLO(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SLO. 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'] === SLO.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["alertings"] = state ? state.alertings : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["objectives"] = state ? state.objectives : undefined; resourceInputs["queries"] = state ? state.queries : undefined; } else { const args = argsOrState; if ((!args || args.description === undefined) && !opts.urn) { throw new Error("Missing required property 'description'"); } if ((!args || args.objectives === undefined) && !opts.urn) { throw new Error("Missing required property 'objectives'"); } if ((!args || args.queries === undefined) && !opts.urn) { throw new Error("Missing required property 'queries'"); } resourceInputs["alertings"] = args ? args.alertings : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["objectives"] = args ? args.objectives : undefined; resourceInputs["queries"] = args ? args.queries : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SLO.__pulumiType, name, resourceInputs, opts); } } exports.SLO = SLO; /** @internal */ SLO.__pulumiType = 'grafana:index/sLO:SLO'; //# sourceMappingURL=slo.js.map