pydo.vpc_subnets.update()

Generated on 1 Oct 2026 from pydo version v0.43.0

Usage

client.vpc_subnets.update(
    vpc_uuid="997615ce-132d-4bae-9270-9ee21b395e5d",
    subnet_uuid="4de7ac8b-495b-4884-9a69-1050c6793cd6",
    body={
        "name": "renamed-subnet",
    },
)
Returns JSONRaises HttpResponseError

Description

To update the name of a specific subnet within a VPC, send a PATCH request to /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}.

Parameters

vpc_uuid string required

The unique identifier of the VPC to which the subnet belongs.

subnet_uuid string required

The unique identifier of a VPC subnet.

name string required

Example: renamed-subnet

The new human-readable name of the VPC subnet.

Max length: 255

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "renamed-subnet"
}

resp = client.vpc_subnets.update(vpc_uuid="997615ce-132d-4bae-9270-9ee21b395e5d", subnet_uuid="4de7ac8b-495b-4884-9a69-1050c6793cd6", body=req)

Response Example

Show Response Example
{
  "vpc_subnet": {
    "id": "4de7ac8b-495b-4884-9a69-1050c6793cd6",
    "urn": "do:vpc_subnet:4de7ac8b-495b-4884-9a69-1050c6793cd6",
    "name": "new-subnet",
    "ip_range": "10.20.0.0/16",
    "type": "REGULAR",
    "region": "nyc3",
    "created_at": "2024-01-01T12:00:00Z",
    "meta": {
      "stats": {
        "members": 3,
        "resources": {
          "droplet": 2,
          "loadbalancer": 1
        }
      }
    }
  }
}

More Information

See /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.