# 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, overload
from . import _utilities
from . import outputs

__all__ = [
    'GetVirtualMachineResult',
    'AwaitableGetVirtualMachineResult',
    'get_virtual_machine',
    'get_virtual_machine_output',
]

@pulumi.output_type
class GetVirtualMachineResult:
    """
    A collection of values returned by getVirtualMachine.
    """
    def __init__(__self__, cloudinits=None, cpu=None, description=None, disks=None, hostname=None, id=None, machine_type=None, memory=None, name=None, namespace=None, network_interfaces=None, node_name=None, ssh_keys=None, start=None, state=None, tags=None):
        if cloudinits and not isinstance(cloudinits, list):
            raise TypeError("Expected argument 'cloudinits' to be a list")
        pulumi.set(__self__, "cloudinits", cloudinits)
        if cpu and not isinstance(cpu, int):
            raise TypeError("Expected argument 'cpu' to be a int")
        pulumi.set(__self__, "cpu", cpu)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if disks and not isinstance(disks, list):
            raise TypeError("Expected argument 'disks' to be a list")
        pulumi.set(__self__, "disks", disks)
        if hostname and not isinstance(hostname, str):
            raise TypeError("Expected argument 'hostname' to be a str")
        pulumi.set(__self__, "hostname", hostname)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if machine_type and not isinstance(machine_type, str):
            raise TypeError("Expected argument 'machine_type' to be a str")
        pulumi.set(__self__, "machine_type", machine_type)
        if memory and not isinstance(memory, str):
            raise TypeError("Expected argument 'memory' to be a str")
        pulumi.set(__self__, "memory", memory)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if namespace and not isinstance(namespace, str):
            raise TypeError("Expected argument 'namespace' to be a str")
        pulumi.set(__self__, "namespace", namespace)
        if network_interfaces and not isinstance(network_interfaces, list):
            raise TypeError("Expected argument 'network_interfaces' to be a list")
        pulumi.set(__self__, "network_interfaces", network_interfaces)
        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 ssh_keys and not isinstance(ssh_keys, list):
            raise TypeError("Expected argument 'ssh_keys' to be a list")
        pulumi.set(__self__, "ssh_keys", ssh_keys)
        if start and not isinstance(start, bool):
            raise TypeError("Expected argument 'start' to be a bool")
        pulumi.set(__self__, "start", start)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        if tags and not isinstance(tags, dict):
            raise TypeError("Expected argument 'tags' to be a dict")
        pulumi.set(__self__, "tags", tags)

    @property
    @pulumi.getter
    def cloudinits(self) -> Sequence['outputs.GetVirtualMachineCloudinitResult']:
        return pulumi.get(self, "cloudinits")

    @property
    @pulumi.getter
    def cpu(self) -> int:
        return pulumi.get(self, "cpu")

    @property
    @pulumi.getter
    def description(self) -> str:
        """
        Any text you want that better describes this resource
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def disks(self) -> Sequence['outputs.GetVirtualMachineDiskResult']:
        return pulumi.get(self, "disks")

    @property
    @pulumi.getter
    def hostname(self) -> str:
        return pulumi.get(self, "hostname")

    @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="machineType")
    def machine_type(self) -> str:
        return pulumi.get(self, "machine_type")

    @property
    @pulumi.getter
    def memory(self) -> str:
        return pulumi.get(self, "memory")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        A unique name
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def namespace(self) -> Optional[str]:
        return pulumi.get(self, "namespace")

    @property
    @pulumi.getter(name="networkInterfaces")
    def network_interfaces(self) -> Sequence['outputs.GetVirtualMachineNetworkInterfaceResult']:
        return pulumi.get(self, "network_interfaces")

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

    @property
    @pulumi.getter(name="sshKeys")
    def ssh_keys(self) -> Sequence[str]:
        return pulumi.get(self, "ssh_keys")

    @property
    @pulumi.getter
    def start(self) -> bool:
        return pulumi.get(self, "start")

    @property
    @pulumi.getter
    def state(self) -> str:
        return pulumi.get(self, "state")

    @property
    @pulumi.getter
    def tags(self) -> Mapping[str, Any]:
        return pulumi.get(self, "tags")


class AwaitableGetVirtualMachineResult(GetVirtualMachineResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetVirtualMachineResult(
            cloudinits=self.cloudinits,
            cpu=self.cpu,
            description=self.description,
            disks=self.disks,
            hostname=self.hostname,
            id=self.id,
            machine_type=self.machine_type,
            memory=self.memory,
            name=self.name,
            namespace=self.namespace,
            network_interfaces=self.network_interfaces,
            node_name=self.node_name,
            ssh_keys=self.ssh_keys,
            start=self.start,
            state=self.state,
            tags=self.tags)


def get_virtual_machine(name: Optional[str] = None,
                        namespace: Optional[str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVirtualMachineResult:
    """
    ## Example Usage

    ```python
    import pulumi
    import pulumi_harvester as harvester

    ubuntu20_dev = harvester.get_virtual_machine(name="ubuntu-dev",
        namespace="default")
    ```


    :param str name: A unique name
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['namespace'] = namespace
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('harvester:index/getVirtualMachine:getVirtualMachine', __args__, opts=opts, typ=GetVirtualMachineResult).value

    return AwaitableGetVirtualMachineResult(
        cloudinits=__ret__.cloudinits,
        cpu=__ret__.cpu,
        description=__ret__.description,
        disks=__ret__.disks,
        hostname=__ret__.hostname,
        id=__ret__.id,
        machine_type=__ret__.machine_type,
        memory=__ret__.memory,
        name=__ret__.name,
        namespace=__ret__.namespace,
        network_interfaces=__ret__.network_interfaces,
        node_name=__ret__.node_name,
        ssh_keys=__ret__.ssh_keys,
        start=__ret__.start,
        state=__ret__.state,
        tags=__ret__.tags)


@_utilities.lift_output_func(get_virtual_machine)
def get_virtual_machine_output(name: Optional[pulumi.Input[str]] = None,
                               namespace: Optional[pulumi.Input[Optional[str]]] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetVirtualMachineResult]:
    """
    ## Example Usage

    ```python
    import pulumi
    import pulumi_harvester as harvester

    ubuntu20_dev = harvester.get_virtual_machine(name="ubuntu-dev",
        namespace="default")
    ```


    :param str name: A unique name
    """
    ...
