Skip to content

Commit

Permalink
Remove (most) '/os-networks' REST APIs
Browse files Browse the repository at this point in the history
Drop support for most of the 'os-networks' REST APIs excluding those
that proxy through to neutron.

This API now returns a 410 response for the non-proxy routes.

Unit tests are removed for removed APIs and the functional API sample
tests are just asserting the 410 response now same. The latter are also
expanded to cover APIs that weren't previously tested.

The API sample docs are left intact since the API reference still builds
from those and can be considered more or less branchless, so people
looking at the API reference can apply it to older deployments of nova
before these APIs were removed.

Note: yes, the API samples are correct. It really is a useless API when
used with neutron.

Change-Id: I68bfa77a520382317fc490a4f6c12dd62fc6dcda
Signed-off-by: Stephen Finucane <[email protected]>
  • Loading branch information
stephenfin committed Nov 18, 2019
1 parent 3776e97 commit 1b71252
Show file tree
Hide file tree
Showing 26 changed files with 174 additions and 1,182 deletions.
79 changes: 34 additions & 45 deletions api-ref/source/os-networks.inc
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
.. -*- rst -*-
.. NOTE(sdague): These APIs are deprecated so do not update this
file even body, example or parameters are not complete.
=====================================
======================================
Networks (os-networks) (DEPRECATED)
=====================================
======================================

.. warning:: The networks API was designed to work with
``nova-network``. Some features are proxied to
``neutron`` when appropriate, but as with all translation
proxies, this is far from perfect compatibility. These
APIs should be avoided in new applications in favor of
using ``neutron`` directly. These will fail with a 404
starting from microversion 2.36.
See: `Relevant Network APIs
<https://docs.openstack.org/api-ref/network/v2/#networks>`__.
.. warning::

This API was designed to work with ``nova-network`` which was deprecated in
the 14.0.0 (Newton) release and removed in the 21.0.0 (Ussuri) release. Some
features are proxied to the Network service (neutron) when appropriate, but
as with all translation proxies, this is far from perfect compatibility.
These APIs should be avoided in new applications in favor of `using
neutron directly`__. These will fail with a 404 starting from microversion
2.36. They were removed in the 21.0.0 (Ussuri) release.

__ https://docs.openstack.org/api-ref/network/v2/#networks

Creates, lists, shows information for, and deletes networks.

Adds network to a project, disassociates a network from a project, and
disassociates a project from a network.


Associates host with and disassociates host from a network.

List Networks
Expand Down Expand Up @@ -60,7 +58,8 @@ these permissions through the ``policy.json`` file.

Normal response codes: 200

Error response codes: badRequest(400), unauthorized(401), forbidden(403), conflict(409), NotImplemented(501)
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
conflict(409), gone(410), notImplemented(501)

Request
-------
Expand Down Expand Up @@ -91,7 +90,8 @@ this operation. Cloud providers can change these permissions through the

Normal response codes: 202

Error response codes: badRequest(400), unauthorized(401), forbidden(403), NotImplemented(501)
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
gone(410), notImplemented(501)

Request
-------
Expand Down Expand Up @@ -146,7 +146,8 @@ these permissions through the ``policy.json`` file.

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
conflict(409), gone(410)

Request
-------
Expand All @@ -160,15 +161,11 @@ Response

There is no body content for the response of a successful DELETE query.

Associate Host (DEPRECATED)
===========================
Associate Host
==============

.. rest_method:: POST /os-networks/{network_id}/action

.. warning::
This API is only available with ``nova-network`` which is
deprecated. It should be avoided in any new applications.

Associates a network with a host.

Specify the ``associate_host`` action in the request body.
Expand All @@ -179,7 +176,8 @@ permissions through the ``policy.json`` file.

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), NotImplemented(501)
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
gone(410), notImplemented(501)

Request
-------
Expand All @@ -199,15 +197,11 @@ Response

There is no body content for the response of a successful POST query.

Disassociate Network (DEPRECATED)
=================================
Disassociate Network
====================

.. rest_method:: POST /os-networks/{network_id}/action

.. warning::
This API is only available with ``nova-network`` which is
deprecated. It should be avoided in any new applications.

Disassociates a network from a project. You can then reuse the network.

Specify the ``disassociate`` action in the request body.
Expand All @@ -218,7 +212,8 @@ these permissions through the ``policy.json`` file.

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), NotImplemented(501)
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
gone(410), notImplemented(501)

Request
-------
Expand All @@ -237,15 +232,11 @@ Response

There is no body content for the response of a successful POST query.

Disassociate Host (DEPRECATED)
==============================
Disassociate Host
=================

.. rest_method:: POST /os-networks/{network_id}/action

.. warning::
This API is only available with ``nova-network`` which is
deprecated. It should be avoided in any new applications.

Disassociates a host from a network.

Specify the ``disassociate_host`` action in the request body.
Expand All @@ -256,7 +247,8 @@ these permissions through the ``policy.json`` file.

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), NotImplemented(501)
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
gone(410), notImplemented(501)

Request
-------
Expand All @@ -276,15 +268,11 @@ Response
There is no body content for the response of a successful POST query.


