All URIs are relative to https://api.equinix.com/metal/v1
Method | HTTP request | Description |
---|---|---|
create_virtual_network | POST /projects/{id}/virtual-networks | Create a virtual network |
delete_virtual_network | DELETE /virtual-networks/{id} | Delete a virtual network |
find_virtual_networks | GET /projects/{id}/virtual-networks | Retrieve all virtual networks |
get_virtual_network | GET /virtual-networks/{id} | Get a virtual network |
update_virtual_network | PUT /virtual-networks/{id} | Updates the virtual network |
VirtualNetwork create_virtual_network(id, virtual_network_create_input, include=include, exclude=exclude)
Create a virtual network
Creates an virtual network.
- Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.virtual_network import VirtualNetwork
from equinix_metal.models.virtual_network_create_input import VirtualNetworkCreateInput
from equinix_metal.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.equinix.com/metal/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = equinix_metal.Configuration(
host = "https://api.equinix.com/metal/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: x_auth_token
configuration.api_key['x_auth_token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x_auth_token'] = 'Bearer'
# Enter a context with an instance of the API client
with equinix_metal.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = equinix_metal.VLANsApi(api_client)
id = 'id_example' # str | Project UUID
virtual_network_create_input = equinix_metal.VirtualNetworkCreateInput() # VirtualNetworkCreateInput | Virtual Network to create
include = ['include_example'] # List[str] | 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. (optional)
exclude = ['exclude_example'] # List[str] | 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. (optional)
try:
# Create a virtual network
api_response = api_instance.create_virtual_network(id, virtual_network_create_input, include=include, exclude=exclude)
print("The response of VLANsApi->create_virtual_network:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VLANsApi->create_virtual_network: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Project UUID | |
virtual_network_create_input | VirtualNetworkCreateInput | Virtual Network to create | |
include | List[str] | 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. | [optional] |
exclude | List[str] | 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. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | created | - |
401 | unauthorized | - |
403 | forbidden | - |
404 | not found | - |
422 | unprocessable entity | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_virtual_network(id, include=include, exclude=exclude)
Delete a virtual network
Deletes a virtual network.
- Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.equinix.com/metal/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = equinix_metal.Configuration(
host = "https://api.equinix.com/metal/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: x_auth_token
configuration.api_key['x_auth_token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x_auth_token'] = 'Bearer'
# Enter a context with an instance of the API client
with equinix_metal.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = equinix_metal.VLANsApi(api_client)
id = 'id_example' # str | Virtual Network UUID
include = ['include_example'] # List[str] | 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. (optional)
exclude = ['exclude_example'] # List[str] | 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. (optional)
try:
# Delete a virtual network
api_instance.delete_virtual_network(id, include=include, exclude=exclude)
except Exception as e:
print("Exception when calling VLANsApi->delete_virtual_network: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Virtual Network UUID | |
include | List[str] | 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. | [optional] |
exclude | List[str] | 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. | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no content | - |
401 | unauthorized | - |
403 | forbidden | - |
404 | not found | - |
422 | unprocessable entity | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
VirtualNetworkList find_virtual_networks(id, include=include, exclude=exclude, facility=facility, metro=metro)
Retrieve all virtual networks
Provides a list of virtual networks for a single project.
- Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.virtual_network_list import VirtualNetworkList
from equinix_metal.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.equinix.com/metal/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = equinix_metal.Configuration(
host = "https://api.equinix.com/metal/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: x_auth_token
configuration.api_key['x_auth_token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x_auth_token'] = 'Bearer'
# Enter a context with an instance of the API client
with equinix_metal.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = equinix_metal.VLANsApi(api_client)
id = 'id_example' # str | Project UUID
include = ['include_example'] # List[str] | 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. (optional)
exclude = ['exclude_example'] # List[str] | 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. (optional)
facility = 'facility_example' # str | Filter by Facility ID (uuid) or Facility Code (optional)
metro = 'metro_example' # str | Filter by Metro ID (uuid) or Metro Code (optional)
try:
# Retrieve all virtual networks
api_response = api_instance.find_virtual_networks(id, include=include, exclude=exclude, facility=facility, metro=metro)
print("The response of VLANsApi->find_virtual_networks:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VLANsApi->find_virtual_networks: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Project UUID | |
include | List[str] | 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. | [optional] |
exclude | List[str] | 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. | [optional] |
facility | str | Filter by Facility ID (uuid) or Facility Code | [optional] |
metro | str | Filter by Metro ID (uuid) or Metro Code | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | ok | - |
401 | unauthorized | - |
403 | forbidden | - |
404 | not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
VirtualNetwork get_virtual_network(id, include=include, exclude=exclude)
Get a virtual network
Get a virtual network.
- Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.virtual_network import VirtualNetwork
from equinix_metal.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.equinix.com/metal/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = equinix_metal.Configuration(
host = "https://api.equinix.com/metal/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: x_auth_token
configuration.api_key['x_auth_token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x_auth_token'] = 'Bearer'
# Enter a context with an instance of the API client
with equinix_metal.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = equinix_metal.VLANsApi(api_client)
id = 'id_example' # str | Virtual Network UUID
include = ['include_example'] # List[str] | 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. (optional)
exclude = ['exclude_example'] # List[str] | 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. (optional)
try:
# Get a virtual network
api_response = api_instance.get_virtual_network(id, include=include, exclude=exclude)
print("The response of VLANsApi->get_virtual_network:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VLANsApi->get_virtual_network: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Virtual Network UUID | |
include | List[str] | 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. | [optional] |
exclude | List[str] | 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. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | ok | - |
401 | unauthorized | - |
403 | forbidden | - |
404 | not found | - |
422 | unprocessable entity | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
VirtualNetwork update_virtual_network(id, virtual_network_update_input, include=include, exclude=exclude)
Updates the virtual network
Updates the virtual network.
- Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.virtual_network import VirtualNetwork
from equinix_metal.models.virtual_network_update_input import VirtualNetworkUpdateInput
from equinix_metal.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.equinix.com/metal/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = equinix_metal.Configuration(
host = "https://api.equinix.com/metal/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: x_auth_token
configuration.api_key['x_auth_token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x_auth_token'] = 'Bearer'
# Enter a context with an instance of the API client
with equinix_metal.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = equinix_metal.VLANsApi(api_client)
id = 'id_example' # str | Virtual Network UUID
virtual_network_update_input = equinix_metal.VirtualNetworkUpdateInput() # VirtualNetworkUpdateInput | Virtual network to update
include = ['include_example'] # List[str] | 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. (optional)
exclude = ['exclude_example'] # List[str] | 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. (optional)
try:
# Updates the virtual network
api_response = api_instance.update_virtual_network(id, virtual_network_update_input, include=include, exclude=exclude)
print("The response of VLANsApi->update_virtual_network:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VLANsApi->update_virtual_network: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Virtual Network UUID | |
virtual_network_update_input | VirtualNetworkUpdateInput | Virtual network to update | |
include | List[str] | 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. | [optional] |
exclude | List[str] | 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. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | ok | - |
401 | unauthorized | - |
403 | forbidden | - |
404 | not found | - |
422 | unprocessable entity | - |
429 | too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]