Retrieve

async AsyncCogniteClient.data_modeling.streams.retrieve(
external_id: str,
include_statistics: bool | None = None,
) → Stream | None

Retrieve a stream.

Note

This method sends the alpha cdf-version header so that the alpha field settings.limits.max_unique_properties_with_data is returned, see StreamLimitSettings.

Parameters:
  • external_id (str) – External ID of the stream to retrieve.

  • include_statistics (bool | None) – When True, usage statistics will be returned together with stream settings, i.e. the consumed values of the stream limits, including the number of unique properties with data. Computing statistics can be expensive.

Returns:

The stream metadata (and optionally statistics), or None if not found.

Return type:

Stream | None

Examples

Retrieve a stream by external ID:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.data_modeling.streams.retrieve("my-stream")

Retrieve a stream with usage statistics:

>>> res = client.data_modeling.streams.retrieve(
...     "my-stream",
...     include_statistics=True,
... )