Streams

AsyncCogniteClient.data_modeling.streams.create(items)

Create streams.

AsyncCogniteClient.data_modeling.streams.delete(...)

Delete streams.

AsyncCogniteClient.data_modeling.streams.list()

List streams.

AsyncCogniteClient.data_modeling.streams.retrieve(...)

Retrieve a stream.

Streams data classes

class cognite.client.data_classes.data_modeling.streams.Stream(
external_id: str,
created_time: int,
created_from_template: str,
type: Literal['Immutable', 'Mutable'],
settings: StreamSettings,
)

Bases: WriteableCogniteResource[StreamWrite]

A stream instance returned from the streams API.

This is the read version of StreamWrite.

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns:

A dictionary representation of the instance.

Return type:

dict[str, Any]

class cognite.client.data_classes.data_modeling.streams.StreamLifecycleSettings(
retained_after_soft_delete: str,
data_deleted_after: str | None = None,
)

Bases: CogniteResource

Lifecycle metadata for a stream.

class cognite.client.data_classes.data_modeling.streams.StreamLimit(provisioned: float, consumed: float | None = None)

Bases: CogniteResource

Numeric limit bucket for a stream (provisioned / optionally consumed).

class cognite.client.data_classes.data_modeling.streams.StreamLimitSettings(
max_records_total: StreamLimit,
max_giga_bytes_total: StreamLimit,
max_filtering_interval: str | None = None,
)

Bases: CogniteResource

Provisioned/consumed limits for a stream.

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns:

A dictionary representation of the instance.

Return type:

dict[str, Any]

class cognite.client.data_classes.data_modeling.streams.StreamList(
resources: Sequence[T_CogniteResource],
)

Bases: CogniteResourceList[Stream], ExternalIDTransformerMixin

class cognite.client.data_classes.data_modeling.streams.StreamSettings(
lifecycle: StreamLifecycleSettings,
limits: StreamLimitSettings,
)

Bases: CogniteResource

Read model for stream settings (lifecycle + limits).

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns:

A dictionary representation of the instance.

Return type:

dict[str, Any]

class cognite.client.data_classes.data_modeling.streams.StreamTemplate(name: str)

Bases: CogniteResource

Reference to a stream template by name.

Parameters:

name (str) – Name of the stream template to create the stream from.

class cognite.client.data_classes.data_modeling.streams.StreamTemplateWriteSettings(
template: StreamTemplate,
)

Bases: CogniteResource

Write-side settings that specify which template to create the stream from.

Parameters:

template (StreamTemplate) – The template to create the stream from.

dump(
camel_case: bool = True,
) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns:

A dictionary representation of the instance.

Return type:

dict[str, Any]

class cognite.client.data_classes.data_modeling.streams.StreamWrite(
external_id: str,
settings: StreamTemplateWriteSettings,
)

Bases: WriteableCogniteResource[StreamWrite]

Write representation of a stream, used when creating a new stream.

This is the write version of Stream.

Parameters:
  • external_id (str) – External ID of the stream, must be unique within the project.

  • settings (StreamTemplateWriteSettings) – Settings specifying which template to create the stream from.

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns:

A dictionary representation of the instance.

Return type:

dict[str, Any]