UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

96 lines 5.37 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.Escalation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * * [Official documentation](https://grafana.com/docs/oncall/latest/configure/escalation-chains-and-routes/) * * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/escalation_policies/) * * ## Import * * ```sh * $ pulumi import grafana:onCall/escalation:Escalation name "{{ id }}" * ``` */ class Escalation extends pulumi.CustomResource { /** * Get an existing Escalation 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 Escalation(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Escalation. 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'] === Escalation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["actionToTrigger"] = state ? state.actionToTrigger : undefined; resourceInputs["duration"] = state ? state.duration : undefined; resourceInputs["escalationChainId"] = state ? state.escalationChainId : undefined; resourceInputs["groupToNotify"] = state ? state.groupToNotify : undefined; resourceInputs["important"] = state ? state.important : undefined; resourceInputs["notifyIfTimeFrom"] = state ? state.notifyIfTimeFrom : undefined; resourceInputs["notifyIfTimeTo"] = state ? state.notifyIfTimeTo : undefined; resourceInputs["notifyOnCallFromSchedule"] = state ? state.notifyOnCallFromSchedule : undefined; resourceInputs["notifyToTeamMembers"] = state ? state.notifyToTeamMembers : undefined; resourceInputs["personsToNotifies"] = state ? state.personsToNotifies : undefined; resourceInputs["personsToNotifyNextEachTimes"] = state ? state.personsToNotifyNextEachTimes : undefined; resourceInputs["position"] = state ? state.position : undefined; resourceInputs["severity"] = state ? state.severity : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.escalationChainId === undefined) && !opts.urn) { throw new Error("Missing required property 'escalationChainId'"); } if ((!args || args.position === undefined) && !opts.urn) { throw new Error("Missing required property 'position'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["actionToTrigger"] = args ? args.actionToTrigger : undefined; resourceInputs["duration"] = args ? args.duration : undefined; resourceInputs["escalationChainId"] = args ? args.escalationChainId : undefined; resourceInputs["groupToNotify"] = args ? args.groupToNotify : undefined; resourceInputs["important"] = args ? args.important : undefined; resourceInputs["notifyIfTimeFrom"] = args ? args.notifyIfTimeFrom : undefined; resourceInputs["notifyIfTimeTo"] = args ? args.notifyIfTimeTo : undefined; resourceInputs["notifyOnCallFromSchedule"] = args ? args.notifyOnCallFromSchedule : undefined; resourceInputs["notifyToTeamMembers"] = args ? args.notifyToTeamMembers : undefined; resourceInputs["personsToNotifies"] = args ? args.personsToNotifies : undefined; resourceInputs["personsToNotifyNextEachTimes"] = args ? args.personsToNotifyNextEachTimes : undefined; resourceInputs["position"] = args ? args.position : undefined; resourceInputs["severity"] = args ? args.severity : undefined; resourceInputs["type"] = args ? args.type : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "grafana:index/oncallEscalation:OncallEscalation" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(Escalation.__pulumiType, name, resourceInputs, opts); } } exports.Escalation = Escalation; /** @internal */ Escalation.__pulumiType = 'grafana:onCall/escalation:Escalation'; //# sourceMappingURL=escalation.js.map