# 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, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetMachineResult',
    'AwaitableGetMachineResult',
    'get_machine',
    'get_machine_output',
]

@pulumi.output_type
class GetMachineResult:
    """
    A collection of values returned by getMachine.
    """
    def __init__(__self__, address=None, cloud_account_ids=None, created_at=None, custom_properties=None, deployment_id=None, description=None, external_id=None, external_region_id=None, external_zone_id=None, filter=None, id=None, links=None, name=None, org_id=None, owner=None, power_state=None, project_id=None, tags=None, updated_at=None):
        if address and not isinstance(address, str):
            raise TypeError("Expected argument 'address' to be a str")
        pulumi.set(__self__, "address", address)
        if cloud_account_ids and not isinstance(cloud_account_ids, list):
            raise TypeError("Expected argument 'cloud_account_ids' to be a list")
        pulumi.set(__self__, "cloud_account_ids", cloud_account_ids)
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if custom_properties and not isinstance(custom_properties, dict):
            raise TypeError("Expected argument 'custom_properties' to be a dict")
        pulumi.set(__self__, "custom_properties", custom_properties)
        if deployment_id and not isinstance(deployment_id, str):
            raise TypeError("Expected argument 'deployment_id' to be a str")
        pulumi.set(__self__, "deployment_id", deployment_id)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if external_id and not isinstance(external_id, str):
            raise TypeError("Expected argument 'external_id' to be a str")
        pulumi.set(__self__, "external_id", external_id)
        if external_region_id and not isinstance(external_region_id, str):
            raise TypeError("Expected argument 'external_region_id' to be a str")
        pulumi.set(__self__, "external_region_id", external_region_id)
        if external_zone_id and not isinstance(external_zone_id, str):
            raise TypeError("Expected argument 'external_zone_id' to be a str")
        pulumi.set(__self__, "external_zone_id", external_zone_id)
        if filter and not isinstance(filter, str):
            raise TypeError("Expected argument 'filter' to be a str")
        pulumi.set(__self__, "filter", filter)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if links and not isinstance(links, list):
            raise TypeError("Expected argument 'links' to be a list")
        pulumi.set(__self__, "links", links)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if org_id and not isinstance(org_id, str):
            raise TypeError("Expected argument 'org_id' to be a str")
        pulumi.set(__self__, "org_id", org_id)
        if owner and not isinstance(owner, str):
            raise TypeError("Expected argument 'owner' to be a str")
        pulumi.set(__self__, "owner", owner)
        if power_state and not isinstance(power_state, str):
            raise TypeError("Expected argument 'power_state' to be a str")
        pulumi.set(__self__, "power_state", power_state)
        if project_id and not isinstance(project_id, str):
            raise TypeError("Expected argument 'project_id' to be a str")
        pulumi.set(__self__, "project_id", project_id)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if updated_at and not isinstance(updated_at, str):
            raise TypeError("Expected argument 'updated_at' to be a str")
        pulumi.set(__self__, "updated_at", updated_at)

    @property
    @pulumi.getter
    def address(self) -> str:
        """
        Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address.
        """
        return pulumi.get(self, "address")

    @property
    @pulumi.getter(name="cloudAccountIds")
    def cloud_account_ids(self) -> Sequence[str]:
        """
        Set of ids of the cloud accounts this resource belongs to.
        """
        return pulumi.get(self, "cloud_account_ids")

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> str:
        """
        Date when the entity was created. The date is in ISO 6801 and UTC.
        """
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter(name="customProperties")
    def custom_properties(self) -> Mapping[str, Any]:
        """
        Additional properties that may be used to extend the base resource.
        """
        return pulumi.get(self, "custom_properties")

    @property
    @pulumi.getter(name="deploymentId")
    def deployment_id(self) -> str:
        """
        Deployment id that is associated with this resource.
        """
        return pulumi.get(self, "deployment_id")

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

    @property
    @pulumi.getter(name="externalId")
    def external_id(self) -> str:
        """
        External entity Id on the provider side.
        """
        return pulumi.get(self, "external_id")

    @property
    @pulumi.getter(name="externalRegionId")
    def external_region_id(self) -> str:
        """
        The external regionId of the resource.
        """
        return pulumi.get(self, "external_region_id")

    @property
    @pulumi.getter(name="externalZoneId")
    def external_zone_id(self) -> str:
        """
        The external zoneId of the resource.
        """
        return pulumi.get(self, "external_zone_id")

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

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

    @property
    @pulumi.getter
    def links(self) -> Sequence['outputs.GetMachineLinkResult']:
        """
        HATEOAS of the entity
        """
        return pulumi.get(self, "links")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        A human-friendly name used as an identifier in APIs that support this option.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="orgId")
    def org_id(self) -> str:
        """
        The id of the organization this entity belongs to.
        """
        return pulumi.get(self, "org_id")

    @property
    @pulumi.getter
    def owner(self) -> str:
        """
        Email of the user that owns the entity.
        """
        return pulumi.get(self, "owner")

    @property
    @pulumi.getter(name="powerState")
    def power_state(self) -> str:
        """
        Power state of machine.
        """
        return pulumi.get(self, "power_state")

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> str:
        """
        The id of the project this resource belongs to.
        """
        return pulumi.get(self, "project_id")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetMachineTagResult']:
        """
        A set of tag keys and optional values that were set on this resource.
        example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
        """
        return pulumi.get(self, "tags")

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


