VPCs v4.174.0
VPCs List
Display all VPCs on your account.
Authorizations
personalAccessToken | |
oauth |
Query Parameters
page |
The page of a collection to return. |
page_size |
The number of items to return per page. |
Request Samples
curl https://api.linode.com/v4/vpcs \
-H "Authorization: Bearer $TOKEN"
linode-cli vpcs list
Response Samples
{
"data": null,
"page": 1,
"pages": 1,
"results": 1
}
{
"errors": null
}
Responses
data | [array] |
page | [integer] The current page. |
pages | [integer] The total number of pages. |
results | [integer] The total number of results. |
errors | [array] |
VPC Create
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 andsubnet_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:
- Linode Create ( POST /linode/instances)
- Configuration Profile Create ( POST /linode/instances/{linodeId}/configs)
- Configuration Profile Update ( PUT /linode/instances/{linodeId}/configs/{configId})
- Configuration Profile Interface Add ( POST /linode/instances/{linodeId}/configs/{configId}/interfaces)
Authorizations
personalAccessToken | |
oauth | vpc:read_write |
Request Samples
curl https://api.linode.com/v4/vpcs \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST -d '{
"description": "A description of my VPC.",
"label": "cool-vpc",
"region": "us-east",
"subnets": [
{
"label": "cool-vpc-subnet",
"ipv4": "10.0.1.0/24"
}
]
}'
linode-cli vpcs create \
--description "A description of my VPC." \
--label cool-vpc \
--region us-east \
--subnets.label cool-vpc-subnet \
--subnets.ipv4 10.0.1.0/24
Request Body Schema
description | [string]
<=
255
charactersA written description to help distinguish the VPC. |
label Required | [string]
1..64
charactersThe VPC’s label, for display purposes only.
|
region Required | [string] The Region for the VPC. |
subnets | [array] A list of subnets associated with the VPC. |
Response Samples
{
"created": "2023-07-11T00:00:00",
"description": "A description of my VPC.",
"id": 123,
"label": "cool-vpc",
"region": "us-east",
"subnets": null,
"updated": "2023-09-11T00:00:00"
}
{
"errors": null
}
Responses
created | [string]<date-time> The date-time of VPC creation. |
description | [string]
<=
255
charactersA written description to help distinguish the VPC. |
id | [integer] The unique ID of the VPC. |
label | [string]
1..64
charactersThe VPC’s label, for display purposes only.
|
region | [string] The Region for the VPC. |
subnets | [array] A list of subnets associated with the VPC. |
updated Nullable | [string]<date-time> The date-time of the most recent VPC update. |
errors | [array] |
VPC IP Addresses List
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 | |
oauth | ips:read_only |
Query Parameters
page |
The page of a collection to return. |
page_size |
The number of items to return per page. |
Request Samples
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/networking/vpcs/ips
linode-cli vpcs ip list
Response Samples
{
"data": null,
"page": 1,
"pages": 1,
"results": 1
}
{
"errors": null
}
Responses
data | [array] |
page | [integer] The current page. |
pages | [integer] The total number of pages. |
results | [integer] The total number of results. |
errors | [array] |
VPC Delete
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 andsubnet_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 | |
oauth | vpc:read_write |
Path Parameters
vpcId | [integer] RequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId \
-H "Authorization: Bearer $TOKEN" \
-X DELETE
linode-cli vpcs delete $vpcId
Response Samples
{}
{
"errors": null
}
Responses
errors | [array] |
VPC View
Get information about a single VPC.
Authorizations
personalAccessToken | |
oauth |
Path Parameters
vpcId | [integer] RequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId \
-H "Authorization: Bearer $TOKEN"
linode-cli vpcs view $vpcId
Response Samples
{
"created": "2023-07-11T00:00:00",
"description": "A description of my VPC.",
"id": 123,
"label": "cool-vpc",
"region": "us-east",
"subnets": null,
"updated": "2023-09-11T00:00:00"
}
{
"errors": null
}
Responses
created | [string]<date-time> The date-time of VPC creation. |
description | [string]
<=
255
charactersA written description to help distinguish the VPC. |
id | [integer] The unique ID of the VPC. |
label | [string]
1..64
charactersThe VPC’s label, for display purposes only.
|
region | [string] The Region for the VPC. |
subnets | [array] A list of subnets associated with the VPC. |
updated Nullable | [string]<date-time> The date-time of the most recent VPC update. |
errors | [array] |
VPC Update
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 | |
oauth | vpc:read_write |
Path Parameters
vpcId | [integer] RequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X PUT -d '{
"description": "A description of my VPC.",
"label": "cool-vpc"
}'
linode-cli vpcs update $vpcId \
--description "A description of my VPC."
--label cool-vpc
Request Body Schema
description | [string]
<=
255
charactersA written description to help distinguish the VPC. |
label | [string]
1..64
charactersThe VPC’s label, for display purposes only.
|
Response Samples
{
"created": "2023-07-11T00:00:00",
"description": "A description of my VPC.",
"id": 123,
"label": "cool-vpc",
"region": "us-east",
"subnets": null,
"updated": "2023-09-11T00:00:00"
}
{
"errors": null
}
Responses
created | [string]<date-time> The date-time of VPC creation. |
description | [string]
<=
255
charactersA written description to help distinguish the VPC. |
id | [integer] The unique ID of the VPC. |
label | [string]
1..64
charactersThe VPC’s label, for display purposes only.
|
region | [string] The Region for the VPC. |
subnets | [array] A list of subnets associated with the VPC. |
updated Nullable | [string]<date-time> The date-time of the most recent VPC update. |
errors | [array] |
VPC IP Addresses View
Returns a paginated list of IP addresses for a single VPC.
Authorizations
personalAccessToken | |
oauth | ips:read_only |
Path Parameters
vpcId | [integer] RequiredThe |
Query Parameters
page |
The page of a collection to return. |
page_size |
The number of items to return per page. |
Request Samples
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/vpcs/123/ips
linode-cli vpcs ip-list 123
Response Samples
{
"data": null,
"page": 1,
"pages": 1,
"results": 1
}
{
"errors": null
}
Responses
data | [array] |
page | [integer] The current page. |
pages | [integer] The total number of pages. |
results | [integer] The total number of results. |
errors | [array] |
VPC Subnets List
Get information about all VPC Subnets associated with a VPC.
Authorizations
personalAccessToken | |
oauth |
Path Parameters
vpcId | [integer] RequiredThe |
Query Parameters
page |
The page of a collection to return. |
page_size |
The number of items to return per page. |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId/subnets \
-H "Authorization: Bearer $TOKEN"
linode-cli vpcs subnets-list $vpcId
Response Samples
{
"data": null,
"page": 1,
"pages": 1,
"results": 1
}
{
"errors": null
}
Responses
data | [array] |
page | [integer] The current page. |
pages | [integer] The total number of pages. |
results | [integer] The total number of results. |
errors | [array] |
VPC Subnet Create
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:
- Linode Create ( POST /linode/instances)
- Configuration Profile Create ( POST /linode/instances/{linodeId}/configs)
- Configuration Profile Update ( PUT /linode/instances/{linodeId}/configs/{configId})
- Configuration Profile Interface Add ( POST /linode/instances/{linodeId}/configs/{configId}/interfaces)
Authorizations
personalAccessToken | |
oauth | vpc:read_write |
Path Parameters
vpcId | [integer] RequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId/subnets \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST -d '{
"label": "cool-vpc-subnet",
"ipv4": "10.0.1.0/24",
}'
linode-cli vpcs subnet-create $vpcId \
--label cool-vpc-subnet \
--ipv4 10.0.1.0/24
Request Body Schema
ipv4 Required | [string]<ip> IPv4 range in CIDR canonical form.
|
label Required | [string]
1..64
charactersThe VPC Subnet’s label, for display purposes only.
|
Response Samples
{
"created": "2023-07-11T00:00:00",
"id": 456,
"ipv4": "10.0.1.0/24",
"label": "cool-vpc-subnet",
"linodes": null,
"updated": "2023-09-11T00:00:00"
}
{
"errors": null
}
Responses
created | [string]<date-time> The date-time of VPC Subnet creation. |
id | [integer] The unique ID of the VPC Subnet. |
ipv4 | [string]<ip> IPv4 range in CIDR canonical form.
|
label | [string]
1..64
charactersThe VPC Subnet’s label, for display purposes only.
|
linodes | [array] An array of Linode IDs assigned to the VPC Subnet. A Linode is assigned to a VPC Subnet if it has a Configuration Profile with a |
updated Nullable | [string]<date-time> The date-time of the most recent VPC Subnet update. |
errors | [array] |
VPC Subnet Delete
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 | |
oauth | vpc:read_write |
Path Parameters
vpcId | [integer] RequiredThe |
vpcSubnetId | [integer] RequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId/subnets/$vpcSubnetId \
-H "Authorization: Bearer $TOKEN" \
-X DELETE
linode-cli vpcs subnet-delete $vpcId $vpcSubnetId
Response Samples
{}
{
"errors": null
}
Responses
errors | [array] |
VPC Subnet View
Get information about a single VPC Subnet.
Authorizations
personalAccessToken | |
oauth |
Path Parameters
vpcId | [integer] RequiredThe |
vpcSubnetId | [integer] RequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId/subnets/$vpcSubnetId \
-H "Authorization: Bearer $TOKEN"
linode-cli vpcs subnet-view $vpcId #vpcSubnetId
Response Samples
{
"created": "2023-07-11T00:00:00",
"id": 456,
"ipv4": "10.0.1.0/24",
"label": "cool-vpc-subnet",
"linodes": null,
"updated": "2023-09-11T00:00:00"
}
{
"errors": null
}
Responses
created | [string]<date-time> The date-time of VPC Subnet creation. |
id | [integer] The unique ID of the VPC Subnet. |
ipv4 | [string]<ip> IPv4 range in CIDR canonical form.
|
label | [string]
1..64
charactersThe VPC Subnet’s label, for display purposes only.
|
linodes | [array] An array of Linode IDs assigned to the VPC Subnet. A Linode is assigned to a VPC Subnet if it has a Configuration Profile with a |
updated Nullable | [string]<date-time> The date-time of the most recent VPC Subnet update. |
errors | [array] |
VPC Subnet Update
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 | |
oauth | vpc:read_write |
Path Parameters
vpcId | [integer] RequiredThe |
vpcSubnetId | [integer] RequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId/subnets/$vpcSubnetId \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X PUT -d '{
"label": "cool-vpc-subnet"
}'
linode-cli vpcs subnet-update $vpcId \
--label cool-vpc-subnet
Request Body Schema
label | [string]
1..64
charactersThe VPC Subnet’s label, for display purposes only.
|
Response Samples
{
"created": "2023-07-11T00:00:00",
"id": 456,
"ipv4": "10.0.1.0/24",
"label": "cool-vpc-subnet",
"linodes": null,
"updated": "2023-09-11T00:00:00"
}
{
"errors": null
}
Responses
created | [string]<date-time> The date-time of VPC Subnet creation. |
id | [integer] The unique ID of the VPC Subnet. |
ipv4 | [string]<ip> IPv4 range in CIDR canonical form.
|
label | [string]
1..64
charactersThe VPC Subnet’s label, for display purposes only.
|
linodes | [array] An array of Linode IDs assigned to the VPC Subnet. A Linode is assigned to a VPC Subnet if it has a Configuration Profile with a |
updated Nullable | [string]<date-time> The date-time of the most recent VPC Subnet update. |
errors | [array] |