@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
128 lines • 5.1 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, Object.assign(Object.assign({}, 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 ? state.criterias : undefined;
resourceInputs["isDefault"] = state ? state.isDefault : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["notifies"] = state ? state.notifies : undefined;
resourceInputs["order"] = state ? state.order : undefined;
resourceInputs["teamId"] = state ? state.teamId : undefined;
resourceInputs["timeRestrictions"] = state ? state.timeRestrictions : undefined;
resourceInputs["timezone"] = state ? state.timezone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.notifies === undefined) && !opts.urn) {
throw new Error("Missing required property 'notifies'");
}
if ((!args || args.teamId === undefined) && !opts.urn) {
throw new Error("Missing required property 'teamId'");
}
resourceInputs["criterias"] = args ? args.criterias : undefined;
resourceInputs["isDefault"] = args ? args.isDefault : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["notifies"] = args ? args.notifies : undefined;
resourceInputs["order"] = args ? args.order : undefined;
resourceInputs["teamId"] = args ? args.teamId : undefined;
resourceInputs["timeRestrictions"] = args ? args.timeRestrictions : undefined;
resourceInputs["timezone"] = args ? args.timezone : undefined;
}
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