f5sdk.cs package

Python module for F5 Cloud Services

Example - Basic:

from f5sdk.cs import ManagementClient
from f5sdk.cs.accounts import AccountClient
from f5sdk.cs.subscriptions import SubscriptionClient

mgmt_client = ManagementClient(user='admin', password='admin')
account_client = AccountClient(mgmt_client)
subscription_client = SubscriptionClient(mgmt_client)

# discover account/subscription ID
account_id = account_client.show_user()['primary_account_id']
subscription_id = subscription_client.list(
    query_parameters={
        'account_id': account_id
    }
)['subscriptions'][0]['subscription_id']

# configure subscription - GSLB, etc.
subscription_client.update(
    name=subscription_id,
    config_file='./decl.json'
)
class f5sdk.cs.ManagementClient(**kwargs)

A class used as a management client for F5 Cloud Services

access_token

the access token for the service

Type

str

token_details

the token details for the service

Type

dict

logger

instantiated logger object

Type

object

make_request()

Refer to method documentation

make_request(uri, **kwargs)

Makes request to service (HTTP/S)

Parameters
  • uri (str) – the URI where the request should be made

  • **kwargs – optional keyword arguments

Keyword Arguments
  • method (str) – the HTTP method to use

  • headers (str) – the HTTP headers to use

  • body (str) – the HTTP body to use

  • body_content_type (str) – the HTTP body content type to use

  • bool_response (bool) – return boolean based on HTTP success/failure

Returns

a dictionary containing the JSON response

Return type

dict