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:
- Returns:
True if finished, False otherwise.
- classmethod from_continuation_token(continuation_token: str, **kwargs: Any) Tuple[Any, Any, Callable[[Any], PollingReturnType_co]] ¶
- 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:
- Returns:
The response of the status request.
- resource() PollingReturnType_co ¶
Return the built resource.
- Return type:
any
- Returns:
The built resource.
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
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:
- Returns:
True if finished, False otherwise.
- classmethod from_continuation_token(continuation_token: str, **kwargs: Any) Tuple[Any, Any, Callable[[Any], PollingReturnType_co]] ¶
- 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:
- Returns:
The response of the status request.
- resource() PollingReturnType_co ¶
Return the built resource.
- Return type:
any
- Returns:
The built resource.