task_start

Code

BIGIP.task_start(path: str, data: dict) RESTObject

Starts a task on the device.

Sends HTTP POST and PUT requests to the iControl REST API.

Parameters:
  • path – HTTP path used in the HTTP request sent to the device.

  • data – Payload that will be sent to the device.

Exceptions:

RESTAPIError: Raised when iControl REST API returns an error.

Example

data = {}
data["command"] = "save"
device.task_start("/mgmt/tm/task/sys/config", data)

Explanation

Some HTTP requests sent to the iControl REST API will take some time to be completed.
In these cases, they are defined as tasks.
First, we create the properties of the task, and then we start the task.
In this example, we are saving the configuration.