ByCloud Docs
GuidesCLIAPISDK
patch/v1/subnets/{subnet_id}

Update subnet

Update a subnet

Path Parameters

subnet_id

string<uuid>required

path

Subnet ID

Example: "550e8400-e29b-41d4-a716-446655440000"

Request Body

required

Content-Type: application/json

name

stringoptional

description

stringoptional

gateway_ip

stringoptional

nullable

dns_nameservers

arrayoptional

allocation_pools

arrayoptional

host_routes

arrayoptional

enable_dhcp

booleanoptional

tags

arrayoptional

Responses

200

Subnet updated

Content-Type: application/json

subnet

objectoptional
400

Invalid request parameters

Content-Type: application/json

error

objectrequired
401

Authentication required or token invalid

Content-Type: application/json

error

objectrequired
404

Resource not found

Content-Type: application/json

error

objectrequired
500

Internal server error

Content-Type: application/json

error

objectrequired
curl -X PATCH "https://api.spo1.mycloud.com/v1/subnets/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"gateway_ip": "string",
"dns_nameservers": [
"string"
],
"allocation_pools": [
{
"start": "192.168.1.100",
"end": "192.168.1.200"
}
],
"host_routes": [
{
"destination": "10.0.0.0/8",
"nexthop": "192.168.1.1"
}
],
"enable_dhcp": true,
"tags": [
"web",
"frontend"
]
}'

Response

Subnet updated

{
"subnet": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"crn": "crn:spo1:network:subnet:550e8400-e29b-41d4-a716-446655440000",
"name": "private-subnet",
"description": "string",
"network_id": "550e8400-e29b-41d4-a716-446655440001",
"ip_version": 4,
"cidr": "192.168.1.0/24",
"gateway_ip": "192.168.1.1",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"allocation_pools": [
{
"start": "192.168.1.100",
"end": "192.168.1.200"
}
],
"host_routes": [
{
"destination": "10.0.0.0/8",
"nexthop": "192.168.1.1"
}
],
"enable_dhcp": true,
"ipv6_ra_mode": "slaac",
"ipv6_address_mode": "slaac",
"tags": [
"web",
"frontend"
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}