summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2013-01-16 18:49:45 +0000
committerChris Behrens <cbehrens@codestud.com>2013-02-07 07:16:43 +0000
commitbe992f7b9a1b02a238b3a0c15c3de67e8aedd4ba (patch)
tree02c6ab2ea7e2d722e827641915259e3bd0512abf /nova/compute
parent24018cabb462f8aeec921d77427e9d65b7068793 (diff)
Cells: Add cells support to instance_usage_audit_log api extension
Adds task_log_get_all() call to HostAPI() so that we can use the local DB when cells is disabled or proxy via cells if cells is enabled. Adds task_log_get_all() call to cells. Change-Id: I9e78c17fcf70f98903d0a26c1de3e2581b8977ad
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py11
-rw-r--r--nova/compute/cells_api.py14
2 files changed, 25 insertions, 0 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 394f09e11..f524a6705 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -2471,6 +2471,17 @@ class HostAPI(base.Base):
"""Return all instances on the given host."""
return self.db.instance_get_all_by_host(context, host_name)
+ def task_log_get_all(self, context, task_name, period_beginning,
+ period_ending, host=None, state=None):
+ """Return the task logs within a given range, optionally
+ filtering by host and/or state.
+ """
+ return self.db.task_log_get_all(context, task_name,
+ period_beginning,
+ period_ending,
+ host=host,
+ state=state)
+
class AggregateAPI(base.Base):
"""Sub-set of the Compute Manager API for managing host aggregates."""
diff --git a/nova/compute/cells_api.py b/nova/compute/cells_api.py
index 98a49417f..88ff70790 100644
--- a/nova/compute/cells_api.py
+++ b/nova/compute/cells_api.py
@@ -635,3 +635,17 @@ class HostAPI(compute_api.HostAPI):
instances = [i for i in instances
if i['cell_name'] == cell_name]
return instances
+
+ def task_log_get_all(self, context, task_name, beginning, ending,
+ host=None, state=None):
+ """Return the task logs within a given range from cells,
+ optionally filtering by the host and/or state. For cells, the
+ host should be a path like 'path!to!cell@host'. If no @host
+ is given, only task logs from a particular cell will be returned.
+ """
+ return self.cells_rpcapi.task_log_get_all(context,
+ task_name,
+ beginning,
+ ending,
+ host=host,
+ state=state)