task_completed

Code

BIGIP.task_completed(obj: RESTObject) bool

Verifies if the task is completed.

Sends an HTTP GET request to the iControl REST API.

Parameters:

obj – Object that represents the task.

Exceptions:

RESTAPIError: Raised when iControl REST API returns an error.

Example

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

 <more Python code here>

if device.task_completed(task):
    print("Task test completed.")

Explanation

Indicates if the task has finished, returning true or false.
If you don’t wait for the task to complete, you can run more Python code, and check the task later.