AzureOperationPoller Class

Initiates long running operation and polls status in separate thread.

Inheritance
builtins.object
AzureOperationPoller

Constructor

AzureOperationPoller(send_cmd, output_cmd, update_cmd, timeout=30)

Parameters

send_cmd
callable
Required

The API request to initiate the operation.

update_cmd
callable
Required

The API reuqest to check the status of the operation.

output_cmd
callable
Required

The function to deserialize the resource of the operation.

timeout
int
default value: 30

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

Methods

add_done_callback

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

Remove a callback from the long running operation.

result

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

status

Returns the current status string.

wait

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

add_done_callback

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
Required

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

Exceptions

ValueError if the long running operation has alreadycompleted.

done

Check status of the long running operation.

done()

Returns

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

Exceptions

ValueError if the long running operation has alreadycompleted.

remove_done_callback

Remove a callback from the long running operation.

remove_done_callback(func)

Parameters

func
callable
Required

The function to be removed from the callbacks.

Exceptions

ValueError if the long running operation has alreadycompleted.

result

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

Server problem with the query.

status

Returns the current status string.

status()

Returns

The current status string

Return type

str

Exceptions

ValueError if the long running operation has alreadycompleted.

wait

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

wait(timeout=None)

Parameters

timeout
int
default value: None

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

Exceptions

Server problem with the query.