# Public Cloud › Network › Subnets API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/network/subnets/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/network/subnets.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/network/subnets.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/network/{networkId}/subnet` — List subnets
- `GET /publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}` — Get a subnet
- `POST /publicCloud/project/{projectId}/network/{networkId}/subnet` — Create a subnet
- `DELETE /publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}` — Delete a subnet
- `PUT /publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}` — Update a subnet

## List subnets

`GET /v2/publicCloud/project/{projectId}/network/{networkId}/subnet`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/subnets/#getSubnets

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:network/subnet/get`

Returns the subnets of the network.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `networkId` | path | string (uuid) | yes | Network ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.network.Subnet[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the subnet |
| `currentState` | publicCloud.network.SubnetCurrentState | read-only | Current state of the subnet |
| `currentState.allocationPools` | publicCloud.network.SubnetAllocationPool[] | read-only | Ranges inside the subnet that addresses are handed out from automatically. Addresses outside them stay free for you to assign yourself. |
| `currentState.allocationPools[].end` | ip | yes | End IP address of the pool |
| `currentState.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `currentState.cidr` | ipBlock | read-only | CIDR address range |
| `currentState.description` | string | read-only | Subnet description |
| `currentState.dhcpEnabled` | boolean | read-only | Whether DHCP is enabled |
| `currentState.dnsNameservers` | string[] | read-only | DNS resolvers handed to instances attached to this subnet. Null or empty when the default resolvers are used. |
| `currentState.gatewayIp` | ip | read-only | Default gateway IP |
| `currentState.hostRoutes` | publicCloud.network.SubnetHostRoute[] | read-only | Static host routes |
| `currentState.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `currentState.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `currentState.location` | publicCloud.common.Location | read-only | Location details |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Subnet name |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the subnet |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the subnet |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Subnet readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.network.SubnetTargetSpec | read-only | Last target specification of the subnet |
| `targetSpec.allocationPools` | publicCloud.network.SubnetAllocationPool[] |  | IP address allocation pools. When omitted, the pools are generated from the CIDR range. |
| `targetSpec.allocationPools[].end` | ip | yes | End IP address of the pool |
| `targetSpec.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `targetSpec.cidr` | ipBlock | yes | CIDR address range. Immutable after creation. |
| `targetSpec.description` | string |  | Subnet description |
| `targetSpec.dhcpEnabled` | boolean |  | Whether DHCP is enabled. When omitted, DHCP is enabled. |
| `targetSpec.dnsNameservers` | string[] |  | DNS nameservers for the subnet. When omitted, an IPv4 subnet gets the default OVHcloud DNS nameserver and an IPv6 subnet gets none. |
| `targetSpec.gatewayIp` | ip |  | Default gateway IP address. When omitted, the subnet has no gateway. |
| `targetSpec.hostRoutes` | publicCloud.network.SubnetHostRoute[] |  | Static routes handed to the instances of the subnet through DHCP. When omitted, the subnet has no static routes. Null when the subnet has no static route. |
| `targetSpec.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `targetSpec.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Subnet name |
| `updatedAt` | string (date-time) | read-only | Last update date of the subnet |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "allocationPools": [
        {
          "end": "192.0.2.0",
          "start": "192.0.2.0"
        }
      ],
      "cidr": "192.0.2.0/24",
      "description": "string",
      "dhcpEnabled": true,
      "dnsNameservers": [
        "string"
      ],
      "gatewayIp": "192.0.2.0",
      "hostRoutes": [
        {
          "destination": "192.0.2.0/24",
          "nextHop": "192.0.2.0"
        }
      ],
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "name": "string"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "allocationPools": [
        {
          "end": "192.0.2.0",
          "start": "192.0.2.0"
        }
      ],
      "cidr": "192.0.2.0/24",
      "description": "string",
      "dhcpEnabled": true,
      "dnsNameservers": [
        "string"
      ],
      "gatewayIp": "192.0.2.0",
      "hostRoutes": [
        {
          "destination": "192.0.2.0/24",
          "nextHop": "192.0.2.0"
        }
      ],
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "name": "string"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet");

print_r($result);
?>
```

