Hades AMQP API agent
Bases: Exception
Exception for illegal task arguments
Bases: Task
When enabled messages for this task will be acknowledged after the task has been executed, and not just before (the default behavior).
Please note that this means the task may be executed twice if the worker crashes mid execution.
The application default can be overridden with the
task_acks_late
setting.
If enabled the worker won't store task state and return values
for this task. Defaults to the task_ignore_result
setting.
Default task priority.
Rate limit for this task type. Examples: None
(no rate
limit), '100/s' (hundred tasks a second), '100/m' (hundred tasks
a minute),`'100/h'` (hundred tasks an hour)
Even if acks_late
is enabled, the worker will
acknowledge tasks when the worker process executing them abruptly
exits or is signaled (e.g., KILL
/INT
, etc).
Setting this to true allows the message to be re-queued instead, so that the task will execute again by the same worker, or another worker.
Warning: Enabling this can cause message loops; make sure you know what you're doing.
Task request stack, the current request will be the topmost.
The name of a serializer that are registered with
kombu.serialization.registry
. Default is 'json'.
When enabled errors will be stored even if the task is otherwise configured to ignore results.
Tuple of expected exceptions.
These are errors that are expected in normal operation and that shouldn't be regarded as a real error by the worker. Currently this means that the state will be updated to an error state, but the worker won't log the event as an error.
If enabled the task will report its status as 'started' when the task is executed by a worker. Disabled by default as the normal behavior is to not report that level of granularity. Tasks are either pending, finished, or waiting to be retried.
Having a 'started' status can be useful for when there are long running tasks and there's a need to report what task is currently running.
The application default can be overridden using the
task_track_started
setting.
Enable argument checking.
You can set this to false if you don't want the signature to be
checked when calling the task.
Defaults to app.strict_typing
.
Bases: Task
If enabled the worker won't store task state and return values
for this task. Defaults to the task_ignore_result
setting.
Default task priority.
Rate limit for this task type. Examples: None
(no rate
limit), '100/s' (hundred tasks a second), '100/m' (hundred tasks
a minute),`'100/h'` (hundred tasks an hour)
Even if acks_late
is enabled, the worker will
acknowledge tasks when the worker process executing them abruptly
exits or is signaled (e.g., KILL
/INT
, etc).
Setting this to true allows the message to be re-queued instead, so that the task will execute again by the same worker, or another worker.
Warning: Enabling this can cause message loops; make sure you know what you're doing.
Task request stack, the current request will be the topmost.
The name of a serializer that are registered with
kombu.serialization.registry
. Default is 'json'.
When enabled errors will be stored even if the task is otherwise configured to ignore results.
If enabled the task will report its status as 'started' when the task is executed by a worker. Disabled by default as the normal behavior is to not report that level of granularity. Tasks are either pending, finished, or waiting to be retried.
Having a 'started' status can be useful for when there are long running tasks and there's a need to report what task is currently running.
The application default can be overridden using the
task_track_started
setting.
Enable argument checking.
You can set this to false if you don't want the signature to be
checked when calling the task.
Defaults to app.strict_typing
.
Try to convert the argument to an integer.
argument -- Name of the argument
number -- The value to convert
ArgumentError -- if the argument is invalid
Try to convert the argument to an IP address.
argument -- Name of the argument
ip_address -- The value to convert
ArgumentError -- if the argument is invalid
Try to convert the argument to an IP network.
argument -- Name of the argument
ip_network -- The value to convert
ArgumentError -- if the argument is invalid
Try to convert the argument to a MAC.
argument -- Name of the argument
mac -- The value to convert
ArgumentError -- if the argument is invalid
Try to convert the argument to a positive integer.
argument -- Name of the argument
number -- The value to convert
ArgumentError -- if the argument is invalid
Try to convert the argument to a string.
argument -- Name of the argument
string -- The value to convert
ArgumentError -- if the argument is invalid
Try to convert the argument to a datetime range (tuple of
datetime.datetime
objects or None
.
argument -- Name of the argument
timestamp_range -- The value to convert
ArgumentError -- if the argument is invalid
Get a given sequence of attributes from a given object and return the results as dictionary.
obj -- An object
attributes -- A sequence of attributes
Get metadata of a given distribution and all its dependencies.
distribution -- A distribution object
A metadata dictionary
Get the status of a given systemd unit.
unit_name -- The name of the unit.
A dictionary of the unit properties
The attributes of the Python platform, that should be return by the
get_system_information()
task.
A convenience decorator that invokes celery.Celery.task()
, but sets
the following options, if not explicitly overridden:
Option |
Value |
---|---|
|
|
|
|
|
|
The attributes of the Celery tasks, that should be returned by the
get_system_information()
task.
The Hades systemd units that should be reported by the
get_systemd_status()
task.