Skip to content

Latest commit

 

History

History
585 lines (406 loc) · 19.2 KB

BGPApi.md

File metadata and controls

585 lines (406 loc) · 19.2 KB

equinix_metal.BGPApi

All URIs are relative to https://api.equinix.com/metal/v1

Method HTTP request Description
delete_bgp_session DELETE /bgp/sessions/{id} Delete the BGP session
find_bgp_config_by_project GET /projects/{id}/bgp-config Retrieve a bgp config
find_bgp_session_by_id GET /bgp/sessions/{id} Retrieve a BGP session
find_global_bgp_ranges GET /projects/{id}/global-bgp-ranges Retrieve all global bgp ranges
find_project_bgp_sessions GET /projects/{id}/bgp/sessions Retrieve all BGP sessions for project
request_bgp_config POST /projects/{id}/bgp-configs Requesting bgp config
update_bgp_session PUT /bgp/sessions/{id} Update the BGP session

delete_bgp_session

delete_bgp_session(id)

Delete the BGP session

Deletes the BGP session.

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.BGPApi(api_client)
    id = 'id_example' # str | BGP session UUID

    try:
        # Delete the BGP session
        api_instance.delete_bgp_session(id)
    except Exception as e:
        print("Exception when calling BGPApi->delete_bgp_session: %s\n" % e)

Parameters

Name Type Description Notes
id str BGP session UUID

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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

find_bgp_config_by_project

BgpConfig find_bgp_config_by_project(id, include=include)

Retrieve a bgp config

Returns a bgp config

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.bgp_config import BgpConfig
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.BGPApi(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)

    try:
        # Retrieve a bgp config
        api_response = api_instance.find_bgp_config_by_project(id, include=include)
        print("The response of BGPApi->find_bgp_config_by_project:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BGPApi->find_bgp_config_by_project: %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]

Return type

BgpConfig

Authorization

x_auth_token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ok When BGP configuration is not enabled empty structure is returned. When BGP configuration is disabled after being enabled BGP configuration data is returned with status disabled. -
401 unauthorized -
403 forbidden -
404 not found The project was not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

find_bgp_session_by_id

BgpSession find_bgp_session_by_id(id, include=include)

Retrieve a BGP session

Returns a BGP session

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.bgp_session import BgpSession
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.BGPApi(api_client)
    id = 'id_example' # str | BGP session 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)

    try:
        # Retrieve a BGP session
        api_response = api_instance.find_bgp_session_by_id(id, include=include)
        print("The response of BGPApi->find_bgp_session_by_id:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BGPApi->find_bgp_session_by_id: %s\n" % e)

Parameters

Name Type Description Notes
id str BGP session 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]

Return type

BgpSession

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]

find_global_bgp_ranges

GlobalBgpRangeList find_global_bgp_ranges(id)

Retrieve all global bgp ranges

Returns all global bgp ranges for a project

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.global_bgp_range_list import GlobalBgpRangeList
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.BGPApi(api_client)
    id = 'id_example' # str | Project UUID

    try:
        # Retrieve all global bgp ranges
        api_response = api_instance.find_global_bgp_ranges(id)
        print("The response of BGPApi->find_global_bgp_ranges:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BGPApi->find_global_bgp_ranges: %s\n" % e)

Parameters

Name Type Description Notes
id str Project UUID

Return type

GlobalBgpRangeList

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]

find_project_bgp_sessions

BgpSessionList find_project_bgp_sessions(id)

Retrieve all BGP sessions for project

Provides a listing of available BGP sessions for the project.

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.bgp_session_list import BgpSessionList
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.BGPApi(api_client)
    id = 'id_example' # str | Project UUID

    try:
        # Retrieve all BGP sessions for project
        api_response = api_instance.find_project_bgp_sessions(id)
        print("The response of BGPApi->find_project_bgp_sessions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BGPApi->find_project_bgp_sessions: %s\n" % e)

Parameters

Name Type Description Notes
id str Project UUID

Return type

BgpSessionList

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 -
404 not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

request_bgp_config

request_bgp_config(id, bgp_config_request_input, include=include)

Requesting bgp config

Requests to enable bgp configuration for a project.

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.bgp_config_request_input import BgpConfigRequestInput
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.BGPApi(api_client)
    id = 'id_example' # str | Project UUID
    bgp_config_request_input = equinix_metal.BgpConfigRequestInput() # BgpConfigRequestInput | BGP config Request 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)

    try:
        # Requesting bgp config
        api_instance.request_bgp_config(id, bgp_config_request_input, include=include)
    except Exception as e:
        print("Exception when calling BGPApi->request_bgp_config: %s\n" % e)

Parameters

Name Type Description Notes
id str Project UUID
bgp_config_request_input BgpConfigRequestInput BGP config Request 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]

Return type

void (empty response body)

Authorization

x_auth_token

HTTP request headers

  • Content-Type: application/json
  • 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]

update_bgp_session

update_bgp_session(id, body)

Update the BGP session

Updates the BGP session by either enabling or disabling the default route functionality.

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.BGPApi(api_client)
    id = 'id_example' # str | BGP session UUID
    body = True # bool | Default route

    try:
        # Update the BGP session
        api_instance.update_bgp_session(id, body)
    except Exception as e:
        print("Exception when calling BGPApi->update_bgp_session: %s\n" % e)

Parameters

Name Type Description Notes
id str BGP session UUID
body bool Default route

Return type

void (empty response body)

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 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]