Skip to content

Latest commit

 

History

History
247 lines (183 loc) · 10.3 KB

FacilitiesApi.md

File metadata and controls

247 lines (183 loc) · 10.3 KB

metal.FacilitiesApi

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

Method HTTP request Description
find_facilities GET /facilities Retrieve all facilities
find_facilities_by_organization GET /organizations/{id}/facilities Retrieve all facilities visible by the organization
find_facilities_by_project GET /projects/{id}/facilities Retrieve all facilities visible by the project

find_facilities

FacilityList find_facilities(include=include, exclude=exclude)

Retrieve all facilities

Provides a listing of available datacenters where you can provision Packet devices.

Example

  • Api Key Authentication (x_auth_token):
from __future__ import print_function
import time
import metal
from 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 = 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'] = 'YOUR_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 metal.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metal.FacilitiesApi(api_client)
    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 = ["address"] # 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) (default to ["address"])

    try:
        # Retrieve all facilities
        api_response = api_instance.find_facilities(include=include, exclude=exclude)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling FacilitiesApi->find_facilities: %s\n" % e)

Parameters

Name Type Description Notes
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] [default to ["address"]]

Return type

FacilityList

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 -

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

find_facilities_by_organization

FacilityList find_facilities_by_organization(id, include=include, exclude=exclude)

Retrieve all facilities visible by the organization

Returns a listing of available datacenters for the given organization

Example

  • Api Key Authentication (x_auth_token):
from __future__ import print_function
import time
import metal
from 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 = 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'] = 'YOUR_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 metal.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metal.FacilitiesApi(api_client)
    id = 'id_example' # str | Organization 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:
        # Retrieve all facilities visible by the organization
        api_response = api_instance.find_facilities_by_organization(id, include=include, exclude=exclude)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling FacilitiesApi->find_facilities_by_organization: %s\n" % e)

Parameters

Name Type Description Notes
id str Organization 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

FacilityList

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_facilities_by_project

FacilityList find_facilities_by_project(id, include=include, exclude=exclude)

Retrieve all facilities visible by the project

Returns a listing of available datacenters for the given project

Example

  • Api Key Authentication (x_auth_token):
from __future__ import print_function
import time
import metal
from 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 = 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'] = 'YOUR_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 metal.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metal.FacilitiesApi(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)

    try:
        # Retrieve all facilities visible by the project
        api_response = api_instance.find_facilities_by_project(id, include=include, exclude=exclude)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling FacilitiesApi->find_facilities_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]
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

FacilityList

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]