UNPKG

@pulumi/opsgenie

Version:

A Pulumi package for creating and managing opsgenie cloud resources.

149 lines 5.77 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TeamRoutingRule = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Manages a Team Routing Rule within Opsgenie. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as opsgenie from "@pulumi/opsgenie"; * * const test = new opsgenie.Schedule("test", { * name: "genieschedule", * description: "schedule test", * timezone: "Europe/Rome", * enabled: false, * }); * const testTeam = new opsgenie.Team("test", { * name: "example team", * description: "This team deals with all the things", * }); * const testTeamRoutingRule = new opsgenie.TeamRoutingRule("test", { * name: "routing rule example", * teamId: testTeam.id, * order: 0, * timezone: "America/Los_Angeles", * criterias: [{ * type: "match-any-condition", * conditions: [{ * field: "message", * operation: "contains", * expectedValue: "expected1", * not: false, * }], * }], * timeRestrictions: [{ * type: "weekday-and-time-of-day", * restrictionList: [{ * startDay: "monday", * startHour: 8, * startMin: 0, * endDay: "tuesday", * endHour: 18, * endMin: 30, * }], * }], * notifies: [{ * name: test.name, * type: "schedule", * }], * }); * ``` * * ## Import * * Team Routing Rules can be imported using the `team_id/routing_rule_id`, e.g. * * `$ terraform import opsgenie_team_routing_rule.ruletest team_id/routing_rule_id` */ class TeamRoutingRule extends pulumi.CustomResource { /** * Get an existing TeamRoutingRule 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 TeamRoutingRule(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'opsgenie:index/teamRoutingRule:TeamRoutingRule'; /** * Returns true if the given object is an instance of TeamRoutingRule. 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'] === TeamRoutingRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["criterias"] = state?.criterias; resourceInputs["isDefault"] = state?.isDefault; resourceInputs["name"] = state?.name; resourceInputs["notifies"] = state?.notifies; resourceInputs["order"] = state?.order; resourceInputs["teamId"] = state?.teamId; resourceInputs["timeRestrictions"] = state?.timeRestrictions; resourceInputs["timezone"] = state?.timezone; } else { const args = argsOrState; if (args?.notifies === undefined && !opts.urn) { throw new Error("Missing required property 'notifies'"); } if (args?.teamId === undefined && !opts.urn) { throw new Error("Missing required property 'teamId'"); } resourceInputs["criterias"] = args?.criterias; resourceInputs["isDefault"] = args?.isDefault; resourceInputs["name"] = args?.name; resourceInputs["notifies"] = args?.notifies; resourceInputs["order"] = args?.order; resourceInputs["teamId"] = args?.teamId; resourceInputs["timeRestrictions"] = args?.timeRestrictions; resourceInputs["timezone"] = args?.timezone; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(TeamRoutingRule.__pulumiType, name, resourceInputs, opts); } } exports.TeamRoutingRule = TeamRoutingRule; //# sourceMappingURL=teamRoutingRule.js.map