tsa.task.prepare#

TaskAPI.prepare(opname, rule, inputdata=None, domain='default', hostid=None, metadata=None)#

Schedule an operation to be run periodically.

tsa.task.prepare(
    'migrate_series_storage',
    '5 * * * *',
    {'series_name': 'a-series', 'target_backend': 'fs1'}
)

The rule is a standard five fields cron expression (minute, hour, day of the month, month, day of the week). The task fires on the zeroth second of the matching minute: rework takes a sixth leading field for the seconds but we do not expose it.

A TaskError is raised if the operation is unknown, the rule is invalid or the inputs do not match the operation specification.

Parameters:
  • opname (str)

  • rule (str)

  • inputdata (dict | None)

  • domain (str)

  • hostid (str | None)

  • metadata (dict | None)

Return type:

None