## Get a subnet

`GET /v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/subnets/#getSubnet

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:network/subnet/get`

Returns the subnet, including its gateway IP and allocation pools.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `networkId` | path | string (uuid) | yes | Network ID |
| `projectId` | path | string | yes | Project ID |
| `subnetId` | path | string (uuid) | yes | Subnet ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.network.Subnet | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the subnet |
| `currentState` | publicCloud.network.SubnetCurrentState | read-only | Current state of the subnet |
| `currentState.allocationPools` | publicCloud.network.SubnetAllocationPool[] | read-only | Ranges inside the subnet that addresses are handed out from automatically. Addresses outside them stay free for you to assign yourself. |
| `currentState.allocationPools[].end` | ip | yes | End IP address of the pool |
| `currentState.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `currentState.cidr` | ipBlock | read-only | CIDR address range |
| `currentState.description` | string | read-only | Subnet description |
| `currentState.dhcpEnabled` | boolean | read-only | Whether DHCP is enabled |
| `currentState.dnsNameservers` | string[] | read-only | DNS resolvers handed to instances attached to this subnet. Null or empty when the default resolvers are used. |
| `currentState.gatewayIp` | ip | read-only | Default gateway IP |
| `currentState.hostRoutes` | publicCloud.network.SubnetHostRoute[] | read-only | Static host routes |
| `currentState.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `currentState.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `currentState.location` | publicCloud.common.Location | read-only | Location details |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Subnet name |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the subnet |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the subnet |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Subnet readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.network.SubnetTargetSpec | read-only | Last target specification of the subnet |
| `targetSpec.allocationPools` | publicCloud.network.SubnetAllocationPool[] |  | IP address allocation pools. When omitted, the pools are generated from the CIDR range. |
| `targetSpec.allocationPools[].end` | ip | yes | End IP address of the pool |
| `targetSpec.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `targetSpec.cidr` | ipBlock | yes | CIDR address range. Immutable after creation. |
| `targetSpec.description` | string |  | Subnet description |
| `targetSpec.dhcpEnabled` | boolean |  | Whether DHCP is enabled. When omitted, DHCP is enabled. |
| `targetSpec.dnsNameservers` | string[] |  | DNS nameservers for the subnet. When omitted, an IPv4 subnet gets the default OVHcloud DNS nameserver and an IPv6 subnet gets none. |
| `targetSpec.gatewayIp` | ip |  | Default gateway IP address. When omitted, the subnet has no gateway. |
| `targetSpec.hostRoutes` | publicCloud.network.SubnetHostRoute[] |  | Static routes handed to the instances of the subnet through DHCP. When omitted, the subnet has no static routes. Null when the subnet has no static route. |
| `targetSpec.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `targetSpec.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Subnet name |
| `updatedAt` | string (date-time) | read-only | Last update date of the subnet |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}");

print_r($result);
?>
```

## Create a subnet

`POST /v2/publicCloud/project/{projectId}/network/{networkId}/subnet`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/subnets/#createSubnet

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:network/subnet/create`

