Skip to main content

vlans

Creates, updates, deletes, gets or lists a vlans resource.

Overview

Namevlans
TypeResource
Idlinode.networking.vlans

Fields

The following fields are returned by SELECT queries:

The VLANs available on this Account.

NameDatatypeDescription
createdstring (date-time)Read-only The date this VLAN was created. (example: 2020-01-01T00:01:01)
labelstringFilterable, Read-only The name of this VLAN. (example: vlan-example)
linodesarrayRead-only An array of Linode IDs attached to this VLAN.
regionstringFilterable, Read-only This VLAN's data center region. > 📘 > > Currently, a VLAN can only be assigned to a Linode within the same data center region. (example: ap-west)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectpage, page_sizeReturns a list of all Virtual Local Area Networks (VLANs) on your account. VLANs provide a mechanism for secure communication between two or more Linodes that are assigned to the same VLAN, and are both within the same Layer 2 broadcast domain.

For legacy configuration profile interfaces, you can use the following operations to create, attach, detach, and delete VLANs on a Linode:
- Create a Linode
- Create a config profile
- Update a config profile
- Update the active Configuration Profile to remove the VLAN Interface, then reboot the Linode.
- Create a config profile without the VLAN Interface, then reboot the Linode into the new Configuration Profile.
- Delete the Linode.

For Linode interfaces, you can use the following operations to create, attach, detach, and delete VLANs on a Linode:
- Create a Linode
- Add a Linode interface
- Update a Linode interface
- Delete a Linode interface from a Linode.

> 📘
>
> - Only Next Generation Network (NGN) data centers support VLANs. Run the List regions operation to view the capabilities of data center regions. If a VLAN is attached to your Linode and you attempt to migrate or clone it to a non-NGN data center, the migration or cloning won't initiate. If a Linode cannot be migrated because of an incompatibility, you will be prompted to select a different data center or contact support.
>
> - See the VLANs Overview to view additional specifications and limitations.

Learn more...

Learn more...
deletedeletelabel, regionIdThis operation deletes a legacy configuration profile VLAN interface. To delete a Linode interface VLAN, use the Delete a Linode interface operation.

You can't delete a VLAN if it's still attached to a Linode. There are a few ways to detach it:
- Update the active configuration profile to remove the VLAN interface, then reboot the Linode.
- Create a config profile without the VLAN interface, then reboot the Linode into the new configuration profile.
- Delete the Linode.

To run this operation, you need read_write grants to Linodes that use the VLAN.

A successful request triggers a vlan_delete event.

> 📘
>
> VLANs without any attached Linodes are periodically cleaned up by the system.

Learn more...

Learn more...

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
labelstringThe label of the VLAN to be deleted.
regionIdstringThe VLAN's region.
pageintegerThe page of a collection to return.
page_sizeintegerThe number of items to return per page.

SELECT examples

Returns a list of all Virtual Local Area Networks (VLANs) on your account. VLANs provide a mechanism for secure communication between two or more Linodes that are assigned to the same VLAN, and are both within the same Layer 2 broadcast domain.

For legacy configuration profile interfaces, you can use the following operations to create, attach, detach, and delete VLANs on a Linode:
- Create a Linode
- Create a config profile
- Update a config profile
- Update the active Configuration Profile to remove the VLAN Interface, then reboot the Linode.
- Create a config profile without the VLAN Interface, then reboot the Linode into the new Configuration Profile.
- Delete the Linode.

For Linode interfaces, you can use the following operations to create, attach, detach, and delete VLANs on a Linode:
- Create a Linode
- Add a Linode interface
- Update a Linode interface
- Delete a Linode interface from a Linode.

> 📘
>
> - Only Next Generation Network (NGN) data centers support VLANs. Run the List regions operation to view the capabilities of data center regions. If a VLAN is attached to your Linode and you attempt to migrate or clone it to a non-NGN data center, the migration or cloning won't initiate. If a Linode cannot be migrated because of an incompatibility, you will be prompted to select a different data center or contact support.
>
> - See the VLANs Overview to view additional specifications and limitations.

Learn more...

Learn more...

SELECT
created,
label,
linodes,
region
FROM linode.networking.vlans
WHERE page = '{{ page }}'
AND page_size = '{{ page_size }}'
;

DELETE examples

This operation deletes a legacy configuration profile VLAN interface. To delete a Linode interface VLAN, use the Delete a Linode interface operation.

You can't delete a VLAN if it's still attached to a Linode. There are a few ways to detach it:
- Update the active configuration profile to remove the VLAN interface, then reboot the Linode.
- Create a config profile without the VLAN interface, then reboot the Linode into the new configuration profile.
- Delete the Linode.

To run this operation, you need read_write grants to Linodes that use the VLAN.

A successful request triggers a vlan_delete event.

> 📘
>
> VLANs without any attached Linodes are periodically cleaned up by the system.

Learn more...

Learn more...

DELETE FROM linode.networking.vlans
WHERE label = '{{ label }}' --required
AND regionId = '{{ regionId }}' --required
;