Planning Service#
Planning Service Class#
Classes:
|
Kill a Group of process. |
|
Execute and control processes according to a planning. |
|
Start a Process and assign a it to a group. |
- class enoslib.service.planning.planning.KillEvent(date: datetime, host: Host, name: str)#
Kill a Group of process.
Process in the cgroup “name” will be killed
- Parameters:
date – date of the event
host – host on which the event will occur
name – process group to kill
- class enoslib.service.planning.planning.PlanningService(planning: Planning | None = None)#
Execute and control processes according to a planning.
Scheduling of events use cronjobs on each of the target nodes.
- Parameters:
planning – optional. The planning to use
- add_event(e: Event) PlanningService#
Schedule an event.
- Parameters:
e – the event to schedule
- Returns:
The current PlanningService
- backup() None#
(abstract) Backup the service.
- check() None#
Check for inconsistencies in the planning
- deploy() None#
Set all events / cronjobs of a planning.
- destroy(wait: bool = True) None#
Remove all events / cronjobs of a planning.
- property duration: timedelta#
The timespan as a timedelta of the planning.
- property end: datetime#
Date as a datetime of the last event.
- property start: datetime#
Date as a datetime of the first event.
- status() ProcessRegistry#
Status of the processes in the Planning
- property until_end: timedelta#
Duration between now and the last event of the planning.
- class enoslib.service.planning.planning.StartEvent(*, date: datetime, host: Host, cmd: str, name: str)#
Start a Process and assign a it to a group.
- Parameters:
date – date of the event
host – host on which the event will occur
cmd – command to lauch
name – name of the process group in which cmd will be run