class AwaitableGetMachineResult(GetMachineResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetMachineResult(
            address=self.address,
            cloud_account_ids=self.cloud_account_ids,
            created_at=self.created_at,
            custom_properties=self.custom_properties,
            deployment_id=self.deployment_id,
            description=self.description,
            external_id=self.external_id,
            external_region_id=self.external_region_id,
            external_zone_id=self.external_zone_id,
            filter=self.filter,
            id=self.id,
            links=self.links,
            name=self.name,
            org_id=self.org_id,
            owner=self.owner,
            power_state=self.power_state,
            project_id=self.project_id,
            tags=self.tags,
            updated_at=self.updated_at)


def get_machine(description: Optional[str] = None,
                filter: Optional[str] = None,
                id: Optional[str] = None,
                tags: Optional[Sequence[pulumi.InputType['GetMachineTagArgs']]] = None,
                opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetMachineResult:
    """
    ## ---layout: "vra"

    page_title: "VMware vRealize Automation: machine.Machine"
    description: |-
      Provides a data lookup for vra_machine.
    ---

    # Data Source: machine.Machine
    ## Example Usage
    ### S

    This is an example of how to read a machine data source.

    ```python
    import pulumi
    import pulumi_vra as vra

    this = vra.machine.get_machine(id=var["my_machine_id"])
    ```

    **Machine data source filter by name:**
    ```python
    import pulumi
    import pulumi_vra as vra

    this = vra.machine.get_machine(filter=f"name eq '{var['machine_name']}'")
    ```


    :param str description: A human-friendly description.
    :param str filter: Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    :param str id: The id of the image profile instance.
    :param Sequence[pulumi.InputType['GetMachineTagArgs']] tags: A set of tag keys and optional values that were set on this resource.
           example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
    """
    __args__ = dict()
    __args__['description'] = description
    __args__['filter'] = filter
    __args__['id'] = id
    __args__['tags'] = tags
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('vra:machine/getMachine:getMachine', __args__, opts=opts, typ=GetMachineResult).value

    return AwaitableGetMachineResult(
        address=__ret__.address,
        cloud_account_ids=__ret__.cloud_account_ids,
        created_at=__ret__.created_at,
        custom_properties=__ret__.custom_properties,
        deployment_id=__ret__.deployment_id,
        description=__ret__.description,
        external_id=__ret__.external_id,
        external_region_id=__ret__.external_region_id,
        external_zone_id=__ret__.external_zone_id,
        filter=__ret__.filter,
        id=__ret__.id,
        links=__ret__.links,
        name=__ret__.name,
        org_id=__ret__.org_id,
        owner=__ret__.owner,
        power_state=__ret__.power_state,
        project_id=__ret__.project_id,
        tags=__ret__.tags,
        updated_at=__ret__.updated_at)


@_utilities.lift_output_func(get_machine)
def get_machine_output(description: Optional[pulumi.Input[Optional[str]]] = None,
                       filter: Optional[pulumi.Input[Optional[str]]] = None,
                       id: Optional[pulumi.Input[Optional[str]]] = None,
                       tags: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetMachineTagArgs']]]]] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetMachineResult]:
    """
    ## ---layout: "vra"

    page_title: "VMware vRealize Automation: machine.Machine"
    description: |-
      Provides a data lookup for vra_machine.
    ---

    # Data Source: machine.Machine
    ## Example Usage
    ### S

    This is an example of how to read a machine data source.

    ```python
    import pulumi
    import pulumi_vra as vra

    this = vra.machine.get_machine(id=var["my_machine_id"])
    ```

    **Machine data source filter by name:**
    ```python
    import pulumi
    import pulumi_vra as vra

    this = vra.machine.get_machine(filter=f"name eq '{var['machine_name']}'")
    ```


    :param str description: A human-friendly description.
    :param str filter: Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    :param str id: The id of the image profile instance.
    :param Sequence[pulumi.InputType['GetMachineTagArgs']] tags: A set of tag keys and optional values that were set on this resource.
           example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
    """
    ...
