AzureOperationPoller class

Definition

Initiates long running operation and polls status in separate thread.

AzureOperationPoller(send_cmd, output_cmd, update_cmd, timeout=30)
Inheritance
builtins.object
AzureOperationPoller

Parameters

send_cmd
callable

The API request to initiate the operation.

update_cmd
callable

The API reuqest to check the status of the operation.

output_cmd
callable

The function to deserialize the resource of the operation.

timeout
int

Time in seconds to wait between status calls, default is 30.

Methods

add_done_callback(func)

Add callback function to be run once the long running operation has completed - regardless of the status of the operation.

done()

Check status of the long running operation.

remove_done_callback(func)

Remove a callback from the long running operation.

result(timeout=None)

Return the result of the long running operation, or the result available after the specified timeout.

status()

Returns the current status string.

wait(timeout=None)

Wait on the long running operation for a specified length of time.

add_done_callback(func)

Add callback function to be run once the long running operation has completed - regardless of the status of the operation.

add_done_callback(func)

Parameters

func
callable

Callback function that takes at least one argument, a completed LongRunningOperation.

done()

Check status of the long running operation.

done()

Returns

'True' if the process has completed, else 'False'.

remove_done_callback(func)

Remove a callback from the long running operation.

remove_done_callback(func)

Parameters

func
callable

The function to be removed from the callbacks.

result(timeout=None)

Return the result of the long running operation, or the result available after the specified timeout.

result(timeout=None)

Parameters

timeout
default value: None

Returns

The deserialized resource of the long running operation, if one is available.

Exceptions

CloudError

Server problem with the query.

status()

Returns the current status string.

status()

Returns

The current status string

Return type

str

wait(timeout=None)

Wait on the long running operation for a specified length of time.

wait(timeout=None)

Parameters

timeout
int

Perion of time to wait for the long running operation to complete.

default value: None

Exceptions

CloudError

Server problem with the query.