azure.core.pipeline package¶
Subpackages¶
Module contents¶
-
class
azure.core.pipeline.
AsyncPipeline
(*args, **kwds)[source]¶ Bases:
contextlib.AbstractAsyncContextManager
,typing.Generic
Async pipeline implementation.
This is implemented as a context manager, that will activate the context of the HTTP sender.
- Parameters
transport – The async Http Transport instance.
policies (list) – List of configured policies.
Example:
-
async
run
(request: HTTPRequestType, **kwargs: Any)[source]¶ Runs the HTTP Request through the chained policies.
- Parameters
request (HttpRequest) – The HTTP request object.
- Returns
The PipelineResponse object.
- Return type
-
class
azure.core.pipeline.
Pipeline
(*args, **kwds)[source]¶ Bases:
contextlib.AbstractContextManager
,typing.Generic
A pipeline implementation.
This is implemented as a context manager, that will activate the context of the HTTP sender. The transport is the last node in the pipeline.
- Parameters
transport – The Http Transport instance
policies (list) – List of configured policies.
Example:
-
run
(request: HTTPRequestType, **kwargs: Any) → azure.core.pipeline.PipelineResponse[source]¶ Runs the HTTP Request through the chained policies.
- Parameters
request (HttpRequest) – The HTTP request object.
- Returns
The PipelineResponse object
- Return type
-
class
azure.core.pipeline.
PipelineContext
(transport, **kwargs)[source]¶ Bases:
dict
A context object carried by the pipeline request and response containers.
This is transport specific and can contain data persisted between pipeline requests (for example reusing an open connection pool or “session”), as well as used by the SDK developer to carry arbitrary data through the pipeline.
- Parameters
transport – The HTTP transport type.
kwargs – Developer-defined keyword arguments.
-
class
azure.core.pipeline.
PipelineRequest
(*args, **kwds)[source]¶ Bases:
typing.Generic
A pipeline request object.
Container for moving the HttpRequest through the pipeline. Universal for all transports, both synchronous and asynchronous.
- Parameters
http_request (HttpRequest) – The request object.
context (PipelineContext) – Contains the context - data persisted between pipeline requests.
-
class
azure.core.pipeline.
PipelineResponse
(*args, **kwds)[source]¶ Bases:
typing.Generic
A pipeline response object.
The PipelineResponse interface exposes an HTTP response object as it returns through the pipeline of Policy objects. This ensures that Policy objects have access to the HTTP response.
This also has a “context” object where policy can put additional fields. Policy SHOULD update the “context” with additional post-processed field if they create them. However, nothing prevents a policy to actually sub-class this class a return it instead of the initial instance.
- Parameters
http_request (HttpRequest) – The request object.
http_response (HttpResponse) – The response object.
context (PipelineContext) – Contains the context - data persisted between pipeline requests.