Merge "Remove deprecated fixed_ips APIs"
This commit is contained in:
commit
1feda02155
novaclient
releasenotes/notes
@ -1,38 +0,0 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from novaclient.tests.unit.fixture_data import base
|
||||
|
||||
|
||||
class Fixture(base.Fixture):
|
||||
|
||||
base_url = 'os-fixed-ips'
|
||||
|
||||
def setUp(self):
|
||||
super(Fixture, self).setUp()
|
||||
|
||||
get_os_fixed_ips = {
|
||||
"fixed_ip": {
|
||||
'cidr': '192.168.1.0/24',
|
||||
'address': '192.168.1.1',
|
||||
'hostname': 'foo',
|
||||
'host': 'bar'
|
||||
}
|
||||
}
|
||||
|
||||
self.requests_mock.get(self.url('192.168.1.1'),
|
||||
json=get_os_fixed_ips,
|
||||
headers=self.json_headers)
|
||||
|
||||
self.requests_mock.post(self.url('192.168.1.1', 'action'),
|
||||
headers=self.json_headers,
|
||||
status_code=202)
|
@ -1610,18 +1610,6 @@ class FakeSessionClient(base_client.SessionClient):
|
||||
'binary': body['binary'],
|
||||
'forced_down': False}})
|
||||
|
||||
#
|
||||
# Fixed IPs
|
||||
#
|
||||
def get_os_fixed_ips_192_168_1_1(self, *kw):
|
||||
return (200, {}, {"fixed_ip": {'cidr': '192.168.1.0/24',
|
||||
'address': '192.168.1.1',
|
||||
'hostname': 'foo',
|
||||
'host': 'bar'}})
|
||||
|
||||
def post_os_fixed_ips_192_168_1_1_action(self, body, **kw):
|
||||
return (202, {}, None)
|
||||
|
||||
#
|
||||
# Hosts
|
||||
#
|
||||
|
@ -1,48 +0,0 @@
|
||||
# Copyright 2012 IBM Corp.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from novaclient.tests.unit.fixture_data import client
|
||||
from novaclient.tests.unit.fixture_data import fixedips as data
|
||||
from novaclient.tests.unit import utils
|
||||
from novaclient.tests.unit.v2 import fakes
|
||||
|
||||
|
||||
class FixedIpsTest(utils.FixturedTestCase):
|
||||
|
||||
data_fixture_class = data.Fixture
|
||||
|
||||
scenarios = [('original', {'client_fixture_class': client.V1}),
|
||||
('session', {'client_fixture_class': client.SessionV1})]
|
||||
|
||||
def test_get_fixed_ip(self):
|
||||
info = self.cs.fixed_ips.get(fixed_ip='192.168.1.1')
|
||||
self.assert_request_id(info, fakes.FAKE_REQUEST_ID_LIST)
|
||||
self.assert_called('GET', '/os-fixed-ips/192.168.1.1')
|
||||
self.assertEqual('192.168.1.0/24', info.cidr)
|
||||
self.assertEqual('192.168.1.1', info.address)
|
||||
self.assertEqual('foo', info.hostname)
|
||||
self.assertEqual('bar', info.host)
|
||||
|
||||
def test_reserve_fixed_ip(self):
|
||||
body = {"reserve": None}
|
||||
fixedip = self.cs.fixed_ips.reserve(fixed_ip='192.168.1.1')
|
||||
self.assert_request_id(fixedip, fakes.FAKE_REQUEST_ID_LIST)
|
||||
self.assert_called('POST', '/os-fixed-ips/192.168.1.1/action', body)
|
||||
|
||||
def test_unreserve_fixed_ip(self):
|
||||
body = {"unreserve": None}
|
||||
fixedip = self.cs.fixed_ips.unreserve(fixed_ip='192.168.1.1')
|
||||
self.assert_request_id(fixedip, fakes.FAKE_REQUEST_ID_LIST)
|
||||
self.assert_called('POST', '/os-fixed-ips/192.168.1.1/action', body)
|
@ -28,7 +28,6 @@ from novaclient.v2 import cells
|
||||
from novaclient.v2 import certs
|
||||
from novaclient.v2 import cloudpipe
|
||||
from novaclient.v2 import contrib
|
||||
from novaclient.v2 import fixed_ips
|
||||
from novaclient.v2 import flavor_access
|
||||
from novaclient.v2 import flavors
|
||||
from novaclient.v2 import floating_ips
|
||||
@ -170,7 +169,6 @@ class Client(object):
|
||||
self.hypervisors = hypervisors.HypervisorManager(self)
|
||||
self.hypervisor_stats = hypervisors.HypervisorStatsManager(self)
|
||||
self.services = services.ServiceManager(self)
|
||||
self.fixed_ips = fixed_ips.FixedIPsManager(self)
|
||||
self.os_cache = os_cache
|
||||
self.availability_zones = \
|
||||
availability_zones.AvailabilityZoneManager(self)
|
||||
|
@ -1,65 +0,0 @@
|
||||
# Copyright 2012 IBM Corp.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""
|
||||
Fixed IPs interface.
|
||||
"""
|
||||
|
||||
from novaclient import api_versions
|
||||
from novaclient import base
|
||||
|
||||
|
||||
class FixedIP(base.Resource):
|
||||
"""DEPRECATED"""
|
||||
def __repr__(self):
|
||||
return "<FixedIP: %s>" % self.address
|
||||
|
||||
|
||||
class FixedIPsManager(base.Manager):
|
||||
"""DEPRECATED"""
|
||||
resource_class = FixedIP
|
||||
|
||||
@api_versions.deprecated_after('2.35')
|
||||
def get(self, fixed_ip):
|
||||
"""DEPRECATED: Show information for a Fixed IP.
|
||||
|
||||
:param fixed_ip: Fixed IP address to get info for
|
||||
"""
|
||||
return self._get('/os-fixed-ips/%s' % base.getid(fixed_ip),
|
||||
"fixed_ip")
|
||||
|
||||
@api_versions.deprecated_after('2.35')
|
||||
def reserve(self, fixed_ip):
|
||||
"""DEPRECATED: Reserve a Fixed IP.
|
||||
|
||||
:param fixed_ip: Fixed IP address to reserve
|
||||
:returns: An instance of novaclient.base.TupleWithMeta
|
||||
"""
|
||||
body = {"reserve": None}
|
||||
resp, body = self.api.client.post('/os-fixed-ips/%s/action' %
|
||||
base.getid(fixed_ip), body=body)
|
||||
return self.convert_into_with_meta(body, resp)
|
||||
|
||||
@api_versions.deprecated_after('2.35')
|
||||
def unreserve(self, fixed_ip):
|
||||
"""DEPRECATED: Unreserve a Fixed IP.
|
||||
|
||||
:param fixed_ip: Fixed IP address to unreserve
|
||||
:returns: An instance of novaclient.base.TupleWithMeta
|
||||
"""
|
||||
body = {"unreserve": None}
|
||||
resp, body = self.api.client.post('/os-fixed-ips/%s/action' %
|
||||
base.getid(fixed_ip), body=body)
|
||||
return self.convert_into_with_meta(body, resp)
|
@ -55,6 +55,7 @@ upgrade:
|
||||
Along with the following python API bindings::
|
||||
|
||||
* novaclient.v2.contrib.tenant_networks
|
||||
* novaclient.v2.fixed_ips
|
||||
* novaclient.v2.floating_ip_dns
|
||||
* novaclient.v2.floating_ip_pools
|
||||
* novaclient.v2.floating_ips_bulk
|
||||
|
Loading…
x
Reference in New Issue
Block a user