UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

130 lines 5.71 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.L7PolicyV2 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Load Balancer L7 Policy resource within OpenStack. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const network1 = new openstack.networking.Network("network_1", { * name: "network_1", * adminStateUp: true, * }); * const subnet1 = new openstack.networking.Subnet("subnet_1", { * name: "subnet_1", * cidr: "192.168.199.0/24", * ipVersion: 4, * networkId: network1.id, * }); * const loadbalancer1 = new openstack.loadbalancer.LoadBalancer("loadbalancer_1", { * name: "loadbalancer_1", * vipSubnetId: subnet1.id, * }); * const listener1 = new openstack.loadbalancer.Listener("listener_1", { * name: "listener_1", * protocol: "HTTP", * protocolPort: 8080, * loadbalancerId: loadbalancer1.id, * }); * const pool1 = new openstack.loadbalancer.Pool("pool_1", { * name: "pool_1", * protocol: "HTTP", * lbMethod: "ROUND_ROBIN", * loadbalancerId: loadbalancer1.id, * }); * const l7policy1 = new openstack.loadbalancer.L7PolicyV2("l7policy_1", { * name: "test", * action: "REDIRECT_TO_POOL", * description: "test l7 policy", * position: 1, * listenerId: listener1.id, * redirectPoolId: pool1.id, * }); * ``` * * ## Import * * Load Balancer L7 Policy can be imported using the L7 Policy ID, e.g.: * * ```sh * $ pulumi import openstack:loadbalancer/l7PolicyV2:L7PolicyV2 l7policy_1 8a7a79c2-cf17-4e65-b2ae-ddc8bfcf6c74 * ``` */ class L7PolicyV2 extends pulumi.CustomResource { /** * Get an existing L7PolicyV2 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 L7PolicyV2(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of L7PolicyV2. 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'] === L7PolicyV2.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state ? state.action : undefined; resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["listenerId"] = state ? state.listenerId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["position"] = state ? state.position : undefined; resourceInputs["redirectHttpCode"] = state ? state.redirectHttpCode : undefined; resourceInputs["redirectPoolId"] = state ? state.redirectPoolId : undefined; resourceInputs["redirectPrefix"] = state ? state.redirectPrefix : undefined; resourceInputs["redirectUrl"] = state ? state.redirectUrl : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; } else { const args = argsOrState; if ((!args || args.action === undefined) && !opts.urn) { throw new Error("Missing required property 'action'"); } if ((!args || args.listenerId === undefined) && !opts.urn) { throw new Error("Missing required property 'listenerId'"); } resourceInputs["action"] = args ? args.action : undefined; resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["listenerId"] = args ? args.listenerId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["position"] = args ? args.position : undefined; resourceInputs["redirectHttpCode"] = args ? args.redirectHttpCode : undefined; resourceInputs["redirectPoolId"] = args ? args.redirectPoolId : undefined; resourceInputs["redirectPrefix"] = args ? args.redirectPrefix : undefined; resourceInputs["redirectUrl"] = args ? args.redirectUrl : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(L7PolicyV2.__pulumiType, name, resourceInputs, opts); } } exports.L7PolicyV2 = L7PolicyV2; /** @internal */ L7PolicyV2.__pulumiType = 'openstack:loadbalancer/l7PolicyV2:L7PolicyV2'; //# sourceMappingURL=l7policyV2.js.map