summaryrefslogtreecommitdiff
path: root/novaclient/v2/fixed_ips.py
diff options
context:
space:
mode:
authorAndrey Kurilin <akurilin@mirantis.com>2015-02-03 02:32:58 +0200
committerAndrey Kurilin <akurilin@mirantis.com>2015-02-04 17:40:46 +0200
commit0a60aae852d2688861d0b4ba097a1a00529f0611 (patch)
treeb08ba9344b88e38767f54c5d5c7366c2ef306608 /novaclient/v2/fixed_ips.py
parent4e76f9590b49c925703cbbf42d1e232725465eff (diff)
Rename v1_1 to v2
Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3. Since future development(microversioning) will be done across V2, implementation should be done in appropriate module(to prevent misleading). Despite the fact that implementation for all versions are equal, discover method for contrib path worked only for v1.1. This patch fixes this bug and modifies shell tests to check all versions. Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Kevin L. Mitchell <kevin.mitchell@rackspace.com> Code-Review+2: Sean Dague <sean@dague.net> Workflow+1: Sean Dague <sean@dague.net> Submitted-by: Jenkins Submitted-at: Thu, 05 Feb 2015 00:17:20 +0000 Reviewed-on: https://review.openstack.org/149006 Project: openstack/python-novaclient Branch: refs/heads/master
Diffstat (limited to 'novaclient/v2/fixed_ips.py')
-rw-r--r--novaclient/v2/fixed_ips.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/novaclient/v2/fixed_ips.py b/novaclient/v2/fixed_ips.py
new file mode 100644
index 0000000..4e7c0e9
--- /dev/null
+++ b/novaclient/v2/fixed_ips.py
@@ -0,0 +1,56 @@
1# Copyright 2012 IBM Corp.
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16"""
17Fixed IPs interface.
18"""
19
20from novaclient import base
21
22
23class FixedIP(base.Resource):
24 def __repr__(self):
25 return "<FixedIP: %s>" % self.address
26
27
28class FixedIPsManager(base.Manager):
29 resource_class = FixedIP
30
31 def get(self, fixed_ip):
32 """
33 Show information for a Fixed IP
34
35 :param fixed_ip: Fixed IP address to get info for
36 """
37 return self._get('/os-fixed-ips/%s' % base.getid(fixed_ip),
38 "fixed_ip")
39
40 def reserve(self, fixed_ip):
41 """Reserve a Fixed IP
42
43 :param fixed_ip: Fixed IP address to reserve
44 """
45 body = {"reserve": None}
46 self.api.client.post('/os-fixed-ips/%s/action' % base.getid(fixed_ip),
47 body=body)
48
49 def unreserve(self, fixed_ip):
50 """Unreserve a Fixed IP
51
52 :param fixed_ip: Fixed IP address to unreserve
53 """
54 body = {"unreserve": None}
55 self.api.client.post('/os-fixed-ips/%s/action' % base.getid(fixed_ip),
56 body=body)