Creates a subnet within the network's address space. The CIDR is immutable after creation.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `networkId` | path | string (uuid) | yes | Network ID |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.network.SubnetCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.network.SubnetTargetSpec | yes | Desired target specification for the subnet to create |
| `targetSpec.allocationPools` | publicCloud.network.SubnetAllocationPool[] |  | IP address allocation pools. When omitted, the pools are generated from the CIDR range. |
| `targetSpec.allocationPools[].end` | ip | yes | End IP address of the pool |
| `targetSpec.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `targetSpec.cidr` | ipBlock | yes | CIDR address range. Immutable after creation. |
| `targetSpec.description` | string |  | Subnet description |
| `targetSpec.dhcpEnabled` | boolean |  | Whether DHCP is enabled. When omitted, DHCP is enabled. |
| `targetSpec.dnsNameservers` | string[] |  | DNS nameservers for the subnet. When omitted, an IPv4 subnet gets the default OVHcloud DNS nameserver and an IPv6 subnet gets none. |
| `targetSpec.gatewayIp` | ip |  | Default gateway IP address. When omitted, the subnet has no gateway. |
| `targetSpec.hostRoutes` | publicCloud.network.SubnetHostRoute[] |  | Static routes handed to the instances of the subnet through DHCP. When omitted, the subnet has no static routes. Null when the subnet has no static route. |
| `targetSpec.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `targetSpec.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Subnet name |

```json
{
  "targetSpec": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.network.Subnet | successful operation |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the subnet |
| `currentState` | publicCloud.network.SubnetCurrentState | read-only | Current state of the subnet |
| `currentState.allocationPools` | publicCloud.network.SubnetAllocationPool[] | read-only | Ranges inside the subnet that addresses are handed out from automatically. Addresses outside them stay free for you to assign yourself. |
| `currentState.allocationPools[].end` | ip | yes | End IP address of the pool |
| `currentState.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `currentState.cidr` | ipBlock | read-only | CIDR address range |
| `currentState.description` | string | read-only | Subnet description |
| `currentState.dhcpEnabled` | boolean | read-only | Whether DHCP is enabled |
| `currentState.dnsNameservers` | string[] | read-only | DNS resolvers handed to instances attached to this subnet. Null or empty when the default resolvers are used. |
| `currentState.gatewayIp` | ip | read-only | Default gateway IP |
| `currentState.hostRoutes` | publicCloud.network.SubnetHostRoute[] | read-only | Static host routes |
| `currentState.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `currentState.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `currentState.location` | publicCloud.common.Location | read-only | Location details |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Subnet name |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the subnet |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the subnet |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Subnet readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.network.SubnetTargetSpec | read-only | Last target specification of the subnet |
| `targetSpec.allocationPools` | publicCloud.network.SubnetAllocationPool[] |  | IP address allocation pools. When omitted, the pools are generated from the CIDR range. |
| `targetSpec.allocationPools[].end` | ip | yes | End IP address of the pool |
| `targetSpec.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `targetSpec.cidr` | ipBlock | yes | CIDR address range. Immutable after creation. |
| `targetSpec.description` | string |  | Subnet description |
| `targetSpec.dhcpEnabled` | boolean |  | Whether DHCP is enabled. When omitted, DHCP is enabled. |
| `targetSpec.dnsNameservers` | string[] |  | DNS nameservers for the subnet. When omitted, an IPv4 subnet gets the default OVHcloud DNS nameserver and an IPv6 subnet gets none. |
| `targetSpec.gatewayIp` | ip |  | Default gateway IP address. When omitted, the subnet has no gateway. |
| `targetSpec.hostRoutes` | publicCloud.network.SubnetHostRoute[] |  | Static routes handed to the instances of the subnet through DHCP. When omitted, the subnet has no static routes. Null when the subnet has no static route. |
| `targetSpec.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `targetSpec.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Subnet name |
| `updatedAt` | string (date-time) | read-only | Last update date of the subnet |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.network.SubnetCreation
result = client.post("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet",
	targetSpec = None, # Desired target specification for the subnet to create (type: publicCloud.network.SubnetTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.network.SubnetCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet", array(
	targetSpec => null, // Desired target specification for the subnet to create (type: publicCloud.network.SubnetTargetSpec)
));

