Packet Host VLANs API
Manage virtual networks (VLANs). See project endpoints to list and create virtual networks. Check out the product docs to learn more about [VLANs](https://metal.equinix.com/developers/docs/networking/layer2/).
Manage virtual networks (VLANs). See project endpoints to list and create virtual networks. Check out the product docs to learn more about [VLANs](https://metal.equinix.com/developers/docs/networking/layer2/).
openapi: 3.0.0
info:
contact:
email: support@equinixmetal.com
name: Equinix Metal API Team
description: "# Introduction\nEquinix Metal provides a RESTful HTTP API which can be reached at <https://api.equinix.com/metal/v1>. This document describes the API and how to use it.\n\nThe API allows you to programmatically interact with all\nof your Equinix Metal resources, including devices, networks, addresses, organizations,\nprojects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API.\n\nThe API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at <https://metal.equinix.com/developers/api>.\n\n# Common Parameters\n\nThe Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them.\n\n## Pagination\n\nPagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters.\n\nThe `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type.\n\n## Sorting\n\nWhere offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending).\n\n## Filtering\n\nFiltering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter.\n\nFor example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request:\n\n```sh\ncurl -H 'X-Auth-Token: my_authentication_token' \\\n https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4\n```\n\nOnly IP addresses with the `type` field set to `public_ipv4` will be returned.\n\n## Searching\n\nSearching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints.\n\nTo search resources you can use the `search` query parameter.\n\n## Include and Exclude\n\nFor resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource.\n\n```json\n{\n ...\n \"project\": {\n \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\"\n }\n}\n```\n\nIf you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter.\n\nFor example:\n\n```sh\ncurl -H 'X-Auth-Token: my_authentication_token' \\\n https://api.equinix.com/metal/v1/user?include=projects\n```\n\nThe `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented.\n\nTo have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`).\n\n```sh\ncurl -H 'X-Auth-Token: my_authentication_token' \\\n https://api.equinix.com/metal/v1/user?include=emails,projects,memberships\n```\n\nYou may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`):\n\n```sh\ncurl -H 'X-Auth-Token: my_authentication_token' \\\n https://api.equinix.com/metal/v1/user?include=memberships.projects\n```\n\nTo exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field.\n"
license:
name: Equinix Metal
url: https://metal.equinix.com/legal/
termsOfService: https://metal.equinix.com/legal/
title: Metal Authentication VLANs API
version: 1.0.0
servers:
- url: https://api.equinix.com/metal/v1
security:
- x_auth_token: []
tags:
- description: 'Manage virtual networks (VLANs). See project endpoints to list and create virtual networks. Check out the product docs to learn more about [VLANs](https://metal.equinix.com/developers/docs/networking/layer2/).
'
externalDocs:
url: https://metal.equinix.com/developers/docs/networking/layer2/
name: VLANs
paths:
/projects/{id}/virtual-networks:
get:
description: Provides a list of virtual networks for a single project.
operationId: findVirtualNetworks
parameters:
- description: Project UUID
in: path
name: id
required: true
schema:
format: uuid
type: string
- description: 'Nested attributes to include. Included objects will return their full
attributes. Attribute names can be dotted (up to 3 levels) to included deeply
nested objects.'
explode: false
in: query
name: include
schema:
items:
type: string
type: array
style: form
- description: 'Nested attributes to exclude. Excluded objects will return only the href
attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply
nested objects.'
explode: false
in: query
name: exclude
schema:
items:
type: string
type: array
style: form
- deprecated: true
description: Filter by Facility ID (uuid) or Facility Code
in: query
name: facility
schema:
type: string
- description: Filter by Metro ID (uuid) or Metro Code
in: query
name: metro
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualNetworkList'
description: ok
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: not found
summary: Retrieve all virtual networks
tags:
- VLANs
post:
description: Creates an virtual network.
operationId: createVirtualNetwork
parameters:
- description: Project UUID
in: path
name: id
required: true
schema:
format: uuid
type: string
- description: 'Nested attributes to include. Included objects will return their full
attributes. Attribute names can be dotted (up to 3 levels) to included deeply
nested objects.'
explode: false
in: query
name: include
schema:
items:
type: string
type: array
style: form
- description: 'Nested attributes to exclude. Excluded objects will return only the href
attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply
nested objects.'
explode: false
in: query
name: exclude
schema:
items:
type: string
type: array
style: form
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualNetworkCreateInput'
description: Virtual Network to create
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualNetwork'
description: created
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: not found
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unprocessable entity
summary: Create a virtual network
tags:
- VLANs
/virtual-networks/{id}:
delete:
description: Deletes a virtual network.
operationId: deleteVirtualNetwork
parameters:
- description: Virtual Network UUID
in: path
name: id
required: true
schema:
format: uuid
type: string
- description: 'Nested attributes to include. Included objects will return their full
attributes. Attribute names can be dotted (up to 3 levels) to included deeply
nested objects.'
explode: false
in: query
name: include
schema:
items:
type: string
type: array
style: form
- description: 'Nested attributes to exclude. Excluded objects will return only the href
attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply
nested objects.'
explode: false
in: query
name: exclude
schema:
items:
type: string
type: array
style: form
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualNetwork'
description: ok
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: not found
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unprocessable entity
summary: Delete a virtual network
tags:
- VLANs
get:
description: Get a virtual network.
operationId: getVirtualNetwork
parameters:
- description: Virtual Network UUID
in: path
name: id
required: true
schema:
format: uuid
type: string
- description: 'Nested attributes to include. Included objects will return their full
attributes. Attribute names can be dotted (up to 3 levels) to included deeply
nested objects.'
explode: false
in: query
name: include
schema:
items:
type: string
type: array
style: form
- description: 'Nested attributes to exclude. Excluded objects will return only the href
attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply
nested objects.'
explode: false
in: query
name: exclude
schema:
items:
type: string
type: array
style: form
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualNetwork'
description: ok
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: not found
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unprocessable entity
summary: Get a virtual network
tags:
- VLANs
components:
schemas:
Href:
example:
href: href
properties:
href:
type: string
required:
- href
type: object
VirtualNetworkList:
example:
virtual_networks:
- vxlan: 4
instances:
- href: href
- href: href
description: description
created_at: 2000-01-23 04:56:07+00:00
assigned_to_virtual_circuit: true
tags:
- tags
- tags
metal_gateways:
- gateway_address: 10.1.2.1/27
updated_at: 2000-01-23 04:56:07+00:00
vlan: 1001
created_at: 2000-01-23 04:56:07+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: null
- gateway_address: 10.1.2.1/27
updated_at: 2000-01-23 04:56:07+00:00
vlan: 1001
created_at: 2000-01-23 04:56:07+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: null
metro_code: metro_code
metro:
href: href
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
facility:
href: href
assigned_to:
href: href
- vxlan: 4
instances:
- href: href
- href: href
description: description
created_at: 2000-01-23 04:56:07+00:00
assigned_to_virtual_circuit: true
tags:
- tags
- tags
metal_gateways:
- gateway_address: 10.1.2.1/27
updated_at: 2000-01-23 04:56:07+00:00
vlan: 1001
created_at: 2000-01-23 04:56:07+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: null
- gateway_address: 10.1.2.1/27
updated_at: 2000-01-23 04:56:07+00:00
vlan: 1001
created_at: 2000-01-23 04:56:07+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: null
metro_code: metro_code
metro:
href: href
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
facility:
href: href
assigned_to:
href: href
properties:
virtual_networks:
items:
$ref: '#/components/schemas/VirtualNetwork'
type: array
type: object
MetalGateway_state:
description: The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.
enum:
- ready
- active
- deleting
type: string
VirtualNetwork:
example:
vxlan: 4
instances:
- href: href
- href: href
description: description
created_at: 2000-01-23 04:56:07+00:00
assigned_to_virtual_circuit: true
tags:
- tags
- tags
metal_gateways:
- gateway_address: 10.1.2.1/27
updated_at: 2000-01-23 04:56:07+00:00
vlan: 1001
created_at: 2000-01-23 04:56:07+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: null
- gateway_address: 10.1.2.1/27
updated_at: 2000-01-23 04:56:07+00:00
vlan: 1001
created_at: 2000-01-23 04:56:07+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: null
metro_code: metro_code
metro:
href: href
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
facility:
href: href
assigned_to:
href: href
properties:
assigned_to:
$ref: '#/components/schemas/Href'
assigned_to_virtual_circuit:
description: True if the virtual network is attached to a virtual circuit. False if not.
type: boolean
description:
type: string
facility:
$ref: '#/components/schemas/Href'
href:
type: string
created_at:
format: date-time
type: string
id:
format: uuid
type: string
instances:
description: A list of instances with ports currently associated to this Virtual Network.
items:
$ref: '#/components/schemas/Href'
type: array
metal_gateways:
description: A list of metal gateways currently associated to this Virtual Network.
items:
$ref: '#/components/schemas/MetalGatewayLite'
type: array
metro:
$ref: '#/components/schemas/Href'
metro_code:
description: The Metro code of the metro in which this Virtual Network is defined.
type: string
vxlan:
type: integer
tags:
items:
type: string
type: array
type: object
Error:
description: Error responses are included with 4xx and 5xx HTTP responses from the API service. Either "error" or "errors" will be set.
properties:
error:
description: A description of the error that caused the request to fail.
type: string
errors:
description: A list of errors that contributed to the request failing.
items:
description: An error message that contributed to the request failing.
type: string
type: array
type: object
MetalGatewayLite:
example:
gateway_address: 10.1.2.1/27
updated_at: 2000-01-23 04:56:07+00:00
vlan: 1001
created_at: 2000-01-23 04:56:07+00:00
href: href
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
state: null
properties:
created_at:
format: date-time
type: string
gateway_address:
description: The gateway address with subnet CIDR value for this Metal Gateway. For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 would have a gateway address of 10.1.2.1/27.
example: 10.1.2.1/27
type: string
href:
type: string
id:
format: uuid
type: string
state:
$ref: '#/components/schemas/MetalGateway_state'
updated_at:
format: date-time
type: string
vlan:
description: The VLAN id of the Virtual Network record associated to this Metal Gateway.
example: 1001
type: integer
type: object
VirtualNetworkCreateInput:
example:
vxlan: 1099
metro: metro
description: description
facility: facility
tags:
- tags
- tags
properties:
description:
type: string
facility:
deprecated: true
description: The UUID (or facility code) for the Facility in which to create this Virtual network.
type: string
metro:
description: The UUID (or metro code) for the Metro in which to create this Virtual Network.
type: string
vxlan:
description: VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected.
example: 1099
type: integer
tags:
items:
type: string
type: array
type: object
securitySchemes:
x_auth_token:
description: 'HTTP header containing the User or Project API key that will be used to authenticate the request.
'
in: header
name: X-Auth-Token
type: apiKey
x-displayName: X-Auth-Token
x-tagGroups:
- name: Accounts and Organization
tags:
- Authentication
- Emails
- Invitations
- Memberships
- Organizations
- OTPs
- PasswordResetTokens
- PaymentMethods
- Projects
- SSHKeys
- SupportRequest
- TransferRequests
- TwoFactorAuth
- Users
- UserVerificationTokens
- name: Services and Billing
tags:
- Events
- Facilities
- Incidents
- Invoices
- Licenses
- Metros
- Plans
- Usages
- name: Servers
tags:
- Devices
- Batches
- Capacity
- HardwareReservations
- OperatingSystems
- Ports
- SelfServiceReservations
- SpotMarket
- Userdata
- Volumes
- name: Networking
tags:
- BGP
- Interconnections
- IPAddresses
- MetalGateways
- VLANs
- VRFs