diff options
| author | Jason Koelker <jason@koelker.net> | 2011-09-14 10:13:36 -0500 |
|---|---|---|
| committer | Jason Koelker <jason@koelker.net> | 2011-09-14 10:13:36 -0500 |
| commit | 7c727b7700298e0d280e11cb2e06b177ee63a83b (patch) | |
| tree | 4f36cb37ab4c6797bc74698e5cc4a85c4fffb2e2 | |
| parent | dfeaf988a11fe2d7cee4533ef89e2544fd70e965 (diff) | |
change vifs to rpc call and add instance ids by ip
| -rw-r--r-- | nova/network/api.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/nova/network/api.py b/nova/network/api.py index 78580d360..014583a63 100644 --- a/nova/network/api.py +++ b/nova/network/api.py @@ -46,8 +46,9 @@ class API(base.Base): return ips def get_vifs_by_instance(self, context, instance_id): - vifs = self.db.virtual_interface_get_by_instance(context, instance_id) - return vifs + return rpc.call(context, FLAGS.network_topic, + {'method': 'get_vifs_by_instance', + 'args': {'instance_id': instance_id}}) def allocate_floating_ip(self, context): """Adds a floating ip to a project.""" @@ -210,3 +211,12 @@ class API(base.Base): return rpc.call(context, FLAGS.network_topic, {'method': 'validate_networks', 'args': args}) + + def get_instance_ids_by_ip_filter(self, context, ip_filter): + """Returns a list of dicts in the form of + {'instance_id': id, 'ip': ip} that matched the ip_filter + """ + args = {'ip_filter': ip_filter} + return rpc.call(context, FLAGS.network_topic, + {'method': 'get_instance_ids_by_ip_filter', + 'args': args}) |
