Retrieve views by id(s)

async AsyncCogniteClient.data_modeling.views.retrieve(
ids: ViewId | tuple[str, str] | tuple[str, str, str] | Sequence[ViewId | tuple[str, str] | tuple[str, str, str]],
include_inherited_properties: bool = True,
all_versions: bool = True,
) ViewList

Retrieve a single view by id.

Parameters:
  • ids (ViewIdentifier | Sequence[ViewIdentifier]) – The view identifier(s). This can be given as a tuple of strings or a ViewId object. For example, (“my_space”, “my_view”), (“my_space”, “my_view”, “my_version”), or ViewId(“my_space”, “my_view”, “my_version”). Note that version is optional, if not provided, all versions will be returned.

  • include_inherited_properties (bool) – Whether to include properties inherited from views this view implements.

  • all_versions (bool) – Whether to return all versions. If false, only the newest version is returned (based on created_time)

Returns:

Requested view or None if it does not exist.

Return type:

ViewList

Examples

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