Endpoint
General implementation for an endpoint. Provided classes and assets are aimed to be used for developing endpoints. An endpoint provides all options to communicate with a dedicated part of StreamPipes in a handy way.
APIEndpoint(parent_client)
¶
Bases: Endpoint
Abstract implementation of an API endpoint.
Serves as template for all endpoints of the StreamPipes API.
By design, endpoints are only instantiated within the __init__
method of the StreamPipesClient.
all()
¶
Get all resources of this endpoint provided by the StreamPipes API.
Results are provided as an instance of a ResourceContainer
that
allows to handle the returned resources in a comfortable and pythonic way.
RETURNS | DESCRIPTION |
---|---|
container
|
Container element that bundles the returned resources
TYPE:
|
build_url()
¶
Builds the endpoint's URL of the API path.
RETURNS | DESCRIPTION |
---|---|
url
|
The URL of the endpoint
TYPE:
|
Endpoint(parent_client)
¶
Bases: ABC
Abstract implementation of a StreamPipes endpoint.
Serves as template for all endpoints used for interaction with a StreamPipes instance.
By design, endpoints are only instantiated within the __init__
method of the StreamPipesClient.
PARAMETER | DESCRIPTION |
---|---|
parent_client |
This parameter expects the instance of
TYPE:
|
MessagingEndpoint(parent_client)
¶
Bases: Endpoint
Abstract implementation of a StreamPipes messaging endpoint.
Serves as template for all endpoints used for interacting with the StreamPipes messaging layer directly.
Therefore, they need to provide the functionality to talk with the broker system running in StreamPipes.
By design, endpoints are only instantiated within the __init__
method of the StreamPipesClient.
broker: Broker
property
writable
¶
Defines the broker instance that is used to connect to StreamPipes' messaging layer.
This instance enables the client to authenticate to the broker used in the target StreamPipes instance, to consume messages from and to write messages to the broker.
RAISES | DESCRIPTION |
---|---|
MessagingEndpointNotConfiguredError
|
If the endpoint is used before the broker instance is set via |
RETURNS | DESCRIPTION |
---|---|
broker
|
The broker instance to be used to communicate with StreamPipes' messaging layer.
TYPE:
|
configure(broker)
¶
Configures the message endpoint by setting the broker instance to be used.
This configuration step is required before the endpoint can be actually used.
The based broker
instance is passed to an internal property.
PARAMETER | DESCRIPTION |
---|---|
broker |
Broker instance that should be used for this endpoint
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
None
|
|