# Private Network


<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>

Private Network provides private L2 networking functionality between Compute instances.

[Read more](https://community.exoscale.com/product/networking/private-network/)

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

Create a Private Network

```
POST /private-network
```

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | **yes** | Private Network name<br/><br/>Min length: `1`. Max length: `255`. |
| `description` | string | no | Private Network description<br/><br/>Max length: `255`. |
| `end-ip` | string | no | Private Network end IP address<br/><br/>Must be a valid IPv4 address. |
| `labels` | object | no | Resource labels |
| `netmask` | string | no | Private Network netmask<br/><br/>Must be a valid IPv4 address. |
| `options` | [Private Network DHCP Options](/reference/api/_schemas/private-network-options/) | no | DHCP options |
| `start-ip` | string | no | Private Network start IP address<br/><br/>Must be a valid IPv4 address. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "end-ip": "string",
  "labels": {},
  "name": "string",
  "netmask": "string",
  "options": {
    "dns-servers": [
      "string"
    ],
    "domain-search": [
      "string"
    ],
    "ntp-servers": [
      "string"
    ],
    "routers": [
      "string"
    ]
  },
  "start-ip": "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-private-network`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreatePrivateNetwork) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_private_network) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createPrivateNetwork(com.exoscale.sdk.model.CreatePrivateNetworkRequest))

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

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

Retrieve Private Network details

```
GET /private-network/{id}
```

### Path parameters

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

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `description` | string | Private Network description<br/><br/>Max length: `255`. |
| `end-ip` | string | Private Network end IP address<br/><br/>Must be a valid IPv4 address. |
| `id` | string | Private Network ID<br/><br/>Must be a valid UUID. |
| `labels` | object | Resource labels |
| `leases` | array of [Private Network leased IP address](/reference/api/_schemas/private-network-lease/) | Private Network leased IP addresses |
| `name` | string | Private Network name<br/><br/>Min length: `1`. Max length: `255`. |
| `netmask` | string | Private Network netmask<br/><br/>Must be a valid IPv4 address. |
| `options` | [Private Network DHCP Options](/reference/api/_schemas/private-network-options/) | DHCP options |
| `start-ip` | string | Private Network start IP address<br/><br/>Must be a valid IPv4 address. |
| `vni` | integer | Private Network VXLAN ID<br/><br/>Min: `0`. |

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

```json
{
  "description": "string",
  "end-ip": "string",
  "id": "string",
  "labels": {},
  "leases": [
    {
      "instance-id": "string",
      "ip": "string"
    }
  ],
  "name": "string",
  "netmask": "string",
  "options": {
    "dns-servers": [
      "string"
    ],
    "domain-search": [
      "string"
    ],
    "ntp-servers": [
      "string"
    ],
    "routers": [
      "string"
    ]
  },
  "start-ip": "string",
  "vni": 0
}
```
</details>


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

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

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

Update a Private Network

```
PUT /private-network/{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 | Private Network description<br/><br/>Max length: `255`. |
| `end-ip` | string | no | Private Network end IP address<br/><br/>Must be a valid IPv4 address. |
| `labels` | object | no | Resource labels |
| `name` | string | no | Private Network name<br/><br/>Min length: `1`. Max length: `255`. |
| `netmask` | string | no | Private Network netmask<br/><br/>Must be a valid IPv4 address. |
| `options` | [Private Network DHCP Options](/reference/api/_schemas/private-network-options/) | no | DHCP options |
| `start-ip` | string | no | Private Network start IP address<br/><br/>Must be a valid IPv4 address. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "end-ip": "string",
  "labels": {},
  "name": "string",
  "netmask": "string",
  "options": {
    "dns-servers": [
      "string"
    ],
    "domain-search": [
      "string"
    ],
    "ntp-servers": [
      "string"
    ],
    "routers": [
      "string"
    ]
  },
  "start-ip": "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 `update-private-network`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdatePrivateNetwork) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_private_network) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updatePrivateNetwork(java.util.UUID,com.exoscale.sdk.model.UpdatePrivateNetworkRequest))

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

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

Delete a Private Network

```
DELETE /private-network/{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-private-network`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeletePrivateNetwork) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_private_network) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deletePrivateNetwork(java.util.UUID))

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


---

## Other Operations

## <span data-label="PUT" class="pill-PUT"></span>detach-instance-from-private-network

Detach a Compute instance from a Private Network

```
PUT /private-network/{id}:detach
```

### Path parameters

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

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `instance` | [Instance](/reference/api/_schemas/instance/) | **yes** | Compute instance |

<details>
<summary>Example</summary>

```json
{
  "instance": {
    "anti-affinity-groups": [
      {
        "id": "string"
      }
    ],
    "application-consistent-snapshot-enabled": true,
    "created-at": "2024-01-01T12:00:00Z",
    "deploy-target": {
      "id": "string"
    },
    "disk-encrypted": true,
    "disk-size": 0,
    "elastic-ips": [
      {
        "id": "string"
      }
    ],
    "id": "string",
    "instance-type": {
      "authorized": true,
      "cpus": 0,
      "family": "gpu3",
      "gpus": 0,
      "id": "string",
      "memory": 0,
      "size": "large",
      "zones": [
        "ch-dk-2"
      ]
    },
    "ipv6-address": "string",
    "labels": {},
    "mac-address": "string",
    "manager": {
      "id": "string",
      "type": "sks-nodepool"
    },
    "name": "string",
    "private-networks": [
      {
        "id": "string",
        "mac-address": "string"
      }
    ],
    "public-ip": "string",
    "public-ip-assignment": "inet4",
    "secureboot-enabled": true,
    "security-groups": [
      {
        "id": "string"
      }
    ],
    "snapshots": [
      {
        "id": "string"
      }
    ],
    "ssh-key": {
      "fingerprint": "string",
      "name": "string"
    },
    "ssh-keys": [
      {
        "fingerprint": "string",
        "name": "string"
      }
    ],
    "state": "expunging",
    "template": {
      "application-consistent-snapshot-enabled": true,
      "boot-mode": "legacy",
      "build": "string",
      "checksum": "string",
      "created-at": "2024-01-01T12:00:00Z",
      "default-user": "string",
      "description": "string",
      "family": "string",
      "id": "string",
      "maintainer": "string",
      "name": "string",
      "password-enabled": true,
      "size": 0,
      "ssh-key-enabled": true,
      "url": "string",
      "version": "string",
      "visibility": "private",
      "zones": [
        "ch-dk-2"
      ]
    },
    "tpm-enabled": true,
    "user-data": "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 `detach-instance-from-private-network`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DetachInstanceFromPrivateNetwork) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.detach_instance_from_private_network) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#detachInstanceFromPrivateNetwork(java.util.UUID,com.exoscale.sdk.model.DetachInstanceFromPrivateNetworkRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api detach-instance-from-private-network`

## <span data-label="PUT" class="pill-PUT"></span>attach-instance-to-private-network

Attach a Compute instance to a Private Network

```
PUT /private-network/{id}:attach
```

### Path parameters

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

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `instance` | [Instance](#instance) | **yes** | Compute instance |
| `ip` | string | no | Static IP address lease for the corresponding network interface<br/><br/>Must be a valid IPv4 address. |

<details>
<summary>Example</summary>

```json
{
  "instance": {
    "id": "string"
  },
  "ip": "string"
}
```
</details>


### Instance {#instance}

Compute instance

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | Instance ID<br/><br/>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 `attach-instance-to-private-network`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.AttachInstanceToPrivateNetwork) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.attach_instance_to_private_network) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#attachInstanceToPrivateNetwork(java.util.UUID,com.exoscale.sdk.model.AttachInstanceToPrivateNetworkRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api attach-instance-to-private-network`

## <span data-label="DELETE" class="pill-DELETE"></span>reset-private-network-field

Reset Private Network field

```
DELETE /private-network/{id}/{field}
```

### Path parameters

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

### 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 `reset-private-network-field`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ResetPrivateNetworkField) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reset_private_network_field) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#resetPrivateNetworkField(java.util.UUID,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reset-private-network-field`

## <span data-label="PUT" class="pill-PUT"></span>update-private-network-instance-ip

Update the IP address of an instance attached to a managed private network

```
PUT /private-network/{id}:update-ip
```

### Path parameters

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

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `instance` | [Instance](#instance) | no |  |
| `ip` | string | no | Static IP address lease for the corresponding network interface<br/><br/>Must be a valid IPv4 address. |

<details>
<summary>Example</summary>

```json
{
  "instance": {
    "id": "string"
  },
  "ip": "string"
}
```
</details>


### Instance {#instance}

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | **yes** | Instance ID<br/><br/>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 `update-private-network-instance-ip`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdatePrivateNetworkInstanceIP) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_private_network_instance_ip) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updatePrivateNetworkInstanceIp(java.util.UUID,com.exoscale.sdk.model.UpdatePrivateNetworkInstanceIpRequest))

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

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

List Private Networks

```
GET /private-network
```

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `private-networks` | array of [Private Network](/reference/api/_schemas/private-network/) |  |

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

```json
{
  "private-networks": [
    {
      "description": "string",
      "end-ip": "string",
      "id": "string",
      "labels": {},
      "leases": [
        {
          "instance-id": "string",
          "ip": "string"
        }
      ],
      "name": "string",
      "netmask": "string",
      "options": {
        "dns-servers": [
          "string"
        ],
        "domain-search": [
          "string"
        ],
        "ntp-servers": [
          "string"
        ],
        "routers": [
          "string"
        ]
      },
      "start-ip": "string",
      "vni": 0
    }
  ]
}
```
</details>


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

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


