VPCs v4.176.0
List VPCs
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": [
{
"created": "2023-07-11T00:00:00",
"description": "A description of my VPC.",
"id": 123,
"label": "cool-vpc",
"region": "us-east",
"subnets": [
{
"created": "2023-07-11T00:00:00",
"id": 456,
"ipv4": "10.0.1.0/24",
"label": "cool-vpc-subnet",
"linodes": [
{
"id": 111,
"interfaces": [
{
"active": true,
"id": 421
}
]
}
],
"updated": "2023-09-11T00:00:00"
}
],
"updated": "2023-09-11T00:00:00"
}
],
"page": 1,
"pages": 1,
"results": 1
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
data | array
of objects
| ||||||||||||||||||||||||||||||||||
page | integer Read-only The current page. | ||||||||||||||||||||||||||||||||||
pages | integer Read-only The total number of pages. | ||||||||||||||||||||||||||||||||||
results | integer Read-only The total number of results. |
errors | array
of objects
|
Create a VPC
Create a new VPC and optionally associated VPC Subnets.
- Users must have the
add_vpc
grant to access this operation. - 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 operations:
CLI.
linode-cli vpcs create
OAuth.
vpc:read_write
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
of objects 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": [
{
"created": "2023-07-11T00:00:00",
"id": 456,
"ipv4": "10.0.1.0/24",
"label": "cool-vpc-subnet",
"linodes": [
{
"id": 111,
"interfaces": [
{
"active": true,
"id": 421
}
]
}
],
"updated": "2023-09-11T00:00:00"
}
],
"updated": "2023-09-11T00:00:00"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> Read-only The date-time of VPC creation. | ||||||||||||||||||||
description | string
<=
255
charactersA written description to help distinguish the VPC. | ||||||||||||||||||||
id | integer Read-only 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
of objects A list of subnets associated with the VPC.
| ||||||||||||||||||||
updated Nullable | string<date-time> Read-only The date-time of the most recent VPC update. |
errors | array
of objects
|
Delete a VPC
Delete a single VPC and all of its Subnets.
- The User accessing this operation 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.
CLI.
linode-cli vpcs delete
OAuth.
vpc:read_write
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": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
errors | array
of objects
|
Get a VPC
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": [
{
"created": "2023-07-11T00:00:00",
"id": 456,
"ipv4": "10.0.1.0/24",
"label": "cool-vpc-subnet",
"linodes": [
{
"id": 111,
"interfaces": [
{
"active": true,
"id": 421
}
]
}
],
"updated": "2023-09-11T00:00:00"
}
],
"updated": "2023-09-11T00:00:00"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> Read-only The date-time of VPC creation. | ||||||||||||||||||||
description | string
<=
255
charactersA written description to help distinguish the VPC. | ||||||||||||||||||||
id | integer Read-only 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
of objects A list of subnets associated with the VPC.
| ||||||||||||||||||||
updated Nullable | string<date-time> Read-only The date-time of the most recent VPC update. |
errors | array
of objects
|
Update a VPC
Update an existing VPC.
- The User accessing this operation must have
read_write
grants to the VPC. - A successful request triggers a
vpc_update
event.
To update a VPC’s Subnet, run the Update a VPC subnet operation.
CLI.
linode-cli vpcs update
OAuth.
vpc:read_write
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": [
{
"created": "2023-07-11T00:00:00",
"id": 456,
"ipv4": "10.0.1.0/24",
"label": "cool-vpc-subnet",
"linodes": [
{
"id": 111,
"interfaces": [
{
"active": true,
"id": 421
}
]
}
],
"updated": "2023-09-11T00:00:00"
}
],
"updated": "2023-09-11T00:00:00"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> Read-only The date-time of VPC creation. | ||||||||||||||||||||
description | string
<=
255
charactersA written description to help distinguish the VPC. | ||||||||||||||||||||
id | integer Read-only 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
of objects A list of subnets associated with the VPC.
| ||||||||||||||||||||
updated Nullable | string<date-time> Read-only The date-time of the most recent VPC update. |
errors | array
of objects
|