# VPC


<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] Virtual Private Cloud (VPC) provides isolated virtual network environments for your Exoscale resources.

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

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

[BETA] Create a VPC

```
POST /vpc
```

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | **yes** | VPC name<br/><br/>Min length: `1`. Max length: `255`. |
| `description` | string | no | VPC description<br/><br/>Max length: `4096`. |
| `labels` | object | no | Resource labels |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "labels": {},
  "name": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

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

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-vpc`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateVpc) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_vpc) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createVpc(com.exoscale.sdk.model.CreateVpcRequest))

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

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

[BETA] Retrieve VPC details

```
GET /vpc/{id}
```

### Path parameters

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

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | VPC creation date<br/><br/>ISO 8601 date-time. |
| `description` | string | VPC description<br/><br/>Max length: `4096`. |
| `id` | string | VPC ID<br/><br/>Must be a valid UUID. |
| `labels` | object | Resource labels |
| `name` | string | VPC name<br/><br/>Min length: `1`. Max length: `255`. |

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

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "string",
  "labels": {},
  "name": "string"
}
```
</details>


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

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

## <span data-label="PUT" class="pill-PUT"></span>update-vpc

[BETA] Update a VPC

```
PUT /vpc/{id}
```

### Path parameters

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

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string | no | VPC description<br/><br/>Max length: `4096`. |
| `labels` | object | no | Resource labels |
| `name` | string | no | VPC name<br/><br/>Min length: `1`. Max length: `255`. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "labels": {},
  "name": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | VPC creation date<br/><br/>ISO 8601 date-time. |
| `description` | string | VPC description<br/><br/>Max length: `4096`. |
| `id` | string | VPC ID<br/><br/>Must be a valid UUID. |
| `labels` | object | Resource labels |
| `name` | string | VPC name<br/><br/>Min length: `1`. Max length: `255`. |

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

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "string",
  "labels": {},
  "name": "string"
}
```
</details>


SDK reference for `update-vpc`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateVpc) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_vpc) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateVpc(java.util.UUID,com.exoscale.sdk.model.UpdateVpcRequest))

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

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

[BETA] Delete a VPC

```
DELETE /vpc/{id}
```

### Path parameters

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

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

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

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


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

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


---

## Other Operations

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

[BETA] List VPCs

```
GET /vpc
```

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `vpcs` | array of [VPC](/reference/api/_schemas/list-vpc-response-entry/) |  |

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

```json
{
  "vpcs": [
    {
      "created-at": "2024-01-01T12:00:00Z",
      "description": "string",
      "id": "string",
      "labels": {},
      "name": "string"
    }
  ]
}
```
</details>


SDK reference for `list-vpcs`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListVpcs) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_vpcs) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listVpcs())

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


