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 listResponse 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 | integerRead-only The current page. | ||||||||||||||||||||||||||||||||||
pages | integerRead-only The total number of pages. | ||||||||||||||||||||||||||||||||||
results | integerRead-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_vpcgrant to access this operation. - A successful request triggers a
vpc_createevent andsubnet_createevents 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 createOAuth.
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/24Request 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 | stringThe Region for the VPC. | ||||
subnets | array
of objectsA 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 | integerRead-only The unique ID of the VPC. | ||||||||||||||||||||
label | string
1..64
charactersThe VPC’s label, for display purposes only.
| ||||||||||||||||||||
region | stringThe Region for the VPC. | ||||||||||||||||||||
subnets | array
of objectsA 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_writegrants to the VPC. - A successful request triggers a
vpc_deleteevent andsubnet_deleteevents 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 deleteOAuth.
vpc:read_write
Authorizations
| personalAccessToken | |
| oauth | vpc:read_write |
Path Parameters
| vpcId | integerRequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId \
-H "Authorization: Bearer $TOKEN" \
-X DELETElinode-cli vpcs delete $vpcIdResponse 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 | integerRequiredThe |
Request Samples
curl https://api.linode.com/v4/vpcs/$vpcId \
-H "Authorization: Bearer $TOKEN"linode-cli vpcs view $vpcIdResponse 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 | integerRead-only The unique ID of the VPC. | ||||||||||||||||||||
label | string
1..64
charactersThe VPC’s label, for display purposes only.
| ||||||||||||||||||||
region | stringThe Region for the VPC. | ||||||||||||||||||||
subnets | array
of objectsA 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_writegrants to the VPC. - A successful request triggers a
vpc_updateevent.
To update a VPC’s Subnet, run the Update a VPC subnet operation.
CLI.
linode-cli vpcs updateOAuth.
vpc:read_write
Authorizations
| personalAccessToken | |
| oauth | vpc:read_write |
Path Parameters
| vpcId | integerRequiredThe |
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-vpcRequest 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 | integerRead-only The unique ID of the VPC. | ||||||||||||||||||||
label | string
1..64
charactersThe VPC’s label, for display purposes only.
| ||||||||||||||||||||
region | stringThe Region for the VPC. | ||||||||||||||||||||
subnets | array
of objectsA 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
|