# 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

__all__ = [
    'GetHAResourceResult',
    'AwaitableGetHAResourceResult',
    'get_ha_resource',
    'get_ha_resource_output',
]

@pulumi.output_type
class GetHAResourceResult:
    """
    A collection of values returned by getHAResource.
    """
    def __init__(__self__, comment=None, group=None, id=None, max_relocate=None, max_restart=None, resource_id=None, state=None, type=None):
        if comment and not isinstance(comment, str):
            raise TypeError("Expected argument 'comment' to be a str")
        pulumi.set(__self__, "comment", comment)
        if group and not isinstance(group, str):
            raise TypeError("Expected argument 'group' to be a str")
        pulumi.set(__self__, "group", group)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if max_relocate and not isinstance(max_relocate, int):
            raise TypeError("Expected argument 'max_relocate' to be a int")
        pulumi.set(__self__, "max_relocate", max_relocate)
        if max_restart and not isinstance(max_restart, int):
            raise TypeError("Expected argument 'max_restart' to be a int")
        pulumi.set(__self__, "max_restart", max_restart)
        if resource_id and not isinstance(resource_id, str):
            raise TypeError("Expected argument 'resource_id' to be a str")
        pulumi.set(__self__, "resource_id", resource_id)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter
    def comment(self) -> str:
        """
        The comment associated with this resource.
        """
        return pulumi.get(self, "comment")

    @property
    @pulumi.getter
    def group(self) -> str:
        """
        The identifier of the High Availability group this resource is a member of.
        """
        return pulumi.get(self, "group")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The unique identifier of this resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="maxRelocate")
    def max_relocate(self) -> int:
        """
        The maximal number of relocation attempts.
        """
        return pulumi.get(self, "max_relocate")

    @property
    @pulumi.getter(name="maxRestart")
    def max_restart(self) -> int:
        """
        The maximal number of restart attempts.
        """
        return pulumi.get(self, "max_restart")

    @property
    @pulumi.getter(name="resourceId")
    def resource_id(self) -> str:
        """
        The identifier of the Proxmox HA resource to read.
        """
        return pulumi.get(self, "resource_id")

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

    @property
    @pulumi.getter
    def type(self) -> str:
        """
        The type of High Availability resource (`vm` or `ct`).
        """
        return pulumi.get(self, "type")


class AwaitableGetHAResourceResult(GetHAResourceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetHAResourceResult(
            comment=self.comment,
            group=self.group,
            id=self.id,
            max_relocate=self.max_relocate,
            max_restart=self.max_restart,
            resource_id=self.resource_id,
            state=self.state,
            type=self.type)


def get_ha_resource(resource_id: Optional[str] = None,
                    opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetHAResourceResult:
    """
    Retrieves the list of High Availability resources.

    ## Example Usage

    <!--Start PulumiCodeChooser -->
    ```python
    import pulumi
    import pulumi_proxmoxve as proxmoxve

    all = proxmoxve.HA.get_ha_resources()
    example = [proxmoxve.HA.get_ha_resource(resource_id=__value) for __key, __value in all.resource_ids]
    pulumi.export("proxmoxVirtualEnvironmentHaresourcesFull", example)
    ```
    <!--End PulumiCodeChooser -->


    :param str resource_id: The identifier of the Proxmox HA resource to read.
    """
    __args__ = dict()
    __args__['resourceId'] = resource_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('proxmoxve:HA/getHAResource:getHAResource', __args__, opts=opts, typ=GetHAResourceResult).value

    return AwaitableGetHAResourceResult(
        comment=pulumi.get(__ret__, 'comment'),
        group=pulumi.get(__ret__, 'group'),
        id=pulumi.get(__ret__, 'id'),
        max_relocate=pulumi.get(__ret__, 'max_relocate'),
        max_restart=pulumi.get(__ret__, 'max_restart'),
        resource_id=pulumi.get(__ret__, 'resource_id'),
        state=pulumi.get(__ret__, 'state'),
        type=pulumi.get(__ret__, 'type'))


@_utilities.lift_output_func(get_ha_resource)
def get_ha_resource_output(resource_id: Optional[pulumi.Input[str]] = None,
                           opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetHAResourceResult]:
    """
    Retrieves the list of High Availability resources.

    ## Example Usage

    <!--Start PulumiCodeChooser -->
    ```python
    import pulumi
    import pulumi_proxmoxve as proxmoxve

    all = proxmoxve.HA.get_ha_resources()
    example = [proxmoxve.HA.get_ha_resource(resource_id=__value) for __key, __value in all.resource_ids]
    pulumi.export("proxmoxVirtualEnvironmentHaresourcesFull", example)
    ```
    <!--End PulumiCodeChooser -->


    :param str resource_id: The identifier of the Proxmox HA resource to read.
    """
    ...
