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.

AsyncCogniteClient.data_modeling.streams.templates.list()

List stream templates.

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.StreamTemplateInfo(
name: str,
type: Literal['Immutable', 'Mutable'],
max_streams: int,
settings: StreamTemplateSettings,
)

Bases: CogniteResource

A stream template available in the project, as returned by the list templates endpoint.

Only templates the project may create streams from (at least one provisioned) are returned.

Parameters:
  • name (str) – Name of the template, used when creating a stream (see StreamTemplate).

  • type (Literal['Immutable', 'Mutable']) – The type of streams created from the template.

  • max_streams (int) – Number of streams that can be provisioned from this template.

  • settings (StreamTemplateSettings) – Limits and lifecycle settings of streams created from the template.

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.StreamTemplateInfoList(
resources: Sequence[T_CogniteResource],
)

Bases: CogniteResourceList[StreamTemplateInfo]

class cognite.client.data_classes.data_modeling.streams.StreamTemplateLimit(type: str, name: str, value: int | float | str)

Bases: CogniteResource

A single limit or lifecycle setting of a stream template.

Parameters:
  • type (str) – The kind of setting, e.g. "fixed".

  • name (str) – Human readable description of the setting.

  • value (int | float | str) – Integer or float for numeric limits, an ISO-8601 duration string (e.g. "PT168H") for durations, or "infinity".

class cognite.client.data_classes.data_modeling.streams.StreamTemplateSettings(
limits: dict[str, StreamTemplateLimit],
lifecycle: dict[str, StreamTemplateLimit],
)

Bases: CogniteResource

Limits and lifecycle settings of a stream template.

Parameters:
  • limits (dict[str, StreamTemplateLimit]) – Limits keyed by identifier, e.g. "maxRecordsTotal".

  • lifecycle (dict[str, StreamTemplateLimit]) – Lifecycle settings keyed by identifier, e.g. "retainedAfterSoftDelete".

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: StreamWriteSettings,
)

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 (StreamWriteSettings) – 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]

class cognite.client.data_classes.data_modeling.streams.StreamWriteSettings(
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]