---
title: "Resource quotas CLI reference"
description: "Customer-hosted cloud features"
---

# Resource quotas CLI reference

#### Customer-hosted cloud features

:::note
Some features are only available on customer-hosted clouds. Reach out to [support@anyscale.com](mailto:support@anyscale.com) for info.
:::

## Resource quotas CLI

### `anyscale resource-quota create` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale resource-quota create [OPTIONS]`

Create a resource quota.

**Options**

-   **`-n/--name`**: Name of the resource quota to create.
-   **`--cloud`**: Name of the cloud that this resource quota applies to.
-   **`--project`**: Name of the project that this resource quota applies to.
-   **`--user-email`**: Email of the user that this resource quota applies to.
-   **`--num-cpus`**: The quota limit for the number of CPUs.
-   **`--num-instances`**: The quota limit for the number of instances.
-   **`--num-gpus`**: The quota limit for the total number of GPUs.
-   **`--num-accelerators`**: The quota limit for the number of accelerators. Example: --num-accelerators A100-80G 10

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale resource-quota create -n my-resource-quota --cloud my-cloud --project my-project --user-email someone@myorg.com --num-instances 100 --num-cpus 1000 --num-gpus 50 --num-accelerators A10G 10 --num-accelerators A100-80G 0
(anyscale +2.5s) Name: my-resource-quota
Cloud name: my-cloud
Project name: my-project
User email: someone@myorg.com
Number of CPUs: 1000
Number of instances: 100
Number of GPUs: 50
Number of accelerators: {'A10G': 10, 'A100-80G': 0}
(anyscale +2.5s) Resource quota created successfully ID: rsq_abcdef
```
:::

::::

### `anyscale resource-quota list` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale resource-quota list [OPTIONS]`

List resource quotas.

**Options**

-   **`-n/--name`**: The name filter for the resource quotas.
-   **`--cloud`**: The cloud filter for the resource quotas.
-   **`--creator-id`**: The creator ID filter for the resource quotas.
-   **`--is-enabled`**: The is\_enabled filter for the resource quotas.
-   **`--max-items`**: Max items to show in list.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale resource-quota list --cloud my-cloud
Resource quotas:
ID       NAME               CLOUD ID    PROJECT ID  USER ID     IS ENABLED    CREATED AT    DELETED AT    QUOTA
rsq_123  resource-quota-1   cld_abcdef  prj_abcdef  usr_abcdef  True          09/11/2024                  {'num_accelerators': {'A100-80G': 0, 'A10G': 10},
                                                                                                           'num_cpus': 1000,
                                                                                                           'num_gpus': 50,
                                                                                                           'num_instances': 100}
rsq_456  resource-quota-2   cld_abcdef              usr_abcdef  True          09/10/2024                  {'num_accelerators': {}, 'num_cpus': None, 'num_gpus': None, 'num_instances': 2}
rsq_789  resource-quota-3   cld_abcdef                          False         09/05/2024                  {'num_accelerators': {'A10G': 1},
                                                                                                            'num_cpus': None,
                                                                                                            'num_gpus': None,
                                                                                                            'num_instances': None}
```
:::

::::

### `anyscale resource-quota delete` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale resource-quota delete [OPTIONS]`

Delete a resource quota.

**Options**

-   **`--id`**: ID of the resource quota to delete.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale resource-quota delete --id rsq_abcdef
(anyscale +1.0s) Resource quota with ID rsq_abcdef deleted successfully.
```
:::

::::

### `anyscale resource-quota enable` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale resource-quota enable [OPTIONS]`

Enable a resource quota.

**Options**

-   **`--id`**: ID of the resource quota to enable.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale resource-quota enable --id rsq_abcdef
(anyscale +1.2s) Enabled resource quota with ID rsq_abcdef successfully.
```
:::

::::

### `anyscale resource-quota disable` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale resource-quota disable [OPTIONS]`

Disable a resource quota.

**Options**

-   **`--id`**: ID of the resource quota to disable.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale resource-quota disable --id rsq_abcdef
(anyscale +1.4s) Disabled resource quota with ID rsq_abcdef successfully.
```
:::

::::

## Resource quotas models

### `CreateResourceQuota`

Resource quota creation model.

#### Fields

-   **`name` (str)**: Name of the resource quota to create.
-   **`cloud` (str)**: Name of the cloud that this resource quota applies to.
-   **`project` (str | None)**: Name of the project that this resource quota applies to (optional).
-   **`user_email` (str | None)**: Email of the user that this resource quota applies to (optional).
-   **`num_cpus` (int | None)**: The quota limit for the number of CPUs (optional).
-   **`num_instances` (int | None)**: The quota limit for the number of instances. (optional).
-   **`num_gpus` (int | None)**: The quota limit for the total number of GPUs (optional).
-   **`num_accelerators` (Dict\[str, int\] | None)**: The quota limit for the number of accelerators (optional).

#### Python Methods

```python
def to_dict(self) -> Dict[str, Any]
    """Return a dictionary representation of the model."""
