# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities, _tables

__all__ = ['HostVirtualSwitch']


class HostVirtualSwitch(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 active_nics: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 allow_forged_transmits: Optional[pulumi.Input[bool]] = None,
                 allow_mac_changes: Optional[pulumi.Input[bool]] = None,
                 allow_promiscuous: Optional[pulumi.Input[bool]] = None,
                 beacon_interval: Optional[pulumi.Input[int]] = None,
                 check_beacon: Optional[pulumi.Input[bool]] = None,
                 failback: Optional[pulumi.Input[bool]] = None,
                 host_system_id: Optional[pulumi.Input[str]] = None,
                 link_discovery_operation: Optional[pulumi.Input[str]] = None,
                 link_discovery_protocol: Optional[pulumi.Input[str]] = None,
                 mtu: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 network_adapters: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 notify_switches: Optional[pulumi.Input[bool]] = None,
                 number_of_ports: Optional[pulumi.Input[int]] = None,
                 shaping_average_bandwidth: Optional[pulumi.Input[int]] = None,
                 shaping_burst_size: Optional[pulumi.Input[int]] = None,
                 shaping_enabled: Optional[pulumi.Input[bool]] = None,
                 shaping_peak_bandwidth: Optional[pulumi.Input[int]] = None,
                 standby_nics: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 teaming_policy: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Create a HostVirtualSwitch resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] active_nics: The list of active network adapters used for load
               balancing.
        :param pulumi.Input[bool] allow_forged_transmits: Controls whether or not the virtual
               network adapter is allowed to send network traffic with a different MAC
               address than that of its own. Default: `true`.
        :param pulumi.Input[bool] allow_mac_changes: Controls whether or not the Media Access
               Control (MAC) address can be changed. Default: `true`.
        :param pulumi.Input[bool] allow_promiscuous: Enable promiscuous mode on the network. This
               flag indicates whether or not all traffic is seen on a given port. Default:
               `false`.
        :param pulumi.Input[int] beacon_interval: The interval, in seconds, that a NIC beacon
               packet is sent out. This can be used with `check_beacon` to
               offer link failure capability beyond link status only. Default: `1`.
        :param pulumi.Input[bool] check_beacon: Enable beacon probing - this requires that the
               `beacon_interval` option has been set in the bridge
               options. If this is set to `false`, only link status is used to check for
               failed NICs.  Default: `false`.
        :param pulumi.Input[bool] failback: If set to `true`, the teaming policy will re-activate
               failed interfaces higher in precedence when they come back up.  Default:
               `true`.
        :param pulumi.Input[str] host_system_id: The managed object ID of
               the host to set the virtual switch up on. Forces a new resource if changed.
        :param pulumi.Input[str] link_discovery_operation: Whether to `advertise` or `listen`
               for link discovery traffic. Default: `listen`.
        :param pulumi.Input[str] link_discovery_protocol: The discovery protocol type.  Valid
               types are `cpd` and `lldp`. Default: `cdp`.
        :param pulumi.Input[int] mtu: The maximum transmission unit (MTU) for the virtual
               switch. Default: `1500`.
        :param pulumi.Input[str] name: The name of the virtual switch. Forces a new resource if
               changed.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] network_adapters: The network interfaces to bind to the bridge.
        :param pulumi.Input[bool] notify_switches: If set to `true`, the teaming policy will
               notify the broadcast network of a NIC failover, triggering cache updates.
               Default: `true`.
        :param pulumi.Input[int] number_of_ports: The number of ports to create with this
               virtual switch. Default: `128`.
        :param pulumi.Input[int] shaping_average_bandwidth: The average bandwidth in bits per
               second if traffic shaping is enabled. Default: `0`
        :param pulumi.Input[int] shaping_burst_size: The maximum burst size allowed in bytes if
               shaping is enabled. Default: `0`
        :param pulumi.Input[bool] shaping_enabled: Set to `true` to enable the traffic shaper for
               ports managed by this virtual switch. Default: `false`.
        :param pulumi.Input[int] shaping_peak_bandwidth: The peak bandwidth during bursts in
               bits per second if traffic shaping is enabled. Default: `0`
        :param pulumi.Input[Sequence[pulumi.Input[str]]] standby_nics: The list of standby network adapters used for
               failover.
        :param pulumi.Input[str] teaming_policy: The network adapter teaming policy. Can be one
               of `loadbalance_ip`, `loadbalance_srcmac`, `loadbalance_srcid`, or
               `failover_explicit`. Default: `loadbalance_srcid`.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            if active_nics is None and not opts.urn:
                raise TypeError("Missing required property 'active_nics'")
            __props__['active_nics'] = active_nics
            __props__['allow_forged_transmits'] = allow_forged_transmits
            __props__['allow_mac_changes'] = allow_mac_changes
            __props__['allow_promiscuous'] = allow_promiscuous
            __props__['beacon_interval'] = beacon_interval
            __props__['check_beacon'] = check_beacon
            __props__['failback'] = failback
            if host_system_id is None and not opts.urn:
                raise TypeError("Missing required property 'host_system_id'")
            __props__['host_system_id'] = host_system_id
            __props__['link_discovery_operation'] = link_discovery_operation
            __props__['link_discovery_protocol'] = link_discovery_protocol
            __props__['mtu'] = mtu
            __props__['name'] = name
            if network_adapters is None and not opts.urn:
                raise TypeError("Missing required property 'network_adapters'")
            __props__['network_adapters'] = network_adapters
            __props__['notify_switches'] = notify_switches
            __props__['number_of_ports'] = number_of_ports
            __props__['shaping_average_bandwidth'] = shaping_average_bandwidth
            __props__['shaping_burst_size'] = shaping_burst_size
            __props__['shaping_enabled'] = shaping_enabled
            __props__['shaping_peak_bandwidth'] = shaping_peak_bandwidth
            if standby_nics is None and not opts.urn:
                raise TypeError("Missing required property 'standby_nics'")
            __props__['standby_nics'] = standby_nics
            __props__['teaming_policy'] = teaming_policy
        super(HostVirtualSwitch, __self__).__init__(
            'vsphere:index/hostVirtualSwitch:HostVirtualSwitch',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            active_nics: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            allow_forged_transmits: Optional[pulumi.Input[bool]] = None,
            allow_mac_changes: Optional[pulumi.Input[bool]] = None,
            allow_promiscuous: Optional[pulumi.Input[bool]] = None,
            beacon_interval: Optional[pulumi.Input[int]] = None,
            check_beacon: Optional[pulumi.Input[bool]] = None,
            failback: Optional[pulumi.Input[bool]] = None,
            host_system_id: Optional[pulumi.Input[str]] = None,
            link_discovery_operation: Optional[pulumi.Input[str]] = None,
            link_discovery_protocol: Optional[pulumi.Input[str]] = None,
            mtu: Optional[pulumi.Input[int]] = None,
            name: Optional[pulumi.Input[str]] = None,
            network_adapters: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            notify_switches: Optional[pulumi.Input[bool]] = None,
            number_of_ports: Optional[pulumi.Input[int]] = None,
            shaping_average_bandwidth: Optional[pulumi.Input[int]] = None,
            shaping_burst_size: Optional[pulumi.Input[int]] = None,
            shaping_enabled: Optional[pulumi.Input[bool]] = None,
            shaping_peak_bandwidth: Optional[pulumi.Input[int]] = None,
            standby_nics: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            teaming_policy: Optional[pulumi.Input[str]] = None) -> 'HostVirtualSwitch':
        """
        Get an existing HostVirtualSwitch resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] active_nics: The list of active network adapters used for load
               balancing.
        :param pulumi.Input[bool] allow_forged_transmits: Controls whether or not the virtual
               network adapter is allowed to send network traffic with a different MAC
               address than that of its own. Default: `true`.
        :param pulumi.Input[bool] allow_mac_changes: Controls whether or not the Media Access
               Control (MAC) address can be changed. Default: `true`.
        :param pulumi.Input[bool] allow_promiscuous: Enable promiscuous mode on the network. This
               flag indicates whether or not all traffic is seen on a given port. Default:
               `false`.
        :param pulumi.Input[int] beacon_interval: The interval, in seconds, that a NIC beacon
               packet is sent out. This can be used with `check_beacon` to
               offer link failure capability beyond link status only. Default: `1`.
        :param pulumi.Input[bool] check_beacon: Enable beacon probing - this requires that the
               `beacon_interval` option has been set in the bridge
               options. If this is set to `false`, only link status is used to check for
               failed NICs.  Default: `false`.
        :param pulumi.Input[bool] failback: If set to `true`, the teaming policy will re-activate
               failed interfaces higher in precedence when they come back up.  Default:
               `true`.
        :param pulumi.Input[str] host_system_id: The managed object ID of
               the host to set the virtual switch up on. Forces a new resource if changed.
        :param pulumi.Input[str] link_discovery_operation: Whether to `advertise` or `listen`
               for link discovery traffic. Default: `listen`.
        :param pulumi.Input[str] link_discovery_protocol: The discovery protocol type.  Valid
               types are `cpd` and `lldp`. Default: `cdp`.
        :param pulumi.Input[int] mtu: The maximum transmission unit (MTU) for the virtual
               switch. Default: `1500`.
        :param pulumi.Input[str] name: The name of the virtual switch. Forces a new resource if
               changed.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] network_adapters: The network interfaces to bind to the bridge.
        :param pulumi.Input[bool] notify_switches: If set to `true`, the teaming policy will
               notify the broadcast network of a NIC failover, triggering cache updates.
               Default: `true`.
        :param pulumi.Input[int] number_of_ports: The number of ports to create with this
               virtual switch. Default: `128`.
        :param pulumi.Input[int] shaping_average_bandwidth: The average bandwidth in bits per
               second if traffic shaping is enabled. Default: `0`
        :param pulumi.Input[int] shaping_burst_size: The maximum burst size allowed in bytes if
               shaping is enabled. Default: `0`
        :param pulumi.Input[bool] shaping_enabled: Set to `true` to enable the traffic shaper for
               ports managed by this virtual switch. Default: `false`.
        :param pulumi.Input[int] shaping_peak_bandwidth: The peak bandwidth during bursts in
               bits per second if traffic shaping is enabled. Default: `0`
        :param pulumi.Input[Sequence[pulumi.Input[str]]] standby_nics: The list of standby network adapters used for
               failover.
        :param pulumi.Input[str] teaming_policy: The network adapter teaming policy. Can be one
               of `loadbalance_ip`, `loadbalance_srcmac`, `loadbalance_srcid`, or
               `failover_explicit`. Default: `loadbalance_srcid`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["active_nics"] = active_nics
        __props__["allow_forged_transmits"] = allow_forged_transmits
        __props__["allow_mac_changes"] = allow_mac_changes
        __props__["allow_promiscuous"] = allow_promiscuous
        __props__["beacon_interval"] = beacon_interval
        __props__["check_beacon"] = check_beacon
        __props__["failback"] = failback
        __props__["host_system_id"] = host_system_id
        __props__["link_discovery_operation"] = link_discovery_operation
        __props__["link_discovery_protocol"] = link_discovery_protocol
        __props__["mtu"] = mtu
        __props__["name"] = name
        __props__["network_adapters"] = network_adapters
        __props__["notify_switches"] = notify_switches
        __props__["number_of_ports"] = number_of_ports
        __props__["shaping_average_bandwidth"] = shaping_average_bandwidth
        __props__["shaping_burst_size"] = shaping_burst_size
        __props__["shaping_enabled"] = shaping_enabled
        __props__["shaping_peak_bandwidth"] = shaping_peak_bandwidth
        __props__["standby_nics"] = standby_nics
        __props__["teaming_policy"] = teaming_policy
        return HostVirtualSwitch(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="activeNics")
    def active_nics(self) -> pulumi.Output[Sequence[str]]:
        """
        The list of active network adapters used for load
        balancing.
        """
        return pulumi.get(self, "active_nics")

    @property
    @pulumi.getter(name="allowForgedTransmits")
    def allow_forged_transmits(self) -> pulumi.Output[Optional[bool]]:
        """
        Controls whether or not the virtual
        network adapter is allowed to send network traffic with a different MAC
        address than that of its own. Default: `true`.
        """
        return pulumi.get(self, "allow_forged_transmits")

    @property
    @pulumi.getter(name="allowMacChanges")
    def allow_mac_changes(self) -> pulumi.Output[Optional[bool]]:
        """
        Controls whether or not the Media Access
        Control (MAC) address can be changed. Default: `true`.
        """
        return pulumi.get(self, "allow_mac_changes")

    @property
    @pulumi.getter(name="allowPromiscuous")
    def allow_promiscuous(self) -> pulumi.Output[Optional[bool]]:
        """
        Enable promiscuous mode on the network. This
        flag indicates whether or not all traffic is seen on a given port. Default:
        `false`.
        """
        return pulumi.get(self, "allow_promiscuous")

    @property
    @pulumi.getter(name="beaconInterval")
    def beacon_interval(self) -> pulumi.Output[Optional[int]]:
        """
        The interval, in seconds, that a NIC beacon
        packet is sent out. This can be used with `check_beacon` to
        offer link failure capability beyond link status only. Default: `1`.
        """
        return pulumi.get(self, "beacon_interval")

    @property
    @pulumi.getter(name="checkBeacon")
    def check_beacon(self) -> pulumi.Output[Optional[bool]]:
        """
        Enable beacon probing - this requires that the
        `beacon_interval` option has been set in the bridge
        options. If this is set to `false`, only link status is used to check for
        failed NICs.  Default: `false`.
        """
        return pulumi.get(self, "check_beacon")

    @property
    @pulumi.getter
    def failback(self) -> pulumi.Output[Optional[bool]]:
        """
        If set to `true`, the teaming policy will re-activate
        failed interfaces higher in precedence when they come back up.  Default:
        `true`.
        """
        return pulumi.get(self, "failback")

    @property
    @pulumi.getter(name="hostSystemId")
    def host_system_id(self) -> pulumi.Output[str]:
        """
        The managed object ID of
        the host to set the virtual switch up on. Forces a new resource if changed.
        """
        return pulumi.get(self, "host_system_id")

    @property
    @pulumi.getter(name="linkDiscoveryOperation")
    def link_discovery_operation(self) -> pulumi.Output[Optional[str]]:
        """
        Whether to `advertise` or `listen`
        for link discovery traffic. Default: `listen`.
        """
        return pulumi.get(self, "link_discovery_operation")

    @property
    @pulumi.getter(name="linkDiscoveryProtocol")
    def link_discovery_protocol(self) -> pulumi.Output[Optional[str]]:
        """
        The discovery protocol type.  Valid
        types are `cpd` and `lldp`. Default: `cdp`.
        """
        return pulumi.get(self, "link_discovery_protocol")

    @property
    @pulumi.getter
    def mtu(self) -> pulumi.Output[Optional[int]]:
        """
        The maximum transmission unit (MTU) for the virtual
        switch. Default: `1500`.
        """
        return pulumi.get(self, "mtu")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name of the virtual switch. Forces a new resource if
        changed.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="networkAdapters")
    def network_adapters(self) -> pulumi.Output[Sequence[str]]:
        """
        The network interfaces to bind to the bridge.
        """
        return pulumi.get(self, "network_adapters")

    @property
    @pulumi.getter(name="notifySwitches")
    def notify_switches(self) -> pulumi.Output[Optional[bool]]:
        """
        If set to `true`, the teaming policy will
        notify the broadcast network of a NIC failover, triggering cache updates.
        Default: `true`.
        """
        return pulumi.get(self, "notify_switches")

    @property
    @pulumi.getter(name="numberOfPorts")
    def number_of_ports(self) -> pulumi.Output[Optional[int]]:
        """
        The number of ports to create with this
        virtual switch. Default: `128`.
        """
        return pulumi.get(self, "number_of_ports")

    @property
    @pulumi.getter(name="shapingAverageBandwidth")
    def shaping_average_bandwidth(self) -> pulumi.Output[Optional[int]]:
        """
        The average bandwidth in bits per
        second if traffic shaping is enabled. Default: `0`
        """
        return pulumi.get(self, "shaping_average_bandwidth")

    @property
    @pulumi.getter(name="shapingBurstSize")
    def shaping_burst_size(self) -> pulumi.Output[Optional[int]]:
        """
        The maximum burst size allowed in bytes if
        shaping is enabled. Default: `0`
        """
        return pulumi.get(self, "shaping_burst_size")

    @property
    @pulumi.getter(name="shapingEnabled")
    def shaping_enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Set to `true` to enable the traffic shaper for
        ports managed by this virtual switch. Default: `false`.
        """
        return pulumi.get(self, "shaping_enabled")

    @property
    @pulumi.getter(name="shapingPeakBandwidth")
    def shaping_peak_bandwidth(self) -> pulumi.Output[Optional[int]]:
        """
        The peak bandwidth during bursts in
        bits per second if traffic shaping is enabled. Default: `0`
        """
        return pulumi.get(self, "shaping_peak_bandwidth")

    @property
    @pulumi.getter(name="standbyNics")
    def standby_nics(self) -> pulumi.Output[Sequence[str]]:
        """
        The list of standby network adapters used for
        failover.
        """
        return pulumi.get(self, "standby_nics")

    @property
    @pulumi.getter(name="teamingPolicy")
    def teaming_policy(self) -> pulumi.Output[Optional[str]]:
        """
        The network adapter teaming policy. Can be one
        of `loadbalance_ip`, `loadbalance_srcmac`, `loadbalance_srcid`, or
        `failover_explicit`. Default: `loadbalance_srcid`.
        """
        return pulumi.get(self, "teaming_policy")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

