@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
137 lines • 6.33 kB
JavaScript
;
// *** 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.OncallUserNotificationRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/)
*
* **Note**: you must be running Grafana OnCall >= v1.8.0 to use this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const myUser = grafana.onCall.getUser({
* username: "my_username",
* });
* const myUserStep1 = new grafana.oncall.UserNotificationRule("my_user_step_1", {
* userId: myUser.then(myUser => myUser.id),
* position: 0,
* type: "notify_by_mobile_app",
* });
* const myUserStep2 = new grafana.oncall.UserNotificationRule("my_user_step_2", {
* userId: myUser.then(myUser => myUser.id),
* position: 1,
* duration: 600,
* type: "wait",
* });
* const myUserStep3 = new grafana.oncall.UserNotificationRule("my_user_step_3", {
* userId: myUser.then(myUser => myUser.id),
* position: 2,
* type: "notify_by_phone_call",
* });
* const myUserStep4 = new grafana.oncall.UserNotificationRule("my_user_step_4", {
* userId: myUser.then(myUser => myUser.id),
* position: 3,
* duration: 300,
* type: "wait",
* });
* const myUserStep5 = new grafana.oncall.UserNotificationRule("my_user_step_5", {
* userId: myUser.then(myUser => myUser.id),
* position: 4,
* type: "notify_by_slack",
* });
* const myUserImportantStep1 = new grafana.oncall.UserNotificationRule("my_user_important_step_1", {
* userId: myUser.then(myUser => myUser.id),
* important: true,
* position: 0,
* type: "notify_by_mobile_app_critical",
* });
* const myUserImportantStep2 = new grafana.oncall.UserNotificationRule("my_user_important_step_2", {
* userId: myUser.then(myUser => myUser.id),
* important: true,
* position: 1,
* duration: 300,
* type: "wait",
* });
* const myUserImportantStep3 = new grafana.oncall.UserNotificationRule("my_user_important_step_3", {
* userId: myUser.then(myUser => myUser.id),
* important: true,
* position: 2,
* type: "notify_by_mobile_app_critical",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/oncallUserNotificationRule:OncallUserNotificationRule name "{{ id }}"
* ```
*
* @deprecated grafana.index/oncallusernotificationrule.OncallUserNotificationRule has been deprecated in favor of grafana.oncall/usernotificationrule.UserNotificationRule
*/
class OncallUserNotificationRule extends pulumi.CustomResource {
/**
* Get an existing OncallUserNotificationRule 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) {
pulumi.log.warn("OncallUserNotificationRule is deprecated: grafana.index/oncallusernotificationrule.OncallUserNotificationRule has been deprecated in favor of grafana.oncall/usernotificationrule.UserNotificationRule");
return new OncallUserNotificationRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of OncallUserNotificationRule. 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'] === OncallUserNotificationRule.__pulumiType;
}
/** @deprecated grafana.index/oncallusernotificationrule.OncallUserNotificationRule has been deprecated in favor of grafana.oncall/usernotificationrule.UserNotificationRule */
constructor(name, argsOrState, opts) {
pulumi.log.warn("OncallUserNotificationRule is deprecated: grafana.index/oncallusernotificationrule.OncallUserNotificationRule has been deprecated in favor of grafana.oncall/usernotificationrule.UserNotificationRule");
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["duration"] = state ? state.duration : undefined;
resourceInputs["important"] = state ? state.important : undefined;
resourceInputs["position"] = state ? state.position : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
if ((!args || args.userId === undefined) && !opts.urn) {
throw new Error("Missing required property 'userId'");
}
resourceInputs["duration"] = args ? args.duration : undefined;
resourceInputs["important"] = args ? args.important : undefined;
resourceInputs["position"] = args ? args.position : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["userId"] = args ? args.userId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(OncallUserNotificationRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.OncallUserNotificationRule = OncallUserNotificationRule;
/** @internal */
OncallUserNotificationRule.__pulumiType = 'grafana:index/oncallUserNotificationRule:OncallUserNotificationRule';
//# sourceMappingURL=oncallUserNotificationRule.js.map