```

#### Examples

::::tabs

:::tab[Python]
```python
import anyscale
from anyscale.resource_quota.models import CreateResourceQuota

create_resource_quota = CreateResourceQuota(
    # Name of the resource quota to create
    name="resource_quota_name",
    # Name of the cloud that this resource quota applies to
    cloud="cloud_name",
    # Name of the project that this resource quota applies to (optional)
    project="project_name",
    # Email of the user that this resource quota applies to (optional)
    user_email="test@anyscale.com",
    # The quota limit for the number of CPUs (optional)
    num_cpus=50,
    # The quota limit for the number of instances (optional)
    num_instances=100,
    # The quota limit for the total number of GPUs (optional)
    num_gpus=30,
    # The quota limit for the number of accelerators (optional)
    num_accelerators={"A100-80G": 10, "T4": 20},
)
```
:::

::::

### `Quota`

Resource quota limit

#### Fields

-   **`num_cpus` (int | None)**: The quota limit for the number of CPUs (optional).
-   **`num_instances` (int | None)**: The quota limit for the number of instances. (optional).
-   **`num_gpus` (int | None)**: The quota limit for the total number of GPUs (optional).
-   **`num_accelerators` (Dict\[str, int\] | None)**: The quota limit for the number of accelerators (optional).

#### Python Methods

```python
def to_dict(self) -> Dict[str, Any]
    """Return a dictionary representation of the model."""
```

#### Examples

::::tabs

:::tab[Python]
```python
import anyscale
from anyscale.resource_quota.models import CreateResourceQuota, ResourceQuota, Quota

create_resource_quota = CreateResourceQuota(
    # Name of the resource quota to create
    name="resource_quota_name",
    # Name of the cloud that this resource quota applies to
    cloud="cloud_name",
    # Name of the project that this resource quota applies to (optional)
    project="project_name",
    # Email of the user that this resource quota applies to (optional)
    user_email="test@anyscale.com",
    # The quota limit for the number of CPUs (optional)
    num_cpus=50,
    # The quota limit for the number of instances (optional)
    num_instances=100,
    # The quota limit for the total number of GPUs (optional)
    num_gpus=30,
    # The quota limit for the number of accelerators (optional)
    num_accelerators={"A100-80G": 10, "T4": 20},
)

resource_quota: ResourceQuota = anyscale.resource_quota.create(create_resource_quota)

quota: Quota = resource_quota.quota
```
:::

::::

### `ResourceQuota`

Resource quota

#### Fields

-   **`id` (str)**: The ID of the resource quota.
-   **`name` (str)**: Name of the resource quota.
-   **`quota` ([Quota](#quota))**: The quota limit.
-   **`created_at` (datetime)**: The timestamp when this resource quota was created.
-   **`cloud_id` (str)**: ID of the cloud that this resource quota applies to.
-   **`project_id` (str | None)**: ID of the project that this resource quota applies to (optional).
-   **`user_id` (str | None)**: ID of the user that this resource quota applies to (optional).
-   **`is_enabled` (bool)**: Whether the resource quota is enabled.
-   **`deleted_at` (datetime | None)**: The timestamp when this resource quota was deleted.

#### Python Methods

```python
def to_dict(self) -> Dict[str, Any]
    """Return a dictionary representation of the model."""
```

#### Examples

::::tabs

:::tab[Python]
```python
import anyscale
from anyscale.resource_quota.models import CreateResourceQuota, ResourceQuota

create_resource_quota = CreateResourceQuota(
    # Name of the resource quota to create
    name="resource_quota_name",
    # Name of the cloud that this resource quota applies to
    cloud="cloud_name",
    # Name of the project that this resource quota applies to (optional)
    project="project_name",
    # Email of the user that this resource quota applies to (optional)
    user_email="test@anyscale.com",
    # The quota limit for the number of CPUs (optional)
    num_cpus=50,
    # The quota limit for the number of instances (optional)
    num_instances=100,
    # The quota limit for the total number of GPUs (optional)
    num_gpus=30,
    # The quota limit for the number of accelerators (optional)
    num_accelerators={"A100-80G": 10, "T4": 20},
)
resource_quota: ResourceQuota = anyscale.resource_quota.create(create_resource_quota)
```
:::

::::

---

Previous: [Project](/reference/cli/project.md) | Next: [Schedule](/reference/cli/schedule.md)