The watcher.objects.action Module

class watcher.objects.action.Action(context, **kwargs)[source]

Bases: watcher.objects.base.WatcherObject

create(context=None)[source]

Create a Action 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.: Action(context)
destroy(context=None)[source]

Delete the Action 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.: Action(context)
classmethod get(context, action_id)[source]

Find a action based on its id or uuid and return a Action object.

Parameters:action_id – the id or uuid of a action.
Returns:a Action object.
classmethod get_by_id(context, action_id)[source]

Find a action based on its integer id and return a Action object.

Parameters:action_id – the id of a action.
Returns:a Action object.
classmethod get_by_uuid(context, uuid)[source]

Find a action based on uuid and return a Action object.

Parameters:
  • uuid – the uuid of a action.
  • context – Security context
Returns:

a Action object.

classmethod list(context, limit=None, marker=None, filters=None, sort_key=None, sort_dir=None)[source]

Return a list of Action objects.

Parameters:
  • context – Security 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 Action object.

refresh(context=None)[source]

Loads updates for this Action.

Loads a action with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded action 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.: Action(context)
save(context=None)[source]

Save updates to this Action.

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.: Action(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.action.State[source]

Bases: object

Previous topic

The watcher.hacking.checks Module

Next topic

The watcher.objects.action_plan Module

Project Source

This Page