The watcher.objects.goal Module

class watcher.objects.goal.Goal(context, **kwargs)[source]

Bases: watcher.objects.base.WatcherObject

create()[source]

Create a Goal record in the DB.

destroy()[source]

Delete the Goal from the DB.

classmethod get(context, goal_id)[source]

Find a goal based on its id or uuid

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.: Goal(context)
  • goal_id – the id or uuid of a goal.
Returns:

a Goal object.

classmethod get_by_id(context, goal_id)[source]

Find a goal based on its integer id

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.: Goal(context)
  • goal_id – the id or uuid of a goal.
Returns:

a Goal object.

classmethod get_by_name(context, name)[source]

Find a goal based on name

Parameters:
  • name – the name of a goal.
  • context – Security context
Returns:

a Goal object.

classmethod get_by_uuid(context, uuid)[source]

Find a goal based on uuid

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.: Goal(context)
  • uuid – the uuid of a goal.
Returns:

a Goal object.

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

Return a list of Goal 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.: Goal(context)
  • filters – dict mapping the filter key to a value.
  • limit – maximum number of resources to return in a single result.
  • marker – pagination marker for large data sets.
  • sort_key – column to sort results by.
  • sort_dir – direction to sort. “asc” or “desc”.
Returns:

a list of Goal object.

refresh()[source]

Loads updates for this Goal.

Loads a goal with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded goal column by column, if there are any updates.

save()[source]

Save updates to this Goal.

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

soft_delete()[source]

Soft Delete the Goal from the DB.

Previous topic

The watcher.objects.efficacy_indicator Module

Next topic

The watcher.objects.scoring_engine Module

Project Source

This Page