Skip to content

Data stream

Specific implementation of the StreamPipes API's data stream endpoints.

DataStreamEndpoint(parent_client)

Bases: APIEndpoint

Implementation of the DataStream endpoint.

Consequently, it allows querying metadata about available data streams (see all() method). The metadata is returned as an instance of DataStreams.

Examples:

from streampipes.client import StreamPipesClient
from streampipes.client.config import StreamPipesClientConfig
from streampipes.client.credential_provider import StreamPipesApiKeyCredentials

client_config = StreamPipesClientConfig(
    credential_provider=StreamPipesApiKeyCredentials(username="test-user", api_key="api-key"),
    host_address="localhost",
    port=8082,
    https_disabled=True
)
client = StreamPipesClient.create(client_config=client_config)

# let's get all existing data streams in StreamPipes
data_streams = client.dataStreamApi.all()
len(data_streams)
2

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

Last update: December 7, 2024