summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAndrew Bogott <abogott@wikimedia.org>2012-01-02 17:31:36 -0600
committerAndrew Bogott <abogott@wikimedia.org>2012-01-10 16:31:19 -0600
commit4c5586a28fd7a085369c49f6039876ffdc86b526 (patch)
tree339999b8ba41ec8e1e7407cabc7154da9a44196e /nova/api
parent5165320257b18ca1917727c1ae1d3cdde366d85d (diff)
Add a modify function to the floating ip dns api.
Removed the dns driver function rename_entry(). Since 'name' is the unique identifier for an entry, trying to rename things causes various confusions. Better to leave the user to delete and recreate. For blueprint public-and-private-dns. Change-Id: I766af01299b7b28ad8d9f6c072a8f3e049bd286b
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/v2/contrib/floating_ip_dns.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/nova/api/openstack/v2/contrib/floating_ip_dns.py b/nova/api/openstack/v2/contrib/floating_ip_dns.py
index 17efd6d84..1f1cf824c 100644
--- a/nova/api/openstack/v2/contrib/floating_ip_dns.py
+++ b/nova/api/openstack/v2/contrib/floating_ip_dns.py
@@ -168,6 +168,28 @@ class FloatingIPDNSController(object):
'type': dns_type,
'zone': zone})
+ def update(self, req, id, body):
+ """Modify a dns entry."""
+ context = req.environ['nova.context']
+ zone = _unquote_zone(id)
+
+ try:
+ entry = body['dns_entry']
+ name = entry['name']
+ new_ip = entry['ip']
+ except (TypeError, KeyError):
+ raise webob.exc.HTTPUnprocessableEntity()
+
+ try:
+ self.network_api.modify_dns_entry(context, name,
+ new_ip, zone)
+ except exception.NotFound:
+ return webob.Response(status_int=404)
+
+ return _translate_dns_entry_view({'ip': new_ip,
+ 'name': name,
+ 'zone': zone})
+
def delete(self, req, id):
"""Delete the entry identified by req and id. """
context = req.environ['nova.context']