Retrieve labels
- async AsyncCogniteClient.labels.retrieve(
- external_id: str | SequenceNotStr[str],
- ignore_unknown_ids: bool = False,
Retrieve one or more label definitions by external id.
- Parameters:
external_id (str | SequenceNotStr[str]) – External ID or list of external ids
ignore_unknown_ids (bool) – If True, ignore IDs and external IDs that are not found rather than throw an exception.
- Returns:
The requested label definition(s)
- Return type:
LabelDefinition | LabelDefinitionList | None
Examples
Get label by external id:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.labels.retrieve(external_id="my_label", ignore_unknown_ids=True)