For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
Usage
client.v2.vpcs.byVpc_Id(vpc_Id).subnets.bySubnet_uuid(subnet_uuid).patch(body: Vpc_subnet_update, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | WithSubnet_uuPatchResponse>
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
Path Parameters
vpc_Id string required
Example: 997615ce-132d-4bae-9270-9ee21b395e5d
The unique identifier of the VPC to which the subnet belongs.
subnet_uuid string required
Example: 4de7ac8b-495b-4884-9a69-1050c6793cd6
The unique identifier of a VPC subnet.
Request Body
name string required
Example: renamed-subnet
The new human-readable name of the VPC subnet.
Max length: 255
Request Sample
Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
createDigitalOceanClient,
DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";
const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);
const response = await client.v2.vpcs
.byVpc_Id("997615ce-132d-4bae-9270-9ee21b395e5d").subnets
.bySubnet_uuid("4de7ac8b-495b-4884-9a69-1050c6793cd6").patch({
name: "renamed-subnet",
});
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
}
}
}
}
}
See /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid} in the API reference for additional detail on responses, headers, parameters, and more.