LongRunningOperation Class

Provides default logic for interpreting operation responses and status updates.

Inheritance
builtins.object
LongRunningOperation

Constructor

LongRunningOperation(response, outputs)

Parameters

response
outputs

Methods

get_status_from_async

Process the latest status update retrieved from a 'azure-asyncoperation' header.

get_status_from_location

Process the latest status update retrieved from a 'location' header.

get_status_from_resource

Process the latest status update retrieved from the same URL as the previous request.

set_async_url_if_present
set_initial_status

Process first response after initiating long running operation and set self.status attribute.

should_do_final_get

Check whether the polling should end doing a final GET.

get_status_from_async

Process the latest status update retrieved from a 'azure-asyncoperation' header.

get_status_from_async(response)

Parameters

response
<xref:requests.Response>
Required

latest REST call response.

Exceptions

<xref:BadResponse if response has no body>, <xref:or body does notcontain status.>

get_status_from_location

Process the latest status update retrieved from a 'location' header.

get_status_from_location(response)

Parameters

response
<xref:requests.Response>
Required

latest REST call response.

Exceptions

BadResponse if response has no body and not status 202.

get_status_from_resource

Process the latest status update retrieved from the same URL as the previous request.

get_status_from_resource(response)

Parameters

response
<xref:requests.Response>
Required

latest REST call response.

Exceptions

BadResponse if status not 200 or 204.

set_async_url_if_present

set_async_url_if_present(response)

Parameters

response
Required

Exceptions

<xref:BadResponse if response has no body>, <xref:or body does notcontain status.>

set_initial_status

Process first response after initiating long running operation and set self.status attribute.

set_initial_status(response)

Parameters

response
<xref:requests.Response>
Required

initial REST call response.

Exceptions

<xref:BadResponse if response has no body>, <xref:or body does notcontain status.>

should_do_final_get

Check whether the polling should end doing a final GET.

should_do_final_get()

Parameters

response
<xref:requests.Response>
Required

latest REST call response.

Return type

Exceptions

<xref:BadResponse if response has no body>, <xref:or body does notcontain status.>