Disassociate Project (DEPRECATED)
=================================
Disassociate Project
====================

.. rest_method:: POST /os-networks/{network_id}/action

.. warning::
This API is only available with ``nova-network`` which is
deprecated. It should be avoided in any new applications.

Disassociates a project from a network.

Specify the ``disassociate_project`` action in the request body.
Expand All @@ -295,7 +283,8 @@ these permissions through the ``policy.json`` file.

Normal response codes: 202

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), NotImplemented(501)
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
gone(410), notImplemented(501)

Request
-------
Expand Down
46 changes: 23 additions & 23 deletions doc/api_samples/os-networks/network-show-resp.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"network": {
"bridge": "br100",
"bridge_interface": "eth0",
"broadcast": "10.0.0.7",
"cidr": "10.0.0.0/29",
"bridge": null,
"bridge_interface": null,
"broadcast": null,
"cidr": null,
"cidr_v6": null,
"created_at": "2011-08-15T06:19:19.387525",
"deleted": false,
"created_at": null,
"deleted": null,
"deleted_at": null,
"dhcp_server": "10.0.0.1",
"dhcp_start": "10.0.0.3",
"dhcp_server": null,
"dhcp_start": null,
"dns1": null,
"dns2": null,
"enable_dhcp": true,
"gateway": "10.0.0.1",
"enable_dhcp": null,
"gateway": null,
"gateway_v6": null,
"host": "nsokolov-desktop",
"host": null,
"id": "20c8acc0-f747-4d71-a389-46d078ebf047",
"injected": false,
"label": "mynet_0",
"injected": null,
"label": "private",
"mtu": null,
"multi_host": false,
"netmask": "255.255.255.248",
"multi_host": null,
"netmask": null,
"netmask_v6": null,
"priority": null,
"project_id": "6133f8b603924f45bc0c9e21f6df12fa",
"project_id": null,
"rxtx_base": null,
"share_address": false,
"updated_at": "2011-08-16T09:26:13.048257",
"vlan": 100,
"vpn_private_address": "10.0.0.2",
"vpn_public_address": "127.0.0.1",
"vpn_public_port": 1000
"share_address": null,
"updated_at": null,
"vlan": null,
"vpn_private_address": null,
"vpn_public_address": null,
"vpn_public_port": null
}
}
}
74 changes: 20 additions & 54 deletions doc/api_samples/os-networks/networks-list-resp.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,38 @@
{
"networks": [
{
"bridge": "br100",
"bridge_interface": "eth0",
"broadcast": "10.0.0.7",
"cidr": "10.0.0.0/29",
"bridge": null,
"bridge_interface": null,
"broadcast": null,
"cidr": null,
"cidr_v6": null,
"created_at": "2011-08-15T06:19:19.387525",
"deleted": false,
"created_at": null,
"deleted": null,
"deleted_at": null,
"dhcp_server": "10.0.0.1",
"dhcp_start": "10.0.0.3",
"dhcp_server": null,
"dhcp_start": null,
"dns1": null,
"dns2": null,
"enable_dhcp": true,
"gateway": "10.0.0.1",
"gateway_v6": null,
"host": "nsokolov-desktop",
"id": "20c8acc0-f747-4d71-a389-46d078ebf047",
"injected": false,
"label": "mynet_0",
"mtu": null,
"multi_host": false,
"netmask": "255.255.255.248",
"netmask_v6": null,
"priority": null,
"project_id": "6133f8b603924f45bc0c9e21f6df12fa",
"rxtx_base": null,
"share_address": false,
"updated_at": "2011-08-16T09:26:13.048257",
"vlan": 100,
"vpn_private_address": "10.0.0.2",
"vpn_public_address": "127.0.0.1",
"vpn_public_port": 1000
},
{
"bridge": "br101",
"bridge_interface": "eth0",
"broadcast": "10.0.0.15",
"cidr": "10.0.0.10/29",
"cidr_v6": null,
"created_at": "2011-08-15T06:19:19.885495",
"deleted": false,
"deleted_at": null,
"dhcp_server": "10.0.0.9",
"dhcp_start": "10.0.0.11",
"dns1": null,
"dns2": null,
"enable_dhcp": true,
"gateway": "10.0.0.9",
"enable_dhcp": null,
"gateway": null,
"gateway_v6": null,
"host": null,
"id": "20c8acc0-f747-4d71-a389-46d078ebf000",
"injected": false,
"label": "mynet_1",
"id": "20c8acc0-f747-4d71-a389-46d078ebf047",
"injected": null,
"label": "private",
"mtu": null,
"multi_host": false,
"netmask": "255.255.255.248",
"multi_host": null,
"netmask": null,
"netmask_v6": null,
"priority": null,
"project_id": null,
"rxtx_base": null,
"share_address": false,
"share_address": null,
"updated_at": null,
"vlan": 101,
"vpn_private_address": "10.0.0.10",
"vlan": null,
"vpn_private_address": null,
"vpn_public_address": null,
"vpn_public_port": 1001
"vpn_public_port": null
}
]
}
}
Loading

0 comments on commit 1b71252

Please sign in to comment.