Update jobs

async AsyncCogniteClient.hosted_extractors.jobs.update(
items: JobWrite | JobUpdate | Sequence[JobWrite | JobUpdate],
mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null',
) Job | JobList

Update one or more jobs.

Parameters:
  • items (JobWrite | JobUpdate | Sequence[JobWrite | JobUpdate]) – Job(s) to update.

  • mode (Literal['replace_ignore_null', 'patch', 'replace']) – How to update data when a non-update object is given (JobWrite). 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 job(s)

Return type:

Job | JobList

Examples

Update job:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.hosted_extractors import EventHubSourceUpdate
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> job = EventHubSourceUpdate("my_event_hub").event_hub_name.set("My Updated EventHub")
>>> updated_job = client.hosted_extractors.jobs.update(job)