@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
107 lines • 4.56 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, Object.assign(Object.assign({}, 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 ? state.alertMessage : undefined;
resourceInputs["alertPriority"] = state ? state.alertPriority : undefined;
resourceInputs["alertTags"] = state ? state.alertTags : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["interval"] = state ? state.interval : undefined;
resourceInputs["intervalUnit"] = state ? state.intervalUnit : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["ownerTeamId"] = state ? state.ownerTeamId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.enabled === undefined) && !opts.urn) {
throw new Error("Missing required property 'enabled'");
}
if ((!args || args.interval === undefined) && !opts.urn) {
throw new Error("Missing required property 'interval'");
}
if ((!args || args.intervalUnit === undefined) && !opts.urn) {
throw new Error("Missing required property 'intervalUnit'");
}
resourceInputs["alertMessage"] = args ? args.alertMessage : undefined;
resourceInputs["alertPriority"] = args ? args.alertPriority : undefined;
resourceInputs["alertTags"] = args ? args.alertTags : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["interval"] = args ? args.interval : undefined;
resourceInputs["intervalUnit"] = args ? args.intervalUnit : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["ownerTeamId"] = args ? args.ownerTeamId : undefined;
}
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