Containers

AsyncCogniteClient.data_modeling.containers.apply(...)

Add or update (upsert) containers.

AsyncCogniteClient.data_modeling.containers.delete(ids)

Delete one or more containers.

AsyncCogniteClient.data_modeling.containers.delete_constraints(ids)

Delete one or more constraints.

AsyncCogniteClient.data_modeling.containers.delete_indexes(ids)

Delete one or more indexes.

AsyncCogniteClient.data_modeling.containers.list([...])

List containers.

AsyncCogniteClient.data_modeling.containers.retrieve(ids)

Retrieve one or more container by id(s).

Containers data classes

class cognite.client.data_classes.data_modeling.containers.BTreeIndex(
state: Literal['current', 'failed', 'pending'],
*,
properties: list[str],
cursorable: bool,
)

Bases: Index

Read version of btree index with state information.

as_apply() BTreeIndexApply

Return the write version of this index.

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.containers.BTreeIndexApply(properties: list[str], cursorable: bool = False)

Bases: IndexApply

Write version of btree index.

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.containers.Constraint(state: Literal['current', 'failed', 'pending'])

Bases: ConstraintCore, ABC

Read version of constraint with state information.

class cognite.client.data_classes.data_modeling.containers.ConstraintApply

Bases: ConstraintCore, ABC

Write version of constraint without state information.

as_apply() ConstraintApply

Return this ConstraintApply instance.

class cognite.client.data_classes.data_modeling.containers.ConstraintCore

Bases: CogniteResource, ABC

Base class for constraints with shared functionality.

abstract as_apply() ConstraintApply

Return the write version of this constraint.

abstract 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.containers.Container(space: str, external_id: str, description: str | None = None, name: str | None = None, *, properties: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.ContainerProperty], constraints: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.Constraint] = <factory>, indexes: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.Index] = <factory>, is_global: bool, last_updated_time: int, created_time: int, used_for: ~typing.Literal['node', 'edge', 'record', 'all'])

Bases: ContainerCore

Represent the physical storage of data. This is the read format of the container

Parameters:
  • space (str) – The workspace for the container, a unique identifier for the space.

  • external_id (str) – Combined with the space is the unique identifier of the container.

  • description (str | None) – Textual description of the container

  • name (str | None) – Human readable name for the container.

  • properties (Mapping[str, ContainerProperty]) – We index the property by a local unique identifier.

  • constraints (Mapping[str, Constraint]) – Set of constraints to apply to the container

  • indexes (Mapping[str, Index]) – Set of indexes to apply to the container.

  • is_global (bool) – Whether this is a global container, i.e., one of the out-of-the-box models.

  • last_updated_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

  • created_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

  • used_for (ContainerUsedFor) – Whether the container is for nodes, edges, records, or both nodes and edges (all).

class cognite.client.data_classes.data_modeling.containers.ContainerApply(space: str, external_id: str, properties: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.ContainerPropertyApply], description: str | None = None, name: str | None = None, constraints: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.ConstraintApply] = <factory>, indexes: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.IndexApply] = <factory>, used_for: ~typing.Literal['node', 'edge', 'record', 'all'] | None = None)

Bases: ContainerCore

Represent the physical storage of data. This is the write format of the container

Parameters:
  • space (str) – The workspace for the container, a unique identifier for the space.

  • external_id (str) – Combined with the space is the unique identifier of the container.

  • properties (Mapping[str, ContainerPropertyApply]) – We index the property by a local unique identifier.

  • description (str | None) – Textual description of the container

  • name (str | None) – Human readable name for the container.

  • constraints (Mapping[str, ConstraintApply]) – Set of constraints to apply to the container

  • indexes (Mapping[str, IndexApply]) – Set of indexes to apply to the container.

  • used_for (ContainerUsedFor | None) – Whether the container is for nodes, edges, records, or both nodes and edges (all).

as_write() ContainerApply

Returns this ContainerApply instance.

class cognite.client.data_classes.data_modeling.containers.ContainerApplyList(
resources: Sequence[T_CogniteResource],
)

Bases: CogniteResourceList[ContainerApply]

as_ids() list[ContainerId]

Convert to a container id list.

Returns:

The container id list.

Return type:

list[ContainerId]

class cognite.client.data_classes.data_modeling.containers.ContainerCore(space: str, external_id: str, properties: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.ContainerPropertyCore], description: str | None = None, name: str | None = None, constraints: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.ConstraintCore] = <factory>, indexes: ~collections.abc.Mapping[str, ~cognite.client.data_classes.data_modeling.containers.IndexCore] = <factory>)

