azure.mgmt.core.polling package

Submodules

azure.mgmt.core.polling.arm_polling module

class azure.mgmt.core.polling.arm_polling.ARMPolling(timeout: float = 30, lro_algorithms: Sequence[LongRunningOperation[HttpRequestTypeVar, AllHttpResponseTypeVar]] | None = None, lro_options: Dict[str, Any] | None = None, path_format_arguments: Dict[str, str] | None = None, **operation_config: Any)[source]
finished() bool

Is this polling finished?

Return type:

bool

Returns:

True if finished, False otherwise.

classmethod from_continuation_token(continuation_token: str, **kwargs: Any) Tuple[Any, Any, Callable[[Any], PollingReturnType_co]]
get_continuation_token() str
initialize(client: PipelineClientType, initial_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar], deserialization_callback: Callable[[PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]], PollingReturnType_co]) None

Set the initial status of this LRO.

Parameters:
  • client (PipelineClient) – The Azure Core Pipeline client used to make request.

  • initial_response (PipelineResponse) – The initial response for the call.

  • deserialization_callback (callable) – A callback function to deserialize the final response.

Raises:

HttpResponseError if initial status is incorrect LRO state

request_status(status_link: str) PipelineResponse[HttpRequestTypeVar, HttpResponseTypeVar]

Do a simple GET to this status link.

This method re-inject ‘x-ms-client-request-id’.

Parameters:

status_link (str) – The URL to poll.

Return type:

azure.core.pipeline.PipelineResponse

Returns:

The response of the status request.

resource() PollingReturnType_co

Return the built resource.

Return type:

any

Returns:

The built resource.

run() None
status() str

Return the current status as a string.

Return type:

str

Returns:

The current status.

update_status() None

Update the current status of the LRO.

class azure.mgmt.core.polling.arm_polling.AzureAsyncOperationPolling(lro_options: Dict[str, Any] | None = None)[source]

Implements a operation resource polling, typically from Azure-AsyncOperation.

can_poll(pipeline_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]) bool

Check if status monitor header (e.g. Operation-Location) is present.

Parameters:

pipeline_response (PipelineResponse) – Initial REST call response.

Returns:

True if this polling method could be used, False otherwise.

Return type:

bool

get_final_get_url(pipeline_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]) str | None[source]

If a final GET is needed, returns the URL.

Parameters:

pipeline_response (PipelineResponse) – The pipeline response object.

Returns:

The URL to poll for the final GET.

Return type:

str

get_polling_url() str

Return the polling URL.

Will extract it from the defined header to read (e.g. Operation-Location)

Returns:

The polling URL.

Return type:

str

get_status(pipeline_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]) str

Process the latest status update retrieved from an “Operation-Location” header.

Parameters:

pipeline_response (PipelineResponse) – Initial REST call response.

Returns:

The status string.

Return type:

str

Raises:

BadResponse if response has no body, or body does not contain status.

set_initial_status(pipeline_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]) str

Process first response after initiating long running operation.

Parameters:

pipeline_response (PipelineResponse) – Initial REST call response.

Returns:

The initial status.

Return type:

str

class azure.mgmt.core.polling.arm_polling.BodyContentPolling[source]

Poll based on the body content.

Implement a ARM resource poller (using provisioning state).

can_poll(pipeline_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]) bool[source]

Answer if this polling method could be used.

Parameters:

pipeline_response (PipelineResponse) – The pipeline response object.

Returns:

True if this polling method could be used.

Return type:

bool

get_final_get_url(pipeline_response: Any) None[source]

If a final GET is needed, returns the URL.

Parameters:

pipeline_response (PipelineResponse) – The pipeline response object.

Returns:

The URL to poll for the final GET.

Return type:

str

get_polling_url() str[source]

Return the polling URL. :return: The polling URL. :rtype: str

get_status(pipeline_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]) str[source]

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

Parameters:

pipeline_response (PipelineResponse) – latest REST call response.

Returns:

Status string.

Return type:

str

Raises:

BadResponse if status not 200 or 204.

set_initial_status(pipeline_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]) str[source]

Process first response after initiating long running operation.

Parameters:

pipeline_response (PipelineResponse) – initial REST call response.

Returns:

Status string.

Return type:

str

azure.mgmt.core.polling.async_arm_polling module

class azure.mgmt.core.polling.async_arm_polling.AsyncARMPolling(timeout: float = 30, lro_algorithms: Sequence[LongRunningOperation[HttpRequestTypeVar, AllHttpResponseTypeVar]] | None = None, lro_options: Dict[str, Any] | None = None, path_format_arguments: Dict[str, str] | None = None, **operation_config: Any)[source]
finished() bool

Is this polling finished?

Return type:

bool

Returns:

True if finished, False otherwise.

classmethod from_continuation_token(continuation_token: str, **kwargs: Any) Tuple[Any, Any, Callable[[Any], PollingReturnType_co]]
get_continuation_token() str
initialize(client: PipelineClientType, initial_response: PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar], deserialization_callback: Callable[[PipelineResponse[HttpRequestTypeVar, AllHttpResponseTypeVar]], PollingReturnType_co]) None

Set the initial status of this LRO.

Parameters:
  • client (PipelineClient) – The Azure Core Pipeline client used to make request.

  • initial_response (PipelineResponse) – The initial response for the call.

  • deserialization_callback (callable) – A callback function to deserialize the final response.

Raises:

HttpResponseError if initial status is incorrect LRO state

async request_status(status_link: str) PipelineResponse[HttpRequestTypeVar, AsyncHttpResponseTypeVar]

Do a simple GET to this status link.

This method re-inject ‘x-ms-client-request-id’.

Parameters:

status_link (str) – URL to poll.

Return type:

azure.core.pipeline.PipelineResponse

Returns:

The response of the status request.

resource() PollingReturnType_co

Return the built resource.

Return type:

any

Returns:

The built resource.

async run() None
status() str

Return the current status as a string.

Return type:

str

Returns:

The current status.

async update_status() None

Update the current status of the LRO.