print_r($result);
?>
```

## Delete a subnet

`DELETE /v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/subnets/#deleteSubnet

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:network/subnet/delete`

Deletes the subnet.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `networkId` | path | string (uuid) | yes | Network ID |
| `projectId` | path | string | yes | Project ID |
| `subnetId` | path | string (uuid) | yes | Subnet ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.network.Subnet | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the subnet |
| `currentState` | publicCloud.network.SubnetCurrentState | read-only | Current state of the subnet |
| `currentState.allocationPools` | publicCloud.network.SubnetAllocationPool[] | read-only | Ranges inside the subnet that addresses are handed out from automatically. Addresses outside them stay free for you to assign yourself. |
| `currentState.allocationPools[].end` | ip | yes | End IP address of the pool |
| `currentState.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `currentState.cidr` | ipBlock | read-only | CIDR address range |
| `currentState.description` | string | read-only | Subnet description |
| `currentState.dhcpEnabled` | boolean | read-only | Whether DHCP is enabled |
| `currentState.dnsNameservers` | string[] | read-only | DNS resolvers handed to instances attached to this subnet. Null or empty when the default resolvers are used. |
| `currentState.gatewayIp` | ip | read-only | Default gateway IP |
| `currentState.hostRoutes` | publicCloud.network.SubnetHostRoute[] | read-only | Static host routes |
| `currentState.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `currentState.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `currentState.location` | publicCloud.common.Location | read-only | Location details |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Subnet name |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the subnet |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the subnet |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Subnet readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.network.SubnetTargetSpec | read-only | Last target specification of the subnet |
| `targetSpec.allocationPools` | publicCloud.network.SubnetAllocationPool[] |  | IP address allocation pools. When omitted, the pools are generated from the CIDR range. |
| `targetSpec.allocationPools[].end` | ip | yes | End IP address of the pool |
| `targetSpec.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `targetSpec.cidr` | ipBlock | yes | CIDR address range. Immutable after creation. |
| `targetSpec.description` | string |  | Subnet description |
| `targetSpec.dhcpEnabled` | boolean |  | Whether DHCP is enabled. When omitted, DHCP is enabled. |
| `targetSpec.dnsNameservers` | string[] |  | DNS nameservers for the subnet. When omitted, an IPv4 subnet gets the default OVHcloud DNS nameserver and an IPv6 subnet gets none. |
| `targetSpec.gatewayIp` | ip |  | Default gateway IP address. When omitted, the subnet has no gateway. |
| `targetSpec.hostRoutes` | publicCloud.network.SubnetHostRoute[] |  | Static routes handed to the instances of the subnet through DHCP. When omitted, the subnet has no static routes. Null when the subnet has no static route. |
| `targetSpec.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `targetSpec.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Subnet name |
| `updatedAt` | string (date-time) | read-only | Last update date of the subnet |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}");

print_r($result);
?>
```

## Update a subnet

`PUT /v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/subnets/#editSubnet

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:network/subnet/edit`

Updates the subnet's name, description, DHCP, DNS nameservers, gateway or allocation pools. The CIDR is immutable.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `networkId` | path | string (uuid) | yes | Network ID |
| `projectId` | path | string | yes | Project ID |
| `subnetId` | path | string (uuid) | yes | Subnet ID |

### Request body (required)

Type: `publicCloud.network.SubnetUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). |
| `targetSpec` | publicCloud.network.SubnetPutTargetSpec | yes | Desired target specification for the subnet |
| `targetSpec.allocationPools` | publicCloud.network.SubnetAllocationPool[] |  | IP address allocation pools. When omitted, the subnet gets the pools of a subnet created without them. |
| `targetSpec.allocationPools[].end` | ip | yes | End IP address of the pool |
| `targetSpec.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `targetSpec.description` | string |  | Subnet description. When omitted, the description is removed. |
| `targetSpec.dhcpEnabled` | boolean |  | Whether DHCP is enabled. When omitted, DHCP is enabled. |
| `targetSpec.dnsNameservers` | string[] |  | DNS nameservers for the subnet. When omitted, the subnet gets the default DNS nameservers of a subnet created without them (none on IPv6). |
| `targetSpec.gatewayIp` | ip |  | Default gateway IP address. When omitted, the subnet has no gateway. |
| `targetSpec.hostRoutes` | publicCloud.network.SubnetHostRoute[] |  | Static routes handed to the instances of the subnet through DHCP. A list replaces the current routes. When omitted, null or empty, all routes are removed. |
| `targetSpec.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `targetSpec.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `targetSpec.name` | string | yes | Subnet name |

