MCPcopy
hub / github.com/saltstack/salt / run_task

Function run_task

salt/modules/celery.py:36–123  ·  view source on GitHub ↗

Execute celery tasks. For celery specific parameters see celery documentation. CLI Example: .. code-block:: bash salt '*' celery.run_task tasks.sleep args=[4] broker=redis://localhost \\ backend=redis://localhost wait_for_result=true task_name The task na

(
    task_name,
    args=None,
    kwargs=None,
    broker=None,
    backend=None,
    wait_for_result=False,
    timeout=None,
    propagate=True,
    interval=0.5,
    no_ack=True,
    raise_timeout=True,
    config=None,
)

Source from the content-addressed store, hash-verified

34
35
36def run_task(
37 task_name,
38 args=None,
39 kwargs=None,
40 broker=None,
41 backend=None,
42 wait_for_result=False,
43 timeout=None,
44 propagate=True,
45 interval=0.5,
46 no_ack=True,
47 raise_timeout=True,
48 config=None,
49):
50 """
51 Execute celery tasks. For celery specific parameters see celery documentation.
52
53 CLI Example:
54
55 .. code-block:: bash
56
57 salt '*' celery.run_task tasks.sleep args=[4] broker=redis://localhost \\
58 backend=redis://localhost wait_for_result=true
59
60 task_name
61 The task name, e.g. tasks.sleep
62
63 args
64 Task arguments as a list
65
66 kwargs
67 Task keyword arguments
68
69 broker
70 Broker for celeryapp, see celery documentation
71
72 backend
73 Result backend for celeryapp, see celery documentation
74
75 wait_for_result
76 Wait until task result is read from result backend and return result, Default: False
77
78 timeout
79 Timeout waiting for result from celery, see celery AsyncResult.get documentation
80
81 propagate
82 Propagate exceptions from celery task, see celery AsyncResult.get documentation, Default: True
83
84 interval
85 Interval to check for task result, see celery AsyncResult.get documentation, Default: 0.5
86
87 no_ack
88 see celery AsyncResult.get documentation. Default: True
89
90 raise_timeout
91 Raise timeout exception if waiting for task result times out. Default: False
92
93 config

Callers

nothing calls this directly

Calls 5

SaltInvocationErrorClass · 0.90
connectionMethod · 0.80
updateMethod · 0.45
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected