diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2011-07-12 02:01:09 -0700 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2011-07-12 02:01:09 -0700 |
| commit | a3096d593fbe21625e3c4102e69d12950e9d2ef2 (patch) | |
| tree | 0d803720424d0de0ed59acdda42d3f4fc41dc429 /nova/compute | |
| parent | 04804aba3c995260cf376b8d979f032942cd0988 (diff) | |
added searching by instance name
added unit tests
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index fba56a2bb..605b0d29c 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -641,6 +641,10 @@ class API(base.Base): raise exception.FixedIpNotFoundForAddress(address=fixed_ip) return instances + def _get_all_by_name(self, context, search_opts): + return self.db.instance_get_all_by_name_regexp( + context, search_opts['name']) + def _get_all_by_ip(self, context, search_opts): return self.db.instance_get_all_by_ip_regexp( context, search_opts['ip']) @@ -673,6 +677,7 @@ class API(base.Base): exclusive_opts = ['reservation_id', 'project_id', 'fixed_ip', + 'name', 'ip', 'ip6'] + search_columns |
