Skip to content

Subnets

All operations require authentication.

5 operationsv2/publicCloud/project
Agent setup

List subnetsProduction

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

Returns the subnets of the network.

Path parameters

networkId
required
stringuuid

Network ID

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200Subnet[]successful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the subnet

currentState
read-only
SubnetCurrentState

Current state of the subnet

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the subnet

id
read-only
stringuuid

Unique identifier of the subnet

resourceStatus
read-only
ResourceStatusEnum

Subnet readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SubnetTargetSpec

Last target specification of the subnet

updatedAt
read-only
stringdate-time

Last update date of the subnet

Example uses networkId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "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" }]

Get a subnetProduction

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

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

Path parameters

networkId
required
stringuuid

Network ID

projectId
required
string

Project ID

subnetId
required
stringuuid

Subnet ID

Response

200Subnetsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the subnet

currentState
read-only
SubnetCurrentState

Current state of the subnet

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the subnet

id
read-only
stringuuid

Unique identifier of the subnet

resourceStatus
read-only
ResourceStatusEnum

Subnet readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SubnetTargetSpec

Last target specification of the subnet

updatedAt
read-only
stringdate-time

Last update date of the subnet

404objectError 404 response

Example uses networkId = 00000000-0000-0000-0000-000000000000, projectId = string, subnetId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "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"}

Create a subnetProduction

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

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

Path parameters

networkId
required
stringuuid

Network ID

projectId
required
string

Project ID

Request body (required)

targetSpec
required
SubnetTargetSpec

Desired target specification for the subnet to create

Response

200Subnetsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the subnet

currentState
read-only
SubnetCurrentState

Current state of the subnet

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the subnet

id
read-only
stringuuid

Unique identifier of the subnet

resourceStatus
read-only
ResourceStatusEnum

Subnet readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SubnetTargetSpec

Last target specification of the subnet

updatedAt
read-only
stringdate-time

Last update date of the subnet

409objectError 409 response

Example uses networkId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "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"}

Delete a subnetProduction

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

Deletes the subnet.

Path parameters

networkId
required
stringuuid

Network ID

projectId
required
string

Project ID

subnetId
required
stringuuid

Subnet ID

Response

200Subnetsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the subnet

currentState
read-only
SubnetCurrentState

Current state of the subnet

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the subnet

id
read-only
stringuuid

Unique identifier of the subnet

resourceStatus
read-only
ResourceStatusEnum

Subnet readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SubnetTargetSpec

Last target specification of the subnet

updatedAt
read-only
stringdate-time

Last update date of the subnet

404objectError 404 response
409objectError 409 response

Example uses networkId = 00000000-0000-0000-0000-000000000000, projectId = string, subnetId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "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"}

Update a subnetProduction

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

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

Path parameters

networkId
required
stringuuid

Network ID

projectId
required
string

Project ID

subnetId
required
stringuuid

Subnet ID

Request body (required)

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

Desired target specification for the subnet

Response

200Subnetsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the subnet

currentState
read-only
SubnetCurrentState

Current state of the subnet

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the subnet

id
read-only
stringuuid

Unique identifier of the subnet

resourceStatus
read-only
ResourceStatusEnum

Subnet readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SubnetTargetSpec

Last target specification of the subnet

updatedAt
read-only
stringdate-time

Last update date of the subnet

404objectError 404 response
409objectError 409 response

Example uses networkId = 00000000-0000-0000-0000-000000000000, projectId = string, subnetId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/network/{networkId}/subnet/{subnetId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "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"}