Retrieve

async AsyncCogniteClient.transformations.external_data_sources.retrieve(
external_id: str | SequenceNotStr[str],
ignore_unknown_ids: bool = False,
) → ExternalDataSource | ExternalDataSourceList | None

Retrieve one or more external data sources by external ID.

The API accepts at most 100 external IDs per request; larger inputs are split into several requests automatically. The external IDs must be unique. A data source you do not have access to is treated as missing.

Parameters:
  • external_id (str | SequenceNotStr[str]) – External ID or list of external IDs of the data source(s).

  • ignore_unknown_ids (bool) – Ignore external IDs that are not found (or not accessible) rather than raise an exception.

Returns:

If a single external ID is specified: the requested data source, or None if it does not exist. If several external IDs are specified: the requested data sources.

Return type:

ExternalDataSource | ExternalDataSourceList | None

Examples

Retrieve a data source:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.transformations.external_data_sources.retrieve("fabric-lakehouse-prod")

Retrieve several data sources, skipping unknown external IDs:

>>> res = client.transformations.external_data_sources.retrieve(
...     ["fabric-lakehouse-prod", "snowflake-analytics-prod", "might-not-exist"],
...     ignore_unknown_ids=True,
... )