The watcher.objects.audit
Module¶
In the Watcher system, an Audit is a request for optimizing a Cluster.
The optimization is done in order to satisfy one Goal on a given Cluster.
For each Audit, the Watcher system generates an Action Plan.
An Audit has a life-cycle and its current state may be one of the following:
- PENDING : a request for an Audit has been submitted (either manually by the Administrator or automatically via some event handling mechanism) and is in the queue for being processed by the Watcher Decision Engine
- ONGOING : the Audit is currently being processed by the Watcher Decision Engine
- SUCCEEDED : the Audit has been executed successfully (note that it may not necessarily produce a Solution).
- FAILED : an error occured while executing the Audit
- DELETED : the Audit is still stored in the Watcher database but is not returned any more through the Watcher APIs.
- CANCELLED : the Audit was in PENDING or ONGOING state and was cancelled by the Administrator
-
class
watcher.objects.audit.
Audit
(context=None, **kwargs)[source]¶ Bases:
watcher.objects.base.WatcherPersistentObject
,watcher.objects.base.WatcherObject
,watcher.objects.base.WatcherObjectDictCompat
-
classmethod
get
(context, *args, **kwargs)[source]¶ Find a audit based on its id or uuid and return a Audit object.
Parameters: - context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Audit(context)
- audit_id – the id or uuid of a audit.
- eager – Load object fields if True (Default: False)
Returns: a
Audit
object.
-
classmethod
get_by_id
(context, *args, **kwargs)[source]¶ Find a audit based on its integer id and return a Audit object.
Parameters: - context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Audit(context)
- audit_id – the id of a audit.
- eager – Load object fields if True (Default: False)
Returns: a
Audit
object.
-
classmethod
get_by_uuid
(context, *args, **kwargs)[source]¶ Find a audit based on uuid and return a
Audit
object.Parameters: - context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Audit(context)
- uuid – the uuid of a audit.
- eager – Load object fields if True (Default: False)
Returns: a
Audit
object.
-
classmethod
list
(context, *args, **kwargs)[source]¶ Return a list of Audit objects.
Parameters: - context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Audit(context)
- limit – maximum number of resources to return in a single result.
- marker – pagination marker for large data sets.
- filters – Filters to apply. Defaults to None.
- sort_key – column to sort results by.
- sort_dir – direction to sort. “asc” or “desc”.
- eager – Load object fields if True (Default: False)
Returns: a list of
Audit
object.
-
refresh
(*args, **kwargs)[source]¶ Loads updates for this Audit.
Loads a audit with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded audit column by column, if there are any updates. :param eager: Load object fields if True (Default: False)
-
classmethod