VPCs v4.176.0

VPCs List

GET https://api.linode.com/v4/vpcs

Display all VPCs on your account.

Authorizations

personalAccessToken
oauth

Query Parameters

page
Type:
integer >= 1
Default: 1
Default:
1

The page of a collection to return.

page_size
Type:
integer 25..500
Default: 100
Default:
100

The number of items to return per page.

Request Samples

Response Samples

Responses

VPC Create

POST https://api.linode.com/v4/vpcs

Create a new VPC and optionally associated VPC Subnets.

  • Users must have the add_vpc grant to access this command.
  • A successful request triggers a vpc_create event and subnet_create events for any created VPC Subnets.

Once a VPC is created, it can be attached to a Linode by assigning a VPC Subnet to one of the Linode’s Configuration Profile Interfaces. This step can be accomplished with the following commands:

Authorizations

personalAccessToken
oauthvpc:read_write

Request Samples

Request Body Schema

description
string <= 255 characters

A written description to help distinguish the VPC.

label
Required
string 1..64 characters

The VPC’s label, for display purposes only.

  • Needs to be unique among the Account’s VPCs.
  • Can only contain ASCII letters, numbers, and hyphens (-). You can’t use two consecutive hyphens (--).

region
Required
string

The Region for the VPC.

subnets
array of objects

A list of subnets associated with the VPC.

ipv4
Required
string<ip>

IPv4 range in CIDR canonical form.

  • The range must belong to a private address space as defined in RFC1918 .
  • Allowed prefix lengths: 1-29.
  • The range must not overlap with 192.168.128.0/17.
  • The range must not overlap with other Subnets on the same VPC.

label
Required
string 1..64 characters

The VPC Subnet’s label, for display purposes only.

  • Must be unique among the VPC’s Subnets.
  • Can only contain ASCII letters, numbers, and hyphens (-). You can’t use two consecutive hyphens (--).

Response Samples

Responses

VPC IP Addresses List

GET https://api.linode.com/v4/vpcs/ips

Returns a paginated list of all VPC IP addresses and address ranges on your account.

Note: If a Linode has several configuration profiles that include a VPC interface, address information for all of them is listed in the response. Since VPCs can use the same address space, you may see duplicate IP addresses.

Authorizations

personalAccessToken
oauthips:read_only

Query Parameters

page
Type:
integer >= 1
Default: 1
Default:
1

The page of a collection to return.

page_size
Type:
integer 25..500
Default: 100
Default:
100

The number of items to return per page.

Request Samples

Response Samples

Responses

VPC Delete

DELETE https://api.linode.com/v4/vpcs/{vpcId}

Delete a single VPC and all of its Subnets.

  • The User accessing this command must have read_write grants to the VPC.
  • A successful request triggers a vpc_delete event and subnet_delete events for each deleted VPC Subnet.
  • All of the VPC’s Subnets must be eligible for deletion. Accordingly, all Configuration Profile Interfaces that each Subnet is assigned to must first be deleted. If those Interfaces are active, the associated Linodes must first be shut down before they can be removed. If any Subnet cannot be deleted, then neither the VPC nor any of its Subnets are deleted.

Authorizations

personalAccessToken
oauthvpc:read_write

Path Parameters

vpcIdinteger
Required

The id of the VPC.

Request Samples

Response Samples

Responses

VPC View

GET https://api.linode.com/v4/vpcs/{vpcId}

Get information about a single VPC.

Authorizations

personalAccessToken
oauth

Path Parameters

vpcIdinteger
Required

The id of the VPC.

Request Samples

Response Samples

Responses

VPC Update

PUT https://api.linode.com/v4/vpcs/{vpcId}

Update an existing VPC.

  • The User accessing this command must have read_write grants to the VPC.
  • A successful request triggers a vpc_update event.

To update a VPC’s Subnet, use the VPC Subnet Update command.

Authorizations

personalAccessToken
oauthvpc:read_write

Path Parameters

vpcIdinteger
Required

The id of the VPC.

Request Samples

Request Body Schema

description
string <= 255 characters

A written description to help distinguish the VPC.

label
string 1..64 characters

