# 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 pulumi
import pulumi.runtime
from typing import Any, Callable, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

__all__ = [
    'GetVirtualMachinesResult',
    'AwaitableGetVirtualMachinesResult',
    'get_virtual_machines',
    'get_virtual_machines_output',
]

@pulumi.output_type
class GetVirtualMachinesResult:
    """
    A collection of values returned by getVirtualMachines.
    """
    def __init__(__self__, id=None, node_name=None, tags=None, vms=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if node_name and not isinstance(node_name, str):
            raise TypeError("Expected argument 'node_name' to be a str")
        pulumi.set(__self__, "node_name", node_name)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if vms and not isinstance(vms, list):
            raise TypeError("Expected argument 'vms' to be a list")
        pulumi.set(__self__, "vms", vms)

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

    @property
    @pulumi.getter(name="nodeName")
    def node_name(self) -> Optional[str]:
        """
        The node name.
        """
        return pulumi.get(self, "node_name")

    @property
    @pulumi.getter
    def tags(self) -> Optional[Sequence[str]]:
        """
        A list of tags of the VM.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def vms(self) -> Sequence['outputs.GetVirtualMachinesVmResult']:
        """
        The VMs list.
        """
        return pulumi.get(self, "vms")


class AwaitableGetVirtualMachinesResult(GetVirtualMachinesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetVirtualMachinesResult(
            id=self.id,
            node_name=self.node_name,
            tags=self.tags,
            vms=self.vms)


def get_virtual_machines(node_name: Optional[str] = None,
                         tags: Optional[Sequence[str]] = None,
                         opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVirtualMachinesResult:
    """
    Retrieves information about all VMs in the Proxmox cluster.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_proxmoxve as proxmoxve

    ubuntu_vms = proxmoxve.VM.get_virtual_machines(tags=["ubuntu"])
    ```


    :param str node_name: The node name.
    :param Sequence[str] tags: A list of tags to filter the VMs. The VM must have all
           the tags to be included in the result.
    """
    __args__ = dict()
    __args__['nodeName'] = node_name
    __args__['tags'] = tags
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('proxmoxve:VM/getVirtualMachines:getVirtualMachines', __args__, opts=opts, typ=GetVirtualMachinesResult).value

    return AwaitableGetVirtualMachinesResult(
        id=pulumi.get(__ret__, 'id'),
        node_name=pulumi.get(__ret__, 'node_name'),
        tags=pulumi.get(__ret__, 'tags'),
        vms=pulumi.get(__ret__, 'vms'))


@_utilities.lift_output_func(get_virtual_machines)
def get_virtual_machines_output(node_name: Optional[pulumi.Input[Optional[str]]] = None,
                                tags: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                                opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetVirtualMachinesResult]:
    """
    Retrieves information about all VMs in the Proxmox cluster.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_proxmoxve as proxmoxve

    ubuntu_vms = proxmoxve.VM.get_virtual_machines(tags=["ubuntu"])
    ```


    :param str node_name: The node name.
    :param Sequence[str] tags: A list of tags to filter the VMs. The VM must have all
           the tags to be included in the result.
    """
    ...
