# VPC Routes


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

[BETA] Create and manipulate routing rules

[Read more](https://community.exoscale.com/documentation/compute/)

## <span data-label="POST" class="pill-POST"></span>create-route

[BETA] Create a route

```
POST /vpc/{vpc-id}/subnet/{subnet-id}/route
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `vpc-id` | `path` | Must be a valid UUID. |
| `subnet-id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `destination` | string | **yes** | Route destination CIDR |
| `target` | string | **yes** | Route target |
| `description` | string | no | Route description<br/><br/>Max length: `4096`. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "destination": "string",
  "target": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `description` | string | Route description<br/><br/>Max length: `4096`. |
| `destination` | string | Route destination CIDR |
| `id` | string | Route ID<br/><br/>Must be a valid UUID. |
| `kind` | string | Route kind<br/><br/>Allowed values: `Subnet`, `Vpc`. |
| `target` | string | Route target |

<details>
<summary>Example output</summary>

```json
{
  "description": "string",
  "destination": "string",
  "id": "string",
  "kind": "Subnet",
  "target": "string"
}
```
</details>


SDK reference for `create-route`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateRoute) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_route) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createRoute(java.util.UUID,java.util.UUID,com.exoscale.sdk.model.CreateRouteRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-route`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-route

[BETA] Delete a route

```
DELETE /vpc/{vpc-id}/subnet/{subnet-id}/route/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `vpc-id` | `path` | Must be a valid UUID. |
| `subnet-id` | `path` | Must be a valid UUID. |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `204` - 204


SDK reference for `delete-route`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteRoute) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_route) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteRoute(java.util.UUID,java.util.UUID,java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-route`


---

## Other Operations

## <span data-label="GET" class="pill-GET"></span>list-routes

[BETA] List Subnet routes

```
GET /vpc/{vpc-id}/subnet/{subnet-id}/route
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `vpc-id` | `path` | Must be a valid UUID. |
| `subnet-id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `routes` | array of [Route](/reference/api/_schemas/list-route-entry/) |  |

<details>
<summary>Example output</summary>

```json
{
  "routes": [
    {
      "description": "string",
      "destination": "string",
      "id": "string",
      "kind": "Subnet",
      "target": "string"
    }
  ]
}
```
</details>


SDK reference for `list-routes`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListRoutes) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_routes) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listRoutes(java.util.UUID,java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-routes`

## <span data-label="GET" class="pill-GET"></span>list-vpc-routes

[BETA] List VPC routes

```
GET /vpc/{vpc-id}/route
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `vpc-id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `routes` | array of [Route](/reference/api/_schemas/list-route-entry/) |  |

<details>
<summary>Example output</summary>

```json
{
  "routes": [
    {
      "description": "string",
      "destination": "string",
      "id": "string",
      "kind": "Subnet",
      "target": "string"
    }
  ]
}
```
</details>


SDK reference for `list-vpc-routes`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListVpcRoutes) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_vpc_routes) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listVpcRoutes(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-vpc-routes`


