# 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__ = [
    'GetLimitsV2Result',
    'AwaitableGetLimitsV2Result',
    'get_limits_v2',
    'get_limits_v2_output',
]

@pulumi.output_type
class GetLimitsV2Result:
    """
    A collection of values returned by getLimitsV2.
    """
    def __init__(__self__, id=None, max_image_meta=None, max_personality=None, max_personality_size=None, max_security_group_rules=None, max_security_groups=None, max_server_group_members=None, max_server_groups=None, max_server_meta=None, max_total_cores=None, max_total_floating_ips=None, max_total_instances=None, max_total_keypairs=None, max_total_ram_size=None, project_id=None, region=None, total_cores_used=None, total_floating_ips_used=None, total_instances_used=None, total_ram_used=None, total_security_groups_used=None, total_server_groups_used=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if max_image_meta and not isinstance(max_image_meta, int):
            raise TypeError("Expected argument 'max_image_meta' to be a int")
        pulumi.set(__self__, "max_image_meta", max_image_meta)
        if max_personality and not isinstance(max_personality, int):
            raise TypeError("Expected argument 'max_personality' to be a int")
        pulumi.set(__self__, "max_personality", max_personality)
        if max_personality_size and not isinstance(max_personality_size, int):
            raise TypeError("Expected argument 'max_personality_size' to be a int")
        pulumi.set(__self__, "max_personality_size", max_personality_size)
        if max_security_group_rules and not isinstance(max_security_group_rules, int):
            raise TypeError("Expected argument 'max_security_group_rules' to be a int")
        pulumi.set(__self__, "max_security_group_rules", max_security_group_rules)
        if max_security_groups and not isinstance(max_security_groups, int):
            raise TypeError("Expected argument 'max_security_groups' to be a int")
        pulumi.set(__self__, "max_security_groups", max_security_groups)
        if max_server_group_members and not isinstance(max_server_group_members, int):
            raise TypeError("Expected argument 'max_server_group_members' to be a int")
        pulumi.set(__self__, "max_server_group_members", max_server_group_members)
        if max_server_groups and not isinstance(max_server_groups, int):
            raise TypeError("Expected argument 'max_server_groups' to be a int")
        pulumi.set(__self__, "max_server_groups", max_server_groups)
        if max_server_meta and not isinstance(max_server_meta, int):
            raise TypeError("Expected argument 'max_server_meta' to be a int")
        pulumi.set(__self__, "max_server_meta", max_server_meta)
        if max_total_cores and not isinstance(max_total_cores, int):
            raise TypeError("Expected argument 'max_total_cores' to be a int")
        pulumi.set(__self__, "max_total_cores", max_total_cores)
        if max_total_floating_ips and not isinstance(max_total_floating_ips, int):
            raise TypeError("Expected argument 'max_total_floating_ips' to be a int")
        pulumi.set(__self__, "max_total_floating_ips", max_total_floating_ips)
        if max_total_instances and not isinstance(max_total_instances, int):
            raise TypeError("Expected argument 'max_total_instances' to be a int")
        pulumi.set(__self__, "max_total_instances", max_total_instances)
        if max_total_keypairs and not isinstance(max_total_keypairs, int):
            raise TypeError("Expected argument 'max_total_keypairs' to be a int")
        pulumi.set(__self__, "max_total_keypairs", max_total_keypairs)
        if max_total_ram_size and not isinstance(max_total_ram_size, int):
            raise TypeError("Expected argument 'max_total_ram_size' to be a int")
        pulumi.set(__self__, "max_total_ram_size", max_total_ram_size)
        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 region and not isinstance(region, str):
            raise TypeError("Expected argument 'region' to be a str")
        pulumi.set(__self__, "region", region)
        if total_cores_used and not isinstance(total_cores_used, int):
            raise TypeError("Expected argument 'total_cores_used' to be a int")
        pulumi.set(__self__, "total_cores_used", total_cores_used)
        if total_floating_ips_used and not isinstance(total_floating_ips_used, int):
            raise TypeError("Expected argument 'total_floating_ips_used' to be a int")
        pulumi.set(__self__, "total_floating_ips_used", total_floating_ips_used)
        if total_instances_used and not isinstance(total_instances_used, int):
            raise TypeError("Expected argument 'total_instances_used' to be a int")
        pulumi.set(__self__, "total_instances_used", total_instances_used)
        if total_ram_used and not isinstance(total_ram_used, int):
            raise TypeError("Expected argument 'total_ram_used' to be a int")
        pulumi.set(__self__, "total_ram_used", total_ram_used)
        if total_security_groups_used and not isinstance(total_security_groups_used, int):
            raise TypeError("Expected argument 'total_security_groups_used' to be a int")
        pulumi.set(__self__, "total_security_groups_used", total_security_groups_used)
        if total_server_groups_used and not isinstance(total_server_groups_used, int):
            raise TypeError("Expected argument 'total_server_groups_used' to be a int")
        pulumi.set(__self__, "total_server_groups_used", total_server_groups_used)

    @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="maxImageMeta")
    def max_image_meta(self) -> int:
        """
        The number of allowed metadata items for each image. Starting from version 2.39 this field is dropped from ‘os-limits’ response, because ‘image-metadata’ proxy API was deprecated. Available until version 2.38.
        """
        return pulumi.get(self, "max_image_meta")

    @property
    @pulumi.getter(name="maxPersonality")
    def max_personality(self) -> int:
        """
        The number of allowed injected files for the tenant. Available until version 2.56.
        """
        return pulumi.get(self, "max_personality")

    @property
    @pulumi.getter(name="maxPersonalitySize")
    def max_personality_size(self) -> int:
        """
        The number of allowed bytes of content for each injected file. Available until version 2.56.
        """
        return pulumi.get(self, "max_personality_size")

    @property
    @pulumi.getter(name="maxSecurityGroupRules")
    def max_security_group_rules(self) -> int:
        """
        The number of allowed rules for each security group. Available until version 2.35.
        """
        return pulumi.get(self, "max_security_group_rules")

    @property
    @pulumi.getter(name="maxSecurityGroups")
    def max_security_groups(self) -> int:
        """
        The number of allowed security groups for the tenant. Available until version 2.35.
        """
        return pulumi.get(self, "max_security_groups")

    @property
    @pulumi.getter(name="maxServerGroupMembers")
    def max_server_group_members(self) -> int:
        """
        The number of allowed members for each server group.
        """
        return pulumi.get(self, "max_server_group_members")

    @property
    @pulumi.getter(name="maxServerGroups")
    def max_server_groups(self) -> int:
        """
        The number of allowed server groups for the tenant.
        """
        return pulumi.get(self, "max_server_groups")

    @property
    @pulumi.getter(name="maxServerMeta")
    def max_server_meta(self) -> int:
        """
        The number of allowed server groups for the tenant.
        """
        return pulumi.get(self, "max_server_meta")

    @property
    @pulumi.getter(name="maxTotalCores")
    def max_total_cores(self) -> int:
        """
        The number of allowed server cores for the tenant.
        """
        return pulumi.get(self, "max_total_cores")

    @property
    @pulumi.getter(name="maxTotalFloatingIps")
    def max_total_floating_ips(self) -> int:
        """
        The number of allowed floating IP addresses for each tenant. Available until version 2.35.
        """
        return pulumi.get(self, "max_total_floating_ips")

    @property
    @pulumi.getter(name="maxTotalInstances")
    def max_total_instances(self) -> int:
        """
        The number of allowed servers for the tenant.
        """
        return pulumi.get(self, "max_total_instances")

    @property
    @pulumi.getter(name="maxTotalKeypairs")
    def max_total_keypairs(self) -> int:
        """
        The number of allowed key pairs for the user.
        """
        return pulumi.get(self, "max_total_keypairs")

    @property
    @pulumi.getter(name="maxTotalRamSize")
    def max_total_ram_size(self) -> int:
        """
        The number of allowed floating IP addresses for the tenant. Available until version 2.35.
        """
        return pulumi.get(self, "max_total_ram_size")

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> str:
        """
        See Argument Reference above.
        """
        return pulumi.get(self, "project_id")

    @property
    @pulumi.getter
    def region(self) -> str:
        """
        See Argument Reference above.
        """
        return pulumi.get(self, "region")

    @property
    @pulumi.getter(name="totalCoresUsed")
    def total_cores_used(self) -> int:
        """
        The number of used server cores in the tenant.
        """
        return pulumi.get(self, "total_cores_used")

    @property
    @pulumi.getter(name="totalFloatingIpsUsed")
    def total_floating_ips_used(self) -> int:
        """
        The number of used floating IP addresses in the tenant.
        """
        return pulumi.get(self, "total_floating_ips_used")

    @property
    @pulumi.getter(name="totalInstancesUsed")
    def total_instances_used(self) -> int:
        """
        The number of used server cores in the tenant.
        """
        return pulumi.get(self, "total_instances_used")

    @property
    @pulumi.getter(name="totalRamUsed")
    def total_ram_used(self) -> int:
        """
        The amount of used server RAM in the tenant.
        """
        return pulumi.get(self, "total_ram_used")

    @property
    @pulumi.getter(name="totalSecurityGroupsUsed")
    def total_security_groups_used(self) -> int:
        """
        The number of used security groups in the tenant. Available until version 2.35.
        """
        return pulumi.get(self, "total_security_groups_used")

    @property
    @pulumi.getter(name="totalServerGroupsUsed")
    def total_server_groups_used(self) -> int:
        """
        The number of used server groups in each tenant.
        """
        return pulumi.get(self, "total_server_groups_used")


