Skip to content

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 ad dedicated part of StreamPipes in a handy way.

APIEndpoint

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: ResourceContainer

build_url()

Builds the endpoint's URL of the API path.

RETURNS DESCRIPTION
url

The URL of the endpoint

TYPE: str

get(identifier, **kwargs)

Queries the specified resource from the API endpoint.

PARAMETER DESCRIPTION
identifier

The identifier of the resource to be queried.

TYPE: str

RETURNS DESCRIPTION
resource

The specified resource as an instance of the corresponding model class.

TYPE: Resource

post(resource)

Allows to post a resource to the StreamPipes API.

PARAMETER DESCRIPTION
resource

The resource to be posted.

TYPE: Resource

RETURNS DESCRIPTION
None

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 StreamPipesClient the endpoint is attached to.

TYPE: StreamPipesClient

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 writable property

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 configure()

RETURNS DESCRIPTION
broker

The broker instance to be used to communicate with StreamPipes' messaging layer.

TYPE: Broker

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: Broker

RETURNS DESCRIPTION
None