o |nh@s,ddlmZddlmZGdddeZdS))utils)SystemBackendMixinc@s:eZdZddZddZ      d ddZdd ZdS) QuotacC"tjd||d}|jj|dS)aZRead quota. Only works when calling on the root namespace. Supported methods: GET: /sys/quotas/rate-limit/:name. Produces: 200 application/json :param name: the name of the quota to look up. :type name: str | unicode :return: JSON response from API request. :rtype: requests.Response /v1/sys/quotas/rate-limit/nameurl)r format_url_adaptergetselfrapi_pathrH/usr/local/lib/python3.10/dist-packages/hvac/api/system_backend/quota.py read_quotas zQuota.read_quotacCsd}|jj|dS)aRetrieve a list of quotas by name. Only works when calling on the root namespace. Supported methods: LIST: /sys/quotas/rate-limit. Produces: 200 application/json :return: JSON response from API request. :rtype: requests.Response z/v1/sys/quotas/rate-limitr )r list)rrrrr list_quotass zQuota.list_quotasNc Cs:tjd|d} t||||||||d} |jj| | dS)a=Create quota if it doesn't exist or update if already created. Only works when calling on the root namespace. Supported methods: POST: /sys/quotas/rate-limit. Produces: 204 (empty body) :param name: The name of the quota to create or update. :type name: str | unicode :param path: Path of the mount or namespace to apply the quota. :type path: str | unicode :param rate: The maximum number of requests in a given interval to be allowed. Must be positive. :type rate: float :param interval: The duration to enforce rate limit. Default is "1s". :type interval: str | unicode :param block_interval: If rate limit is reached, how long before client can send requests again. :type block_interval: str | unicode :param role: If quota is set on an auth mount path, restrict login requests that are made with a specified role. :type role: str | unicode :param rate_limit_type: Type of rate limit quota. Can be lease-count or rate-limit. :type rate_limit_type: str | unicode :param inheritable: If set to true on a path that is a namespace, quota will be applied to all child namespaces :type inheritable: bool :return: API status code from request. :rtype: requests.Response z /v1/sys/quotas/rate-limit/{name}r)rpathrateintervalblock_intervalroletype inheritable)r json)rr remove_nonesr post) rrrrrrrrate_limit_typerrparamsrrrcreate_or_update_quota"s # zQuota.create_or_update_quotacCr)aUDelete a given quota. Only works when calling on the root namespace. Supported methods: DELETE: /sys/quotas/rate-limit. Produces: 204 (empty body) :param name: Name of the quota to delete :type name: str | unicode :return: API status code from request. :rtype: requests.Response rrr )rr r deleterrrr delete_quotaWs zQuota.delete_quota)NNNNNN)__name__ __module__ __qualname__rrr"r$rrrrrs 5rN)hvacr,hvac.api.system_backend.system_backend_mixinrrrrrrs