@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
128 lines • 4.75 kB
JavaScript
;
// *** 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.TeamRoutingRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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.
*
* ```sh
* $ pulumi import opsgenie:index/teamRoutingRule:TeamRoutingRule 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 });
}
/**
* 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;
/** @internal */
TeamRoutingRule.__pulumiType = 'opsgenie:index/teamRoutingRule:TeamRoutingRule';
//# sourceMappingURL=teamRoutingRule.js.map