# 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 copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = [
    'GetPifResult',
    'AwaitableGetPifResult',
    'get_pif',
    'get_pif_output',
]

warnings.warn("""xenorchestra.index/getpif.getPif has been deprecated in favor of xenorchestra.index/getxoapif.getXoaPif""", DeprecationWarning)

@pulumi.output_type
class GetPifResult:
    """
    A collection of values returned by getPif.
    """
    def __init__(__self__, attached=None, device=None, host=None, host_id=None, id=None, network=None, pool_id=None, uuid=None, vlan=None):
        if attached and not isinstance(attached, bool):
            raise TypeError("Expected argument 'attached' to be a bool")
        pulumi.set(__self__, "attached", attached)
        if device and not isinstance(device, str):
            raise TypeError("Expected argument 'device' to be a str")
        pulumi.set(__self__, "device", device)
        if host and not isinstance(host, str):
            raise TypeError("Expected argument 'host' to be a str")
        pulumi.set(__self__, "host", host)
        if host_id and not isinstance(host_id, str):
            raise TypeError("Expected argument 'host_id' to be a str")
        pulumi.set(__self__, "host_id", host_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if network and not isinstance(network, str):
            raise TypeError("Expected argument 'network' to be a str")
        pulumi.set(__self__, "network", network)
        if pool_id and not isinstance(pool_id, str):
            raise TypeError("Expected argument 'pool_id' to be a str")
        pulumi.set(__self__, "pool_id", pool_id)
        if uuid and not isinstance(uuid, str):
            raise TypeError("Expected argument 'uuid' to be a str")
        pulumi.set(__self__, "uuid", uuid)
        if vlan and not isinstance(vlan, int):
            raise TypeError("Expected argument 'vlan' to be a int")
        pulumi.set(__self__, "vlan", vlan)

    @property
    @pulumi.getter
    def attached(self) -> bool:
        """
        If the PIF is attached to the network.
        """
        return pulumi.get(self, "attached")

    @property
    @pulumi.getter
    def device(self) -> str:
        """
        The name of the network device. Examples include eth0, eth1, etc. See `ifconfig` for possible devices.
        """
        return pulumi.get(self, "device")

    @property
    @pulumi.getter
    def host(self) -> str:
        """
        The host the PIF is associated with.
        """
        return pulumi.get(self, "host")

    @property
    @pulumi.getter(name="hostId")
    def host_id(self) -> str:
        """
        The ID of the host that the PIF belongs to.
        """
        return pulumi.get(self, "host_id")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def network(self) -> str:
        """
        The network the PIF is associated with.
        """
        return pulumi.get(self, "network")

    @property
    @pulumi.getter(name="poolId")
    def pool_id(self) -> str:
        """
        The pool the PIF is associated with.
        """
        return pulumi.get(self, "pool_id")

    @property
    @pulumi.getter
    def uuid(self) -> str:
        """
        The uuid of the PIF.
        """
        return pulumi.get(self, "uuid")

    @property
    @pulumi.getter
    def vlan(self) -> int:
        """
        The VLAN the PIF belongs to.
        """
        return pulumi.get(self, "vlan")


class AwaitableGetPifResult(GetPifResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPifResult(
            attached=self.attached,
            device=self.device,
            host=self.host,
            host_id=self.host_id,
            id=self.id,
            network=self.network,
            pool_id=self.pool_id,
            uuid=self.uuid,
            vlan=self.vlan)


def get_pif(device: Optional[str] = None,
            host_id: Optional[str] = None,
            vlan: Optional[int] = None,
            opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPifResult:
    """
    ## Example Usage

    ```python
    import pulumi
    import pulumi_xenorchestra as xenorchestra

    eth0 = xenorchestra.get_xoa_pif(device="eth0",
        vlan=-1)
    demo_vm = xenorchestra.Vm("demo-vm", networks=[{
        "network_id": eth0.network,
    }])
    ```


    :param str device: The name of the network device. Examples include eth0, eth1, etc. See `ifconfig` for possible devices.
    :param str host_id: The ID of the host that the PIF belongs to.
    :param int vlan: The VLAN the PIF belongs to.
    """
    pulumi.log.warn("""get_pif is deprecated: xenorchestra.index/getpif.getPif has been deprecated in favor of xenorchestra.index/getxoapif.getXoaPif""")
    __args__ = dict()
    __args__['device'] = device
    __args__['hostId'] = host_id
    __args__['vlan'] = vlan
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('xenorchestra:index/getPif:getPif', __args__, opts=opts, typ=GetPifResult).value

    return AwaitableGetPifResult(
        attached=pulumi.get(__ret__, 'attached'),
        device=pulumi.get(__ret__, 'device'),
        host=pulumi.get(__ret__, 'host'),
        host_id=pulumi.get(__ret__, 'host_id'),
        id=pulumi.get(__ret__, 'id'),
        network=pulumi.get(__ret__, 'network'),
        pool_id=pulumi.get(__ret__, 'pool_id'),
        uuid=pulumi.get(__ret__, 'uuid'),
        vlan=pulumi.get(__ret__, 'vlan'))
def get_pif_output(device: Optional[pulumi.Input[str]] = None,
                   host_id: Optional[pulumi.Input[Optional[str]]] = None,
                   vlan: Optional[pulumi.Input[int]] = None,
                   opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPifResult]:
    """
    ## Example Usage

    ```python
    import pulumi
    import pulumi_xenorchestra as xenorchestra

    eth0 = xenorchestra.get_xoa_pif(device="eth0",
        vlan=-1)
    demo_vm = xenorchestra.Vm("demo-vm", networks=[{
        "network_id": eth0.network,
    }])
    ```


    :param str device: The name of the network device. Examples include eth0, eth1, etc. See `ifconfig` for possible devices.
    :param str host_id: The ID of the host that the PIF belongs to.
    :param int vlan: The VLAN the PIF belongs to.
    """
    pulumi.log.warn("""get_pif is deprecated: xenorchestra.index/getpif.getPif has been deprecated in favor of xenorchestra.index/getxoapif.getXoaPif""")
    __args__ = dict()
    __args__['device'] = device
    __args__['hostId'] = host_id
    __args__['vlan'] = vlan
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('xenorchestra:index/getPif:getPif', __args__, opts=opts, typ=GetPifResult)
    return __ret__.apply(lambda __response__: GetPifResult(
        attached=pulumi.get(__response__, 'attached'),
        device=pulumi.get(__response__, 'device'),
        host=pulumi.get(__response__, 'host'),
        host_id=pulumi.get(__response__, 'host_id'),
        id=pulumi.get(__response__, 'id'),
        network=pulumi.get(__response__, 'network'),
        pool_id=pulumi.get(__response__, 'pool_id'),
        uuid=pulumi.get(__response__, 'uuid'),
        vlan=pulumi.get(__response__, 'vlan')))
