1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may
7
# not use this file except in compliance with the License. You may obtain
8
# a copy of the License at
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
# License for the specific language governing permissions and limitations
22
from novaclient import base
25
class FixedIP(base.Resource):
27
return "<FixedIP: %s>" % self.address
30
class FixedIPsManager(base.ManagerWithFind):
31
resource_class = FixedIP
33
def get(self, fixed_ip):
35
Show information for a Fixed IP
37
:param fixed_ip: Fixed IP address to get info for
39
return self._get('/os-fixed-ips/%s' % base.getid(fixed_ip),
42
def reserve(self, fixed_ip):
45
:param fixed_ip: Fixed IP address to reserve
47
body = {"reserve": None}
48
self.api.client.post('/os-fixed-ips/%s/action' % base.getid(fixed_ip),
51
def unreserve(self, fixed_ip):
52
"""Unreserve a Fixed IP
54
:param fixed_ip: Fixed IP address to unreserve
56
body = {"unreserve": None}
57
self.api.client.post('/os-fixed-ips/%s/action' % base.getid(fixed_ip),