The VPC’s label, for display purposes only.

  • Needs to be unique among the Account’s VPCs.
  • Can only contain ASCII letters, numbers, and hyphens (-). You can’t use two consecutive hyphens (--).

Response Samples

Responses

VPC IP Addresses View

GET https://api.linode.com/v4/vpcs/{vpcId}/ips

Returns a paginated list of IP addresses for a single VPC.

Authorizations

personalAccessToken
oauthips:read_only

Path Parameters

vpcIdinteger
Required

The id of the VPC.

Query Parameters

page
Type:
integer >= 1
Default: 1
Default:
1

The page of a collection to return.

page_size
Type:
integer 25..500
Default: 100
Default:
100

The number of items to return per page.

Request Samples

Response Samples

Responses

VPC Subnets List

GET https://api.linode.com/v4/vpcs/{vpcId}/subnets

Get information about all VPC Subnets associated with a VPC.

Authorizations

personalAccessToken
oauth

Path Parameters

vpcIdinteger
Required

The id of the VPC.

Query Parameters

page
Type:
integer >= 1
Default: 1
Default:
1

The page of a collection to return.

page_size
Type:
integer 25..500
Default: 100
Default:
100

The number of items to return per page.

Request Samples

Response Samples

Responses

VPC Subnet Create

POST https://api.linode.com/v4/vpcs/{vpcId}/subnets

Create a VPC Subnet.

  • The User accessing this command must have read_write grants to the VPC.
  • A successful request triggers a subnet_create event.

Once a VPC Subnet is created, it can be attached to a Linode by assigning the Subnet to one of the Linode’s Configuration Profile Interfaces. This step can be accomplished with the following commands:

Authorizations

personalAccessToken
oauthvpc:read_write

Path Parameters

vpcIdinteger
Required

The id of the VPC.

Request Samples

Request Body Schema

ipv4
Required
string<ip>

IPv4 range in CIDR canonical form.

  • The range must belong to a private address space as defined in RFC1918 .
  • Allowed prefix lengths: 1-29.
  • The range must not overlap with 192.168.128.0/17.
  • The range must not overlap with other Subnets on the same VPC.

label
Required
string 1..64 characters

The VPC Subnet’s label, for display purposes only.

  • Must be unique among the VPC’s Subnets.
  • Can only contain ASCII letters, numbers, and hyphens (-). You can’t use two consecutive hyphens (--).

Response Samples

Responses

VPC Subnet Delete

DELETE https://api.linode.com/v4/vpcs/{vpcId}/subnets/{vpcSubnetId}

Delete a single VPC Subnet.

The user accessing this command must have read_write grants to the VPC. A successful request triggers a subnet_delete event.

Note: You need to delete all the Configuration Profile Interfaces that this Subnet is assigned to before you can delete it. If those Interfaces are active, the associated Linode needs to be shut down before they can be removed.

Authorizations

personalAccessToken
oauthvpc:read_write

Path Parameters

vpcIdinteger
Required

The id of the VPC.

vpcSubnetIdinteger
Required

The id of the VPC Subnet.

Request Samples

Response Samples

Responses

VPC Subnet View

GET https://api.linode.com/v4/vpcs/{vpcId}/subnets/{vpcSubnetId}

Get information about a single VPC Subnet.

Authorizations

personalAccessToken
oauth

Path Parameters

vpcIdinteger
Required

The id of the VPC.

vpcSubnetIdinteger
Required

The id of the VPC Subnet.

Request Samples

Response Samples

Responses

VPC Subnet Update

PUT https://api.linode.com/v4/vpcs/{vpcId}/subnets/{vpcSubnetId}

Update a VPC Subnet.

  • The User accessing this command must have read_write grants to the VPC.
  • A successful request triggers a subnet_update event.

Authorizations

personalAccessToken
oauthvpc:read_write

Path Parameters

vpcIdinteger
Required

The id of the VPC.

vpcSubnetIdinteger
Required

The id of the VPC Subnet.

Request Samples

Request Body Schema

label
string 1..64 characters

The VPC Subnet’s label, for display purposes only.

  • Must be unique among the VPC’s Subnets.
  • Can only contain ASCII letters, numbers, and hyphens (-). You can’t use two consecutive hyphens (--).

Response Samples

Responses