The watcher.objects.service Module

class watcher.objects.service.Service(context=None, **kwargs)[source]

Bases: watcher.objects.base.WatcherPersistentObject, watcher.objects.base.WatcherObject, watcher.objects.base.WatcherObjectDictCompat

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

Create a Service record in the DB.

classmethod get(context, *args, **kwargs)[source]

Find a service based on its 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.: Service(context)
  • service_id – the id of a service.
Returns:

a Service object.

classmethod get_by_name(context, *args, **kwargs)[source]

Find a service based on name

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

a Service object.

classmethod list(context, *args, **kwargs)[source]

Return a list of Service 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.: Service(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 Service object.

refresh()[source]

Loads updates for this Service.

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

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

Save updates to this Service.

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

soft_delete()[source]

Soft Delete the Service from the DB.

class watcher.objects.service.ServiceStatus[source]

Bases: object