@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
107 lines • 4.16 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.Heartbeat = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages heartbeat within Opsgenie.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opsgenie from "@pulumi/opsgenie";
*
* const test = new opsgenie.Heartbeat("test", {
* name: "genieheartbeat-test",
* description: "test opsgenie heartbeat terraform",
* intervalUnit: "minutes",
* interval: 10,
* enabled: false,
* alertMessage: "Test",
* alertPriority: "P3",
* alertTags: [
* "test",
* "fahri",
* ],
* ownerTeamId: testOpsgenieTeam.id,
* });
* ```
*
* ## Import
*
* Heartbeat Integrations can be imported using the `name`, e.g.
*
* ```sh
* $ pulumi import opsgenie:index/heartbeat:Heartbeat test name`
* ```
*/
class Heartbeat extends pulumi.CustomResource {
/**
* Get an existing Heartbeat 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 Heartbeat(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Heartbeat. 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'] === Heartbeat.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["alertMessage"] = state?.alertMessage;
resourceInputs["alertPriority"] = state?.alertPriority;
resourceInputs["alertTags"] = state?.alertTags;
resourceInputs["description"] = state?.description;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["interval"] = state?.interval;
resourceInputs["intervalUnit"] = state?.intervalUnit;
resourceInputs["name"] = state?.name;
resourceInputs["ownerTeamId"] = state?.ownerTeamId;
}
else {
const args = argsOrState;
if (args?.enabled === undefined && !opts.urn) {
throw new Error("Missing required property 'enabled'");
}
if (args?.interval === undefined && !opts.urn) {
throw new Error("Missing required property 'interval'");
}
if (args?.intervalUnit === undefined && !opts.urn) {
throw new Error("Missing required property 'intervalUnit'");
}
resourceInputs["alertMessage"] = args?.alertMessage;
resourceInputs["alertPriority"] = args?.alertPriority;
resourceInputs["alertTags"] = args?.alertTags;
resourceInputs["description"] = args?.description;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["interval"] = args?.interval;
resourceInputs["intervalUnit"] = args?.intervalUnit;
resourceInputs["name"] = args?.name;
resourceInputs["ownerTeamId"] = args?.ownerTeamId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Heartbeat.__pulumiType, name, resourceInputs, opts);
}
}
exports.Heartbeat = Heartbeat;
/** @internal */
Heartbeat.__pulumiType = 'opsgenie:index/heartbeat:Heartbeat';
//# sourceMappingURL=heartbeat.js.map