@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
165 lines (164 loc) • 7.21 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Manages a Notification Rule within Opsgenie.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opsgenie from "@pulumi/opsgenie";
*
* const test = new opsgenie.User("test", {
* username: "Example user",
* fullName: "Name Lastname",
* role: "User",
* });
* const testNotificationRule = new opsgenie.NotificationRule("test", {
* name: "Example notification rule",
* username: test.username,
* actionType: "schedule-end",
* notificationTimes: [
* "just-before",
* "15-minutes-ago",
* ],
* steps: [{
* contacts: [{
* method: "email",
* to: "example@user.com",
* }],
* }],
* });
* ```
*
* ## Import
*
* Notification policies can be imported using the `user_id/notification_rule_id`, e.g.
*
* ```sh
* $ pulumi import opsgenie:index/notificationRule:NotificationRule test user_id/notification_rule_id`
* ```
*/
export declare class NotificationRule extends pulumi.CustomResource {
/**
* Get an existing NotificationRule 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: string, id: pulumi.Input<pulumi.ID>, state?: NotificationRuleState, opts?: pulumi.CustomResourceOptions): NotificationRule;
/**
* Returns true if the given object is an instance of NotificationRule. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is NotificationRule;
/**
* Type of the action that notification rule will have. Allowed values: `create-alert`, `acknowledged-alert`, `closed-alert`, `assigned-alert`, `add-note`, `schedule-start`, `schedule-end`, `incoming-call-routing`
*/
readonly actionType: pulumi.Output<string>;
readonly criterias: pulumi.Output<outputs.NotificationRuleCriteria[] | undefined>;
/**
* If policy should be enabled. Default: `true`
*/
readonly enabled: pulumi.Output<boolean | undefined>;
/**
* Name of the notification policy
*/
readonly name: pulumi.Output<string>;
/**
* List of Time Periods that notification for schedule start/end will be sent. Allowed values: `just-before`, `15-minutes-ago`, `1-hour-ago`, `1-day-ago`. If `actionType` is `schedule-start` or `schedule-end` then it is required.
*/
readonly notificationTimes: pulumi.Output<string[] | undefined>;
readonly order: pulumi.Output<number>;
readonly repeats: pulumi.Output<outputs.NotificationRuleRepeat[] | undefined>;
readonly schedules: pulumi.Output<outputs.NotificationRuleSchedule[] | undefined>;
/**
* Notification rule steps to take (eg. SMS or email message). This is a block, structure is documented below.
*/
readonly steps: pulumi.Output<outputs.NotificationRuleStep[] | undefined>;
readonly timeRestrictions: pulumi.Output<outputs.NotificationRuleTimeRestriction[] | undefined>;
/**
* Username of user to which this notification rule belongs to.
*/
readonly username: pulumi.Output<string>;
/**
* Create a NotificationRule resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: NotificationRuleArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering NotificationRule resources.
*/
export interface NotificationRuleState {
/**
* Type of the action that notification rule will have. Allowed values: `create-alert`, `acknowledged-alert`, `closed-alert`, `assigned-alert`, `add-note`, `schedule-start`, `schedule-end`, `incoming-call-routing`
*/
actionType?: pulumi.Input<string>;
criterias?: pulumi.Input<pulumi.Input<inputs.NotificationRuleCriteria>[]>;
/**
* If policy should be enabled. Default: `true`
*/
enabled?: pulumi.Input<boolean>;
/**
* Name of the notification policy
*/
name?: pulumi.Input<string>;
/**
* List of Time Periods that notification for schedule start/end will be sent. Allowed values: `just-before`, `15-minutes-ago`, `1-hour-ago`, `1-day-ago`. If `actionType` is `schedule-start` or `schedule-end` then it is required.
*/
notificationTimes?: pulumi.Input<pulumi.Input<string>[]>;
order?: pulumi.Input<number>;
repeats?: pulumi.Input<pulumi.Input<inputs.NotificationRuleRepeat>[]>;
schedules?: pulumi.Input<pulumi.Input<inputs.NotificationRuleSchedule>[]>;
/**
* Notification rule steps to take (eg. SMS or email message). This is a block, structure is documented below.
*/
steps?: pulumi.Input<pulumi.Input<inputs.NotificationRuleStep>[]>;
timeRestrictions?: pulumi.Input<pulumi.Input<inputs.NotificationRuleTimeRestriction>[]>;
/**
* Username of user to which this notification rule belongs to.
*/
username?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NotificationRule resource.
*/
export interface NotificationRuleArgs {
/**
* Type of the action that notification rule will have. Allowed values: `create-alert`, `acknowledged-alert`, `closed-alert`, `assigned-alert`, `add-note`, `schedule-start`, `schedule-end`, `incoming-call-routing`
*/
actionType: pulumi.Input<string>;
criterias?: pulumi.Input<pulumi.Input<inputs.NotificationRuleCriteria>[]>;
/**
* If policy should be enabled. Default: `true`
*/
enabled?: pulumi.Input<boolean>;
/**
* Name of the notification policy
*/
name?: pulumi.Input<string>;
/**
* List of Time Periods that notification for schedule start/end will be sent. Allowed values: `just-before`, `15-minutes-ago`, `1-hour-ago`, `1-day-ago`. If `actionType` is `schedule-start` or `schedule-end` then it is required.
*/
notificationTimes?: pulumi.Input<pulumi.Input<string>[]>;
order?: pulumi.Input<number>;
repeats?: pulumi.Input<pulumi.Input<inputs.NotificationRuleRepeat>[]>;
schedules?: pulumi.Input<pulumi.Input<inputs.NotificationRuleSchedule>[]>;
/**
* Notification rule steps to take (eg. SMS or email message). This is a block, structure is documented below.
*/
steps?: pulumi.Input<pulumi.Input<inputs.NotificationRuleStep>[]>;
timeRestrictions?: pulumi.Input<pulumi.Input<inputs.NotificationRuleTimeRestriction>[]>;
/**
* Username of user to which this notification rule belongs to.
*/
username: pulumi.Input<string>;
}