cmem_client.repositories.schedulers¤
Repository for the workflow schedulers of DataIntegration.
Provides SchedulersRepository for listing the schedulers which trigger workflows, and for enabling or disabling a single one.
Examples:
List the schedulers and inspect one:
>>> from cmem_client.client import Client
>>> client = Client.from_env()
>>> for scheduler_id in client.schedulers:
... print(scheduler_id, client.schedulers[scheduler_id])
Disable a scheduler and enable it again:
>>> client.schedulers.update_enabled("my-project:my-scheduler", enabled=False)
>>> client.schedulers.update_enabled("my-project:my-scheduler", enabled=True)
Classes:
- SchedulerUpdateConfig – Configuration for updating schedulers.
- SchedulersRepository – Repository for managing workflow schedulers.
SchedulerUpdateConfig¤
Bases: UpdateConfig
Configuration for updating schedulers.
Attributes:
- model_config –
SchedulersRepository¤
Bases: TaskSearchRepository, UpdateItemProtocol
Repository for managing workflow schedulers.
Provides access to workflow schedulers in Corporate Memory. Schedulers execute workflows at specified intervals and are identified by a ‘project_id:scheduler_id’ composite key.
Functions:
- fetch_data – Fetch a list from the DI task search endpoint via a type adapter.
- get_task – Get full task details from the API.
- items – Get the items of the repository
- keys – Get the keys of the repository
- update_enabled – Update the enabled state of a scheduler.
- update_item – Update an existing item in the repository.
- values – Get the values of the repository
Attributes:
- logger (
Logger) – Gets the client logger
fetch_data¤
Fetch a list from the DI task search endpoint via a type adapter.
get_task¤
Get full task details from the API.
Parameters:
- project_id (
str) – The project ID. - task_id (
str) – The task ID. - with_labels (
bool) – Whether to include labels in the response.
Returns:
TaskResponse– The full task details as a TaskResponse model.
items¤
Get the items of the repository
keys¤
Get the keys of the repository
logger¤
Gets the client logger
update_enabled¤
Update the enabled state of a scheduler.
Parameters:
- scheduler_id (
str) – Composite scheduler ID in ‘project_id:scheduler_id’ format. - enabled (
bool) – True to enable, False to disable.
Returns:
bool– True if the state was changed, False if already in the desired state.
update_item¤
Update an existing item in the repository.
Parameters:
- item (
ItemType) – The item to update in the repository. - configuration (
UpdateItemConfig_contra | None) – Optional configuration for the update operation.
Raises:
RepositoryModificationError– If the item does not exist or an error occurs.HTTPError– For any other HTTP error.
values¤
Get the values of the repository