UNPKG

@muhlba91/pulumi-proxmoxve

Version:

A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.

105 lines 4.5 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.NetworkVlan = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Linux VLAN network interface in a Proxmox VE node. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * // using VLAN tag * const vlan99 = new proxmoxve.network.NetworkVlan("vlan99", { * comment: "VLAN 99", * nodeName: "pve", * }); * // using custom network interface name * const vlan98 = new proxmoxve.network.NetworkVlan("vlan98", { * comment: "VLAN 98", * "interface": "eno0", * nodeName: "pve", * vlan: 98, * }); * ``` * * ## Import * * #!/usr/bin/env sh * * #Interfaces can be imported using the `node_name:iface` format, e.g. * * ```sh * $ pulumi import proxmoxve:Network/networkVlan:NetworkVlan vlan99 pve:vlan99 * ``` */ class NetworkVlan extends pulumi.CustomResource { /** * Get an existing NetworkVlan 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 NetworkVlan(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of NetworkVlan. 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'] === NetworkVlan.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["address6"] = state ? state.address6 : undefined; resourceInputs["autostart"] = state ? state.autostart : undefined; resourceInputs["comment"] = state ? state.comment : undefined; resourceInputs["gateway"] = state ? state.gateway : undefined; resourceInputs["gateway6"] = state ? state.gateway6 : undefined; resourceInputs["interface"] = state ? state.interface : undefined; resourceInputs["mtu"] = state ? state.mtu : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nodeName"] = state ? state.nodeName : undefined; resourceInputs["vlan"] = state ? state.vlan : undefined; } else { const args = argsOrState; if ((!args || args.nodeName === undefined) && !opts.urn) { throw new Error("Missing required property 'nodeName'"); } resourceInputs["address"] = args ? args.address : undefined; resourceInputs["address6"] = args ? args.address6 : undefined; resourceInputs["autostart"] = args ? args.autostart : undefined; resourceInputs["comment"] = args ? args.comment : undefined; resourceInputs["gateway"] = args ? args.gateway : undefined; resourceInputs["gateway6"] = args ? args.gateway6 : undefined; resourceInputs["interface"] = args ? args.interface : undefined; resourceInputs["mtu"] = args ? args.mtu : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nodeName"] = args ? args.nodeName : undefined; resourceInputs["vlan"] = args ? args.vlan : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NetworkVlan.__pulumiType, name, resourceInputs, opts); } } exports.NetworkVlan = NetworkVlan; /** @internal */ NetworkVlan.__pulumiType = 'proxmoxve:Network/networkVlan:NetworkVlan'; //# sourceMappingURL=networkVlan.js.map