f5sdk.bigip package

Module for BIG-IP

Example - Basic:

from f5sdk.bigip import ManagementClient

device = ManagementClient('192.0.2.10', user='admin', password='admin')
# get BIG-IP info (version, etc.)
device.get_info()

Example - Token Authentication:

device = ManagementClient('192.0.2.10', token='my_token')

Example - Key-Based Authentication:

device = ManagementClient('192.0.2.10',
                        user='admin',
                        private_key_file='~/my_key',
                        set_user_password='admin')
class f5sdk.bigip.ManagementClient(host, **kwargs)

A class used as a management client for BIG-IP

host

the hostname of the device

Type

str

port

the port of the device

Type

str

token

the token of the device

Type

str

token_details

the token details of the device

Type

dict

logger

instantiated logger object

Type

object

get_info()

Refer to method documentation

make_request()

Refer to method documentation

make_ssh_request()

Refer to method documentation

get_info()

Gets device info

Parameters

None

Returns

the device information

{
    'version': 'x.x.x.x'
}

Return type

dict

make_request(uri, **kwargs)

Makes request to device (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

  • advanced_return (bool) – return additional information, like HTTP status code to caller

Returns

a dictionary containing the JSON response

Return type

dict

make_ssh_request(command)

Makes request to device (SSH)

Parameters

command (str) – the command to execute on the device

Returns

the command response

Return type

str