Bases: DataModelingSchemaResource[ContainerApply], ABC

Represent the physical storage of data. This is the base class for the read and write version.

Parameters:
  • space (str) – The workspace for the container, a unique identifier for the space.

  • external_id (str) – Combined with the space is the unique identifier of the container.

  • properties (Mapping[str, ContainerPropertyCore]) – We index the property by a local unique identifier.

  • description (str | None) – Textual description of the container

  • name (str | None) – Human readable name for the container.

  • constraints (Mapping[str, ConstraintCore]) – Set of constraints to apply to the container

  • indexes (Mapping[str, IndexCore]) – Set of indexes to apply to the container.

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

Bases: WriteableCogniteResourceList[ContainerApply, Container]

as_apply() ContainerApplyList

Convert to a ContainerApply list.

Returns:

The container apply list.

Return type:

ContainerApplyList

as_ids() list[ContainerId]

Convert to a container id list.

Returns:

The container id list.

Return type:

list[ContainerId]

class cognite.client.data_classes.data_modeling.containers.ContainerProperty(
type: ~cognite.client.data_classes.data_modeling.data_types.PropertyType,
nullable: bool = True,
auto_increment: bool = False,
name: str | None = None,
default_value: str | int | float | bool | dict | None = None,
description: str | None = None,
immutable: bool = False,
constraint_state: ~cognite.client.data_classes.data_modeling.containers.PropertyConstraintState = <factory>,
)

Bases: ContainerPropertyCore

Read version of container property with state information.

as_apply() ContainerPropertyApply

Return the write version of this property.

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.containers.ContainerPropertyApply(
type: PropertyType,
nullable: bool = True,
auto_increment: bool = False,
name: str | None = None,
default_value: str | int | float | bool | dict | None = None,
description: str | None = None,
immutable: bool = False,
)

Bases: ContainerPropertyCore

Write version of container property.

as_apply() ContainerPropertyApply

Return this ContainerPropertyApply instance.

class cognite.client.data_classes.data_modeling.containers.ContainerPropertyCore(
type: PropertyType,
nullable: bool = True,
auto_increment: bool = False,
name: str | None = None,
default_value: str | int | float | bool | dict | None = None,
description: str | None = None,
immutable: bool = False,
)

Bases: CogniteResource, ABC

Base class for container properties with shared functionality.

abstract as_apply() ContainerPropertyApply

Return the write version of this property.

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.containers.Index(state: Literal['current', 'failed', 'pending'])

Bases: IndexCore, ABC

Read version of index with state information.

class cognite.client.data_classes.data_modeling.containers.IndexApply

Bases: IndexCore, ABC

Write version of index without state information.

as_apply() IndexApply

Return this IndexApply instance.

class cognite.client.data_classes.data_modeling.containers.IndexCore

Bases: CogniteResource, ABC

Base class for indexes with shared functionality.

abstract as_apply() IndexApply

Return the write version of this index.

abstract 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.containers.InvertedIndex(
state: Literal['current', 'failed', 'pending'],
*,
properties: list[str],
)

Bases: Index

Read version of inverted index with state information.

as_apply() InvertedIndexApply

Return the write version of this index.

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.containers.InvertedIndexApply(properties: list[str])

Bases: IndexApply

Write version of inverted index.

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.containers.PropertyConstraintState(
nullability: "Literal['current', 'failed', 'pending'] | None" = None,
max_list_size: "Literal['current', 'failed', 'pending'] | None" = None,
max_text_size: "Literal['current', 'failed', 'pending'] | None" = None,
)

Bases: CogniteResource

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

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.containers.RequiresConstraint(
state: Literal['current', 'failed', 'pending'],
*,
require: ContainerId,
)

Bases: Constraint

Read version of requires constraint with state information.

as_apply() RequiresConstraintApply

Return the write version of this constraint.

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.containers.RequiresConstraintApply(
require: ContainerId,
)

Bases: ConstraintApply

Write version of requires constraint.

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.containers.UniquenessConstraint(
state: Literal['current', 'failed', 'pending'],
properties: list[str],
)

Bases: Constraint

Read version of uniqueness constraint with state information.

as_apply() UniquenessConstraintApply

Return the write version of this constraint.

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.containers.UniquenessConstraintApply(properties: list[str])

Bases: ConstraintApply

Write version of uniqueness constraint.

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]