Update sources
- async AsyncCogniteClient.hosted_extractors.sources.update(
- items: SourceWrite | SourceUpdate | Sequence[SourceWrite | SourceUpdate],
- mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null',
-
- Parameters:
items (SourceWrite | SourceUpdate | Sequence[SourceWrite | SourceUpdate]) – Source(s) to update.
mode (Literal['replace_ignore_null', 'patch', 'replace']) – How to update data when a non-update object is given (SourceWrite). If you use ‘replace_ignore_null’, only the fields you have set will be used to replace existing (default). Using ‘replace’ will additionally clear all the fields that are not specified by you. Last option, ‘patch’, will update only the fields you have set and for container-like fields such as metadata or labels, add the values to the existing. For more details, see Update and Upsert Mode Parameter.
- Returns:
Updated source(s)
- Return type:
Source | SourceList
Examples
Update source:
>>> from cognite.client import CogniteClient >>> from cognite.client.data_classes.hosted_extractors import EventHubSourceUpdate >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> source = EventHubSourceUpdate("my_event_hub").event_hub_name.set( ... "My Updated EventHub" ... ) >>> res = client.hosted_extractors.sources.update(source)