Beispiel #1
0
def test_polling_with_path_format_arguments():
    method = AsyncARMPolling(
        timeout=0,
        path_format_arguments={"host": "host:3000", "accountName": "local"}
    )
    client = AsyncPipelineClient(base_url="http://{accountName}{host}")

    method._operation = LocationPolling()
    method._operation._location_url = "/results/1"
    method._client = client
    assert "http://localhost:3000/results/1" == method._client.format_url(method._operation.get_polling_url(), **method._path_format_arguments)
 def __init__(self,
              timeout=30,
              lro_algorithms=None,
              lro_options=None,
              **operation_config):
     lro_algorithms = lro_algorithms or [
         AzureAsyncOperationPolling(lro_options=lro_options),
         LocationPolling(),
         BodyContentPolling(),
         StatusCheckPolling(),
     ]
     super(ARMPolling, self).__init__(timeout=timeout,
                                      lro_algorithms=lro_algorithms,
                                      lro_options=lro_options,
                                      **operation_config)
Beispiel #3
0
    def build_lro_polling(self, no_wait, initial_session, deserialization_callback, error_callback,
                          lro_options=None, path_format_arguments=None):
        from azure.mgmt.core.polling.arm_polling import AzureAsyncOperationPolling, BodyContentPolling
        if no_wait == True:  # noqa: E712, pylint: disable=singleton-comparison
            polling = AAZNoPolling()
        else:
            polling = AAZBasePolling(
                lro_options=lro_options,
                lro_algorithms=[
                    AzureAsyncOperationPolling(lro_options=lro_options),
                    LocationPolling(),
                    BodyContentPolling(),
                    StatusCheckPolling(),
                ],
                path_format_arguments=path_format_arguments,
                http_response_error_callback=error_callback,
            )

        polling.initialize(
            self,
            initial_response=initial_session,
            deserialization_callback=deserialization_callback
        )
        return polling