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 occurred 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
  • SUSPENDED : the Audit was in ONGOING state and was suspended 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

create(*args, **kwargs)[source]

Create an Audit record in the DB.

Returns:An Audit object.
destroy(*args, **kwargs)[source]

Delete the Audit from the DB.

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)

save(*args, **kwargs)[source]

Save updates to this Audit.

Updates will be made column by column based on the result of self.what_changed().

soft_delete(*args, **kwargs)[source]

Soft Delete the Audit from the DB.

class watcher.objects.audit.AuditStateTransitionManager[source]

Bases: object

check_transition(initial, new)[source]
is_inactive(audit)[source]
class watcher.objects.audit.AuditType[source]

Bases: enum.Enum

class watcher.objects.audit.State[source]

Bases: object

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.