Skip to content

Latest commit

 

History

History
265 lines (189 loc) · 9.76 KB

DirectorBackendApi.md

File metadata and controls

265 lines (189 loc) · 9.76 KB

fastly.DirectorBackendApi

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
create_director_backend POST /service/{service_id}/version/{version_id}/director/{director_name}/backend/{backend_name} Create a director-backend relationship
delete_director_backend DELETE /service/{service_id}/version/{version_id}/director/{director_name}/backend/{backend_name} Delete a director-backend relationship
get_director_backend GET /service/{service_id}/version/{version_id}/director/{director_name}/backend/{backend_name} Get a director-backend relationship

create_director_backend

DirectorBackend create_director_backend(director_name, service_id, version_id, backend_name)

Create a director-backend relationship

Establishes a relationship between a Backend and a Director. The Backend is then considered a member of the Director and can be used to balance traffic onto.

Example

  • Api Key Authentication (token):
import time
import fastly
from fastly.api import director_backend_api
from fastly.model.director_backend import DirectorBackend
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
    host = "https://api.fastly.com"
)

# 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: token
configuration.api_key['token'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'

# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = director_backend_api.DirectorBackendApi(api_client)
    director_name = "test-director" # str | Name for the Director.
    service_id = "SU1Z0isxPaozGVKXdv0eY" # str | Alphanumeric string identifying the service.
    version_id = 1 # int | Integer identifying a service version.
    backend_name = "test-backend" # str | The name of the backend.

    # example passing only required values which don't have defaults set
    try:
        # Create a director-backend relationship
        api_response = api_instance.create_director_backend(director_name, service_id, version_id, backend_name)
        pprint(api_response)
    except fastly.ApiException as e:
        print("Exception when calling DirectorBackendApi->create_director_backend: %s\n" % e)

Parameters

Name Type Description Notes
director_name str Name for the Director.
service_id str Alphanumeric string identifying the service.
version_id int Integer identifying a service version.
backend_name str The name of the backend.

Return type

DirectorBackend

Authorization

token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -

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

delete_director_backend

InlineResponse200 delete_director_backend(director_name, service_id, version_id, backend_name)

Delete a director-backend relationship

Deletes the relationship between a Backend and a Director. The Backend is no longer considered a member of the Director and thus will not have traffic balanced onto it from this Director.

Example

  • Api Key Authentication (token):
import time
import fastly
from fastly.api import director_backend_api
from fastly.model.inline_response200 import InlineResponse200
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
    host = "https://api.fastly.com"
)

# 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: token
configuration.api_key['token'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'

# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = director_backend_api.DirectorBackendApi(api_client)
    director_name = "test-director" # str | Name for the Director.
    service_id = "SU1Z0isxPaozGVKXdv0eY" # str | Alphanumeric string identifying the service.
    version_id = 1 # int | Integer identifying a service version.
    backend_name = "test-backend" # str | The name of the backend.

    # example passing only required values which don't have defaults set
    try:
        # Delete a director-backend relationship
        api_response = api_instance.delete_director_backend(director_name, service_id, version_id, backend_name)
        pprint(api_response)
    except fastly.ApiException as e:
        print("Exception when calling DirectorBackendApi->delete_director_backend: %s\n" % e)

Parameters

Name Type Description Notes
director_name str Name for the Director.
service_id str Alphanumeric string identifying the service.
version_id int Integer identifying a service version.
backend_name str The name of the backend.

Return type

InlineResponse200

Authorization

token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -

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

get_director_backend

DirectorBackend get_director_backend(director_name, service_id, version_id, backend_name)

Get a director-backend relationship

Returns the relationship between a Backend and a Director. If the Backend has been associated with the Director, it returns a simple record indicating this. Otherwise, returns a 404.

Example

  • Api Key Authentication (token):
import time
import fastly
from fastly.api import director_backend_api
from fastly.model.director_backend import DirectorBackend
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
    host = "https://api.fastly.com"
)

# 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: token
configuration.api_key['token'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'

# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = director_backend_api.DirectorBackendApi(api_client)
    director_name = "test-director" # str | Name for the Director.
    service_id = "SU1Z0isxPaozGVKXdv0eY" # str | Alphanumeric string identifying the service.
    version_id = 1 # int | Integer identifying a service version.
    backend_name = "test-backend" # str | The name of the backend.

    # example passing only required values which don't have defaults set
    try:
        # Get a director-backend relationship
        api_response = api_instance.get_director_backend(director_name, service_id, version_id, backend_name)
        pprint(api_response)
    except fastly.ApiException as e:
        print("Exception when calling DirectorBackendApi->get_director_backend: %s\n" % e)

Parameters

Name Type Description Notes
director_name str Name for the Director.
service_id str Alphanumeric string identifying the service.
version_id int Integer identifying a service version.
backend_name str The name of the backend.

Return type

DirectorBackend

Authorization

token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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