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

Latest commit

 

History

History
443 lines (314 loc) · 16.9 KB

LicensesApi.md

File metadata and controls

443 lines (314 loc) · 16.9 KB

equinix_metal.LicensesApi

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

Method HTTP request Description
create_license POST /projects/{id}/licenses Create a License
delete_license DELETE /licenses/{id} Delete the license
find_license_by_id GET /licenses/{id} Retrieve a license
find_project_licenses GET /projects/{id}/licenses Retrieve all licenses
update_license PUT /licenses/{id} Update the license

create_license

License create_license(id, license_create_input, include=include, exclude=exclude)

Create a License

Creates a new license for the given project

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.license import License
from equinix_metal.models.license_create_input import LicenseCreateInput
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.LicensesApi(api_client)
    id = 'id_example' # str | Project UUID
    license_create_input = equinix_metal.LicenseCreateInput() # LicenseCreateInput | License 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 License
        api_response = api_instance.create_license(id, license_create_input, include=include, exclude=exclude)
        print("The response of LicensesApi->create_license:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LicensesApi->create_license: %s\n" % e)

Parameters

Name Type Description Notes
id str Project UUID
license_create_input LicenseCreateInput License 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

License

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_license

delete_license(id)

Delete the license

Deletes a license.

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.LicensesApi(api_client)
    id = 'id_example' # str | License UUID

    try:
        # Delete the license
        api_instance.delete_license(id)
    except Exception as e:
        print("Exception when calling LicensesApi->delete_license: %s\n" % e)

Parameters

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

License find_license_by_id(id, include=include, exclude=exclude)

Retrieve a license

Returns a license

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.license import License
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.LicensesApi(api_client)
    id = 'id_example' # str | License 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 a license
        api_response = api_instance.find_license_by_id(id, include=include, exclude=exclude)
        print("The response of LicensesApi->find_license_by_id:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LicensesApi->find_license_by_id: %s\n" % e)

Parameters

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

License

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_licenses

LicenseList find_project_licenses(id, include=include, exclude=exclude, page=page, per_page=per_page)

Retrieve all licenses

Provides a collection of licenses for a given project.

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.license_list import LicenseList
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.LicensesApi(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)
    page = 1 # int | Page to return (optional) (default to 1)
    per_page = 10 # int | Items returned per page (optional) (default to 10)

    try:
        # Retrieve all licenses
        api_response = api_instance.find_project_licenses(id, include=include, exclude=exclude, page=page, per_page=per_page)
        print("The response of LicensesApi->find_project_licenses:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LicensesApi->find_project_licenses: %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]
page int Page to return [optional] [default to 1]
per_page int Items returned per page [optional] [default to 10]

Return type

LicenseList

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]

update_license

License update_license(id, license_update_input, include=include, exclude=exclude)

Update the license

Updates the license.

Example

  • Api Key Authentication (x_auth_token):
import equinix_metal
from equinix_metal.models.license import License
from equinix_metal.models.license_update_input import LicenseUpdateInput
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.LicensesApi(api_client)
    id = 'id_example' # str | License UUID
    license_update_input = equinix_metal.LicenseUpdateInput() # LicenseUpdateInput | License 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:
        # Update the license
        api_response = api_instance.update_license(id, license_update_input, include=include, exclude=exclude)
        print("The response of LicensesApi->update_license:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LicensesApi->update_license: %s\n" % e)

Parameters

Name Type Description Notes
id str License UUID
license_update_input LicenseUpdateInput License 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

License

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]