Update transformation schedules
- async AsyncCogniteClient.transformations.schedules.update(
- item: TransformationSchedule | TransformationScheduleWrite | TransformationScheduleUpdate | Sequence[TransformationSchedule | TransformationScheduleWrite | TransformationScheduleUpdate],
- mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null',
Update one or more transformation schedules.
- Parameters:
item (TransformationSchedule | TransformationScheduleWrite | TransformationScheduleUpdate | Sequence[TransformationSchedule | TransformationScheduleWrite | TransformationScheduleUpdate]) – Transformation schedule(s) to update
mode (Literal['replace_ignore_null', 'patch', 'replace']) – How to update data when a non-update object is given (TransformationSchedule or -Write). 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 transformation schedule(s)
- Return type:
Examples
Update a transformation schedule that you have fetched. This will perform a full update of the schedule:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> transformation_schedule = client.transformations.schedules.retrieve(id=1) >>> transformation_schedule.is_paused = True >>> res = client.transformations.schedules.update(transformation_schedule)
Perform a partial update on a transformation schedule, updating the interval and unpausing it:
>>> from cognite.client.data_classes import TransformationScheduleUpdate >>> my_update = ( ... TransformationScheduleUpdate(id=1).interval.set("0 * * * *").is_paused.set(False) ... ) >>> res = client.transformations.schedules.update(my_update)