BIGIP

Code

class bigrest.bigip.BIGIP(device: str, username: str = None, password: str = None, login_provider: str = 'tmos', request_token: bool = False, token: str = None, debug: str = None, session_verify: bool = True, timeout: int = 10)

Defines methods to call the iControl REST API that can be used by BIG-IP.

Parameters:
  • device – Name or IP of the device to send the HTTP requests.

  • username – Username used to login to the device.

  • password – Password used to login to the device.

  • login_provider – Login provider used to authenticate the user.

  • request_token – Indicates if token a should be requested from the device and used for HTTP requests.

  • token – Token to be used to send HTTP requests to the device.

  • debug – Debug file name to be used to output the debug information.

  • session_verify – Disables SSL certificate validation if set to False

  • timeout – Specifies the number of seconds to wait for a response from the device.

Exceptions:

InvalidOptionError: Raised when invalid options are used as arguments.

Example

device = BIGIP("192.168.255.1", "admin", "password")

Explanation

Use this class to create an object that represents a BIG-IP device.
When the object is created, BIGREST will try to connect to the device and report an error if it can’t.
If you pass the debug keyword with filename, when iControl REST API returns an error, BIGREST will create the file with debug information.
The information will include the full HTTP request sent to the device, and the full HTTP response received from the device.
It will also include a curl command you can use to test the request.
For HTTP request with a binary body, curl command will end with “–data-binary @filename”, replace filename with the file you were uploading.
Take into account there is a limit of 1MB per HTTP request in the REST API, for large files you need to send the file in chunks.
BIGREST does that automatically, but you need to do manually when using curl.
By default the BIGREST will validate the SSL certificate, you can set session_verify=False to disable that.
Timeout parameter defaults to 5 seconds, so it will wait up to 10 seconds for the device to response.