UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

84 lines 4.2 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.UptimeAlert = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.checkId : undefined; resourceInputs["comparison"] = state ? state.comparison : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["notifications"] = state ? state.notifications : undefined; resourceInputs["period"] = state ? state.period : undefined; resourceInputs["threshold"] = state ? state.threshold : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.checkId === undefined) && !opts.urn) { throw new Error("Missing required property 'checkId'"); } if ((!args || args.notifications === undefined) && !opts.urn) { throw new Error("Missing required property 'notifications'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["checkId"] = args ? args.checkId : undefined; resourceInputs["comparison"] = args ? args.comparison : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["notifications"] = args ? args.notifications : undefined; resourceInputs["period"] = args ? args.period : undefined; resourceInputs["threshold"] = args ? args.threshold : undefined; resourceInputs["type"] = args ? args.type : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(UptimeAlert.__pulumiType, name, resourceInputs, opts); } } exports.UptimeAlert = UptimeAlert; /** @internal */ UptimeAlert.__pulumiType = 'digitalocean:index/uptimeAlert:UptimeAlert'; //# sourceMappingURL=uptimeAlert.js.map