From 0b43ddbc936122ba155c07490daeffb2d0fdeba7 Mon Sep 17 00:00:00 2001
From: "Kevin L. Mitchell" <kevin.mitchell@rackspace.com>
Date: Tue, 7 Jun 2011 17:56:33 -0500
Subject: [PATCH] Add the basic calls for add_fixed_ip/remove_fixed_ip.

Implementation depends on extensions to the OpenStack API
---
 novaclient/servers.py | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/novaclient/servers.py b/novaclient/servers.py
index ffb6bad34..4f7f94b70 100644
--- a/novaclient/servers.py
+++ b/novaclient/servers.py
@@ -63,6 +63,22 @@ class Server(base.Resource):
         """
         self.manager.unshare_ip(self, address)
 
+    def add_fixed_ip(self, network_id):
+        """
+        Add an IP address on a network.
+
+        :param network_id: The ID of the network the IP should be on.
+        """
+        self.manager.add_fixed_ip(self, network_id)
+
+    def remove_fixed_ip(self, address):
+        """
+        Remove an IP address.
+
+        :param address: The IP address to remove.
+        """
+        self.manager.remove_fixed_ip(self, address)
+
     def reboot(self, type=REBOOT_SOFT):
         """
         Reboot the server.
@@ -282,6 +298,26 @@ class ServerManager(base.BootingManagerWithFind):
         server = base.getid(server)
         self._delete("/servers/%s/ips/public/%s" % (server, address))
 
+    def add_fixed_ip(self, server, network_id):
+        """
+        Add an IP address on a network.
+
+        :param server: The :class:`Server` (or its ID) to add an IP to.
+        :param network_id: The ID of the network the IP should be on.
+        """
+        server = base.getid(server)
+        # TODO(Vek) Call extension to add fixed IP
+
+    def remove_fixed_ip(self, server, address):
+        """
+        Remove an IP address.
+
+        :param server: The :class:`Server` (or its ID) to add an IP to.
+        :param address: The IP address to remove.
+        """
+        server = base.getid(server)
+        # TODO(Vek) Call extension to remove fixed IP
+
     def reboot(self, server, type=REBOOT_SOFT):
         """
         Reboot a server.