```json
{
  "checksum": "string",
  "targetSpec": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "name": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.network.Subnet | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the subnet |
| `currentState` | publicCloud.network.SubnetCurrentState | read-only | Current state of the subnet |
| `currentState.allocationPools` | publicCloud.network.SubnetAllocationPool[] | read-only | Ranges inside the subnet that addresses are handed out from automatically. Addresses outside them stay free for you to assign yourself. |
| `currentState.allocationPools[].end` | ip | yes | End IP address of the pool |
| `currentState.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `currentState.cidr` | ipBlock | read-only | CIDR address range |
| `currentState.description` | string | read-only | Subnet description |
| `currentState.dhcpEnabled` | boolean | read-only | Whether DHCP is enabled |
| `currentState.dnsNameservers` | string[] | read-only | DNS resolvers handed to instances attached to this subnet. Null or empty when the default resolvers are used. |
| `currentState.gatewayIp` | ip | read-only | Default gateway IP |
| `currentState.hostRoutes` | publicCloud.network.SubnetHostRoute[] | read-only | Static host routes |
| `currentState.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `currentState.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `currentState.location` | publicCloud.common.Location | read-only | Location details |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Subnet name |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the subnet |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the subnet |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Subnet readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.network.SubnetTargetSpec | read-only | Last target specification of the subnet |
| `targetSpec.allocationPools` | publicCloud.network.SubnetAllocationPool[] |  | IP address allocation pools. When omitted, the pools are generated from the CIDR range. |
| `targetSpec.allocationPools[].end` | ip | yes | End IP address of the pool |
| `targetSpec.allocationPools[].start` | ip | yes | Start IP address of the pool |
| `targetSpec.cidr` | ipBlock | yes | CIDR address range. Immutable after creation. |
| `targetSpec.description` | string |  | Subnet description |
| `targetSpec.dhcpEnabled` | boolean |  | Whether DHCP is enabled. When omitted, DHCP is enabled. |
| `targetSpec.dnsNameservers` | string[] |  | DNS nameservers for the subnet. When omitted, an IPv4 subnet gets the default OVHcloud DNS nameserver and an IPv6 subnet gets none. |
| `targetSpec.gatewayIp` | ip |  | Default gateway IP address. When omitted, the subnet has no gateway. |
| `targetSpec.hostRoutes` | publicCloud.network.SubnetHostRoute[] |  | Static routes handed to the instances of the subnet through DHCP. When omitted, the subnet has no static routes. Null when the subnet has no static route. |
| `targetSpec.hostRoutes[].destination` | ipBlock | yes | CIDR reached through the next hop |
| `targetSpec.hostRoutes[].nextHop` | ip | yes | IP address, inside the subnet, that traffic to the destination is sent to |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Subnet name |
| `updatedAt` | string (date-time) | read-only | Last update date of the subnet |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "allocationPools": [
      {
        "end": "192.0.2.0",
        "start": "192.0.2.0"
      }
    ],
    "cidr": "192.0.2.0/24",
    "description": "string",
    "dhcpEnabled": true,
    "dnsNameservers": [
      "string"
    ],
    "gatewayIp": "192.0.2.0",
    "hostRoutes": [
      {
        "destination": "192.0.2.0/24",
        "nextHop": "192.0.2.0"
      }
    ],
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.network.SubnetUpdate
result = client.put("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}",
	checksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec = None, # Desired target specification for the subnet (type: publicCloud.network.SubnetPutTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.network.SubnetUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId}", array(
	checksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec => null, // Desired target specification for the subnet (type: publicCloud.network.SubnetPutTargetSpec)
));

print_r($result);
?>
```
