---
title: "QuotaApi"
lastmod: 2026-05-29
canonical: "https://container-registry.com/docs/harbor-api-client/api/quotaapi/"
source: "https://container-registry.com/docs/harbor-api-client/api/quotaapi/index.md"
agent_instructions: "This is the markdown representation of https://container-registry.com/docs/harbor-api-client/api/quotaapi/index.md. Prefer this version over scraping the HTML. The site index is at https://container-registry.com/llms.txt."
---

> Agent-friendly representation of <https://container-registry.com/docs/harbor-api-client/api/quotaapi/index.md>. Site index: <https://container-registry.com/llms.txt>.

# harbor_client.QuotaApi

All URIs are relative to *http://localhost/api/v2.0*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_quota**](#get_quota) | **GET** /quotas/{id} | Get the specified quota
[**list_quotas**](#list_quotas) | **GET** /quotas | List quotas
[**update_quota**](#update_quota) | **PUT** /quotas/{id} | Update the specified quota


# **get_quota**

### Signature

```python
get_quota(id: int, x_request_id: Optional[str])-> Quota
```

Get the specified quota

Get the specified quota

### Example
```python
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.QuotaApi(harbor_client.ApiClient(configuration))
id = 56 # int | Quota ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get the specified quota
    api_response = api_instance.get_quota(id, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling QuotaApi->get_quota: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **int**| Quota ID | 
 **x_request_id** | **str**| An unique ID for the request | [optional] 

### Return type

**[Quota](../../model/quota/)**

### Authorization

[basic](../../#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

[[Back to top]](#)

# **list_quotas**

### Signature

```python
list_quotas(x_request_id: Optional[str], page: Optional[int], page_size: Optional[int], reference: Optional[str], reference_id: Optional[str], sort: Optional[str])-> list[Quota]
```

List quotas

List quotas

### Example
```python
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.QuotaApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
reference = 'reference_example' # str | The reference type of quota. (optional)
reference_id = 'reference_id_example' # str | The reference id of quota. (optional)
sort = 'sort_example' # str | Sort method, valid values include: 'hard.resource_name', '-hard.resource_name', 'used.resource_name', '-used.resource_name'. Here '-' stands for descending order, resource_name should be the real resource name of the quota.  (optional)

try:
    # List quotas
    api_response = api_instance.list_quotas(x_request_id=x_request_id, page=page, page_size=page_size, reference=reference, reference_id=reference_id, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling QuotaApi->list_quotas: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **x_request_id** | **str**| An unique ID for the request | [optional] 
 **page** | **int**| The page number | [optional] [default to 1]
 **page_size** | **int**| The size of per page | [optional] [default to 10]
 **reference** | **str**| The reference type of quota. | [optional] 
 **reference_id** | **str**| The reference id of quota. | [optional] 
 **sort** | **str**| Sort method, valid values include: &#39;hard.resource_name&#39;, &#39;-hard.resource_name&#39;, &#39;used.resource_name&#39;, &#39;-used.resource_name&#39;. Here &#39;-&#39; stands for descending order, resource_name should be the real resource name of the quota.  | [optional] 

### Return type

**[list[Quota]](../../model/quota/)**

### Authorization

[basic](../../#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

[[Back to top]](#)

# **update_quota**

### Signature

```python
update_quota(id: int, hard: QuotaUpdateReq, x_request_id: Optional[str])-> None
```

Update the specified quota

Update hard limits of the specified quota

### Example
```python
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.QuotaApi(harbor_client.ApiClient(configuration))
id = 56 # int | Quota ID
hard = harbor_client.QuotaUpdateReq() # QuotaUpdateReq | The new hard limits for the quota
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Update the specified quota
    api_instance.update_quota(id, hard, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling QuotaApi->update_quota: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **int**| Quota ID | 
 **hard** | **[QuotaUpdateReq](../../model/quotaupdatereq/)**| The new hard limits for the quota | 
 **x_request_id** | **str**| An unique ID for the request | [optional] 

### Return type

void (empty response body)

### Authorization

[basic](../../#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

[[Back to top]](#)


