UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

106 lines 4.93 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.UptimeAlert = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Provides a [DigitalOcean Uptime Alerts](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Uptime/operation/uptime_create_alert) * resource. Uptime Alerts provide the ability to add alerts to your [DigitalOcean Uptime Checks](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Uptime) when your endpoints are slow, unavailable, or SSL certificates are expiring. * * ## Import * * Uptime alerts can be imported using both the ID of the alert's parent check and * its own separated by a comma in the format: `check_id,alert_id`. For example: * * ```sh * $ pulumi import digitalocean:index/uptimeAlert:UptimeAlert target 94a7d216-d821-11ee-a327-33d3239ffc4b,5a4981aa-9653-4bd1-bef5-d6bff52042e4 * ``` */ class UptimeAlert extends pulumi.CustomResource { /** * Get an existing UptimeAlert 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 UptimeAlert(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'digitalocean:index/uptimeAlert:UptimeAlert'; /** * Returns true if the given object is an instance of UptimeAlert. 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'] === UptimeAlert.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["checkId"] = state?.checkId; resourceInputs["comparison"] = state?.comparison; resourceInputs["name"] = state?.name; resourceInputs["notifications"] = state?.notifications; resourceInputs["period"] = state?.period; resourceInputs["threshold"] = state?.threshold; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.checkId === undefined && !opts.urn) { throw new Error("Missing required property 'checkId'"); } if (args?.notifications === undefined && !opts.urn) { throw new Error("Missing required property 'notifications'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["checkId"] = args?.checkId; resourceInputs["comparison"] = args?.comparison; resourceInputs["name"] = args?.name; resourceInputs["notifications"] = args?.notifications; resourceInputs["period"] = args?.period; resourceInputs["threshold"] = args?.threshold; resourceInputs["type"] = args?.type; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(UptimeAlert.__pulumiType, name, resourceInputs, opts); } } exports.UptimeAlert = UptimeAlert; //# sourceMappingURL=uptimeAlert.js.map