Retrieve sources

async AsyncCogniteClient.hosted_extractors.sources.retrieve(
external_ids: str | SequenceNotStr[str],
ignore_unknown_ids: bool = False,
) Source | SourceList

Retrieve one or more sources.

Parameters:
  • external_ids (str | SequenceNotStr[str]) – The external ID provided by the client. Must be unique for the resource type.

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

Returns:

Requested sources

Return type:

Source | SourceList

Examples

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.hosted_extractors.sources.retrieve("myMQTTSource")

Get multiple sources by id:

>>> res = client.hosted_extractors.sources.retrieve(
...     ["myMQTTSource", "MyEventHubSource"], ignore_unknown_ids=True
... )