Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Latest commit

 

History

History
450 lines (321 loc) · 18.6 KB

VLANsApi.md

File metadata and controls

450 lines (321 loc) · 18.6 KB

equinix_metal.VLANsApi

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

create_virtual_network

VirtualNetwork create_virtual_network(id, virtual_network_create_input, include=include, exclude=exclude)

Create a virtual network

Creates an virtual network.

Example

  • 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)

Parameters

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]

Return type

VirtualNetwork

Authorization

x_auth_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

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

delete_virtual_network(id, include=include, exclude=exclude)

Delete a virtual network

Deletes a virtual network.

Example

  • 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)

Parameters

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]

Return type

void (empty response body)

Authorization

x_auth_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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]

find_virtual_networks

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.

Example

  • 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)

Parameters

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]

Return type

VirtualNetworkList

Authorization

x_auth_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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]

get_virtual_network

VirtualNetwork get_virtual_network(id, include=include, exclude=exclude)

Get a virtual network

Get a virtual network.

Example

  • 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)

Parameters

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]

Return type

VirtualNetwork

Authorization

x_auth_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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]

update_virtual_network

VirtualNetwork update_virtual_network(id, virtual_network_update_input, include=include, exclude=exclude)

Updates the virtual network

Updates the virtual network.

Example

  • 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)

Parameters

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]

Return type

VirtualNetwork

Authorization

x_auth_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

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]