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, **kwargs)[source]
Bases: watcher.objects.base.WatcherObject
-
create(context=None)[source]
Create a Audit record in the DB.
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) |
-
destroy(context=None)[source]
Delete the Audit from the DB.
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) |
-
classmethod get(context, audit_id)[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.
|
Returns: | a Audit object.
|
-
classmethod get_by_id(context, audit_id)[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.
|
Returns: | a Audit object.
|
-
classmethod get_by_uuid(context, uuid)[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.
|
Returns: | a Audit object.
|
-
classmethod list(context, limit=None, marker=None, filters=None, sort_key=None, sort_dir=None)[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”.
|
Returns: | a list of Audit object.
|
-
refresh(context=None)[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.
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) |
-
save(context=None)[source]
Save updates to this Audit.
Updates will be made column by column based on the result
of self.what_changed().
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) |
-
soft_delete(context=None)[source]
soft Delete the Audit from the DB.
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) |
-
class watcher.objects.audit.AuditType[source]
Bases: enum.Enum
-
class watcher.objects.audit.State[source]
Bases: object