UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

123 lines 5.88 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.Monitor = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V2 monitor resource within OpenStack. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const monitor1 = new openstack.loadbalancer.Monitor("monitor_1", { * poolId: pool1.id, * type: "PING", * delay: 20, * timeout: 10, * maxRetries: 5, * }); * ``` * * ## Import * * Load Balancer Pool Monitor can be imported using the Monitor ID, e.g.: * * ```sh * $ pulumi import openstack:loadbalancer/monitor:Monitor monitor_1 47c26fc3-2403-427a-8c79-1589bd0533c2 * ``` * In case of using OpenContrail, the import may not work properly. If you face an issue, try to import the monitor providing its parent pool ID: * * ```sh * $ pulumi import openstack:loadbalancer/monitor:Monitor monitor_1 47c26fc3-2403-427a-8c79-1589bd0533c2/708bc224-0f8c-4981-ac82-97095fe051b6 * ``` */ class Monitor extends pulumi.CustomResource { /** * Get an existing Monitor 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 Monitor(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Monitor. 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'] === Monitor.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined; resourceInputs["delay"] = state ? state.delay : undefined; resourceInputs["domainName"] = state ? state.domainName : undefined; resourceInputs["expectedCodes"] = state ? state.expectedCodes : undefined; resourceInputs["httpMethod"] = state ? state.httpMethod : undefined; resourceInputs["httpVersion"] = state ? state.httpVersion : undefined; resourceInputs["maxRetries"] = state ? state.maxRetries : undefined; resourceInputs["maxRetriesDown"] = state ? state.maxRetriesDown : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["poolId"] = state ? state.poolId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; resourceInputs["timeout"] = state ? state.timeout : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["urlPath"] = state ? state.urlPath : undefined; } else { const args = argsOrState; if ((!args || args.delay === undefined) && !opts.urn) { throw new Error("Missing required property 'delay'"); } if ((!args || args.maxRetries === undefined) && !opts.urn) { throw new Error("Missing required property 'maxRetries'"); } if ((!args || args.poolId === undefined) && !opts.urn) { throw new Error("Missing required property 'poolId'"); } if ((!args || args.timeout === undefined) && !opts.urn) { throw new Error("Missing required property 'timeout'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined; resourceInputs["delay"] = args ? args.delay : undefined; resourceInputs["domainName"] = args ? args.domainName : undefined; resourceInputs["expectedCodes"] = args ? args.expectedCodes : undefined; resourceInputs["httpMethod"] = args ? args.httpMethod : undefined; resourceInputs["httpVersion"] = args ? args.httpVersion : undefined; resourceInputs["maxRetries"] = args ? args.maxRetries : undefined; resourceInputs["maxRetriesDown"] = args ? args.maxRetriesDown : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["poolId"] = args ? args.poolId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["timeout"] = args ? args.timeout : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["urlPath"] = args ? args.urlPath : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Monitor.__pulumiType, name, resourceInputs, opts); } } exports.Monitor = Monitor; /** @internal */ Monitor.__pulumiType = 'openstack:loadbalancer/monitor:Monitor'; //# sourceMappingURL=monitor.js.map