class AwaitableGetLimitsV2Result(GetLimitsV2Result):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetLimitsV2Result(
            id=self.id,
            max_image_meta=self.max_image_meta,
            max_personality=self.max_personality,
            max_personality_size=self.max_personality_size,
            max_security_group_rules=self.max_security_group_rules,
            max_security_groups=self.max_security_groups,
            max_server_group_members=self.max_server_group_members,
            max_server_groups=self.max_server_groups,
            max_server_meta=self.max_server_meta,
            max_total_cores=self.max_total_cores,
            max_total_floating_ips=self.max_total_floating_ips,
            max_total_instances=self.max_total_instances,
            max_total_keypairs=self.max_total_keypairs,
            max_total_ram_size=self.max_total_ram_size,
            project_id=self.project_id,
            region=self.region,
            total_cores_used=self.total_cores_used,
            total_floating_ips_used=self.total_floating_ips_used,
            total_instances_used=self.total_instances_used,
            total_ram_used=self.total_ram_used,
            total_security_groups_used=self.total_security_groups_used,
            total_server_groups_used=self.total_server_groups_used)


def get_limits_v2(project_id: Optional[str] = None,
                  region: Optional[str] = None,
                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetLimitsV2Result:
    """
    Use this data source to get the compute limits of an OpenStack project.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_openstack as openstack

    limits = openstack.compute.get_limits_v2(project_id="2e367a3d29f94fd988e6ec54e305ec9d")
    ```


    :param str project_id: The id of the project to retrieve the limits.
    :param str region: The region in which to obtain the V2 Compute client.
           If omitted, the `region` argument of the provider is used.
    """
    __args__ = dict()
    __args__['projectId'] = project_id
    __args__['region'] = region
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('openstack:compute/getLimitsV2:getLimitsV2', __args__, opts=opts, typ=GetLimitsV2Result).value

    return AwaitableGetLimitsV2Result(
        id=pulumi.get(__ret__, 'id'),
        max_image_meta=pulumi.get(__ret__, 'max_image_meta'),
        max_personality=pulumi.get(__ret__, 'max_personality'),
        max_personality_size=pulumi.get(__ret__, 'max_personality_size'),
        max_security_group_rules=pulumi.get(__ret__, 'max_security_group_rules'),
        max_security_groups=pulumi.get(__ret__, 'max_security_groups'),
        max_server_group_members=pulumi.get(__ret__, 'max_server_group_members'),
        max_server_groups=pulumi.get(__ret__, 'max_server_groups'),
        max_server_meta=pulumi.get(__ret__, 'max_server_meta'),
        max_total_cores=pulumi.get(__ret__, 'max_total_cores'),
        max_total_floating_ips=pulumi.get(__ret__, 'max_total_floating_ips'),
        max_total_instances=pulumi.get(__ret__, 'max_total_instances'),
        max_total_keypairs=pulumi.get(__ret__, 'max_total_keypairs'),
        max_total_ram_size=pulumi.get(__ret__, 'max_total_ram_size'),
        project_id=pulumi.get(__ret__, 'project_id'),
        region=pulumi.get(__ret__, 'region'),
        total_cores_used=pulumi.get(__ret__, 'total_cores_used'),
        total_floating_ips_used=pulumi.get(__ret__, 'total_floating_ips_used'),
        total_instances_used=pulumi.get(__ret__, 'total_instances_used'),
        total_ram_used=pulumi.get(__ret__, 'total_ram_used'),
        total_security_groups_used=pulumi.get(__ret__, 'total_security_groups_used'),
        total_server_groups_used=pulumi.get(__ret__, 'total_server_groups_used'))
def get_limits_v2_output(project_id: Optional[pulumi.Input[str]] = None,
                         region: Optional[pulumi.Input[Optional[str]]] = None,
                         opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetLimitsV2Result]:
    """
    Use this data source to get the compute limits of an OpenStack project.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_openstack as openstack

    limits = openstack.compute.get_limits_v2(project_id="2e367a3d29f94fd988e6ec54e305ec9d")
    ```


    :param str project_id: The id of the project to retrieve the limits.
    :param str region: The region in which to obtain the V2 Compute client.
           If omitted, the `region` argument of the provider is used.
    """
    __args__ = dict()
    __args__['projectId'] = project_id
    __args__['region'] = region
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('openstack:compute/getLimitsV2:getLimitsV2', __args__, opts=opts, typ=GetLimitsV2Result)
    return __ret__.apply(lambda __response__: GetLimitsV2Result(
        id=pulumi.get(__response__, 'id'),
        max_image_meta=pulumi.get(__response__, 'max_image_meta'),
        max_personality=pulumi.get(__response__, 'max_personality'),
        max_personality_size=pulumi.get(__response__, 'max_personality_size'),
        max_security_group_rules=pulumi.get(__response__, 'max_security_group_rules'),
        max_security_groups=pulumi.get(__response__, 'max_security_groups'),
        max_server_group_members=pulumi.get(__response__, 'max_server_group_members'),
        max_server_groups=pulumi.get(__response__, 'max_server_groups'),
        max_server_meta=pulumi.get(__response__, 'max_server_meta'),
        max_total_cores=pulumi.get(__response__, 'max_total_cores'),
        max_total_floating_ips=pulumi.get(__response__, 'max_total_floating_ips'),
        max_total_instances=pulumi.get(__response__, 'max_total_instances'),
        max_total_keypairs=pulumi.get(__response__, 'max_total_keypairs'),
        max_total_ram_size=pulumi.get(__response__, 'max_total_ram_size'),
        project_id=pulumi.get(__response__, 'project_id'),
        region=pulumi.get(__response__, 'region'),
        total_cores_used=pulumi.get(__response__, 'total_cores_used'),
        total_floating_ips_used=pulumi.get(__response__, 'total_floating_ips_used'),
        total_instances_used=pulumi.get(__response__, 'total_instances_used'),
        total_ram_used=pulumi.get(__response__, 'total_ram_used'),
        total_security_groups_used=pulumi.get(__response__, 'total_security_groups_used'),
        total_server_groups_used=pulumi.get(__response__, 'total_server_groups_used')))
