task_wait
Code
- BIGIP.task_wait(obj: RESTObject, interval: int = 10) None
Continually queries the status of the task until it finishes.
Sends an HTTP GET request to the iControl REST API.
- Parameters:
obj – Object that represents the task.
interval – The interval the queries will be made.
- 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)
device.task_wait(task)
Explanation
After the task has started, we can wait for its completion with the task_wait method.