Retrieve a space by id

async AsyncCogniteClient.data_modeling.spaces.retrieve(
spaces: str | SequenceNotStr[str],
) Space | SpaceList | None

Retrieve one or more spaces.

Parameters:

spaces (str | SequenceNotStr[str]) – Space ID

Returns:

Requested space or None if it does not exist.

Return type:

Space | SpaceList | None

Examples

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.data_modeling.spaces.retrieve(spaces="mySpace")

Get multiple spaces by id:

>>> res = client.data_modeling.spaces.retrieve(
...     spaces=["MySpace", "MyAwesomeSpace", "MyOtherSpace"]
... )