diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 05b6f14..0000000 --- a/.coveragerc +++ /dev/null @@ -1,7 +0,0 @@ -[run] -branch = True -source = neutron_lib -omit = neutron_lib/tests/* - -[report] -ignore_errors = True diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 127cafc..0000000 --- a/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -AUTHORS -build/* -build-stamp -ChangeLog -api-ref/build/ -cover/ -covhtml/ -dist/ -doc/build -doc/source/reference/modules/ -*.DS_Store -*.pyc -neutron_lib.egg-info/ -neutron_lib/vcsversion.py -neutron_lib/versioninfo -pbr*.egg/ -releasenotes/build -setuptools*.egg/ -*.log -*.mo -*.sw? -*~ -/.* -!/.coveragerc -!/.gitignore -!/.gitreview -!/.mailmap -!/.pylintrc -!/.testr.conf - -# Files created by releasenotes build -releasenotes/build diff --git a/.gitreview b/.gitreview deleted file mode 100644 index c017749..0000000 --- a/.gitreview +++ /dev/null @@ -1,4 +0,0 @@ -[gerrit] -host=review.openstack.org -port=29418 -project=openstack/neutron-lib.git diff --git a/.mailmap b/.mailmap deleted file mode 100644 index 516ae6f..0000000 --- a/.mailmap +++ /dev/null @@ -1,3 +0,0 @@ -# Format is: -# -# diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 7e156d7..0000000 --- a/.testr.conf +++ /dev/null @@ -1,8 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ \ - ${OS_TEST_PATH:-./neutron_lib/tests/unit} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index d48fa13..0000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,14 +0,0 @@ -If you would like to contribute to the development of OpenStack, you must -follow the steps in this page: -http://docs.openstack.org/infra/manual/developers.html - -If you already have a good understanding of how the system works and your -OpenStack accounts are set up, you can skip to the development workflow -section of this documentation to learn how changes to OpenStack should be -submitted for review via the Gerrit tool: -http://docs.openstack.org/infra/manual/developers.html#development-workflow - -Pull requests submitted through GitHub will be ignored. - -Bugs should be filed on Launchpad, not GitHub: -https://bugs.launchpad.net/neutron-lib diff --git a/HACKING.rst b/HACKING.rst deleted file mode 100644 index d512170..0000000 --- a/HACKING.rst +++ /dev/null @@ -1,22 +0,0 @@ -neutron-lib Style Commandments -============================== - -- Step 1: Read the OpenStack Style Commandments - https://docs.openstack.org/hacking/latest/ -- Step 2: Read on - -Neutron Library Specific Commandments -------------------------------------- - -- [N521] Validate that jsonutils module is used instead of json -- [N524] Prevent use of deprecated contextlib.nested. -- [N525] Python 3: Do not use xrange. -- [N526] Python 3: do not use basestring. -- [N527] Python 3: do not use dict.iteritems. -- [N529] Method's default argument shouldn't be mutable -- [N530] No importing of neutron; should be ignored in neutron itself -- [N532] Validate that LOG.warning is used instead of LOG.warn. The latter is deprecated. -- [N534] Exception messages should be translated -- [N535] Usage of Python eventlet module not allowed -- [N536] Use assertIsNone/assertIsNotNone rather than assertEqual/assertIs to check None values. -- [N537] Don't translate logs. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 68c771a..0000000 --- a/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - diff --git a/README b/README new file mode 100644 index 0000000..8fcd2b2 --- /dev/null +++ b/README @@ -0,0 +1,14 @@ +This project is no longer maintained. + +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". + +For ongoing work on maintaining OpenStack packages in the Debian +distribution, please see the Debian OpenStack packaging team at +https://wiki.debian.org/OpenStack/. + +For any further questions, please email +openstack-dev@lists.openstack.org or join #openstack-dev on +Freenode. diff --git a/README.rst b/README.rst deleted file mode 100644 index 6ed7ca8..0000000 --- a/README.rst +++ /dev/null @@ -1,24 +0,0 @@ -======================== -Team and repository tags -======================== - -.. image:: http://governance.openstack.org/badges/neutron-lib.svg - :target: http://governance.openstack.org/reference/tags/index.html - -.. Change things from this point on - -=============================== -neutron-lib -=============================== - -Neutron shared routines and utilities - -* Free software: Apache license -* Documentation: https://docs.openstack.org/neutron-lib/latest/ -* Source: http://git.openstack.org/cgit/openstack/neutron-lib -* Bugs: http://bugs.launchpad.net/neutron - -Features --------- - -* TODO diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py deleted file mode 100644 index 163eec4..0000000 --- a/api-ref/source/conf.py +++ /dev/null @@ -1,230 +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. -# -# neutron documentation build configuration file, created by -# sphinx-quickstart on Sat May 1 15:17:47 2010. -# -# This file is execfile()d with the current directory set to -# its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import os -import subprocess -import sys -import warnings - -import openstackdocstheme - -extensions = [ - 'os_api_ref', -] - -html_theme = 'openstackdocs' -html_theme_path = [openstackdocstheme.get_html_theme_path()] -html_theme_options = { - "sidebar_mode": "toc", -} - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../../')) -sys.path.insert(0, os.path.abspath('../')) -sys.path.insert(0, os.path.abspath('./')) - -# -- General configuration ---------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -# -# source_encoding = 'utf-8' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Networking API Reference' -copyright = u'2010-present, OpenStack Foundation' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -from neutron_lib.version import version_info -# The full version, including alpha/beta/rc tags. -release = version_info.release_string() -# The short X.Y version. -version = version_info.version_string() - -# Config logABug feature -# html_context allows us to pass arbitrary values into the html template -html_context = {"bug_tag": "api-ref", "bug_project": "neutron"} - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# The reST default role (used for this markup: `text`) to use -# for all documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -add_module_names = False - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# -- Options for man page output ---------------------------------------------- - -# Grouping the document tree for man pages. -# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' - - -# -- Options for HTML output -------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -# html_theme_path = ["."] -# html_theme = '_theme' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' -git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", - "-n1"] -try: - html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') -except Exception: - warnings.warn('Cannot get last updated time from git repository. ' - 'Not setting "html_last_updated_fmt".') - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_use_modindex = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = '' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'neutrondoc' - - -# -- Options for LaTeX output ------------------------------------------------- - -# The paper size ('letter' or 'a4'). -# latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -# latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass -# [howto/manual]). -latex_documents = [ - ('index', 'Neutron.tex', u'OpenStack Networking API Documentation', - u'OpenStack Foundation', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# Additional stuff for the LaTeX preamble. -# latex_preamble = '' - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_use_modindex = True diff --git a/api-ref/source/index.rst b/api-ref/source/index.rst deleted file mode 100644 index fca8ebd..0000000 --- a/api-ref/source/index.rst +++ /dev/null @@ -1,8 +0,0 @@ -======================= -Networking Service APIs -======================= - -.. toctree:: - :maxdepth: 2 - - v2/index diff --git a/api-ref/source/v2/bgpvpn-bgpvpns.inc b/api-ref/source/v2/bgpvpn-bgpvpns.inc deleted file mode 100644 index aaff1ae..0000000 --- a/api-ref/source/v2/bgpvpn-bgpvpns.inc +++ /dev/null @@ -1,238 +0,0 @@ -.. -*- rst -*- - -======== -BGP VPNs -======== - -A new BGPVPN resource is introduced. It contains a set of parameters for a -BGP-based VPN. - -A BGPVPN is created by the admin and given to a tenant who can then associate -it to Networks or Routers. - -The BGP VPNs API lists, shows details for, creates, updates, and deletes -BGP VPNs. - -List BGP VPNs -============= - -.. rest_method:: GET /v2.0/bgpvpn/bgpvpns - -Lists BGP VPNs to which the project has access. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 400, 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bgpvpns: bgpvpns - - id: bgpvpn-id-body - - name: bgpvpn-name-required - - type: bgpvpn-type-required - - route_distinguishers: bgpvpn-route_distinguishers-required - - route_targets: bgpvpn-route_targets-required - - import_targets: bgpvpn-import_targets-required - - export_targets: bgpvpn-export_targets-required - - networks: bgpvpn-networks-required - - routers: bgpvpn-routers-required - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpns-list-response.json - :language: javascript - -Create BGP VPNS -=============== - -.. rest_method:: POST /v2.0/bgpvpn/bgpvpns - -Creates a BGP VPN. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn: bgpvpn - - name: bgpvpn-name - - route_distinguishers: bgpvpn-route_distinguishers - - route_targets: bgpvpn-route_targets - - import_targets: bgpvpn-import_targets - - export_targets: bgpvpn-export_targets - - tenant_id: tenant_id-request - - project_id: project_id-request - - type: bgpvpn-type - -Request Example ---------------- - -.. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn: bgpvpn - - id: bgpvpn-id-body - - name: bgpvpn-name-required - - type: bgpvpn-type-required - - route_targets: bgpvpn-route_targets-required - - import_targets: bgpvpn-import_targets-required - - export_targets: bgpvpn-export_targets-required - - networks: bgpvpn-networks-required - - routers: bgpvpn-routers-required - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-create-response.json - :language: javascript - -Show BGP VPN details -==================== - -.. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id} - -Shows details for a BGP VPN. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn: bgpvpn - - id: bgpvpn-id-body - - name: bgpvpn-name-required - - type: bgpvpn-type-required - - route_distinguishers: bgpvpn-route_distinguishers-required - - route_targets: bgpvpn-route_targets-required - - import_targets: bgpvpn-import_targets-required - - export_targets: bgpvpn-export_targets-required - - networks: bgpvpn-networks-required - - routers: bgpvpn-routers-required - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-show-response.json - :language: javascript - -Update a BGP VPN -================ - -.. rest_method:: PUT /v2.0/bgpvpn/bgpvpns/{bgpvpn_id} - -Updates a BGP VPN. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404 - -Request -------- -A non-admin user can only update the name parameter. All other updates require -admin privileges. - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - bgpvpn: bgpvpn - - name: bgpvpn-name - - route_distinguishers: bgpvpn-route_distinguishers - - route_targets: bgpvpn-route_targets - - import_targets: bgpvpn-import_targets - - export_targets: bgpvpn-export_targets - -Request Example ---------------- - -.. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn: bgpvpn - - id: bgpvpn-id-body - - name: bgpvpn-name-required - - type: bgpvpn-type-required - - route_distinguishers: bgpvpn-route_distinguishers-required - - route_targets: bgpvpn-route_targets-required - - import_targets: bgpvpn-import_targets-required - - export_targets: bgpvpn-export_targets-required - - networks: bgpvpn-networks-required - - routers: bgpvpn-routers-required - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/bgpvpns/bgpvpn-update-response.json - :language: javascript - -Delete BGP VPN -============== - -.. rest_method:: DELETE /v2.0/bgpvpn/bgpvpns/{bgpvpn_id} - -Deletes a BGP VPN and its network and/or router associations. - -Normal response codes: 204 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/bgpvpn-network_associations.inc b/api-ref/source/v2/bgpvpn-network_associations.inc deleted file mode 100644 index e8b01e0..0000000 --- a/api-ref/source/v2/bgpvpn-network_associations.inc +++ /dev/null @@ -1,157 +0,0 @@ -==================== -Network Associations -==================== - -Associating a BGPVPN to a Network can be done for both BGPVPN of type L2 and of -type L3. For type L3, the semantic is that all Subnets bound to the Network -will be interconnected with the BGP VPN (and thus between themselves). - -A given Network can be associated with multiple BGPVPNs. - -Associating or disassociating a BGPVPN to a Network is done by manipulating a -Network association API resource as a sub-resource of the BGPVPN resource: - -List Network Associations -========================= - -.. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations - -Lists network associations for a given BGP VPN. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network_associations: bgpvpn-network_associations - - id: bgpvpn-network_association_id - - network_id: bgpvpn-network_id - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/network_associations/network_association-list-response.json - :language: javascript - -Create Network Association -========================== - -.. rest_method:: POST /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations - -Creates a network association for a given BGP VPN - -Normal response codes: 201 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - network_association: bgpvpn-network_association - - network_id: bgpvpn-network_id - -Request Example ---------------- - -.. literalinclude:: samples/bgpvpn/network_associations/network_association-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network_association: bgpvpn-network_association - - id: bgpvpn-network_association_id - - network_id: bgpvpn-network_id - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/network_associations/network_association-create-response.json - :language: javascript - -Show Network Association details -================================ - -.. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations/{network_association_id} - -Shows details for a network association. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - network_association_id: bgpvpn-network_association_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network_association: bgpvpn-network_association - - id: bgpvpn-network_association_id - - network_id: bgpvpn-network_id - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/network_associations/network_association-show-response.json - :language: javascript - -Delete Network Association -========================== - -.. rest_method:: DELETE /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/network_associations/{network_association_id} - -Deletes a network association. - -Normal response codes: 204 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - network_association_id: bgpvpn-network_association_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/bgpvpn-overview.inc b/api-ref/source/v2/bgpvpn-overview.inc deleted file mode 100644 index 061e88f..0000000 --- a/api-ref/source/v2/bgpvpn-overview.inc +++ /dev/null @@ -1,91 +0,0 @@ -======================= -BGP - MPLS VPN Overview -======================= - -The ``bgpvpn`` extension implements the BGP VPN Interconnection API -which provides the ability to associate OpenStack networks and/or -routers with Multiprotocol Label Switching (MPLS) Virtual Private -Networks (VPNs) via Border Gateway Protocol (BGP) peering. BGP-MPLS VPNs -are commonly provided by telecommunications service providers to -customers in addition to or instead of Internet connectivity for Wide -Area Networking. This API enables the interconnection with these -WAN VPNs using *Route Targets* to indicate the desired network(s). - -On Route Targets -================ - -``route_targets``, ``import_targets``, ``export_targets`` attributes - -- The set of RTs used for import is the union of ``route_targets`` and ``import_targets``. -- The set of RTs used for export is the union of ``route_targets`` and ``export_targets``. - -At least one of ``route_targets``, ``import_targets`` or ``export_targets`` options will -typically be defined, but the API will not enforce that and all lists can be -empty. - -For instance, in the very typical use case where the BGP VPN uses a single -Route Target for both import and export, the route_targets parameter alone is -enough and will contain one Route target. - -On Route Distinguishers (RDs) -============================= - -The ``route_distinguishers`` parameter is optional and provides an -indication of the RDs that shall be used for routes announced for -Neutron networks. The contract is that when a list of RDs is specified, -the backend will use, for a said advertisement of a route, one of these -RDs. The motivation for having a list rather than only one RD is to -allow the support for multihoming a VPN prefix (typically for -resiliency, load balancing or anycast). A backend may or may not -support this behavior, and should report an API error in the latter -case. When not specified, the backend will use automatically-assigned -RDs (for instance : RDs derived from the Provider Edge (PE) IP). - -Valid strings for Route Distinguishers and Route Targets -======================================================== - -Valid strings for a Route Target or a Route Distinguisher are the following: - -- <2-byte AS#>:<32bit-number> -- <4-byte AS#>:<16bit-number> -- <4-byte IPv4>:<16bit-number> - -====================== -BGP - MPLS VPN Caveats -====================== - -Association constraints -======================= - -A given BGP VPN can be associated to multiple networks and/or multiple -routers. - -To avoid any ambiguity on semantics in particular the context of -processing associated to a router (e.g. NAT or FWaaS), if a given subnet -in a network is bound to a router, this API does not allow to both -associate the network to an L3 BGP VPN and the router to the same or to -a distinct L3 BGP VPN. - -Moreover, for BGP VPNs of type L3, there are possible cases of IP prefix -overlaps that can't be detected by the service plugin before BGP routes -are received, for which the behavior is left undefined by these -specifications (i.e. which of the overlapping routes is being used) and -will depend on the backend. This applies for both router associations -and network associations in the case where traffic is forwarded by a -router and the destination IP belongs both to a prefix of a BGP VPN -associated with the router or with the network originating the traffic, -and to a prefix of a subnet bound to the router; in such a case whether -the traffic will be delivered to the subnet or to the BGP VPN is not -defined by this API. - -Connectivity Impact inside Openstack Neutron -============================================ - -Creating two BGP VPNs with RTs resulting in both VPNs to exchange -routes, and then associating these two BGP VPNs to two networks, will -result in establishing interconnectivity between these two networks, -this simply being the result of applying BGP VPN Route Target semantics -(i.e. without making prefixes to OpenStack networks a particular case). - -This similarly applies to router associations. - diff --git a/api-ref/source/v2/bgpvpn-router_associations.inc b/api-ref/source/v2/bgpvpn-router_associations.inc deleted file mode 100644 index efc78de..0000000 --- a/api-ref/source/v2/bgpvpn-router_associations.inc +++ /dev/null @@ -1,159 +0,0 @@ -.. -*- rst -*- - -=================== -Router Associations -=================== - -Associating a BGPVPN to a Router can be done only for BGPVPN of type L3. The -semantic is that all Subnets bound to the Router will be interconnected with -the BGPVPN. - -A said Router can be associated with multiple BGPVPNs. - -Associating or disassociating a BGPVPN to a Router is done by manipulating a -Router association API resource as a sub-resource of the BGPVPN resource: - -List Router Associations -========================= - -.. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations - -Lists router associations for a given BGP VPN. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - router_associations: bgpvpn-router_associations - - id: bgpvpn-router_association_id - - router_id: bgpvpn-router_id - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/router_associations/router_association-list-response.json - :language: javascript - -Create Router Association -========================== - -.. rest_method:: POST /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations - -Creates a router association for a given BGP VPN - -Normal response codes: 201 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - router_association: bgpvpn-router_association - - router_id: bgpvpn-router_id - -Request Example ---------------- - -.. literalinclude:: samples/bgpvpn/router_associations/router_association-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - router_association: bgpvpn-router_association - - id: bgpvpn-router_association_id - - router_id: bgpvpn-router_id - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/router_associations/router_association-create-response.json - :language: javascript - -Show Router Association details -================================ - -.. rest_method:: GET /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations/{router_association_id} - -Shows details for a router association. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - router_association_id: bgpvpn-router_association_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - router_association: bgpvpn-router_association - - id: bgpvpn-router_association_id - - router_id: bgpvpn-router_id - - tenant_id: project_id - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/bgpvpn/router_associations/router_association-show-response.json - :language: javascript - -Delete Router Association -========================== - -.. rest_method:: DELETE /v2.0/bgpvpn/bgpvpns/{bgpvpn_id}/router_associations/{router_association_id} - -Deletes a router association. - -Normal response codes: 204 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - bgpvpn_id: bgpvpn-id-path - - router_association_id: bgpvpn-router_association_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/extensions.inc b/api-ref/source/v2/extensions.inc deleted file mode 100644 index c5f6906..0000000 --- a/api-ref/source/v2/extensions.inc +++ /dev/null @@ -1,83 +0,0 @@ -.. -*- rst -*- - -========== -Extensions -========== - - -Extensions introduce features and vendor-specific functionality to -the API. - -List extensions -=============== - -.. rest_method:: GET /v2.0/extensions - -Lists available extensions. - -Lists available Networking API v2.0 extensions and shows details -for an extension. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - extensions: extensions - - name: extension-name - - links: extension-links - - alias: extension-alias-body - - updated: extension-updated - - description: extension-description - -Response Example ----------------- - -.. literalinclude:: samples/extensions/extensions-list-response.json - :language: javascript - -Show extension details -====================== - -.. rest_method:: GET /v2.0/extensions/{alias} - -Shows details for an extension, by alias. -The response shows the extension name and its alias. To show -details for an extension, you specify the alias. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - alias: extensions-alias-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - extension: extension - - name: extension-name - - links: extension-links - - alias: extension-alias-body - - updated: extension-updated - - description: extension-description - -Response Example ----------------- - -.. literalinclude:: samples/extensions/extension-show-response.json - :language: javascript - diff --git a/api-ref/source/v2/fip64.inc b/api-ref/source/v2/fip64.inc deleted file mode 100644 index 6281bc2..0000000 --- a/api-ref/source/v2/fip64.inc +++ /dev/null @@ -1,14 +0,0 @@ -.. -*- rst -*- - -===== -FIP64 -===== - -.. note:: Currently this extension ``fip64`` is only available for networking-midonet. - -This extension ``fip64`` provides -`NAT64 `__ -functionality by allowing to associate IPv6 floating IPs to IPv4 fixed IPs. -(Without this extension, floating IPs are limited to IPv4.) - -This extension does not introduce any resources or attributes. diff --git a/api-ref/source/v2/firewall_log.inc b/api-ref/source/v2/firewall_log.inc deleted file mode 100644 index c1dbd4d..0000000 --- a/api-ref/source/v2/firewall_log.inc +++ /dev/null @@ -1,222 +0,0 @@ -.. -*- rst -*- - -=============== - Firewall Logs -=============== - -.. note:: Currently this extension ``logging-resource`` is only available for networking-midonet. - -Lists, shows information for, creates, updates and deletes firewall logs. - -List Firewall Logs -================== - -.. rest_method:: GET /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs - -Lists firewall logs. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - - fields: fields - -Response --------- - -.. rest_parameters:: parameters.yaml - - - firewall_logs: firewall_logs - - logging_resource_id: logging_resource_id-body - - id: firewall_log_id-body - - tenant_id: project_id - - project_id: project_id - - description: description - - fw_event: fw_event - - firewall_id: firewall_id-body - -Response Example ----------------- - -.. literalinclude:: samples/firewall_log/firewall_logs-list-response.json - :language: javascript - -Create Firewall Log -=================== - -.. rest_method:: POST /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs - -Creates a firewall log. - -Normal response codes: 200 - -Error response codes: 400, 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - - firewall_log: firewall_log - - tenant_id: project_id-request - - project_id: project_id-request - - description: description-request - - fw_event: fw_event-request - - firewall_id: firewall_id-body - -Request Example ---------------- - -.. literalinclude:: samples/firewall_log/firewall_log-create-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - firewall_log: firewall_log - - logging_resource_id: logging_resource_id-body - - id: firewall_log_id-body - - tenant_id: project_id - - project_id: project_id - - description: description - - fw_event: fw_event - - firewall_id: firewall_id-body - -Response Example ----------------- - -.. literalinclude:: samples/firewall_log/firewall_log-create-response.json - :language: javascript - -Show Firewall Log Details -========================= - -.. rest_method:: GET /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs/{firewall_log_id} - -Shows details for a firewall log. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - - firewall_log_id: firewall_log_id - - fields: fields - -Response --------- - -.. rest_parameters:: parameters.yaml - - - firewall_log: firewall_log - - logging_resource_id: logging_resource_id-body - - id: firewall_log_id-body - - tenant_id: project_id - - project_id: project_id - - description: description - - fw_event: fw_event - - firewall_id: firewall_id-body - -Response Example ----------------- - -.. literalinclude:: samples/firewall_log/firewall_log-show-response.json - :language: javascript - -Update Firewall Log -=================== - -.. rest_method:: PUT /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs/{firewall_log_id} - -Updates a firewall log. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - - firewall_log_id: firewall_log_id - - firewall_log: firewall_log - - description: description-request-put - - fw_event: fw_event-request-put - -Request Example ----------------- - -.. literalinclude:: samples/firewall_log/firewall_log-update-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - firewall_log: firewall_log - - logging_resource_id: logging_resource_id-body - - id: firewall_log_id-body - - tenant_id: project_id - - project_id: project_id - - description: description - - fw_event: fw_event - - firewall_id: firewall_id-body - -Response Example ----------------- - -.. literalinclude:: samples/firewall_log/firewall_log-update-response.json - :language: javascript - -Delete Firewall Log -=================== - -.. rest_method:: DELETE /v2.0/logging/logging_resources/{logging_resource_id}/firewall_logs/{firewall_log_id} - -Deletes a firewall log. - -Normal response codes: 202 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - - firewall_log_id: firewall_log_id - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/flavors.inc b/api-ref/source/v2/flavors.inc deleted file mode 100644 index 3401a87..0000000 --- a/api-ref/source/v2/flavors.inc +++ /dev/null @@ -1,541 +0,0 @@ -.. -*- rst -*- - -===================================================================== -Networking Flavors Framework v2.0 (CURRENT) (flavor, service_profile) -===================================================================== - -Extension that allows user selection of operator-curated flavors -during resource creation. - -Users can check if flavor available by performing a GET on the -/v2.0/extensions/flavors. If it is unavailable,there is an 404 error -response (itemNotFound). -Refer `Show extension details <#show-extension-details>`__ for more details. - -List flavors -============ - -.. rest_method:: GET /v2.0/flavors - -Lists all flavors visible to the project. - -The list can be empty. - -Standard query parameters are supported on the URI. Use the ``fields`` -query parameter to control which fields are returned in the response body. -Additionally, you can filter results by using query string parameters. -For information, see `Filtering and Column Selection -`__. If Neutron configuration supports -pagination by overriding allow_pagination = false, the ``marker`` query -parameter can set the last element id the client has seen and ``limit`` -set the maximum number of items to return. if Neutron configuration has -allow_sorting = true, ``sort_key`` and ``sort_dir`` pairs can be used -where sort direction is 'asc' or 'desc'. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - flavors: flavors - - id: flavor-id - - service_type: flavor-service_type - - name: flavor-name - - description: flavor-description - - enabled: flavor-enabled - - service_profiles: flavor-service_profiles - -Response Example ----------------- - -.. literalinclude:: samples/flavors/flavors-list-response.json - :language: javascript - -Create flavor -============= - -.. rest_method:: POST /v2.0/flavors - -Creates a flavor. - -This operation establishes a new flavor. - -The service_type to which the flavor applies is a required -parameter. The corresponding service plugin must have been -activated as part of the configuration. -Check `Service providers <#list-service-providers>`__ for how to see -currently loaded service types. Additionally the service plugin -needs to support the use of flavors. For example, the LOADBALANCERV2 -service type using the LBaaSv2 API currently supports Neutron service -flavors. - -Creation currently limited to administrators. Other users will -receive a ``Forbidden 403`` response code with a response body -NeutronError message expressing that creation is disallowed by -policy. - -Until one or more service profiles are associated with the flavor -by the operator, attempts to use the flavor during resource -creations will currently return a ``Not Found 404`` with a response -body that indicates no service profile could be found. - -If the API cannot fulfill the request due to insufficient data or -data that is not valid, the service returns the HTTP ``Bad Request -(400)`` response code with information about the failure in the -response body. Validation errors require that you correct the error -and submit the request again. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - flavor: flavor - - service_type: flavor-service_type - - enabled: flavor-enabled-request - - description: flavor-description-request - - name: flavor-name-request - -Request Example ---------------- - -.. literalinclude:: samples/flavors/flavor-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - flavor: flavor - - id: flavor-id - - service_type: flavor-service_type - - name: flavor-name - - description: flavor-description - - enabled: flavor-enabled - - service_profiles: flavor-service_profiles - -Response Example ----------------- - -.. literalinclude:: samples/flavors/flavor-create-response.json - :language: javascript - -Show flavor details -=================== - -.. rest_method:: GET /v2.0/flavors/{flavor_id} - -Shows details for a flavor. - -This operation returns a flavor object by ID. If you are not an -administrative user and the flavor object is not visible to your -project account, the service returns the HTTP ``Forbidden (403)`` -response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - flavor_id: flavor_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - flavor: flavor - - id: flavor-id - - service_type: flavor-service_type - - name: flavor-name - - description: flavor-description - - enabled: flavor-enabled - - service_profiles: flavor-service_profiles - -Response Example ----------------- - -.. literalinclude:: samples/flavors/flavor-show-response.json - :language: javascript - -Update flavor -============= - -.. rest_method:: PUT /v2.0/flavors/{flavor_id} - -Updates a flavor. - -The service_type cannot be updated as there may be associated -service profiles and consumers depending on the value. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - flavor_id: flavor_id - - flavor: flavor - - name: flavor-name-request - - description: flavor-description-request - - enabled: flavor-enabled-request - -Request Example ---------------- - -.. literalinclude:: samples/flavors/flavor-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - flavor: flavor - - id: flavor-id - - service_type: flavor-service_type - - name: flavor-name - - description: flavor-description - - enabled: flavor-enabled - - service_profiles: flavor-service_profiles - -Response Example ----------------- - -.. literalinclude:: samples/flavors/flavor-update-response.json - :language: javascript - -Delete flavor -============= - -.. rest_method:: DELETE /v2.0/flavors/{flavor_id} - -Deletes a flavor. - -Normal response codes: 204 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - flavor_id: flavor_id - -Response --------- - -No body content is returned on a successful DELETE. - -Associate flavor with a service profile -======================================= - -.. rest_method:: POST /v2.0/flavors/{flavor_id}/service_profiles - -Associate a flavor with a service profile. - -A flavor can be associated with more than one profile. - -Will return ``409 Conflict`` if association already exists. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - flavor_id: flavor_id - - service_profile: service_profile - - id: service_profile-id - - -Request Example ---------------- - -.. literalinclude:: samples/flavors/flavor-associate-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - service_profile: service_profile - - id: id - -Response Example ----------------- - -.. literalinclude:: samples/flavors/flavor-associate-response.json - :language: javascript - -Disassociate a flavor. -====================== - -.. rest_method:: DELETE /v2.0/flavors/{flavor_id}/service_profiles/{profile_id} - -Disassociate a flavor from a service profile. - -Normal response codes: 204 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - profile_id: profile_id - - flavor_id: flavor_id - -Response --------- - -No body content is returned on a successful disassociation. - -List service profiles -===================== - -.. rest_method:: GET /v2.0/service_profiles - -Lists all service profiles visible for the tenant account. - -The list can be empty. - -Standard query parameters are supported on the URI. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - service_profiles: service_profiles - - id: service_profile-id - - enabled: service_profile-enabled - - driver: service_profile-driver - - description: service_profile-description - - metainfo: service_profile-metainfo - -Response Example ----------------- - -.. literalinclude:: samples/flavors/service-profiles-list-response.json - :language: javascript - -Create service profile -====================== - -.. rest_method:: POST /v2.0/service_profiles - -Creates a service profile. - -This operation establishes a new service profile that can be -associated with one or more flavors. - -Either metadata or a driver is required. - -If a driver is specified but does not exist, call will return a -``Not found 404`` error with the response body explaining that the -driver could not be found. - -Creation currently limited to administrators. Other users will -receive a ``Forbidden 403`` response code with a response body -NeutronError message expressing that creation is disallowed by -policy. - -If the API cannot fulfill the request due to insufficient data or -data that is not valid, the service returns the HTTP ``Bad Request -(400)`` response code with information about the failure in the -response body. Validation errors require that you correct the error -and submit the request again. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - service_profile: service_profile - - description: service_profile-description-request - - metainfo: service_profile-metainfo-request - - enabled: service_profile-enabled-request - - driver: service_profile-driver-request - -Request Example ---------------- - -.. literalinclude:: samples/flavors/service-profile-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - service_profile: service_profile - - id: service_profile-id - - enabled: service_profile-enabled - - driver: service_profile-driver - - description: service_profile-description - - metainfo: service_profile-metainfo - -Response Example ----------------- - -.. literalinclude:: samples/flavors/service-profile-create-response.json - :language: javascript - -Show service profile details -============================ - -.. rest_method:: GET /v2.0/service_profiles/{profile_id} - -Shows details for a service profile. - -This operation returns a service profile object by ID. If you are -not an administrative user and the object is not visible to your -tenant account, the service returns the HTTP ``Forbidden (403)`` -response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - profile_id: profile_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - service_profile: service_profile - - id: service_profile-id - - enabled: service_profile-enabled - - driver: service_profile-driver - - description: service_profile-description - - metainfo: service_profile-metainfo - -Response Example ----------------- - -.. literalinclude:: samples/flavors/service-profile-show-response.json - :language: javascript - -Update service profile -====================== - -.. rest_method:: PUT /v2.0/service_profiles/{profile_id} - -Updates a service profile. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - profile_id: profile_id - - service_profile: service_profile - - enabled: service_profile-enabled-request - - driver: service_profile-driver-request - - description: service_profile-description-request - - metainfo: service_profile-metainfo-request - -Request Example ---------------- - -.. literalinclude:: samples/flavors/service-profile-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - service_profile: service_profile - - id: service_profile-id - - enabled: service_profile-enabled - - driver: service_profile-driver - - description: service_profile-description - - metainfo: service_profile-metainfo - -Response Example ----------------- - -.. literalinclude:: samples/flavors/service-profile-update-response.json - :language: javascript - -Delete service profile -====================== - -.. rest_method:: DELETE /v2.0/service_profiles/{profile_id} - -Deletes a service profile. - -Attempting to delete a service profile that is currently associated -with a flavor will return a ``Conflict 409`` with a response body -containing an in use message. - -Either metadata or a driver is required. - -Normal response codes: 204 - -Error response codes: 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - profile_id: profile_id - -Response --------- - -No body content is returned on a successful DELETE. diff --git a/api-ref/source/v2/floatingips.inc b/api-ref/source/v2/floatingips.inc deleted file mode 100644 index f864b9e..0000000 --- a/api-ref/source/v2/floatingips.inc +++ /dev/null @@ -1,328 +0,0 @@ -========================== -Floating IPs (floatingips) -========================== - -List floating IPs -================= - -.. rest_method:: GET /v2.0/floatingips - -Lists floating IPs visible to the user. - -Default policy settings return only the floating IPs owned by the user's -project, unless the user has admin role. - -This example request lists floating IPs in JSON format: - -:: - - GET /v2.0/floatingips - Accept: application/json - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - floatingips: floatingips - - id: floatingip-id - - router_id: floatingip-router_id - - status: floatingip-status - - tenant_id: project_id - - project_id: project_id - - created_at: created_at_resource - - updated_at: updated_at_resource - - revision_number: revision_number - - description: description - - floating_network_id: floating_network_id - - fixed_ip_address: floatingip-fixed_ip_address - - floating_ip_address: floating_ip_address - - port_id: floatingip-port_id - -Response Example ----------------- - -.. literalinclude:: samples/floatingips/floating-ips-list-response.json - :language: javascript - -Create floating IP -================== - -.. rest_method:: POST /v2.0/floatingips - -Creates a floating IP, and, if you specify port information, associates the floating IP with an internal port. - -To associate the floating IP with an internal port, specify the -port ID attribute in the request body. If you do not specify a -port ID in the request, you can issue a PUT request instead of a -POST request. - -Default policy settings enable only administrative users to set -floating IP addresses and some non-administrative users might -require a floating IP address. If you do not specify a floating IP -address in the request, the operation automatically allocates one. - -By default, this operation associates the floating IP address with -a single fixed IP address that is configured on an OpenStack -Networking port. If a port has multiple IP addresses, you must -specify the ``fixed_ip_address`` attribute in the request body to -associate a fixed IP address with the floating IP address. - -You can create floating IPs on only external networks. When you -create a floating IP, you must specify the ID of the network on -which you want to create the floating IP. Alternatively, you can -create a floating IP on a subnet in the external network, based on -the costs and quality of that subnet. - -You must configure an IP address with the internal OpenStack -Networking port that is associated with the floating IP address. - -The operation returns the ``Bad Request (400)`` response code for one of -reasons: - - - The network is not external, such as ``router:external=False``. - - - The internal OpenStack Networking port is not associated with the - floating IP address. - - - The requested floating IP address does not fall in the subnet - range for the external network. - - - The fixed IP address is not valid. - -If the port ID is not valid, this operation returns ``404`` response code. - -The operation returns the ``Conflict (409)`` response code for one of -reasons: - - - The requested floating IP address is already in use. - - - The internal OpenStack Networking port and fixed IP address are - already associated with another floating IP. - -Normal response codes: 201 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - floatingip: floatingip - - tenant_id: project_id - - project_id: project_id - - floating_network_id: floating_network_id - - fixed_ip_address: floatingip-fixed_ip_address-request - - floating_ip_address: floating_ip_address-request - - port_id: floatingip-port_id-post-request - - subnet_id: floatingip-subnet_id - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/floatingips/floatingip-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - floatingip: floatingip - - router_id: floatingip-router_id - - status: floatingip-status - - description: description - - tenant_id: project_id - - created_at: created_at_resource - - updated_at: updated_at_resource - - revision_number: revision_number - - project_id: project_id - - floating_network_id: floating_network_id - - fixed_ip_address: floatingip-fixed_ip_address - - floating_ip_address: floating_ip_address - - port_id: floatingip-port_id - - id: floatingip-id - -Response Example ----------------- - -.. literalinclude:: samples/floatingips/floatingip-create-response.json - :language: javascript - -Show floating IP details -======================== - -.. rest_method:: GET /v2.0/floatingips/{floatingip_id} - -Shows details for a floating IP. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. For information, see `Filtering and -Column Selection `__. - -This example request shows details for a floating IP in JSON -format. This example also filters the result by the -``fixed_ip_address`` and ``floating_ip_address`` fields. - -:: - - GET /v2.0/floatingips/{floatingip_id}?fields=fixed_ip_address - & - fields=floating_ip_address - Accept: application/json - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - floatingip_id: floatingip-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - floatingip: floatingip - - router_id: floatingip-router_id - - status: floatingip-status - - description: description - - tenant_id: project_id - - created_at: created_at_resource - - updated_at: updated_at_resource - - revision_number: revision_number - - project_id: project_id - - floating_network_id: floating_network_id - - fixed_ip_address: floatingip-fixed_ip_address - - floating_ip_address: floating_ip_address - - port_id: floatingip-port_id - - id: floatingip-id - -Response Example ----------------- - -.. literalinclude:: samples/floatingips/floatingip-show-response.json - :language: javascript - -Update floating IP -================== - -.. rest_method:: PUT /v2.0/floatingips/{floatingip_id} - -Updates a floating IP and its association with an internal port. - -The association process is the same as the process for the create -floating IP operation. - -To disassociate a floating IP from a port, set the ``port_id`` -attribute to null or omit it from the request body. - -This example updates a floating IP: - -:: - - PUT /v2.0/floatingips/{floatingip_id} Accept: application/json - -Depending on the request body that you submit, this request -associates a port with or disassociates a port from a floating IP. - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - floatingip: floatingip - - floatingip_id: floatingip-id-path - - port_id: floatingip-port_id-put-request - - fixed_ip_address: floatingip-fixed_ip_address-request - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/floatingips/floatingip-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - floatingip: floatingip - - router_id: floatingip-router_id - - status: floatingip-status - - tenant_id: project_id - - project_id: project_id - - floating_network_id: floating_network_id - - fixed_ip_address: floatingip-fixed_ip_address - - floating_ip_address: floating_ip_address - - port_id: floatingip-port_id - - id: floatingip-id - - created_at: created_at_resource - - updated_at: updated_at_resource - - revision_number: revision_number - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/floatingips/floatingip-update-response.json - :language: javascript - -Delete floating IP -================== - -.. rest_method:: DELETE /v2.0/floatingips/{floatingip_id} - -Deletes a floating IP and, if present, its associated port. - -This example deletes a floating IP: - -:: - - DELETE /v2.0/floatingips/{floatingip_id} Accept: application/json - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - floatingip_id: floatingip-id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/fwaas-v2.inc b/api-ref/source/v2/fwaas-v2.inc deleted file mode 100644 index f1fc949..0000000 --- a/api-ref/source/v2/fwaas-v2.inc +++ /dev/null @@ -1,848 +0,0 @@ -.. -*- rst -*- - -================================================================================ -FWaaS v2.0 (CURRENT) (fwaas, firewall_groups, firewall_policies, firewall_rules) -================================================================================ - -Use the Firewall-as-a-Service (FWaaS) v2.0 extension to deploy -firewall groups to protect your networks. - -The FWaaS extension enables you to: - -- Apply firewall rules on traffic entering and leaving project - networks. - -- Apply TCP, UDP, ICMP, or protocol-agnostic rules. - -- Create and share firewall policies that hold an ordered collection - of firewall rules. - -- Audit firewall rules and policies. - -This extension introduces the following resources: - -- ``firewall_group``. A logical firewall resource that a project can - create and manage. A firewall group can have a firewall policy for - ingress traffic and/or a firewall policy for egress traffic. - -- ``firewall_policy``. An ordered collection of firewall rules. You - can share a firewall policy across projects. You can include a - firewall policy as part of an audit workflow so that an - authorized relevant entity can audit the firewall policy. This - entity can differ from the user who created, or the projects - that use, the firewall policy. - -- ``firewall_rule``. A collection of attributes, such as source and - destination ports, source and destination IP addresses, protocol, - and IP version. These attributes define match criteria and an - action to take, such as allow, reject, or deny, on matched data - traffic. - -List firewall groups -==================== - -.. rest_method:: GET /v2.0/fwaas/firewall_groups - -Lists all firewall groups. - -The list might be empty. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_groups: firewall_groups_object - - admin_state_up: firewall_group_admin_state_up-body-required - - description: firewall_group_description-body-required - - egress_firewall_policy_id: egress_firewall_policy_id-body-required - - id: firewall_group_id-body-required - - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - - name: firewall_group_name-body-required - - ports: firewall_group_ports-body-required - - project_id: project_id-body-required - - shared: firewall_group_shared-body-required - - status: firewall_group_status-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-groups-list-response.json - :language: javascript - -Show firewall group details -=========================== - -.. rest_method:: GET /v2.0/fwaas/firewall_groups/{firewall_group_id} - -Shows details for a firewall group. - -If the user is not an administrative user and the firewall group -object does not belong to the project, this call returns the -``FirewallGroupNotFound (404)`` response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_group_id: firewall_group_id-path-required - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_group: firewall_group_object - - admin_state_up: firewall_group_admin_state_up-body-required - - description: firewall_group_description-body-required - - egress_firewall_policy_id: egress_firewall_policy_id-body-required - - id: firewall_group_id-body-required - - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - - name: firewall_group_name-body-required - - ports: firewall_group_ports-body-required - - project_id: project_id-body-required - - shared: firewall_group_shared-body-required - - status: firewall_group_status-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-group-show-response.json - :language: javascript - -Create firewall group -===================== - -.. rest_method:: POST /v2.0/fwaas/firewall_groups - -Creates a firewall group. - -The firewall group may be associated with an ingress firewall policy -and/or an egress firewall policy. - -If ``admin_state_up`` is ``false``, the firewall group will block all -traffic. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_group: firewall_group_object - - admin_state_up: firewall_group_admin_state_up-body-optional - - description: firewall_group_description-body-optional - - egress_firewall_policy_id: egress_firewall_policy_id-body-optional - - ingress_firewall_policy_id: ingress_firewall_policy_id-body-optional - - name: firewall_group_name-body-optional - - ports: firewall_group_ports-body-optional - - project_id: project_id-body-optional - - shared: firewall_group_shared-body-optional - - status: firewall_group_status-body-optional - - tenant_id: project_id-body-optional - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-group-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_group: firewall_group_object - - admin_state_up: firewall_group_admin_state_up-body-required - - description: firewall_group_description-body-required - - egress_firewall_policy_id: egress_firewall_policy_id-body-required - - id: firewall_group_id-body-required - - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - - name: firewall_group_name-body-required - - ports: firewall_group_ports-body-required - - project_id: project_id-body-required - - shared: firewall_group_shared-body-required - - status: firewall_group_status-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-group-create-response.json - :language: javascript - -Update firewall group -===================== - -.. rest_method:: PUT /v2.0/fwaas/firewall_groups/{firewall_group_id} - -Updates a firewall group. - -The firewall group cannot be updated if its status is a PENDING_* status. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_group_id: firewall_group_id-path-required - - firewall_group: firewall_group_object - - admin_state_up: firewall_group_admin_state_up-body-optional - - description: firewall_group_description-body-optional - - egress_firewall_policy_id: egress_firewall_policy_id-body-optional - - ingress_firewall_policy_id: ingress_firewall_policy_id-body-optional - - name: firewall_group_name-body-optional - - ports: firewall_group_ports-body-optional - - shared: firewall_group_shared-body-optional - - status: firewall_group_status-body-optional - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-group-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_group: firewall_group_object - - admin_state_up: firewall_group_admin_state_up-body-required - - description: firewall_group_description-body-required - - egress_firewall_policy_id: egress_firewall_policy_id-body-required - - id: firewall_group_id-body-required - - ingress_firewall_policy_id: ingress_firewall_policy_id-body-required - - name: firewall_group_name-body-required - - ports: firewall_group_ports-body-required - - project_id: project_id-body-required - - shared: firewall_group_shared-body-required - - status: firewall_group_status-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-group-update-response.json - :language: javascript - -Delete firewall group -===================== - -.. rest_method:: DELETE /v2.0/fwaas/firewall_groups/{firewall_group_id} - -Deletes a firewall group. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_group_id: firewall_group_id-path-required - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List firewall policies -====================== - -.. rest_method:: GET /v2.0/fwaas/firewall_policies - -Lists all firewall policies. - -The list might be empty. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_policies: firewall_policies_object - - audited: firewall_policy_audited-body-required - - description: firewall_policy_description-body-required - - id: firewall_policy_id-body-required - - firewall_rules: firewall_rules-body-required - - name: firewall_policy_name-body-required - - project_id: project_id-body-required - - shared: firewall_policy_shared-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-policies-list-response.json - :language: javascript - -Show firewall policy details -============================ - -.. rest_method:: GET /v2.0/fwaas/firewall_policies/{firewall_policy_id} - -Shows details of a firewall policy. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path-required - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - audited: firewall_policy_audited-body-required - - description: firewall_policy_description-body-required - - firewall_rules: firewall_rules-body-required - - id: firewall_policy_id-body-required - - name: firewall_policy_name-body-required - - project_id: project_id-body-required - - shared: firewall_policy_shared-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-show-response.json - :language: javascript - -Create firewall policy -====================== - -.. rest_method:: POST /v2.0/fwaas/firewall_policies - -Creates a firewall policy. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy: firewall_policy_object - - audited: firewall_policy_audited-body-optional - - description: firewall_policy_description-body-optional - - firewall_rules: firewall_rules-body-optional - - name: firewall_policy_name-body-optional - - project_id: project_id-body-optional - - shared: firewall_policy_shared-body-optional - - tenant_id: project_id-body-optional - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy: firewall_policy_object - - audited: firewall_policy_audited-body-required - - description: firewall_policy_description-body-required - - firewall_rules: firewall_rules-body-required - - id: firewall_policy_id-body-required - - name: firewall_policy_name-body-required - - project_id: project_id-body-required - - shared: firewall_policy_shared-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-create-response.json - :language: javascript - -Update firewall policy -====================== - -.. rest_method:: PUT /v2.0/fwaas/firewall_policies/{firewall_policy_id} - -Updates a firewall policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path-required - - firewall_policy: firewall_policy_object - - audited: firewall_policy_audited-body-optional - - description: firewall_policy_description-body-optional - - firewall_rules: firewall_rules-body-optional - - name: firewall_policy_name-body-optional - - project_id: project_id-body-optional - - shared: firewall_policy_shared-body-optional - - tenant_id: project_id-body-optional - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy: firewall_policy_object - - audited: firewall_policy_audited-body-required - - description: firewall_policy_description-body-required - - firewall_rules: firewall_rules-body-required - - id: firewall_policy_id-body-required - - name: firewall_policy_name-body-required - - shared: firewall_policy_shared-body-required - - project_id: project_id-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-update-response.json - :language: javascript - -Delete firewall policy -====================== - -.. rest_method:: DELETE /v2.0/fwaas/firewall_policies/{firewall_policy_id} - -Deletes a firewall policy. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path-required - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List firewall rules -=================== - -.. rest_method:: GET /v2.0/fwaas/firewall_rules - -Lists all firewall rules. - -The list might be empty. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rules: firewall_rules_object - - action: firewall_rule_action-body-required - - description: firewall_rule_description-body-required - - destination_ip_address: firewall_rule_destination_ip_address-body-required - - destination_port: firewall_rule_destination_port-body-required - - enabled: firewall_rule_enabled-body-required - - firewall_policy_id: firewall_policy_id-body-required - - id: firewall_rule_id-body-required - - ip_version: firewall_rule_ip_version-body-required - - name: firewall_rule_name-body-required - - project_id: project_id-body-required - - protocol: firewall_rule_protocol-body-required - - shared: firewall_rule_shared-body-required - - source_ip_address: firewall_rule_source_ip_address-body-required - - source_port: firewall_rule_source_port-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-rules-list-response.json - :language: javascript - -Show firewall rule details -========================== - -.. rest_method:: GET /v2.0/fwaas/firewall_rules/{firewall_rule_id} - -Shows details for a firewall rule. - -If the user is not an administrative user and the firewall rule -object does not belong to the project, this call returns the -``Forbidden (403)`` response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule_id: firewall_rule_id-path-required - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule_object - - action: firewall_rule_action-body-required - - description: firewall_rule_description-body-required - - destination_ip_address: firewall_rule_destination_ip_address-body-required - - destination_port: firewall_rule_destination_port-body-required - - enabled: firewall_rule_enabled-body-required - - firewall_policy_id: firewall_policy_id-body-required - - id: firewall_rule_id-body-required - - ip_version: firewall_rule_ip_version-body-required - - name: firewall_rule_name-body-required - - project_id: project_id-body-required - - protocol: firewall_rule_protocol-body-required - - shared: firewall_rule_shared-body-required - - source_ip_address: firewall_rule_source_ip_address-body-required - - source_port: firewall_rule_source_port-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-rule-show-response.json - :language: javascript - -Create firewall rule -==================== - -.. rest_method:: POST /v2.0/fwaas/firewall_rules - -Creates a firewall rule. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule_object - - action: firewall_rule_action-body-optional - - description: firewall_rule_description-body-optional - - destination_ip_address: firewall_rule_destination_ip_address-body-optional - - destination_port: firewall_rule_destination_port-body-optional - - enabled: firewall_rule_enabled-body-optional - - ip_version: firewall_rule_ip_version-body-optional - - name: firewall_rule_name-body-optional - - project_id: project_id-body-optional - - protocol: firewall_rule_protocol-body-optional - - shared: firewall_rule_shared-body-optional - - source_ip_address: firewall_rule_source_ip_address-body-optional - - source_port: firewall_rule_source_port-body-optional - - tenant_id: project_id-body-optional - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-rule-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule_object - - action: firewall_rule_action-body-required - - description: firewall_rule_description-body-required - - destination_ip_address: firewall_rule_destination_ip_address-body-required - - destination_port: firewall_rule_destination_port-body-required - - enabled: firewall_rule_enabled-body-required - - firewall_policy_id: firewall_policy_id-body-required - - id: firewall_rule_id-body-required - - ip_version: firewall_rule_ip_version-body-required - - name: firewall_rule_name-body-required - - project_id: project_id-body-required - - protocol: firewall_rule_protocol-body-required - - shared: firewall_rule_shared-body-required - - source_ip_address: firewall_rule_source_ip_address-body-required - - source_port: firewall_rule_source_port-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-rule-create-response.json - :language: javascript - -Update firewall rule -==================== - -.. rest_method:: PUT /v2.0/fwaas/firewall_rules/{firewall_rule_id} - -Updates a firewall rule. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule_id: firewall_rule_id-path-required - - firewall_rule: firewall_rule_object - - action: firewall_rule_action-body-optional - - description: firewall_rule_description-body-optional - - destination_ip_address: firewall_rule_destination_ip_address-body-optional - - destination_port: firewall_rule_destination_port-body-optional - - enabled: firewall_rule_enabled-body-optional - - firewall_policy_id: firewall_policy_id-body-required - - ip_version: firewall_rule_ip_version-body-optional - - name: firewall_rule_name-body-optional - - project_id: project_id-body-optional - - protocol: firewall_rule_protocol-body-optional - - shared: firewall_rule_shared-body-optional - - source_ip_address: firewall_rule_source_ip_address-body-optional - - source_port: firewall_rule_source_port-body-optional - - tenant_id: project_id-body-optional - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-rule-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule_object - - action: firewall_rule_action-body-required - - description: firewall_rule_description-body-required - - destination_ip_address: firewall_rule_destination_ip_address-body-required - - destination_port: firewall_rule_destination_port-body-required - - enabled: firewall_rule_enabled-body-required - - firewall_policy_id: firewall_policy_id-body-required - - id: firewall_rule_id-body-required - - ip_version: firewall_rule_ip_version-body-required - - name: firewall_rule_name-body-required - - project_id: project_id-body-required - - protocol: firewall_rule_protocol-body-required - - shared: firewall_rule_shared-body-required - - source_ip_address: firewall_rule_source_ip_address-body-required - - source_port: firewall_rule_source_port-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-rule-update-response.json - :language: javascript - -Delete firewall rule -==================== - -.. rest_method:: DELETE /v2.0/fwaas/firewall_rules/{firewall_rule_id} - -Deletes a firewall rule. -samples/firewall-v2/firewall-policy-create-response.json - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule_id: firewall_rule_id-path-required - -Insert rule into a firewall policy -================================== - -.. rest_method:: PUT /v2.0/fwaas/firewall_policies/{firewall_policy_id}/insert_rule - -Insert firewall rule into a policy. - -A firewall_rule_id is inserted relative to the position of the -firewall_rule_id set in ``insert_before`` or ``insert_after``. If -``insert_before`` is set, ``insert_after`` is ignored. If both -``insert_before`` and ``insert_after`` are not set, the new -firewall_rule_id is inserted as the first rule of the policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path-required - - firewall_rule_id: firewall_rule_id-body-required - - insert_after: firewall_rule_insert_after-body-required - - insert_before: firewall_rule_insert_before-body-required - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-insert-rule-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - audited: firewall_policy_audited-body-required - - description: firewall_policy_description-body-required - - firewall_rules: firewall_rules-body-required - - id: firewall_policy_id-body-required - - name: firewall_policy_name-body-required - - project_id: project_id-body-required - - shared: firewall_policy_shared-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-insert-rule-response.json - :language: javascript - -Remove rule from firewall policy -================================ - -.. rest_method:: PUT /v2.0/fwaas/firewall_policies/{firewall_policy_id}/remove_rule - -Remove firewall rule from a policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path-required - - firewall_rule_id: firewall_rule_id-body-required - -Request Example ---------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-remove-rule-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - audited: firewall_policy_audited-body-required - - description: firewall_policy_description-body-required - - firewall_rules: firewall_rules-body-required - - id: firewall_policy_id-body-required - - name: firewall_policy_name-body-required - - project_id: project_id-body-required - - shared: firewall_policy_shared-body-required - - tenant_id: project_id-body-required - -Response Example ----------------- - -.. literalinclude:: samples/firewall-v2/firewall-policy-remove-rule-response.json - :language: javascript - diff --git a/api-ref/source/v2/fwaas.inc b/api-ref/source/v2/fwaas.inc deleted file mode 100644 index 26addf0..0000000 --- a/api-ref/source/v2/fwaas.inc +++ /dev/null @@ -1,817 +0,0 @@ -========================================================================== -FWaaS v1.0 (DEPRECATED) (fw, firewalls, firewall_policies, firewall_rules) -========================================================================== - -.. note:: - - While FWaaS v1.0 is still maintained, new features will be - implemented in FWaaS v2.0 API. - -Use the Firewall-as-a-Service (FWaaS) v1.0 extension to deploy -firewalls to protect your networks. - -The FWaaS extension enables you to: - -- Apply firewall rules on traffic entering and leaving project - networks. - -- Apply TCP, UDP, ICMP, or protocol-agnostic rules. - -- Create and share firewall policies that hold an ordered collection - of the firewall rules. - -- Audit firewall rules and policies. - -This extension introduces these resources: - -- ``firewall``. A logical firewall resource that a project can - instantiate and manage. A firewall can have one firewall policy. - -- ``firewall_policy``. An ordered collection of firewall rules. You - can share a firewall policy across projects. You can include a - firewall policy as part of an audit workflow so that an - authorized relevant entity can audit the firewall policy. This - entity can differ from the user who created, or the projects - that use, the firewall policy. - -- ``firewall_rule``. A collection of attributes, such as ports and - IP addresses. These attributes define match criteria and an - action to take, such as allow or deny, on matched data traffic. - -List firewall policies -====================== - -.. rest_method:: GET /v2.0/fw/firewall_policies - -Lists all firewall policies. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - tenant_id: project_id - - firewall_policies: firewall_policies - - audited: audited - - description: description - - firewall_rules: firewall_rules - - id: firewall_policy_id-body - - name: name - - shared: shared-response - - project_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-policies-list-response.json - :language: javascript - -Create firewall policy -====================== - -.. rest_method:: POST /v2.0/fw/firewall_policies - -Creates a firewall policy. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy: firewall_policy - - firewall_rules_id: firewall_rules_id - - name: name - - tenant_id: project_id-request - - project_id: project_id-request - - shared: shared - - audited: audited - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-policy-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy: firewall_policy - - name: name - - firewall_rules: firewall_rules - - tenant_id: project_id - - project_id: project_id - - audited: audited - - shared: shared-response - - id: firewall_policy_id-body - - description: description - -Show firewall policy details -============================ - -.. rest_method:: GET /v2.0/fw/firewall_policies/{firewall_policy_id} - -Shows details for a firewall policy. - -If the user is not an administrative user and the firewall policy -object does not belong to the project, this call returns the -``Forbidden (403)`` response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy: firewall_policy - - tenant_id: project_id - - project_id: project_id - - audited: audited - - description: description - - firewall_rules: firewall_rules - - id: firewall_policy_id-body - - name: name - - shared: shared-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-policy-show-response.json - :language: javascript - -Update firewall policy -====================== - -.. rest_method:: PUT /v2.0/fw/firewall_policies/{firewall_policy_id} - -Updates a firewall policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path - - firewall_rule: firewall_rule - - shared: shared - - audited: audited - - description: description-request - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-policy-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy: firewall_policy - - project_id: project_id - - audited: audited - - description: description - - firewall_rules: firewall_rules - - id: firewall_policy_id-body - - name: name - - shared: shared-response - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-policy-update-response.json - :language: javascript - -Delete firewall policy -====================== - -.. rest_method:: DELETE /v2.0/fw/firewall_policies/{firewall_policy_id} - -Deletes a firewall policy. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -Insert rule into a firewall policy -================================== - -.. rest_method:: PUT /v2.0/fw/firewall_policies/{firewall_policy_id}/insert_rule - -Insert firewall rule into a policy. - -A firewall_rule_id is inserted relative to the position of the -firewall_rule_id set in ``insert_before`` or ``insert_after``. If -``insert_before`` is set, ``insert_after`` is ignored. If both -``insert_before`` and ``insert_after`` are not set, the new -firewall_rule_id is inserted at the top of the policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path - - firewall_rule_id: firewall_rule_id-body - - insert_after: insert_after - - insert_before: insert_before - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-policy-insert-rule-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - audited: audited - - description: description - - firewall_list: firewall_list - - firewall_rules: firewall_rules - - tenant_id: project_id - - project_id: project_id - - id: firewall_policy_id-body - - name: name - - shared: shared-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-policy-insert-rule-response.json - :language: javascript - -Remove rule from firewall policy -================================ - -.. rest_method:: PUT /v2.0/fw/firewall_policies/{firewall_policy_id}/remove_rule - -Remove firewall rule from a policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_policy_id: firewall_policy_id-path - - firewall_rule_id: firewall_rule_id-body - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-policy-remove-rule-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - tenant_id: project_id - - project_id: project_id - - audited: audited - - description: description - - firewall_list: firewall_list - - firewall_rules: firewall_rules - - id: firewall_id-body - - name: name - - shared: shared-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-policy-remove-rule-response.json - :language: javascript - -List firewall rules -=================== - -.. rest_method:: GET /v2.0/fw/firewall_rules - -Lists all firewall rules. - -The list might be empty. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule - - action: action-response - - description: description - - tenant_id: project_id - - project_id: project_id - - destination_ip_address: destination_ip_address-response - - destination_port: destination_port-response - - enabled: enabled-response - - firewall_policy_id: firewall_policy_id-body - - id: firewall_id-body - - ip_version: ip_version-response - - name: name - - position: position - - protocol: protocol-response - - shared: shared-response - - source_ip_address: source_ip_address - - source_port: source_port-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-rules-list-response.json - :language: javascript - -Create firewall rule -==================== - -.. rest_method:: POST /v2.0/fw/firewall_rules - -Creates a firewall rule. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule - - action: action - - destination_port: destination_port - - enabled: enabled - - description: description-request - - tenant_id: project_id-request - - project_id: project_id-request - - enabled: enabled - - name: name - - protocol: protocol - - ip_version: ip_version - - destination_ip_address: destination_ip_address - - source_port: source_port - - shared: shared - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-rule-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule - - action: action-response - - description: description - - tenant_id: project_id - - project_id: project_id - - destination_ip_address: destination_ip_address-response - - destination_port: destination_port-response - - enabled: enabled-response - - firewall_policy_id: firewall_policy_id-body - - id: firewall_id-body - - ip_version: ip_version-response - - name: name - - position: position - - protocol: protocol-response - - shared: shared-response - - source_ip_address: source_ip_address - - source_port: source_port-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-rule-create-response.json - :language: javascript - -Show firewall rule details -========================== - -.. rest_method:: GET /v2.0/fw/firewall_rules/{firewall_rule_id} - -Shows details for a firewall rule. - -If the user is not an administrative user and the firewall rule -object does not belong to the project, this call returns the -``Forbidden (403)`` response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule_id: firewall_rule_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule - - action: action-response - - description: description - - tenant_id: project_id - - project_id: project_id - - destination_ip_address: destination_ip_address-response - - destination_port: destination_port-response - - enabled: enabled-response - - firewall_policy_id: firewall_policy_id - - id: firewall_rule_id-body - - ip_version: ip_version-response - - name: name - - position: position - - protocol: protocol-response - - shared: shared-response - - source_ip_address: source_ip_address - - source_port: source_port-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-rule-show-response.json - :language: javascript - -Update firewall rule -==================== - -.. rest_method:: PUT /v2.0/fw/firewall_rules/{firewall_rule_id} - -Updates a firewall rule. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule_id: firewall_rule_id - - firewall_rule: firewall_rule - - shared: shared - - description: description-request - - tenant_id: project_id-request - - project_id: project_id-request - - enabled: enabled - - ip_version: ip_version - - destination_ip_address: destination_ip_address - - source_port: source_port - - action: action - - protocol: protocol - - destination_port: destination_port - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-rule-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule: firewall_rule - - action: action-response - - description: description - - source_ip_address: source_ip_address - - tenant_id: project_id - - project_id: project_id - - enabled: enabled - - protocol: protocol - - source_port: source_port - - ip_version: ip_version - - destination_ip_address: destination_ip_address-response - - destination_port: destination_port-response - - enabled: enabled-response - - firewall_policy_id: firewall_policy_id - - id: firewall_rule_id-body - - ip_version: ip_version-response - - name: name - - position: position - - protocol: protocol-response - - shared: shared-response - - source_ip_address: source_ip_address - - source_port: source_port-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-rule-update-response.json - :language: javascript - -Delete firewall rule -==================== - -.. rest_method:: DELETE /v2.0/fw/firewall_rules/{firewall_rule_id} - -Deletes a firewall rule. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_rule_id: firewall_rule_id - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List firewalls -============== - -.. rest_method:: GET /v2.0/fw/firewalls - -Lists all firewalls. - -The list might be empty. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewalls: firewalls - - admin_state_up: admin_state_up - - tenant_id: project_id - - project_id: project_id - - description: description - - firewall_policy_id: firewall_policy_id-body - - id: firewall_id-body - - name: name - - status: firewall-status - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewalls-list-response.json - :language: javascript - -Create firewall -=============== - -.. rest_method:: POST /v2.0/fw/firewalls - -Creates a firewall. - -The firewall must be associated with a firewall policy. - -If ``admin_state_up`` is ``false``, the firewall would block all -traffic. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall: firewall - - admin_state_up: admin_state_up - - firewall_policy_id: firewall_policy_id-body - - description: description-request - - name: name - - router_ids: router_ids - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall: firewall - - tenant_id: project_id - - project_id: project_id - - admin_state_up: admin_state_up - - description: description - - firewall_policy_id: firewall_policy_id-body - - id: firewall_id-body - - name: name - - status: firewall-status - - router_ids: router_ids-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-create-response.json - :language: javascript - -Show firewall details -===================== - -.. rest_method:: GET /v2.0/fw/firewalls/{firewall_id} - -Shows details for a firewall. - -If the user is not an administrative user and the firewall object -does not belong to the project, this call returns the -``Forbidden (403)`` response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_id: firewall_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall: firewall - - tenant_id: project_id - - project_id: project_id - - admin_state_up: admin_state_up - - description: description - - status: firewall-status - - firewall_policy_id: firewall_policy_id - - id: firewall_rule_id-body - - name: name - - router_ids: router_ids-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-show-response.json - :language: javascript - -Update firewall -=============== - -.. rest_method:: PUT /v2.0/fw/firewalls/{firewall_id} - -Updates a firewall. - -To update a service, the service status cannot be a ``PENDING_*`` -status. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_id: firewall_id - - firewall: firewall - - admin_state_up: admin_state_up - - description: description-request - - firewall_policy_id: firewall_policy_id-body - - name: name - - router_ids: router_ids - -Request Example ---------------- - -.. literalinclude:: samples/firewalls/firewall-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - firewall: firewall - - tenant_id: project_id - - project_id: project_id - - admin_state_up: admin_state_up - - description: description - - status: firewall-status - - firewall_policy_id: firewall_policy_id-body - - id: firewall_id-body - - name: name - - router_ids: router_ids-response - -Response Example ----------------- - -.. literalinclude:: samples/firewalls/firewall-update-response.json - :language: javascript - -Delete firewall -=============== - -.. rest_method:: DELETE /v2.0/fw/firewalls/{firewall_id} - -Deletes a firewall. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - firewall_id: firewall_id - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/index.rst b/api-ref/source/v2/index.rst deleted file mode 100644 index 2123447..0000000 --- a/api-ref/source/v2/index.rst +++ /dev/null @@ -1,81 +0,0 @@ -:tocdepth: 2 - - -################### -Networking API v2.0 -################### - -.. rest_expand_all:: - -#################### -General API Overview -#################### -.. include:: intro.inc -.. include:: versions.inc -.. include:: extensions.inc -################## -Layer 2 Networking -################## -.. include:: networks.inc -.. include:: ports.inc -.. include:: segments.inc -.. include:: trunk.inc -.. include:: trunk-details.inc -################## -Layer 3 Networking -################## -.. include:: floatingips.inc -.. include:: routers.inc -.. include:: subnetpools.inc -.. include:: subnets.inc -######## -Security -######## -.. include:: fwaas.inc -.. include:: fwaas-v2.inc -.. include:: rbac-policy.inc -.. include:: security-group-rules.inc -.. include:: security-groups.inc -.. include:: vpnaas.inc -################### -Resource Management -################### -.. include:: flavors.inc -.. include:: metering.inc -.. include:: network-ip-availability.inc -.. include:: quotas.inc -.. include:: service-providers.inc -.. include:: tags.inc -################## -Quality of Service -################## -.. include:: qos.inc -########################## -Load Balancer as a Service -########################## -.. include:: lbaas-v1.inc -.. include:: lbaas-v2.inc -##################################### -Logging Resource (networking-midonet) -##################################### -.. include:: logging_resource.inc -.. include:: firewall_log.inc -################################################# -Router interface floating IP (networking-midonet) -################################################# -.. include:: router-interface-fip.inc -########################## -FIP64 (networking-midonet) -########################## -.. include:: fip64.inc -############################ -BGP/MPLS VPN Interconnection -############################ -.. include:: bgpvpn-overview.inc -.. include:: bgpvpn-bgpvpns.inc -.. include:: bgpvpn-network_associations.inc -.. include:: bgpvpn-router_associations.inc -####### -Logging -####### -.. include:: logging.inc diff --git a/api-ref/source/v2/intro.inc b/api-ref/source/v2/intro.inc deleted file mode 100644 index e26e699..0000000 --- a/api-ref/source/v2/intro.inc +++ /dev/null @@ -1,445 +0,0 @@ -.. -*- rst -*- -.. needs:method_verification -.. needs:parameter_verification -.. needs:example_verification -.. needs:body_verification - -========= -API guide -========= - -This section introduces readers to OpenStack Networking (v2) API, providers -guidelines on how to use it, and describes common features available to users -throughout all Networking APIs. - -General information -=================== - -The Networking API v2.0 is a ReSTful HTTP service that uses all aspects of the -HTTP protocol including methods, URIs, media types, response codes, and so on. -Providers can use existing features of the protocol including caching, -persistent connections, and content compression. For example, providers who -employ a caching layer can respond with a 203 code instead of a 200 code when a -request is served from the cache. Additionally, providers can offer support -for conditional **GET** requests by using ETags, or they may send a redirect in -response to a **GET** request. Create clients so that these differences are -accounted for. - -Authentication and authorization -================================ - -The Networking API v2.0 uses the `OpenStack Identity service -`_ as the default authentication -service. When Keystone is enabled, users that submit requests to the OpenStack -Networking service must provide an authentication token in **X-Auth-Token** -request header. You obtain the token by authenticating to the Keystone -endpoint. - -When Keystone is enabled, the ``project_id`` attribute is not required in create -requests because the project ID is derived from the authentication token. - -NOTE: Currently the Networking API accepts the deprecated ``tenant_id`` -attribute for the project ID for backward compatibility. - -The default authorization settings allow only administrative users to create -resources on behalf of a different project. - -OpenStack Networking uses information received from Keystone to authorize user -requests. OpenStack Networking handles the following types of authorization -policies: - -- **Operation-based policies** specify access criteria for specific - operations, possibly with fine-grained control over specific attributes. - -- **Resource-based policies** access a specific resource. Permissions might or - might not be granted depending on the permissions configured for the - resource. Currently available for only the network resource. - -The actual authorization policies enforced in OpenStack Networking might vary -from deployment to deployment. - -Request and response formats -============================ - -The Networking API v2.0 supports JSON data serialization request and response -formats only. - -Request format --------------- - -The Networking API v2.0 only accepts requests with the JSON data serialization -format. The ``Content-Type`` header is ignored. - -Tenant and project attributes in requests ------------------------------------------ - -Starting with the Newton release of the Networking service, the Networking API -accepts the ``project_id`` attribute in addition to the ``tenant_id`` attribute -in requests. The ``tenant_id`` attribute is accepted for backward compatibility. -If both the ``project_id`` and the ``tenant_id`` attribute are provided in the -same request, their values must be identical. - -To determine whether a Networking API v2.0 endpoint supports the ``project_id`` -attribute in requests, check that the ``project-id`` API extension is enabled -(see Extensions_). - - -Response format ---------------- - -The Networking API v2.0 always responds with the JSON data serialization -format. The ``Accept`` header is ignored. - -Query extension - A ``.json`` extension can be added to the request URI. For example, the - ``.json`` extension in the following requests are equivalent: - - - **GET** *publicURL*/networks - - - **GET** *publicURL*/networks.json - -Tenant and project attributes in responses ------------------------------------------- - -Starting with the Newton release of the Networking service, the Networking API -returns a ``project_id`` attribute in responses, while still returning a -``tenant_id`` attribute for backward compatibility. The values will always be -identical. - -To determine whether a Networking API v2.0 endpoint returns the ``project_id`` -attribute in responses, check that the ``project-id`` API extension is enabled -(see Extensions_). - - -.. _filtering: - -Filtering and column selection -============================== - -The Networking API v2.0 supports filtering based on all top level attributes of -a resource. Filters are applicable to all list requests. - -For example, the following request returns all networks named ``foobar``: - -.. code:: - - GET /v2.0/networks?name=foobar - -When you specify multiple filters using different fields, the Networking API -v2.0 returns only objects that meet all filtering criteria. The operation -applies an AND condition among different filter fields. - -OpenStack Networking offers an OR mechanism for filters by repeating the field -with the different OR criteria. For example, to find all networks named -``foobar`` OR ``bizbaz``: - -.. code:: - - GET /v2.0/networks?name=foobar&name=bizbaz - - -ORs and ANDs can be combined. For example, if you want all networks with -admin_state_up=True and shared=True and named 'foobar' or 'bizbaz': - -.. code:: - - GET /v2.0/networks?name=foobar&name=bizbaz&admin_state_up=True&shared=True - - -Note ----- - -By default, OpenStack Networking returns all attributes for any show or list -call. The Networking API v2.0 has a mechanism to limit the set of attributes -returned. For example, return ``id``. - -You can use the ``fields`` query parameter to control the attributes returned -from the Networking API v2.0. - -For example, the following request returns only ``id`` and ``name`` for each -network: - -.. code:: - - GET /v2.0/networks.json?fields=id&fields=name - -Synchronous versus asynchronous plug-in behavior -================================================ - -The Networking API v2.0 presents a logical model of network connectivity -consisting of networks, ports, and subnets. It is up to the OpenStack -Networking plug-in to communicate with the underlying infrastructure to ensure -packet forwarding is consistent with the logical model. A plug-in might perform -these operations asynchronously. - -When an API client modifies the logical model by issuing an HTTP **POST**, -**PUT**, or **DELETE** request, the API call might return before the plug-in -modifies underlying virtual and physical switching devices. However, an API -client is guaranteed that all subsequent API calls properly reflect the changed -logical model. - -For example, if a client issues an HTTP **PUT** request to set the attachment -for a port, there is no guarantee that packets sent by the interface named in -the attachment are forwarded immediately when the HTTP call returns. However, -it is guaranteed that a subsequent HTTP **GET** request to view the attachment -on that port returns the new attachment value. - -You can use the ``status`` attribute with the network and port resources to -determine whether the OpenStack Networking plug-in has successfully completed -the configuration of the resource. - -Bulk-create -=========== - -The Networking API v2.0 enables you to create several objects of the same type -in the same API request. Bulk create operations use exactly the same API syntax -as single create operations except that you specify a list of objects rather -than a single object in the request body. - -Bulk operations are always performed atomically, meaning that either all or -none of the objects in the request body are created. If a particular plug-in -does not support atomic operations, the Networking API v2.0 emulates the atomic -behavior so that users can expect the same behavior regardless of the -particular plug-in running in the background. - -OpenStack Networking might be deployed without support for bulk operations and -when the client attempts a bulk create operation, a 400 Bad request error is -returned. - -Pagination -========== - -To reduce load on the service, list operations will return a maximum number of -items at a time. To navigate the collection, the parameters limit, marker and -page\_reverse can be set in the URI. For example: - -.. code:: - - ?limit=100&marker=1234&page_reverse=False - -The ``marker`` parameter is the ID of the last item in the previous list. The -``limit`` parameter sets the page size. The ``page_reverse`` parameter sets -the page direction. These parameters are optional. If the client requests a -limit beyond the maximum limit configured by the deployment, the server returns -the maximum limit number of items. - -For convenience, list responses contain atom "next" links and "previous" links. -The last page in the list requested with 'page\_reverse=False' will not contain -"next" link, and the last page in the list requested with 'page\_reverse=True' -will not contain "previous" link. The following examples illustrate two pages -with three items. The first page was retrieved through: - -.. code:: - - GET http://127.0.0.1:9696/v2.0/networks.json?limit=2 - -Pagination is an optional feature of OpenStack Networking API, and it might be -disabled. If pagination is disabled, the pagination parameters will be ignored -and return all the items. - -If a particular plug-in does not support pagination operations, and pagination -is enabled, the Networking API v2.0 will emulate the pagination behavior so -that users can expect the same behavior regardless of the particular plug-in -running in the background. - -To determine if pagination is supported, a user can check whether the -'pagination' extension API is available. - -**Example Network collection, first page: JSON request** - -.. code:: - - GET /v2.0/networks.json?limit=2 HTTP/1.1 - Host: 127.0.0.1:9696 - Content-Type: application/json - Accept: application/json - - - -**Example Network collection, first page: JSON response** - -.. code:: - - { - "networks": [ - { - "admin_state_up": true, - "id": "396f12f8-521e-4b91-8e21-2e003500433a", - "name": "net3", - "provider:network_type": "vlan", - "provider:physical_network": "physnet1", - "provider:segmentation_id": 1002, - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [], - "tenant_id": "20bd52ff3e1b40039c312395b04683cf" - "project_id": "20bd52ff3e1b40039c312395b04683cf" - }, - { - "admin_state_up": true, - "id": "71c1e68c-171a-4aa2-aca5-50ea153a3718", - "name": "net2", - "provider:network_type": "vlan", - "provider:physical_network": "physnet1", - "provider:segmentation_id": 1001, - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [], - "tenant_id": "20bd52ff3e1b40039c312395b04683cf" - "project_id": "20bd52ff3e1b40039c312395b04683cf" - } - ], - "networks_links": [ - { - "href": "http://127.0.0.1:9696/v2.0/networks.json?limit=2&marker=71c1e68c-171a-4aa2-aca5-50ea153a3718", - "rel": "next" - }, - { - "href": "http://127.0.0.1:9696/v2.0/networks.json?limit=2&marker=396f12f8-521e-4b91-8e21-2e003500433a&page_reverse=True", - "rel": "previous" - } - ] - } - - -The last page won't show the "next" links - -**Example Network collection, last page: JSON request** - -.. code:: - - GET /v2.0/networks.json?limit=2&marker=71c1e68c-171a-4aa2-aca5-50ea153a3718 HTTP/1.1 - Host: 127.0.0.1:9696 - Content-Type: application/json - Accept: application/json - - - -**Example Network collection, last page: JSON response** - -.. code:: - - { - "networks": [ - { - "admin_state_up": true, - "id": "b3680498-03da-4691-896f-ef9ee1d856a7", - "name": "net1", - "provider:network_type": "vlan", - "provider:physical_network": "physnet1", - "provider:segmentation_id": 1000, - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [], - "tenant_id": "c05140b3dc7c4555afff9fab6b58edc2" - "project_id": "c05140b3dc7c4555afff9fab6b58edc2" - } - ], - "networks_links": [ - { - "href": "http://127.0.0.1:9696/v2.0/networks.json?limit=2&marker=b3680498-03da-4691-896f-ef9ee1d856a7&page_reverse=True", - "rel": "previous" - } - ] - } - - -Sorting -======= - -You can use the ``sort_key`` and ``sort_dir`` parameters to sort the -results of list operations. Currently sorting does not work with extended -attributes of resource. The ``sort_key`` and ``sort_dir`` can be repeated, -and the number of ``sort_key`` and ``sort_dir`` provided must be same. The -``sort_dir`` parameter indicates in which direction to sort. Acceptable -values are ``asc`` (ascending) and ``desc`` (descending). - -Sorting is optional feature of OpenStack Networking API, and it might be -disabled. If sorting is disabled, the sorting parameters are ignored. - -If a particular plug-in does not support sorting operations and sorting is -enabled, the Networking API v2.0 emulates the sorting behavior so that users -can expect the same behavior regardless of the particular plug-in that runs in -the background. - -To determine if sorting is supported, a user can check whether the 'sorting' -extension API is available. - - -.. _Extensions: - -Extensions -========== - -The Networking API v2.0 is extensible. - -The purpose of Networking API v2.0 extensions is to: - -- Introduce new features in the API without requiring a version change. - -- Introduce vendor-specific niche functionality. - -- Act as a proving ground for experimental functionalities that might be - included in a future version of the API. - -To programmatically determine which extensions are available, issue a **GET** -request on the **v2.0/extensions** URI. - -To query extensions individually by unique alias, issue a **GET** request on -the ``/v2.0/extensions/*alias_name*`` URI. Use this method to easily -determine if an extension is available. If the extension is not available, a -404 Not Found response is returned. - -You can extend existing core API resources with new actions or extra -attributes. Also, you can add new resources as extensions. Extensions usually -have tags that prevent conflicts with other extensions that define attributes -or resources with the same names, and with core resources and attributes. -Because an extension might not be supported by all plug-ins, the availability -of an extension varies with deployments and the specific plug-in in use. - - -Faults -====== - -The Networking API v2.0 returns an error response if a failure occurs while -processing a request. OpenStack Networking uses only standard HTTP error codes. -4\ *nn* errors indicate problems in the particular request being sent from -the client. - -+-------+--------------------------------------------------------------+ -| Error | Description | -+=======+==============================================================+ -| 400 | Bad request | -| | Malformed request URI or body requested admin state invalid | -| | Invalid values entered | -| | Bulk operations disallowed | -| | Validation failed | -| | Method not allowed for request body (such as trying to | -| | update attributes that can be specified at create-time only) | -+-------+--------------------------------------------------------------+ -| 404 | Not Found | -| | Non existent URI | -| | Resource not found | -+-------+--------------------------------------------------------------+ -| 409 | Conflict | -| | Port configured on network | -| | IP allocated on subnet | -| | Conflicting IP allocation pools for subnet | -+-------+--------------------------------------------------------------+ -| 500 | Internal server error | -| | Internal OpenStack Networking error | -+-------+--------------------------------------------------------------+ -| 503 | Service unavailable | -| | Failure in Mac address generation | -+-------+--------------------------------------------------------------+ - -Users submitting requests to the Networking API v2.0 might also receive the -following errors: - -- 401 Unauthorized - If invalid credentials are provided. - -- 403 Forbidden - If the user cannot access a specific resource or perform the - requested operation. diff --git a/api-ref/source/v2/lbaas-v1.inc b/api-ref/source/v2/lbaas-v1.inc deleted file mode 100644 index dfd3d38..0000000 --- a/api-ref/source/v2/lbaas-v1.inc +++ /dev/null @@ -1,1001 +0,0 @@ -.. -*- rst -*- - -====================== -LBaaS 1.0 (DEPRECATED) -====================== - -The Load-Balancer-as-a-Service (LBaaS) v1.0 extension pairs with -the Networking v2.0 API to enable OpenStack projects to manage load -balancers for their VMs. With this extension, you can load-balance -client traffic from one network to application services, such as -VMs, on the same network. - -Use this extension to create and manage virtual IP addresses -(VIPs), pools, members of a pool, health monitors, and view status -of a resource. - -.. note:: - - LBaaS 1.0 support was removed in Newton release. It's no longer available - in any installations starting from this release. - -**Load balancer statuses** - -+----------------+--------------------------------------------------------------------+ -| Status | Description | -+----------------+--------------------------------------------------------------------+ -| ACTIVE | The resource is ready and active. | -+----------------+--------------------------------------------------------------------+ -| PENDING_CREATE | The resource is being created. | -+----------------+--------------------------------------------------------------------+ -| PENDING_UPDATE | The resource is being updated. | -+----------------+--------------------------------------------------------------------+ -| PENDING_DELETE | The resource is pending deletion. | -+----------------+--------------------------------------------------------------------+ -| INACTIVE | The resource is not active. | -+----------------+--------------------------------------------------------------------+ -| ERROR | An object within the service is not working. The ``error_details`` | -| | attribute provides an explanation for the error, its cause, and | -| | possibly a solution. | -+----------------+--------------------------------------------------------------------+ - -.. ============================================================ - -List pools -========== - -.. rest_method:: GET /v2.0/lb/pools - -Lists pools. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pools: pools-obj - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - id: pool-id-response - - lb_method: lb_method - - members: members - - name: name - - protocol: pool-protocol - - provider: pool-provider - - status: pool-status - - status_description: status_description - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/pools-list-response.json - :language: javascript - -Create a load balancer pool -=========================== - -.. rest_method:: POST /v2.0/lb/pools - -Creates a load balancer pool. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up-request - - description: description-request - - health_monitors: health_monitors-request - - lb_method: lb_method - - name: name-request - - protocol: pool-protocol - - provider: pool-provider-request - - subnet_id: pool-subnet_id - - tenant_id: project_id-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/pool-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - id: pool-id-response - - lb_method: lb_method - - members: members - - name: name - - protocol: pool-protocol - - provider: pool-provider - - status: pool-status - - status_description: status_description - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/pool-create-response.json - :language: javascript - -Show pool details -================= - -.. rest_method:: GET /v2.0/lb/pools/{pool_id} - -Shows details for a pool. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - id: pool-id-response - - lb_method: lb_method - - members: members - - name: name - - protocol: pool-protocol - - provider: pool-provider - - status: pool-status - - status_description: status_description - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/pool-show-response.json - :language: javascript - -Update pool -=========== - -.. rest_method:: PUT /v2.0/lb/pools/{pool_id} - -Updates a load balancer pool. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - pool: pool - - admin_state_up: admin_state_up-request - - description: description-request - - health_monitors: health_monitors-request - - lb_method: lb_method-request-put - - name: name-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/pool-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - id: pool-id-response - - lb_method: lb_method - - members: members - - name: name - - protocol: pool-protocol - - provider: pool-provider - - status: pool-status - - status_description: status_description - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/pool-update-response.json - :language: javascript - -Delete pool -=========== - -.. rest_method:: DELETE /v2.0/lb/pools/{pool_id} - -Deletes a load balancer pool. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -When a requested load balancer pool has a VIP, -``Conflict (409)`` is returned. - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -.. ============================================================ - -List VIPs -========= - -.. rest_method:: GET /v2.0/lb/vips - -Lists VIPs. - -The list might be empty. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vips: vips - - address: vip-address - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - description: description - - id: vip-id - - name: name - - pool_id: vip-pool_id - - port_id: vip-port_id - - protocol: vip-protocol - - protocol_port: protocol_port - - session_persistence: vip-session_persistence - - status: vip-status - - status_description: status_description - - subnet_id: vip-subnet_id - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/vips-list-response.json - :language: javascript - -Create a load balancer VIP -========================== - -.. rest_method:: POST /v2.0/lb/vips - -Creates a load balancer VIP. - -Normal response codes: 201 - -Error response codes: 400, 401, 404, 409 - -When a specified pool already has a VIP, ``Conflict (409)`` is -returned. -When a specified pool or a specified subnet is not found, -``Not Found (404)`` is returned. - -Request -------- - -.. rest_parameters:: parameters.yaml - - - vip: vip - - address: vip-address-request - - admin_state_up: admin_state_up-request - - connection_limit: connection_limit - - description: description-request - - name: name-request - - pool_id: vip-pool_id - - protocol: vip-protocol - - protocol_port: protocol_port - - session_persistence: vip-session_persistence-request - - subnet_id: vip-subnet_id - - tenant_id: project_id-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/vip-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vip: vip - - address: vip-address - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - description: description - - id: vip-id - - name: name - - pool_id: vip-pool_id - - port_id: vip-port_id - - protocol: vip-protocol - - protocol_port: protocol_port - - session_persistence: vip-session_persistence - - status: vip-status - - status_description: status_description - - subnet_id: vip-subnet_id - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/vip-create-response.json - :language: javascript - -Show VIP details -================ - -.. rest_method:: GET /v2.0/lb/vips/{vip_id} - -Shows details for a VIP. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - vip_id: vip_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vip: vip - - address: vip-address - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - description: description - - id: vip-id - - name: name - - pool_id: vip-pool_id - - port_id: vip-port_id - - protocol: vip-protocol - - protocol_port: protocol_port - - session_persistence: vip-session_persistence - - status: vip-status - - status_description: status_description - - subnet_id: vip-subnet_id - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/vip-show-response.json - :language: javascript - -Update VIP -========== - -.. rest_method:: PUT /v2.0/lb/vips/{vip_id} - -Updates a load balancer VIP. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - vip_id: vip_id-path - - vip: vip - - admin_state_up: admin_state_up-request - - connection_limit: connection_limit - - description: description-request - - name: name-request - - pool_id: vip-pool_id-request - - session_persistence: vip-session_persistence-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/vip-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vip: vip - - address: vip-address - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - description: description - - id: vip-id - - name: name - - pool_id: vip-pool_id - - port_id: vip-port_id - - protocol: vip-protocol - - protocol_port: protocol_port - - session_persistence: vip-session_persistence - - status: vip-status - - status_description: status_description - - subnet_id: vip-subnet_id - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/vip-update-response.json - :language: javascript - -Delete VIP -========== - -.. rest_method:: DELETE /v2.0/lb/vips/{vip_id} - -Deletes a load balancer VIP. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - vip_id: vip_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -.. ============================================================ - -List members -============ - -.. rest_method:: GET /v2.0/lb/members - -Lists members. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - members: members-obj - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - pool_id: member-pool_id - - protocol_port: protocol_port - - status: member-status - - status_description: status_description - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/members-list-response.json - :language: javascript - -Create a load balancer member -============================= - -.. rest_method:: POST /v2.0/lb/members - -Creates a load balancer member. - -Normal response codes: 201 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - member: member - - address: address - - admin_state_up: admin_state_up-request - - pool_id: member-pool_id - - protocol_port: protocol_port - - tenant_id: project_id-request - - weight: member-weight-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/member-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - member: member - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - pool_id: member-pool_id - - protocol_port: protocol_port - - status: member-status - - status_description: status_description - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/member-create-response.json - :language: javascript - -Show member details -=================== - -.. rest_method:: GET /v2.0/lb/members/{member_id} - -Shows details for a member. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - member_id: member_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - member: member - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - pool_id: member-pool_id - - protocol_port: protocol_port - - status: member-status - - status_description: status_description - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/member-show-response.json - :language: javascript - -Update member -============= - -.. rest_method:: PUT /v2.0/lb/members/{member_id} - -Updates a load balancer member. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - member_id: member_id-path - - member: member - - admin_state_up: admin_state_up-request - - pool_id: member-pool_id-request - - weight: member-weight-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/member-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - member: member - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - pool_id: member-pool_id - - protocol_port: protocol_port - - status: member-status - - status_description: status_description - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/member-update-response.json - :language: javascript - -Delete member -============= - -.. rest_method:: DELETE /v2.0/lb/members/{member_id} - -Deletes a load balancer member. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - member_id: member_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -.. ============================================================ - -List health monitors -==================== - -.. rest_method:: GET /v2.0/lb/health_monitors - -Lists health monitors. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitors: health_monitors-obj - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - id: health_monitor-id - - max_retries: max_retries - - pools: pools - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitors-list-response.json - :language: javascript - -Create a load balancer health monitor -===================================== - -.. rest_method:: POST /v2.0/lb/health_monitors - -Creates a load balancer health monitor. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up-request - - delay: delay - - expected_codes: expected_codes - - http_method: http_method-request - - max_retries: max_retries - - tenant_id: project_id-request - - timeout: timeout - - type: type - - url_path: url_path - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitor-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - id: health_monitor-id - - max_retries: max_retries - - pools: pools - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitor-create-response.json - :language: javascript - -Show health monitor details -=========================== - -.. rest_method:: GET /v2.0/lb/health_monitors/{health_monitor_id} - -Shows details for a health monitor. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor_id: health_monitor_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - id: health_monitor-id - - max_retries: max_retries - - pools: pools - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitor-show-response.json - :language: javascript - -Update health monitor -===================== - -.. rest_method:: PUT /v2.0/lb/health_monitors/{health_monitor_id} - -Updates a load balancer health monitor. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor_id: health_monitor_id-path - - health_monitor: health_monitor - - admin_state_up: admin_state_up-request - - delay: delay - - expected_codes: expected_codes - - http_method: http_method-request - - max_retries: max_retries - - timeout: timeout - - url_path: url_path - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitor-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - id: health_monitor-id - - max_retries: max_retries - - pools: pools - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitor-update-response.json - :language: javascript - -Delete health monitor -===================== - -.. rest_method:: DELETE /v2.0/lb/health_monitors/{health_monitor_id} - -Deletes a load balancer health monitor. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor_id: health_monitor_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -Associate health monitor with pool -================================== - -.. rest_method:: POST /v2.0/lb/pools/{pool_id}/health_monitors - -Associates a health monitor with a pool. - -Normal response codes: 201 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - health_monitor: health_monitor - - id: health_monitor-id - -Request Example ---------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitor-associate-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - -Response Example ----------------- - -.. literalinclude:: samples/lbaas-v1/healthmonitor-associate-response.json - :language: javascript - -Disassociate health monitor from pool -===================================== - -.. rest_method:: DELETE /v2.0/lb/pools/{pool_id}/health_monitors/{health_monitor_id} - -Disassociates a health monitor from a pool. - -Normal response codes: 201 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - health_monitor_id: health_monitor_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/lbaas-v2.inc b/api-ref/source/v2/lbaas-v2.inc deleted file mode 100644 index 28245b8..0000000 --- a/api-ref/source/v2/lbaas-v2.inc +++ /dev/null @@ -1,1663 +0,0 @@ -.. -*- rst -*- - -================== -LBaaS 2.0 (STABLE) -================== - -The Load-Balancer-as-a-Service (LBaaS) version 2.0 extension pairs with the -Networking 2.0 API to enable OpenStack projects to manage load balancers for -their VMs. With this extension you can load-balance client traffic from one -network to application services, such as VMs, on the same network. - -Use this extension to create and manage load balancers, listeners, pools, -members of a pool, and health monitors and view status of a resource. - -**Load balancer statuses** - -+----------------+--------------------------------------------------------------------+ -| Status | Description | -+----------------+--------------------------------------------------------------------+ -| ACTIVE | The resource is ready and active. | -+----------------+--------------------------------------------------------------------+ -| PENDING_CREATE | The resource is being created. | -+----------------+--------------------------------------------------------------------+ -| PENDING_UPDATE | The resource is being updated. | -+----------------+--------------------------------------------------------------------+ -| PENDING_DELETE | The resource is pending deletion. | -+----------------+--------------------------------------------------------------------+ -| INACTIVE | The resource is not active. | -+----------------+--------------------------------------------------------------------+ -| ERROR | An object within the service is not working. The ``error_details`` | -| | attribute provides an explanation for the error, its cause, and | -| | possibly a solution. | -+----------------+--------------------------------------------------------------------+ - -.. ============================================================ - -List load balancers -=================== - -.. rest_method:: GET /v2.0/lbaas/loadbalancers - -Lists all load balancers for the project. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -The list might be empty. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - loadbalancers: loadbalancers - - admin_state_up: admin_state_up - - description: description - - flavor: flavor-id-response - - id: loadbalancer-id - - listeners: listeners - - name: name - - operating_status: operating_status - - project_id: project_id - - provider: loadbalancer-provider - - provisioning_status: provisioning_status - - tenant_id: project_id - - vip_address: vip_address - - vip_subnet_id: vip_subnet_id - - pools: pools-obj - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/loadbalancers-list-response.json - :language: javascript - -Create a load balancer -====================== - -.. rest_method:: POST /v2.0/lbaas/loadbalancers - -Creates a load balancer. - -This operation provisions a new load balancer by using the -configuration that you define in the request object. After the API -validates the request and starts the provisioning process, the API -returns a response object that contains a unique ID and the status -of provisioning the load balancer. - -In the response, the load balancer provisioning status is -``ACTIVE``, ``PENDING_CREATE``, or ``ERROR``. - -If the status is ``PENDING_CREATE``, issue GET -``/lbaas/loadbalancers/loadbalancer_id`` to view the progress of -the provisioning operation. When the load balancer status changes -to ``ACTIVE``, the load balancer is successfully provisioned and -operational for traffic handling. - -If the API cannot fulfill the request due to insufficient data or -data that is not valid, the service returns the HTTP ``Bad Request -(400)`` response code with information about the failure in the -response body. Validation errors require that you correct the error -and submit the request again. - -You can configure all documented features of the load balancer at -creation time by specifying the additional elements or attributes -in the request. - -Administrative users can specify a project ID that is different than -their own to create load balancers for other projects. - -**Example: Create a load balancer** - -- ``project_id``. Admin only. Required to create a load balancer for - another project. - -- ``vip_subnet_id``. The network on which to allocate the VIP - address for the load balancer. A project can only create load - balancer VIPs on networks that the policy authorizes, such as her - own networks or shared or provider networks. - -Some attributes receive default values if you omit them from the -request: - -- ``admin_state_up``. Default is ``true``. - -- ``name``. Default is an empty string. - -- ``description``. Default is an empty string. - -If you own the subnet where you want to create the load balancer -VIP, you can specify a ``vip_address`` attribute. If you omit the -``vip_address`` attribute from the payload, the LBaaS service -allocates a VIP address from the subnet of the load balancer VIP. - -An optional ``flavor`` attribute can be passed to enable dynamic -selection of an appropriate provider if configured by the operator. -The basic selection algorithm chooses the provider in the first -service profile currently associated with flavor. - -You can also specify the ``provider`` attribute when you create a -load balancer. You can set this attribute to any service provider -with a ``LOADBALANCER`` service type. Setting both a flavor and a -provider will result in a conflict error. - -Finally, ``vip_network_id`` can be used in place of -``vip_subnet_id``. When this option is used, the VIP port is -created on the given network using the default behavior. If -assigned multiple fixed IPs, an IPv4 addresses is chosen as the -VIP in preference to IPv6 addresses. - -Normal response codes: 201 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer: loadbalancer - - admin_state_up: admin_state_up-request - - description: description-request - - flavor: flavor-id-request - - name: name-request - - project_id: project_id-request - - provider: loadbalancer-provider-request - - tenant_id: project_id-request - - vip_address: vip_address - - vip_subnet_id: vip_subnet_id - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/loadbalancer-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer: loadbalancer - - admin_state_up: admin_state_up - - description: description - - flavor: flavor-id-response - - id: loadbalancer-id - - listeners: listeners - - name: name - - operating_status: operating_status - - project_id: project_id - - provider: loadbalancer-provider - - provisioning_status: provisioning_status - - tenant_id: project_id - - vip_address: vip_address - - vip_network_id: vip_network_id - - vip_subnet_id: vip_subnet_id - - pools: pools-obj - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/loadbalancer-create-response.json - :language: javascript - -Show load balancer details -========================== - -.. rest_method:: GET /v2.0/lbaas/loadbalancers/{loadbalancer_id} - -Shows details for a load balancer. - -This operation returns a load balancer object, by ID. If you are -not an administrative user and the load balancer object does not -belong to your project, the service returns the HTTP -``Forbidden (403)`` response code. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer_id: loadbalancer-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer: loadbalancer - - admin_state_up: admin_state_up - - description: description - - id: loadbalancer-id - - listeners: listeners - - name: name - - operating_status: operating_status - - project_id: project_id - - provisioning_status: provisioning_status - - tenant_id: project_id - - vip_address: vip_address - - vip_subnet_id: vip_subnet_id - - pools: pools-obj - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/loadbalancer-show-response.json - :language: javascript - -Update load balancer -==================== - -.. rest_method:: PUT /v2.0/lbaas/loadbalancers/{loadbalancer_id} - -Updates a load balancer. - -If the request is valid, the service returns the ``Accepted (202)`` -response code. To confirm the update, check that the load balancer -provisioning status is ``ACTIVE``. If the status is -``PENDING_UPDATE``, use a GET operation to poll the load balancer -object for changes. - -This operation returns the updated load balancer object with the -``ACTIVE``, ``PENDING_UPDATE``, or ``ERROR`` provisioning status. - -Normal response codes: 202 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer_id: loadbalancer-id-path - - loadbalancer: loadbalancer - - admin_state_up: admin_state_up-request - - name: name-request - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/loadbalancer-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer: loadbalancer - - admin_state_up: admin_state_up - - description: description - - flavor: flavor-id-response - - id: loadbalancer-id - - listeners: listeners - - name: name - - operating_status: operating_status - - project_id: project_id - - provider: loadbalancer-provider - - provisioning_status: provisioning_status - - tenant_id: project_id - - vip_address: vip_address - - vip_subnet_id: vip_subnet_id - - pools: pools-obj - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/loadbalancer-update-response.json - :language: javascript - -Remove load balancer -==================== - -.. rest_method:: DELETE /v2.0/lbaas/loadbalancers/{loadbalancer_id} - -Removes a load balancer and its associated configuration from the project. - -The API immediately purges any and all configuration data. You -cannot recover it. - -Example: Delete a load balancer - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer_id: loadbalancer-id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -Show load balancer status tree -============================== - -.. rest_method:: GET /v2.0/lbaas/loadbalancers/{loadbalancer_id}/statuses - -Shows the status tree for a load balancer. - -This operation returns a status tree for a load balancer object, by -load balancer ID. If you are not an administrative user and the -load balancer object does not belong to the project, the API -returns the ``Forbidden (403)`` response code. - -If the operation succeeds, the returned element is a status tree -that contains the load balancer and all provisioning and operating -statuses for its children. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - loadbalancer_id: loadbalancer-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - statuses: loadbalancer-statuses - - loadbalancer: loadbalancer - - listeners: listeners - - pools: pools - - healthmonitor: healthmonitor - - id: loadbalancer-id - - members: members - - operating_status: operating_status - - provisioning_status: provisioning_status - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/loadbalancer-status-tree.json - :language: javascript - -.. ============================================================ - -List listeners -============== - -.. rest_method:: GET /v2.0/lbaas/listeners - -Lists all listeners. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -This operation lists all listeners that are associated with your -project. - -The list might be empty. - -Example: List listeners - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - listeners: listeners-response - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - default_pool_id: default_pool_id-response - - default_tls_container_ref: default_tls_container_ref-response - - description: description - - id: listener-id-response - - loadbalancers: loadbalancers - - name: name - - project_id: project_id - - protocol: protocol-response - - protocol_port: protocol_port - - sni_container_refs: sni_container_refs-response - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/listeners-list-response.json - :language: javascript - -Create listener -=============== - -.. rest_method:: POST /v2.0/lbaas/listeners - -Creates a listener. - -This operation provisions a new listener by using the configuration -that you define in the request object. After the request is -validated and the provisioning process begins, a response object is -returned. The object contains a unique identifier. - -At a minimum, you must specify these listener attributes: - -- ``project_id``. Admin only. Required to create a listener for - another project. - -- ``loadbalancer_id``. The load balancer on which to provision this - listener. A project can only create listeners on load balancers - that the policy authorizes. For example, her own load balancers. - -- ``description``. The load balancer description. - -- ``protocol``. The protocol for which the front end listens. Must - be ``HTTP``, ``HTTPS``, ``TCP``, or ``TERMINATED_HTTPS``. - -Some attributes receive default values if you omit them from the -request: - -- ``protocol_port``. The port on which the front end listens. Must - be an integer from 1 to 65535. - -- ``default_tls_container_ref``. The reference to a container that - holds TLS secrets. If you also specify ``sni_container_refs``, - this container is the default. This parameter is required for the - ``TERMINATED_HTTPS`` protocol. - -- ``sni_container_refs``. A list of references to containers that - hold TLS secrets for server name indication (SNI). This parameter - is required for the ``TERMINATED_HTTPS`` protocol. - -- ``admin_state_up``. Default is ``true``. - -- ``name``. Default is an empty string. - -- ``description``. Default is an empty string. - -- ``connection_limit``. Default is ``-1``, which indicates an - infinite limit. - -If the API cannot fulfill the request due to insufficient data or -data that is not valid, the service returns the HTTP ``Bad Request -(400)`` response code with information about the failure in the -response body. Validation errors require that you correct the error -and submit the request again. - -You can configure all documented features of the listener at -creation time by specifying the additional elements or attributes -in the request. - -Administrative users can specify a project ID that is different than -their own to create listeners for other projects. - -To update a listener, the load balancer to which to attach must -have an ``ACTIVE`` provisioning status. - -Normal response codes: 201 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - listener: listener - - admin_state_up: admin_state_up-request - - connection_limit: connection_limit - - default_pool_id: default_pool_id - - default_tls_container_ref: default_tls_container_ref - - description: description - - loadbalancer_id: loadbalancer-id - - name: name - - project_id: project_id-request - - protocol: protocol-response - - protocol_port: protocol_port-request - - sni_container_refs: sni_container_refs - - tenant_id: project_id-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/listener-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - listener: listener - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - default_pool_id: default_pool_id-response - - default_tls_container_ref: default_tls_container_ref-response - - description: description - - id: listener-id-response - - loadbalancers: loadbalancers - - name: name - - project_id: project_id - - protocol: protocol-response - - protocol_port: protocol_port - - sni_container_refs: sni_container_refs-response - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/listener-create-response.json - :language: javascript - -Show listener details -===================== - -.. rest_method:: GET /v2.0/lbaas/listeners/{listener_id} - -Shows details for a listener. - -This operation returns a listener object, by ID. If you are not an -administrative user and the listener object does not belong to your -account, the API returns the HTTP ``Forbidden (403)`` response -code. - -Example: Show listener details - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - listener_id: listener-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - listener: listener - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - id: listener-id-response - - default_pool_id: default_pool_id-response - - default_tls_container_ref: default_tls_container_ref-response - - description: description - - loadbalancers: loadbalancers - - name: name - - project_id: project_id - - protocol: protocol-response - - protocol_port: protocol_port - - sni_container_refs: sni_container_refs-response - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/listener-show-response.json - :language: javascript - -Update listener -=============== - -.. rest_method:: PUT /v2.0/lbaas/listeners/{listener_id} - -Updates a listener. - -This operation updates the attributes of a listener. Upon -successful validation of the request, the service returns the HTTP -``Accepted (202)`` response code. - -Note: You cannot update the ``listener_id``, ``project_id``, -``loadbalancer_id``, ``loadbalancers``, ``default_pool_id``, -``protocol``, and ``protocol_port`` attributes. Attempting to -update an immutable attribute results in the HTTP ``Immutable -(422)`` response code. - -Note: You cannot update a listener if the load balancer to which -the listener is attached does not have an ``ACTIVE`` provisioning -status. - -Normal response codes: 202 - -Error response codes: 401, 404, 422 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - listener_id: listener-id-path - - listener: listener - - admin_state_up: admin_state_up-request - - connection_limit: connection_limit - - default_tls_container_ref: default_tls_container_ref - - description: description - - name: name - - sni_container_refs: sni_container_refs - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/listener-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - listener: listener - - admin_state_up: admin_state_up - - connection_limit: connection_limit-response - - default_pool_id: default_pool_id-response - - default_tls_container_ref: default_tls_container_ref-response - - description: description - - id: listener-id-response - - loadbalancers: loadbalancers - - name: name - - project_id: project_id - - protocol: protocol-response - - protocol_port: protocol_port - - sni_container_refs: sni_container_refs-response - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/listener-update-response.json - :language: javascript - -Remove listener -=============== - -.. rest_method:: DELETE /v2.0/lbaas/listeners/{listener_id} - -Removes a listener. - -This operation removes a listener and its associated configuration -from the project. The API immediately purges any and all -configuration data. You cannot recover it. - -You cannot delete a listener if the load balancer to which it is -attached does not have an ``ACTIVE`` provisioning status. - -Example: Delete a listener - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - listener_id: listener-id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -.. ============================================================ - -List pools -========== - -.. rest_method:: GET /v2.0/lbaas/pools - -Lists all pools that are associated with your project. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -The list might be empty. - -Example: List pools - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pools: pools-obj - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - id: pool-id-response - - lb_algorithm: lb_algorithm - - members: members - - name: name - - project_id: project_id - - protocol: protocol-response - - provider: loadbalancer-provider - - status: pool-status - - status_description: status_description - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/pools-list-response.json - :language: javascript - -Create pool -=========== - -.. rest_method:: POST /v2.0/lbaas/pools - -Creates a pool. - -This operation provisions a pool by using the configuration that -you define in the request object. After the API validates the -request and starts the provisioning process, the API returns a -response object, which contains a unique ID. - -At a minimum, you must specify these pool attributes: - -- ``project_id``. Admin only. Required to create a pool for another - project. - -- ``protocol``. The protocol for which this pool and its members - listen. A valid value is ``TCP``, ``HTTP``, or ``HTTPS``. - -- ``lb_algorithm``. The load-balancer algorithm, such as - ``ROUND_ROBIN``, ``LEAST_CONNECTIONS``, and ``SOURCE_IP``, that - distributes traffic to the pool members. The load-balancer - provider must support this algorithm. - -- ``listener_id``. The ID of the listener in which this pool - becomes the default pool. Each listener has only one default - pool. - -Some attributes receive default values if you omit them from the -request: - -- ``admin_state_up``. Default is ``true``. - -- ``name``. Default is an empty string. - -- ``description``. Default is an empty string. - -- ``session_persistence``. Default is an empty dictionary. - -If the API cannot fulfill the request due to insufficient data or -data that is not valid, the service returns the HTTP ``Bad Request -(400)`` response code with information about the failure in the -response body. Validation errors require that you correct the error -and submit the request again. - -Users can configure all documented features at creation time by -providing the additional elements or attributes in the request. - -Administrative users can specify a project ID that is different than -their own to create pools for other projects. - -To update a pool, the load balancer to which to attach must have an -``ACTIVE`` provisioning status. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up-request - - description: description-request - - lb_algorithm: lb_algorithm - - listener_id: listener-id-response - - name: name - - project_id: project_id-request - - protocol: protocol - - subnet_id: pool-subnet_id - - tenant_id: project_id-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/pool-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - id: pool-id-response - - lb_algorithm: lb_algorithm - - members: members - - name: name - - project_id: project_id - - protocol: protocol-response - - provider: loadbalancer-provider - - status: pool-status - - status_description: status_description - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/pool-create-response.json - :language: javascript - -Show pool details -================= - -.. rest_method:: GET /v2.0/lbaas/pools/{pool_id} - -Shows details for a pool. - -This operation shows details for a pool, by ID. If you are not an -administrative user and the pool object does not belong to your -project, the call returns the HTTP ``Forbidden (403)`` -response code. - -If this operation succeeds, it returns a ``pool`` element. - -Example: Show pool details - -Normal response codes: 200 - -Error response codes: 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - lb_algorithm: lb_algorithm - - members: members - - id: pool-id-response - - name: name - - status: pool-status - - status_description: status_description - - project_id: project_id - - protocol: protocol-response - - provider: loadbalancer-provider - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/pool-show-response.json - :language: javascript - -Update pool -=========== - -.. rest_method:: PUT /v2.0/lbaas/pools/{pool_id} - -Updates a pool. - -This operation updates the attributes of a pool. Upon successful -validation of the request, the service returns the HTTP ``Accepted -(202)`` response code. - -Note: You cannot update the pool ID, ``project_id``, -``listener_id``, ``listeners``, ``health_monitor_id``, -``protocol``, and ``members`` immutable attributes. If you try to -update any of these attributes, the service returns the HTTP -``Immutable (422)`` response code . - -Note: You cannot update a pool if the load balancer to which it is -attached does not have an ``ACTIVE`` provisioning status. - -Normal response codes: 202 - -Error response codes: 401, 404, 422 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - pool: pool - - admin_state_up: admin_state_up-request - - description: description-request - - lb_algorithm: lb_algorithm - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/pool-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - pool: pool - - admin_state_up: admin_state_up - - description: description - - health_monitors: health_monitors-response - - health_monitors_status: health_monitors_status - - id: pool-id-response - - lb_algorithm: lb_algorithm - - members: members - - name: name - - status: pool-status - - status_description: status_description - - project_id: project_id - - protocol: protocol-response - - provider: loadbalancer-provider - - subnet_id: pool-subnet_id - - tenant_id: project_id - - vip_id: vip_id - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/pool-update-response.json - :language: javascript - -Remove pool -=========== - -.. rest_method:: DELETE /v2.0/lbaas/pools/{pool_id} - -Removes a pool. - -This operation removes a pool and its associated configuration from -the project. The API immediately purges any and all -configuration data. You cannot recover it. - -You cannot delete a pool if the load balancer to which it is -attached does not have an ``ACTIVE`` provisioning status. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -.. ============================================================ - -List pool members -================= - -.. rest_method:: GET /v2.0/lbaas/pools/{pool_id}/members - -Lists members of a pool. - -Lists all members that are associated with a pool that is -associated with your project. The list of members includes -only members that belong to the pool object identified by -``pool_id``. - -The list might be empty. - -Example: List pool members - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - members: members - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - project_id: project_id - - protocol_port: protocol_port - - subnet_id: pool-subnet_id - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/pool-members-list-response.json - :language: javascript - -Add member to pool -================== - -.. rest_method:: POST /v2.0/lbaas/pools/{pool_id}/members - -Adds a member to a pool. - -This operation provisions a member and adds it to a pool by using -the configuration that you define in the request object. After the -API validates the request and starts the provisioning process, it -returns a response object, which contains a unique ID. - -At a minimum, you must specify these pool attributes: - -- ``project_id``. Admin only. Required to create a pool for another - project. - -- ``address``. The IP address of the member to receive traffic from - the load balancer. - -- ``protocol_port`` The port on which the member listens for - traffic. - -Some attributes receive default values if you omit them from the -request: - -- ``admin_state_up``. Default is ``true``. - -- ``weight``. Default is ``1``. - -If you omit the ``subnet_id`` parameter, LBaaS uses the -``vip_subnet_id`` parameter value for the subnet UUID. - -If the request fails due to incorrect data, the service returns the -HTTP ``Bad Request (400)`` response code with information about the -failure in the response body. Validation errors require that you -correct the error and submit the request again. - -To configure all documented member features at creation time, -specify additional elements or attributes in the request. - -Administrative users can specify a project ID that is different than -their own to create members for other projects. - -To update a member, the load balancer must have an ``ACTIVE`` -provisioning status. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - address: address - - member: member - - project_id: project_id-request - - protocol_port: protocol_port - - subnet_id: pool-subnet_id-request - - tenant_id: project_id-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/member-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - member: member - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - project_id: project_id - - protocol_port: protocol_port - - subnet_id: pool-subnet_id - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/member-create-response.json - :language: javascript - -Show pool member details -======================== - -.. rest_method:: GET /v2.0/lbaas/pools/{pool_id}/members/{member_id} - -Shows details for a pool member. - -This operation returns a member object identified by ``member_id`` -that belongs to a pool object identified by ``pool_id``. If you are -not an administrative user and the pool or member object does not -belong to your project, the service returns the HTTP -``Forbidden (403)`` response code. - -If this operation succeeds, it returns a pool element. - -Example: Show pool member details - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - member_id: member_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - member: member - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - project_id: project_id - - protocol_port: protocol_port - - subnet_id: pool-subnet_id - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/member-show-response.json - :language: javascript - -Update pool member -================== - -.. rest_method:: PUT /v2.0/lbaas/pools/{pool_id}/members/{member_id} - -Updates attributes for a pool member. - -Upon successful validation of the request, the service returns the -HTTP ``OK (200)`` response code. - -Note: You cannot update the member ID, ``project_id``, -``address``, ``protocol_port``, and ``subnet_id`` attributes. If -you attempt to update any of these attributes, the service returns -the HTTP ``Immutable (422)`` response code. - -Note: You cannot update a member if the attached load balancer does -not have an ``ACTIVE`` provisioning status. - -Normal response codes: 200 - -Error response codes: 401, 404, 422 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - member_id: member_id-path - - member: member - - admin_state_up: admin_state_up - - weight: member-weight-request - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/member-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - member: member - - address: address - - admin_state_up: admin_state_up - - id: member-id-response - - project_id: project_id - - protocol_port: protocol_port - - subnet_id: pool-subnet_id - - tenant_id: project_id - - weight: member-weight - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/member-update-response.json - :language: javascript - -Remove member from pool -======================= - -.. rest_method:: DELETE /v2.0/lbaas/pools/{pool_id}/members/{member_id} - -Removes a member from a pool and its associated configuration from the project. - -The API immediately purges any and all configuration data. You -cannot recover it. - -You cannot delete a member if the attached load balancer does not -have an ``ACTIVE`` provisioning status. - -Example: Remove a member from a pool - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - pool_id: pool_id-path - - member_id: member_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -.. ============================================================ - -List health monitors -==================== - -.. rest_method:: GET /v2.0/lbaas/healthmonitors - -Lists health monitors. - -This operation lists all health monitors that are associated with -your project. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -This operation returns a list, which might be empty. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitors: health_monitors-obj - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - id: health_monitor-id - - max_retries: max_retries - - pools: pools - - project_id: project_id - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/healthmonitors-list-response.json - :language: javascript - -Create health monitor -===================== - -.. rest_method:: POST /v2.0/lbaas/health_monitors - -Creates a health monitor. - -This operation provisions a health monitor by using the -configuration that you define in the request object. After the API -validates the request and start the provisioning process, it -returns a response object. The object contains a unique identifier. - -At a minimum, you must specify these health monitor attributes: - -- ``project_id``. Admin only. Required to create a health monitor for - another project. - -- ``type``. The type of health monitor. A valid value is ``TCP``, - ``HTTP``, or ``HTTPS``. - -- ``delay``. The interval, in seconds, between health checks. - -- ``timeout``. The time, in seconds, after which a health check - times out. - -- ``max_retries``. Number of failed health checks before marked as - OFFLINE. - -- ``pool_id``. The pool to monitor. - -Some attributes receive default values if you omit them from the -request, and are only useful when you specify a health monitor type -of HTTP(S): - -- ``http_method``. Default is ``GET``. - -- ``url_path``. Default is ``/``. - -- ``expected_codes``. The expected HTTP status codes to get from a - successful health check. Default is ``200``. - -- ``admin_state_up``. Default is ``true``. - -If the API cannot fulfill the request due to insufficient data or -data that is not valid, it returns the ``Bad Request (400)`` -response code with information about the nature of the failure in -the response body. Failures in the validation process are non- -recoverable and require that you correct the cause of the failure -and submit the request again. - -You can configure all documented features of the health monitor at -creation time by specifying the additional elements or attributes -in the request. - -Administrative users can specify a project ID that is different than -their own to create health monitors for other projects. - -To update a health monitor, the load balancer to which to attach -must have an ``ACTIVE`` provisioning status. - -Normal response codes: 201 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes - - http_method: http_method - - max_retries: max_retries - - pool_id: pool_id-request - - project_id: project_id - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/healthmonitor-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - id: health_monitor-id - - max_retries: max_retries - - pools: pools - - project_id: project_id - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/healthmonitor-show-response.json - :language: javascript - -Show health monitor details -=========================== - -.. rest_method:: GET /v2.0/lbaas/health_monitors/{health_monitor_id} - -Shows details for a health monitor. - -This operation returns a health monitor object, by health monitor -ID. If you are not an administrative user and the health monitor -object does not belong to your project, the service returns -the HTTP ``Forbidden (403)`` response code. - -Example: Show health monitor details - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor_id: health_monitor_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - max_retries: max_retries - - id: health_monitor-id - - pools: pools - - project_id: project_id - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/healthmonitor-show-response.json - :language: javascript - -Update health monitor -===================== - -.. rest_method:: PUT /v2.0/lbaas/health_monitors/{health_monitor_id} - -Updates a health monitor. - -Upon successful validation of the request, the service returns the -HTTP ``Accepted (202)`` response code. - -Note: The health monitor ID, ``project_id``, ``pool_id``, and type -are immutable attributes and cannot be updated. If you specify an -unsupported attribute, the service returns the HTTP ``Immutable -(422)`` response code. - -Normal response codes: 202 - -Error response codes: 401, 404, 422 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor_id: health_monitor_id-path - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes - - http_method: http_method - - max_retries: max_retries - - timeout: timeout - - url_path: url_path - -Request Example ---------------- - -.. literalinclude:: samples/lbaas/healthmonitor-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - health_monitor: health_monitor - - admin_state_up: admin_state_up - - delay: delay - - expected_codes: expected_codes-response - - http_method: http_method - - max_retries: max_retries - - id: health_monitor-id - - pools: pools - - project_id: project_id - - tenant_id: project_id - - timeout: timeout - - type: type - - url_path: url_path-response - -Response Example ----------------- - -.. literalinclude:: samples/lbaas/healthmonitor-update-response.json - :language: javascript - -Remove health monitor -===================== - -.. rest_method:: DELETE /v2.0/lbaas/health_monitors/{health_monitor_id} - -Removes a health monitor and its associated configuration from the project. - -The API immediately purges any and all configuration data. You -cannot recover it. - -You cannot delete a health monitor if the attached load balancer -does not have an ``ACTIVE`` provisioning status. - -Example: Delete a health monitor - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - health_monitor_id: health_monitor_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/logging.inc b/api-ref/source/v2/logging.inc deleted file mode 100644 index 309bd87..0000000 --- a/api-ref/source/v2/logging.inc +++ /dev/null @@ -1,271 +0,0 @@ -.. -*- rst -*- - -============ -Log resource -============ - -The ``logging`` extension lists, creates, shows information for, and updates -log resource. - -List logs -========= - -.. rest_method:: GET /v2.0/log/logs - -Lists all log resources associated with your project. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -The list might be empty. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - logs: logs - - id: log_id - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - event: log_event - - resource_type: resource_log_type - - resource_id: resource_log_id - - target_id: resource_target_log_id - - enabled: log_enabled - -Response Example ----------------- - -.. literalinclude:: samples/logs/log-list-response.json - :language: javascript - -Create log -========== - -.. rest_method:: POST /v2.0/log/logs - -Creates a log resource. - -Creates a log resource by using the configuration that you define in -the request object. A response object is returned. The object -contains a unique ID. - -If the caller is not an administrative user, this call returns the -HTTP ``Forbidden (403)`` response code. - -Users with an administrative role can create policies on behalf of -other projects by specifying a project ID that is different than -their own. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - log: log - - name: name-request - - description: description-request - - tenant_id: project_id-request - - project_id: project_id-request - - event: log_event-request - - resource_type: resource_log_type - - resource_id: resource_log_id-request - - target_id: resource_target_log_id-request - - enabled: log_enabled-request - -Request Example ---------------- - -.. literalinclude:: samples/logs/log-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - log: log - - id: log_id - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - event: log_event - - resource_type: resource_log_type - - resource_id: resource_log_id - - target_id: resource_target_log_id - - enabled: log_enabled - -Request Example ---------------- - -.. literalinclude:: samples/logs/log-create-response.json - :language: javascript - -Show log -======== - -.. rest_method:: GET /v2.0/log/logs/{log_id} - -Shows details log resource. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - log_id: log_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - log: log - - id: log_id - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - event: log_event - - resource_type: resource_log_type - - resource_id: resource_log_id - - target_id: resource_target_log_id - - enabled: log_enabled - -Response Example ----------------- - -.. literalinclude:: samples/logs/log-show-response.json - :language: javascript - -Update log -========== - -.. rest_method:: PUT /v2.0/log/logs/{log_id} - -Updates a log resource. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - log_id: log_id-path - - log: log - - name: name-request - - description: description-request - - enabled: log_enabled-request-put - -Request Example ---------------- - -.. literalinclude:: samples/logs/log-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - log: log - - id: log_id - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - event: log_event - - resource_type: resource_log_type - - resource_id: resource_log_id - - target_id: resource_target_log_id - - enabled: log_enabled - -Response Example ----------------- - -.. literalinclude:: samples/logs/log-update-response.json - :language: javascript - -Delete log -========== - -.. rest_method:: DELETE /v2.0/log/logs/{log_id} - -Deletes a log resource. - -Normal response codes: 204 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - log_id: log_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -================= -Loggable resource -================= - -List loggable resources -======================= - -.. rest_method:: GET /v2.0/log/loggable-resources - -Lists all resource log types are supporting. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - loggable_resources: loggable_resources - - type: resource_log_type - -Response Example ----------------- - -.. literalinclude:: samples/logs/loggable_resources-list-response.json - :language: javascript \ No newline at end of file diff --git a/api-ref/source/v2/logging_resource.inc b/api-ref/source/v2/logging_resource.inc deleted file mode 100644 index 7a72302..0000000 --- a/api-ref/source/v2/logging_resource.inc +++ /dev/null @@ -1,218 +0,0 @@ -.. -*- rst -*- - -=================== - Logging Resources -=================== - -.. note:: Currently this extension ``logging-resource`` is only available for networking-midonet. - -Lists, shows information for, creates, updates and deletes logging resources. - -List Logging Resources -====================== - -.. rest_method:: GET /v2.0/logging/logging_resources - -Lists logging resources. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response --------- - -.. rest_parameters:: parameters.yaml - - - logging_resources: logging_resources - - id: logging_resource_id-body - - tenant_id: project_id - - project_id: project_id - - firewall_logs: firewall_logs - - name: name - - description: description - - enabled: logging_resource_enabled - -Response Example ----------------- - -.. literalinclude:: samples/logging_resource/logging_resources-list-response.json - :language: javascript - -Create Logging Resource -======================= - -.. rest_method:: POST /v2.0/logging/logging_resources - -Creates a logging resource. - -Normal response codes: 200 - -Error response codes: 400, 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource: logging_resource - - tenant_id: project_id-request - - project_id: project_id-request - - name: name-request - - description: description-request - - enabled: logging_resource_enabled-request - -Request Example ---------------- - -.. literalinclude:: samples/logging_resource/logging_resource-create-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - logging_resource: logging_resource - - id: logging_resource_id-body - - tenant_id: project_id - - project_id: project_id - - firewall_logs: firewall_logs - - name: name - - description: description - - enabled: logging_resource_enabled - -Response Example ----------------- - -.. literalinclude:: samples/logging_resource/logging_resource-create-response.json - :language: javascript - -Show Logging Resource Details -============================= - -.. rest_method:: GET /v2.0/logging/logging_resources/{logging_resource_id} - -Shows details for a logging resource. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. For information, see `Filtering and -Column Selection `__. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - - fields: fields - -Response --------- - -.. rest_parameters:: parameters.yaml - - - logging_resource: logging_resource - - id: logging_resource_id-body - - tenant_id: project_id - - project_id: project_id - - firewall_logs: firewall_logs - - name: name - - description: description - - enabled: logging_resource_enabled - -Response Example ----------------- - -.. literalinclude:: samples/logging_resource/logging_resource-show-response.json - :language: javascript - -Update Logging Resource -======================= - -.. rest_method:: PUT /v2.0/logging/logging_resources/{logging_resource_id} - -Updates a logging resource. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - - logging_resource: logging_resource - - name: name-request-put - - description: description-request-put - - enabled: logging_resource_enabled-request-put - -Request Example ----------------- - -.. literalinclude:: samples/logging_resource/logging_resource-update-request.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - logging_resource: logging_resource - - id: logging_resource_id-body - - tenant_id: project_id - - project_id: project_id - - firewall_logs: firewall_logs - - name: name - - description: description - - enabled: logging_resource_enabled - -Response Example ----------------- - -.. literalinclude:: samples/logging_resource/logging_resource-update-response.json - :language: javascript - -Delete Logging Resource -======================= - -.. rest_method:: DELETE /v2.0/logging/logging_resources/{logging_resource_id} - -Deletes a logging resource. - -Normal response codes: 202 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - logging_resource_id: logging_resource_id - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/metering.inc b/api-ref/source/v2/metering.inc deleted file mode 100644 index dde9f0e..0000000 --- a/api-ref/source/v2/metering.inc +++ /dev/null @@ -1,347 +0,0 @@ -.. -*- rst -*- - -================================================================= -Metering labels and rules (metering-labels, metering-label-rules) -================================================================= - -Creates, modifies, and deletes OpenStack Layer3 metering labels and -rules. - -List metering labels -==================== - -.. rest_method:: GET /v2.0/metering/metering-labels - -Lists all L3 metering labels that belong to the project. - -The list shows the ID for each metering label. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - metering_labels: metering_labels - - description: description - - tenant_id: project_id - - project_id: project_id - - shared: metering_label-shared - - id: metering_label-id - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/metering/metering-labels-list-response.json - :language: javascript - -Create metering label -===================== - -.. rest_method:: POST /v2.0/metering/metering-labels - -Creates an L3 metering label. - -Normal response codes: 201 - -Error response codes: 400, 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - metering_label: metering_label - - shared: metering_label-shared-request - - description: description - - name: name - - tenant_id: project_id - - project_id: project_id - -Request Example ---------------- - -.. literalinclude:: samples/metering/metering-label-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - metering_label: metering_label - - description: description - - tenant_id: project_id - - project_id: project_id - - shared: metering_label-shared - - id: metering_label-id - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/metering/metering-label-create-response.json - :language: javascript - -Show metering label details -=========================== - -.. rest_method:: GET /v2.0/metering/metering-labels/{metering_label_id} - -Shows details for a metering label. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - metering_label_id: metering_label-id-path - -Request Example ---------------- - -.. literalinclude:: samples/metering/metering-label-show-request-json-http.txt - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - metering_label: metering_label - - description: description - - tenant_id: project_id - - project_id: project_id - - shared: metering_label-shared - - id: metering_label-id - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/metering/metering-label-show-response.json - :language: javascript - -Delete metering label -===================== - -.. rest_method:: DELETE /v2.0/metering/metering-labels/{metering_label_id} - -Deletes an L3 metering label. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - metering_label_id: metering_label-id-path - -Request Example ---------------- - -.. literalinclude:: samples/metering/metering-label-delete-request-json-http.txt - :language: javascript - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List metering label rules -========================= - -.. rest_method:: GET /v2.0/metering/metering-label-rules - -Lists a summary of all L3 metering label rules that belong to the project. - -The list shows the ID for each metering label rule. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - metering_label_rules: metering_label_rules - - direction: direction - - remote_ip_prefix: remote_ip_prefix - - excluded : excluded - - metering_label_id: metering_label-id-response-body - - id: metering_label_rule-id - -Response Example ----------------- - -.. literalinclude:: samples/metering/metering-label-rules-list-response.json - :language: javascript - -Create metering label rule -========================== - -.. rest_method:: POST /v2.0/metering/metering-label-rules - -Creates an L3 metering label rule. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - metering_label_rule: metering_label_rule - - remote_ip_prefix: remote_ip_prefix - - direction: direction - - metering_label_id: metering_label-id-response-body - - excluded: excluded - -Request Example ---------------- - -.. literalinclude:: samples/metering/metering-label-rule-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - metering_label_rule: metering_label_rule - - direction: direction - - remote_ip_prefix: remote_ip_prefix - - excluded : excluded - - metering_label_id: metering_label-id-response-body - - id: metering_label_rule-id - -Response Example ----------------- - -.. literalinclude:: samples/metering/metering-label-rule-create-response.json - :language: javascript - -Show metering label rule details -================================ - -.. rest_method:: GET /v2.0/metering/metering-label-rules/{metering_label_rule_id} - -Shows details for a metering label rule. - -The response body shows this information for each metering label rule: - -- ``direction``. Either ingress or egress. - -- ``excluded``. Either ``true`` or ``false``. - -- The ID for the metering label rule. - -- The remote IP prefix. - -- The metering label ID for the metering label with which the rule - is associated. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - metering_label_rule_id: metering_label_rule-id-path - -Request Example ---------------- - -.. literalinclude:: samples/metering/metering-label-rule-show-request-json-http.txt - :language: javascript - -Response Paramters ------------------- - -.. rest_parameters:: parameters.yaml - - - metering_label_rule: metering_label_rule - - direction: direction - - remote_ip_prefix: remote_ip_prefix - - excluded : excluded - - metering_label_id: metering_label-id-response-body - - id: metering_label_rule-id - -Response Example ----------------- - -.. literalinclude:: samples/metering/metering-label-rule-show-response.json - :language: javascript - -Delete metering label rule -========================== - -.. rest_method:: DELETE /v2.0/metering/metering-label-rules/{metering_label_rule_id} - -Deletes an L3 metering label rule. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - metering_label_rule_id: metering_label_rule-id-path - -Request Example ---------------- - -.. literalinclude:: samples/metering/metering-label-rule-delete-request-json-http.txt - :language: javascript - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/network-ip-availability.inc b/api-ref/source/v2/network-ip-availability.inc deleted file mode 100644 index 22c9fab..0000000 --- a/api-ref/source/v2/network-ip-availability.inc +++ /dev/null @@ -1,96 +0,0 @@ -.. -*- rst -*- - -======================================= -Network IP availability and usage stats -======================================= - -The extension ``network-ip-availability`` allows users to list and show the -network IP usage stats of all networks or of a specified network. -By default policy configuration, only administrative users can use this API. - -Show Network IP Availability -============================ - -.. rest_method:: GET /v2.0/network-ip-availabilities/{network_id} - -Shows network IP availability details for a network. - -By default policy configuration, only administrative users can retrieve -IP availability. Otherwise, ``Not Found (404)`` will be returned. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - network_id: network_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network_ip_availability: network_ip_availability - - network_id: network_ip_availability-network_id - - network_name: network-name - - tenant_id: project_id - - project_id: project_id - - total_ips: total_ips - - used_ips: used_ips - - subnet_ip_availability: subnet_ip_availability - - subnet_id: network_ip_availability-subnet_id - - subnet_name: subnet_name - - ip_version: subnet-ip_version - - cidr: cidr - -Response Example ----------------- - -.. literalinclude:: samples/network-ip-availability/network-ip-availability-show.json - :language: javascript - -List Network IP Availability -============================ - -.. rest_method:: GET /v2.0/network-ip-availabilities - -Lists network IP availability of all networks. - -By default policy configuration, only administrative users can retrieve -IP availabilities. Otherwise, an empty list will be returned. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network_ip_availabilities: network_ip_availabilities - - network_id: network_ip_availability-network_id - - network_name: network-name - - tenant_id: project_id - - project_id: project_id - - total_ips: total_ips - - used_ips: used_ips - - subnet_ip_availability: subnet_ip_availability - - subnet_id: network_ip_availability-subnet_id - - subnet_name: subnet_name - - ip_version: subnet-ip_version - - cidr: cidr - -Response Example ----------------- - -.. literalinclude:: samples/network-ip-availability/network-ip-availability-list.json - :language: javascript - diff --git a/api-ref/source/v2/networks.inc b/api-ref/source/v2/networks.inc deleted file mode 100644 index 2ace55b..0000000 --- a/api-ref/source/v2/networks.inc +++ /dev/null @@ -1,493 +0,0 @@ -.. -*- rst -*- -.. needs:method_verification -.. NOTE(amotoki): method_verification will be removed after sorting methods - in the recommended order. - -======== -Networks -======== - -Lists, shows details for, creates, updates, and deletes networks. - -provider extended attributes -============================ - -The ``provider`` extension allows administrative users to define a physical -binding of a logical network. This extension provides three additional -attributes: ``provider:network_type``, ``provider:physical_network`` and -``provider:segmentation_id``. The validation rules for these attributes -vary across ``provider:network_type``. For example, ``vlan`` and ``flat`` -network types require ``provider:physical_network`` attribute, but ``vxlan`` -network type does not. - -Most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating -any provider related attributes. Check your plug-in whether it supports -updating. - -multiple provider extension -=========================== - -The ``multi-provider`` extension allows administrative users to define multiple -physical bindings for a logical network. - -To define multiple physical bindings for a network, include a ``segments`` list -in the request body of network creation request. Each element in the -``segments`` list has the same structure as the provider network -attributes. These attributes are ``provider:network_type``, -``provider:physical_network``, and ``provider:segmentation_id``. The same -validation rules are applied to each element in the ``segments`` list. - -Note that you cannot use the provider extension and the multiple provider -extension for a single logical network. - -VLAN transparency extension -=========================== - -The ``vlan-transparent`` extension enables plug-ins that support VLAN -transparency to deliver VLAN transparent trunk networks. -This extension introduces ``vlan_transparent`` attribute to control -a VLAN transparecy of the network. If the service does not support VLAN -transparency and a user requests a VLAN transparent network, -the plug-in refuses to create one and returns an appropriate error to the user. - -MTU extension -============= - -The ``net-mtu`` extension allows plug-ins to expose the MTU that is guaranteed -to pass through the data path of the segments in the network. This extension -introduces a read-only ``mtu`` attribute. - -Show network details -==================== - -.. rest_method:: GET /v2.0/networks/{network_id} - -Shows details for a network. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. For information, see `Filtering and -Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - network_id: network_id-path - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network: network - - admin_state_up: network-admin_state_up - - availability_zone_hints: availability_zone_hints - - availability_zones: availability_zones - - created_at: created_at_resource - - id: network-id - - mtu: mtu - - name: network-name - - port_security_enabled: network-port_security_enabled - - project_id: project_id - - provider:network_type: provider:network_type - - provider:physical_network: provider:physical_network - - provider:segmentation_id: provider:segmentation_id - - qos_policy_id: qos_policy_id - - router:external: router:external - - segments: segments - - shared: network-shared - - status: network-status - - subnets: network-subnets - - tenant_id: project_id - - updated_at: updated_at_resource - - vlan_transparent: vlan_transparent - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/networks/network-show-response.json - :language: javascript - -Response Example (admin user; single segment mapping) ------------------------------------------------------ - -.. literalinclude:: samples/networks/network-provider-show-response.json - :language: javascript - -Response Example (admin user; multiple segment mappings) --------------------------------------------------------- - -.. literalinclude:: samples/networks/network-multi-show-response.json - :language: javascript - -Update network -============== - -.. rest_method:: PUT /v2.0/networks/{network_id} - -Updates a network. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - network_id: network_id-path - - network: network - - admin_state_up: network-admin_state_up-request - - name: network-name-request - - port_security_enabled: network-port_security_enabled-request - - provider:network_type: provider:network_type - - provider:physical_network: provider:physical_network - - provider:segmentation_id: provider:segmentation_id - - qos_policy_id: qos_policy_id-request - - router:external: router:external-request - - segments: segments - - shared: network-shared-request - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/networks/network-update-request.json - :language: javascript - -Request Example (admin user; single segment mapping) ----------------------------------------------------- - -.. literalinclude:: samples/networks/network-provider-update-request.json - :language: javascript - -Request Example (admin user; multiple segment mappings) -------------------------------------------------------- - -.. literalinclude:: samples/networks/network-multi-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network: network - - admin_state_up: network-admin_state_up - - availability_zone_hints: availability_zone_hints - - availability_zones: availability_zones - - id: network-id - - mtu: mtu - - name: network-name - - port_security_enabled: network-port_security_enabled - - project_id: project_id - - provider:network_type: provider:network_type - - provider:physical_network: provider:physical_network - - provider:segmentation_id: provider:segmentation_id - - qos_policy_id: qos_policy_id - - router:external: router:external - - segments: segments - - shared: network-shared - - status: network-status - - subnets: network-subnets - - tenant_id: project_id - - description: description - -Response Example ----------------- - -This is an example when a regular user without administrative roles -sends a PUT request. Response examples for administrative users are -similar to responses of `Show network details <#show-network-details>`__ -and `Create network <#create-network>`__. See them for details. - -.. literalinclude:: samples/networks/network-update-response.json - :language: javascript - -Delete network -============== - -.. rest_method:: DELETE /v2.0/networks/{network_id} - -Deletes a network and its associated resources. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - network_id: network_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List networks -============= - -.. rest_method:: GET /v2.0/networks - -Lists networks to which the project has access. - -Default policy settings return only networks that the project who submits the -request owns, unless an administrative user submits the request. In addition, -networks shared with the project who submits the request are also returned. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -.. TODO(amotoki): Add description on tag filtering to the general API overview. - -You can also use the ``tags``, ``tags-any``, ``not-tags``, ``not-tags-any`` -query parameter to filter the response with tags. For information, -see `REST API Impact `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - networks: networks - - admin_state_up: network-admin_state_up - - availability_zone_hints: availability_zone_hints - - availability_zones: availability_zones - - id: network-id - - mtu: mtu - - name: network-name - - port_security_enabled: network-port_security_enabled - - project_id: project_id - - provider:network_type: provider:network_type - - provider:physical_network: provider:physical_network - - provider:segmentation_id: provider:segmentation_id - - qos_policy_id: qos_policy_id - - router:external: router:external - - segments: segments - - shared: network-shared - - status: network-status - - subnets: network-subnets - - tenant_id: project_id - - vlan_transparent: vlan_transparent - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/networks/networks-list-response.json - :language: javascript - -Response Example (admin user) ------------------------------ - -When Administrative users request to list networks, -physical segment information bound to the networks are also returned -in a response. In this example, a network ``net1`` is mapped to a single -network segment and a network ``net2`` is mapped to multiple network segments. - -.. literalinclude:: samples/networks/networks-provider-list-response.json - :language: javascript - -Create network -============== - -.. rest_method:: POST /v2.0/networks - -Creates a network. - -A request body is optional. An administrative user can specify -another project ID, which is the project that owns the network, in -the request body. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - network: network - - admin_state_up: network-admin_state_up-request - - name: network-name-request - - port_security_enabled: network-port_security_enabled-request - - project_id: project_id-request - - provider:network_type: provider:network_type-request - - provider:physical_network: provider:physical_network-request - - provider:segmentation_id: provider:segmentation_id-request - - qos_policy_id: qos_policy_id-request - - router:external: router:external-request - - segments: segments-request - - shared: network-shared-request - - tenant_id: project_id-request - - vlan_transparent: vlan_transparent-request - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/networks/network-create-request.json - :language: javascript - -Request Example (admin user; single segment mapping) ----------------------------------------------------- - -.. literalinclude:: samples/networks/network-provider-create-request.json - :language: javascript - -Request Example (admin user; multiple segment mappings) -------------------------------------------------------- - -.. literalinclude:: samples/networks/network-multi-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - network: network - - admin_state_up: network-admin_state_up - - availability_zone_hints: availability_zone_hints - - availability_zones: availability_zones - - id: network-id - - mtu: mtu - - name: network-name - - port_security_enabled: network-port_security_enabled - - project_id: project_id - - provider:network_type: provider:network_type - - provider:physical_network: provider:physical_network - - provider:segmentation_id: provider:segmentation_id - - qos_policy_id: qos_policy_id - - router:external: router:external - - segments: segments - - shared: network-shared - - status: network-status - - subnets: network-subnets - - tenant_id: project_id - - vlan_transparent: vlan_transparent - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/networks/network-create-response.json - :language: javascript - -Response Example (admin user; single segment mapping) ------------------------------------------------------ - -.. literalinclude:: samples/networks/network-provider-create-response.json - :language: javascript - -Response Example (admin user; multiple segment mappings) --------------------------------------------------------- - -.. literalinclude:: samples/networks/network-multi-create-response.json - :language: javascript - -Bulk create networks -==================== - -.. rest_method:: POST /v2.0/networks - -Creates multiple networks in a single request. - -In the request body, specify a list of networks. - -The bulk create operation is always atomic. Either all or no -networks in the request body are created. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - networks: networks - - admin_state_up: network-admin_state_up-request - - name: network-name-request - - port_security_enabled: network-port_security_enabled-request - - project_id: project_id-request - - provider:network_type: provider:network_type-request - - provider:physical_network: provider:physical_network-request - - provider:segmentation_id: provider:segmentation_id-request - - qos_policy_id: qos_policy_id-request - - router:external: router:external-request - - segments: segments-request - - shared: network-shared-request - - tenant_id: project_id-request - - vlan_transparent: vlan_transparent-request - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/networks/networks-bulk-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - networks: networks - - admin_state_up: network-admin_state_up - - availability_zone_hints: availability_zone_hints - - availability_zones: availability_zones - - id: network-id - - mtu: mtu - - name: network-name - - port_security_enabled: network-port_security_enabled - - project_id: project_id - - provider:network_type: provider:network_type - - provider:physical_network: provider:physical_network - - provider:segmentation_id: provider:segmentation_id - - qos_policy_id: qos_policy_id - - router:external: router:external - - segments: segments - - shared: network-shared - - status: network-status - - subnets: network-subnets - - tenant_id: project_id - - vlan_transparent: vlan_transparent - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/networks/networks-bulk-create-response.json - :language: javascript diff --git a/api-ref/source/v2/parameters.yaml b/api-ref/source/v2/parameters.yaml deleted file mode 100644 index d06b107..0000000 --- a/api-ref/source/v2/parameters.yaml +++ /dev/null @@ -1,6114 +0,0 @@ - # variables in header - -# variables in path -bgpvpn-id-path: - description: | - The ID of the BGP VPN. - in: path - required: true - type: string -bgpvpn-network_association_id-path: - description: | - The ID of an association between a network and a BGP VPN. - in: path - required: true - type: string -bgpvpn-router_association_id-path: - description: | - The ID of an association between a router and a BGP VPN. - in: path - required: true - type: string -connection_id-path: - description: | - The ID of the IPSec site-to-site connection. - in: path - required: false - type: string -dscp_rule_id: - description: | - The ID of the DSCP rule. - in: path - required: true - type: string -endpoint_group_id-path: - description: | - The ID of the VPN endpoint group. - in: path - required: false - type: string -extensions-alias-path: - description: | - The alias of an extension. - in: path - required: true - type: string -firewall_group_id-path-required: - description: | - The ID of the firewall group. - in: path - required: true - type: string -firewall_id: - description: | - The ID of the firewall. - in: path - required: true - type: string -firewall_log_id: - description: | - The ID of the firewall log resource. - in: path - required: true - type: string -firewall_policy_id-path: - description: | - The ID of the firewall policy. - in: path - required: true - type: string -firewall_policy_id-path-required: - description: | - The ID of the firewall policy. - in: path - required: true - type: string -firewall_rule_id: - description: | - The ID for the firewall rule. - in: path - required: true - type: string -firewall_rule_id-path-required: - description: | - The ID for the firewall rule. - in: path - required: true - type: string -flavor_id: - description: | - The UUID of the flavor. - in: path - required: true - type: string -floatingip-id-path: - description: | - The ID of the floating IP address. - in: path - required: true - type: string -health_monitor_id-path: - description: | - The ID for the health monitor. - in: path - required: true - type: string -ikepolicy_id-path: - description: | - The ID of the IKE policy. - in: path - required: true - type: string -ipsecpolicy_id-path: - description: | - The ID of the IPSec policy. - in: path - required: false - type: string -listener-id-path: - description: | - The ID of the listener. - in: path - required: true - type: string -loadbalancer-id-path: - description: | - The ID of the load balancer. - in: path - required: true - type: string -log_id-path: - description: | - The ID of the log resource. - in: path - required: true - type: string -logging_resource_id: - description: | - The ID of the logging resource. - in: path - required: true - type: string -member_id-path: - description: | - The ID for the member. - in: path - required: true - type: string -metering_label-id-path: - description: | - The ID of the metering label. - in: path - required: true - type: string -metering_label_rule-id-path: - description: | - The ID of the metering label rule. - in: path - required: true - type: string -network_id-path: - description: | - The ID of the network. - in: path - required: true - type: string -pool_id-path: - description: | - The ID for the pool. - in: path - required: true - type: string -pool_id-request: - description: | - The ID for the pool. - in: path - required: truee - type: string -port_id-path: - description: | - The ID of the port. - in: path - required: true - type: string -profile_id: - description: | - The UUID of the service profile. - in: path - required: true - type: string -project_id-path: - description: | - The ID of the project. - in: path - required: true - type: string -qos-policy-id-path: - description: | - The ID of the QoS policy. - in: path - required: true - type: string -qos-rule_id: - description: | - The ID of the QoS rule. - in: path - required: true - type: string -rbac_policy_id-path: - description: | - The ID of the RBAC policy. - in: path - required: true - type: integer -resource_id: - description: | - The ID of resource which the tag is set on. - in: path - required: true - type: string -resource_type: - description: | - The type of resource which the tag is set on. - in: path - required: true - type: string -router_id: - description: | - The ID of the router. - in: path - required: true - type: string -security_group-id-path: - description: | - The ID of the security group. - in: path - required: true - type: string -security_group_rule-id-path: - description: | - The ID of the security group rule. - in: path - required: true - type: string -segment_id-path: - description: | - The UUID of the segment. - in: path - required: true - type: string -subnet_id-path: - description: | - The ID of the subnet. - in: path - required: true - type: string -subnetpool_id: - description: | - The UUID of the subnet pool. - in: path - required: true - type: string -tag: - description: | - The name for the tag. - in: path - required: true - type: string -trunk_id: - description: | - The ID of the trunk. - in: path - required: true - type: string -vip_id-path: - description: | - The ID for the VIP. - in: path - required: true - type: string -vpnservice_id-path: - description: | - The ID of the VPN service. - in: path - required: false - type: string -# variables in query -fields: - description: | - The fields that you want the server to return. - If no ``fields`` query parameter is specified, - the networking API returns all attributes allowed by the policy settings. - By using ``fields`` parameter, the API returns only the requested set of - attributes. ``fields`` parameter can be specified multiple times. - For example, if you specify ``fields=id&fields=name`` in the request URL, - only ``id`` and ``name`` attributes will be returned. - in: query - required: false - type: string -verbose: - description: | - Show detailed information. - in: query - required: false - type: boolean - -# variables in body -action: - description: | - The action that the API performs on traffic that - matches the firewall rule. Valid value is ``allow`` or ``deny``. - Default is ``deny``. - in: body - required: false - type: string -action-response: - description: | - The action that the API performs on traffic that - matches the firewall rule. Valid value is ``allow``, ``deny`` or ``reject``. - Default is ``deny``. - in: body - required: true - type: string -action_2: - description: | - The action that the API performs on traffic that - matches the firewall rule. Value is ``allow`` or ``deny``. - in: body - required: true - type: string -address: - description: | - The IP address of the member. - format: ipv4 - in: body - required: true - type: string -address_scope_id: - description: | - An address scope to assign to the subnet pool. - in: body - required: false - type: string -address_scope_id_1: - description: | - The address scope. - in: body - required: true - type: string -admin_state_up: - description: | - The administrative state of the resource, which is - up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up-request: - description: | - The administrative state of the resource, which is - up (``true``) or down (``false``). - Default is ``true``. - in: body - required: false - type: boolean -admin_state_up_1: - description: | - The administrative status of the port, which is - up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_10: - description: | - The administrative state of the VIP. A valid - value is up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_11: - description: | - The administrative state of the VPN service, - which is up (``true``) or down (``false``). If down, connections - on service are not active. - in: body - required: false - type: boolean -admin_state_up_12: - description: | - The administrative state of the firewall, which - is up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_13: - description: | - The administrative state of the health monitor, - which is up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_14: - description: | - The administrative state of the IPSec connection, - which is up (``true``) or down (``false``). If down, the - connection does not forward packets. - in: body - required: true - type: boolean -admin_state_up_15: - description: | - The administrative state of the listener, which - is up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_16: - description: | - The administrative state of the load balancer, - which is up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_17: - description: | - The administrative state of the member. A valid - value is up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_19: - description: | - The administrative state of the pool, which is up - (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_20: - description: | - The administrative state of the router, which is - up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_21: - description: | - The administrative state of the VIP. A valid - value is up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_22: - description: | - The administrative state of the VPN service, - which is up (``true``) or down (``false``). If down, the port does - not forward packets. - in: body - required: true - type: boolean -admin_state_up_23: - description: | - The administrative state of the firewall, which - is up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_24: - description: | - The administrative state of the health monitor. A - valid value is up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_25: - description: | - The administrative state of the load balancer, - which is up (``true``) or down (``false``). Set this attribute to - ``false`` to create the listener in an administratively down - state. - in: body - required: false - type: boolean -admin_state_up_26: - description: | - The administrative state of the IPSec connection, - which is up (``true``) or down (``false``). If down, the - connection does not forward packets. - in: body - required: false - type: boolean -admin_state_up_3: - description: | - The administrative state of the port, which is up - (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_4: - description: | - The administrative state of the load balancer, - which is up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_5: - description: | - The administrative state of the member, which is - up (``true``) or down (``false``). - in: body - required: true - type: boolean -admin_state_up_6: - description: | - The administrative state of the member. A valid - value is up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_7: - description: | - The administrative state of the network, which is - up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_8: - description: | - The administrative state of the pool. A valid - value is up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_9: - description: | - The administrative state of the router, which is - up (``true``) or down (``false``). - in: body - required: false - type: boolean -admin_state_up_trunk: - description: | - The administrative state of the trunk, which - is up (``true``) or down (``false``). - in: body - required: false - type: boolean -alias: - description: | - The alias for the extension. For example, - "FOXNSOX", "os- availability-zone", "os-extended-quotas", "os- - share-unmanage" or "os-used-limits." - in: body - required: true - type: string -allowed_address_pairs: - description: | - A set of zero or more allowed address pairs. - An address pair consists of an IP address range and MAC address - with the format of - ``{"ip_address": "", "mac_address": ""}``. - A server connected to the port can send a packet with source address - which matches one of the specified allowed address pairs. - in: body - required: true - type: array -allowed_address_pairs-request: - description: | - A set of zero or more allowed address pairs. - An address pair consists of an IP address range and MAC address - with the format of - ``{"ip_address": "", "mac_address": ""}``. - A server connected to the port can send a packet with source address - which matches one of the specified allowed address pairs. - The default is an empty list. - For each address pair, ``ip_address`` is required and IP address or - CIDR can be specified. ``mac_address`` is optional and if unspecified - the MAC address of the port is used as default. - in: body - required: false - type: array -audited: - description: | - Each time that the firewall policy or its - associated rules are changed, the API sets this attribute to - ``false``. To audit the policy, explicitly set this attribute to - ``true``. - in: body - required: true - type: boolean -audited_1: - description: | - Indicates whether the policy has been audited. - Each time that the firewall policy or its associated rules are - changed, the API sets this attribute to ``false``. To audit the - policy, the policy owner must explicitly update the policy to set - this attribute to ``true``. - in: body - required: true - type: boolean -auth_algorithm: - description: | - The authentication hash algorithm. Valid values - are ``sha1``, ``sha256``, ``sha384``, ``sha512``. - The default is ``sha1``. - in: body - required: false - type: string -auth_mode: - description: | - The authentication mode. A valid value is - ``psk``, which is the default. - in: body - required: false - type: string -availability_zone_hints: - description: | - The availability zone candidate for the network. - in: body - required: true - type: array -availability_zones: - description: | - The availability zone for the network. - in: body - required: true - type: array -bandwidth_limit_rule: - description: | - A ``bandwidth_limit_rule`` object. - in: body - required: true - type: object -bandwidth_limit_rules: - description: | - A list of bandwidth limit rules associated with - the QoS policy. - in: body - required: true - type: array -bgpvpn: - description: | - A ``bgpvpn`` object represents an MPLS network with which Neutron routers - and/or networks may be associated - in: body - required: true - type: object -bgpvpn-export_targets: - description: | - Additional Route Targets that will be used for export. - in: body - required: false - type: array -bgpvpn-export_targets-required: - description: | - Additional Route Targets that will be used for export. - in: body - required: true - type: array -bgpvpn-id-body: - description: | - The ID of the BGP VPN. - in: body - required: true - type: string -bgpvpn-import_targets: - description: | - Additional Route Targets that will be imported. - in: body - required: false - type: array -bgpvpn-import_targets-required: - description: | - Additional Route Targets that will be imported. - in: body - required: true - type: array -bgpvpn-name: - description: | - The user meaningful name of the BGP VPN. - in: body - required: false - type: string -bgpvpn-name-required: - description: | - The user meaningful name of the BGP VPN. - in: body - required: true - type: string -bgpvpn-network_association: - description: | - A ``network_association`` object represents the binding of a BGP VPN - to a Neutron network. - in: body - required: true - type: object -bgpvpn-network_association_id: - description: | - The ID of an association between a network and a BGP VPN. - in: body - required: true - type: string -bgpvpn-network_associations: - description: | - A list of ``network_association`` objects which represent bindings - of MPLS networks to Neutron networks. - in: body - required: true - type: object -bgpvpn-network_id: - description: | - The ID of a Neutron network with which to associate the BGP VPN. - in: body - required: true - type: string -bgpvpn-networks: - description: | - This read-only list of network IDs reflects the associations defined by - Network association API resources. - in: body - required: false - type: array -bgpvpn-networks-required: - description: | - This read-only list of network IDs reflects the associations defined by - Network association API resources. - in: body - required: true - type: array -bgpvpn-route_distinguishers: - description: | - List of route distinguisher strings. If this parameter is specified, one - of these RDs will be used to advertise VPN routes. - in: body - required: false - type: array -bgpvpn-route_distinguishers-required: - description: | - List of route distinguisher strings. If this parameter is specified, one - of these RDs will be used to advertise VPN routes. - in: body - required: true - type: array -bgpvpn-route_targets: - description: | - Route Targets that will be both imported and used for export. - in: body - required: false - type: array -bgpvpn-route_targets-required: - description: | - Route Targets that will be both imported and used for export. - in: body - required: true - type: array -bgpvpn-router_association: - description: | - A ``router_association`` object represents the binding of a BGP VPN - to a Neutron router. - in: body - required: true - type: object -bgpvpn-router_association_id: - description: | - The ID of an association between a router and a BGP VPN. - in: body - required: true - type: string -bgpvpn-router_associations: - description: | - A list of ``router_association`` objects which represent bindings - of MPLS networks to Neutron routers. - in: body - required: true - type: object -bgpvpn-router_id: - description: | - The ID of a Neutron router with which to associate the BGP VPN. - in: body - required: true - type: string -bgpvpn-routers: - description: | - This read-only list of router IDs reflects the associations defined by - Router association API resources. - in: body - required: false - type: array -bgpvpn-routers-required: - description: | - This read-only list of router IDs reflects the associations defined by - Router association API resources. - in: body - required: true - type: array -bgpvpn-type: - description: | - Selection of the type of VPN and the technology behind it. Allowed - values are ``l2`` or ``l3``. The default is l3. ``l2`` indicates a Layer - 2 (i.e. bridged) attachment and ``l3`` indicates a Layer 3 (i.e. - routed) attachment. - in: body - required: false - type: string -bgpvpn-type-required: - description: | - Selection of the type of VPN and the technology behind it. Allowed - values are ``l2`` or ``l3``. The default is l3. ``l2`` indicates a Layer - 2 (i.e. bridged) attachment and ``l3`` indicates a Layer 3 (i.e. - routed) attachment. - in: body - required: true - type: string -bgpvpns: - description: | - A list of ``bgpvpn`` objects. Each ``bgpvpn`` object represents an - MPLS network with which Neutron routers and/or networks may be associated - in: body - required: true - type: array -binding:host_id: - description: | - The ID of the host where the port resides. - in: body - required: true - type: string -binding:host_id-request: - description: | - The ID of the host where the port resides. - The default is an empty string. - in: body - required: false - type: string -binding:profile: - description: | - A dictionary that enables the application running on the specific host to - pass and receive vif port information specific to the networking back-end. - The networking API does not define a specific format of this field. - in: body - required: true - type: string -binding:profile-request: - description: | - A dictionary that enables the application running on the specific host to - pass and receive vif port information specific to the networking back-end. - The networking API does not define a specific format of this field. - The default is an empty dictionary. - in: body - required: false - type: string -binding:vif_details: - description: | - A dictionary which contains additional information on the port. - Currently the following fields are defined: ``port_filter`` and - ``ovs_hybrid_plug``. - ``port_filter`` is a boolean indicating the networking service - provides port filtering features such as security group and/or - anti MAC/IP spoofing. - ``ovs_hybrid_plug`` is a boolean used to inform an API consumer - like nova that the hybrid plugging strategy for OVS should be used. - in: body - required: true - type: object -binding:vif_type: - description: | - The type of which mechanism is used for the port. - An API consumer like nova can use this to determine an appropriate way to - attach a device (for example an interface of a virtual server) to the port. - Available values currently defined includes - ``ovs``, ``bridge``, ``macvtap``, ``hw_veb``, ``hostdev_physical``, - ``vhostuser``, ``distributed`` and ``other``. - There are also special values: ``unbound`` and ``binding_failed``. - ``unbound`` means the port is - not bound to a networking back-end. ``binding_failed`` means an error - that the port failed to be bound to a networking back-end. - in: body - required: true - type: string -binding:vnic_type: - description: | - The type of vNIC which this port should be attached to. This is used to - determine which mechanism driver(s) to be used to bind the port. - The valid values are ``normal``, ``macvtap``, ``direct``, ``baremetal``, - ``direct-physical`` and ``virtio-forwarder``. - What type of vNIC is actually available depends on deployments. - in: body - required: true - type: string -binding:vnic_type-request: - description: | - The type of vNIC which this port should be attached to. This is used to - determine which mechanism driver(s) to be used to bind the port. - The valid values are ``normal``, ``macvtap``, ``direct``, ``baremetal``, - ``direct-physical`` and ``virtio-forwarder``. - What type of vNIC is actually available depends on deployments. - The default is ``normal``. - in: body - required: false - type: string -cidr: - description: | - The CIDR of the subnet. - in: body - required: true - type: string -connection_id-body-response: - description: | - The ID of the IPSec site-to-site connection. - in: body - required: false - type: string -connection_limit: - description: | - The maximum number of connections permitted for - this load balancer. Default is infinite. - in: body - required: false - type: integer -connection_limit-response: - description: | - The maximum number of connections allowed for the - VIP. Value is ``-1`` if the limit is not set. Default - is infinite. - in: body - required: true - type: integer -connection_limit_2: - description: | - The maximum number of connections permitted for - this load balancer. Default is infinite. - in: body - required: true - type: integer -connection_limit_3: - description: | - The maximum number of connections allowed for the - VIP. Default is ``-1``, meaning no limit. - in: body - required: true - type: integer -created_at: - description: | - Time at which port has been created. - in: body - required: true - type: string -created_at_1: - description: | - Time at which subnetpool has been created. - in: body - required: true - type: string -created_at_resource: - description: | - Time at which the resource has been created (in UTC ISO8601 format). - in: body - required: true - type: string -data_plane_status: - description: | - Status of the underlying data plane of a port. - in: body - required: true - type: string -data_plane_status-request: - description: | - Status of the underlying data plane of a port. - in: body - required: false - type: string -default: - description: | - Defines whether the provider is the default for - the service type. If this value is ``true``, the provider is the - default. If this value is ``false``, the provider is not the - default. - in: body - required: true - type: boolean -default_pool_id: - description: | - The ID of default pool. Must have compatible - protocol with listener. - in: body - required: false - type: string -default_pool_id-response: - description: | - The ID of default pool. Must have compatible - protocol with listener. - in: body - required: true - type: string -default_prefixlen: - description: | - The size of the prefix to allocate when the - ``cidr`` or ``prefixlen`` attributes are omitted when you create - the subnet. Default is ``min_prefixlen``. - in: body - required: false - type: integer -default_prefixlen_1: - description: | - The size of the prefix to allocate when the - ``cidr`` or ``prefixlen`` attributes are omitted when you create - the subnet. - in: body - required: true - type: integer -default_quota: - description: | - A per-project quota on the prefix space that can - be allocated from the subnet pool for project subnets. Default is - no quota is enforced on allocations from the subnet pool. For IPv4 - subnet pools, ``default_quota`` is measured in units of /32. For - IPv6 subnet pools, ``default_quota`` is measured units of /64. All - projects that use the subnet pool have the same prefix quota - applied. - in: body - required: false - type: integer -default_quota_1: - description: | - A per-project quota on the prefix space that can - be allocated from the subnet pool for project subnets. For IPv4 - subnet pools, ``default_quota`` is measured in units of /32. For - IPv6 subnet pools, ``default_quota`` is measured units of /64. All - projects that use the subnet pool have the same prefix quota - applied. - in: body - required: true - type: integer -default_quota_2: - description: | - A per-project quota on the prefix space that can - be allocated from the subnet pool for project subnets. Default is - no quota is enforced on allocations from the subnet pool. For IPv4 - subnet pools, ``default_quota`` is measured in units of /32. For - IPv6 subnet pools, ``default_quota`` is measured units of /64. All - projects that use the subnet pool have the same prefix quota - applied. Updating this parameter has no effect on existing subnet - allocations. The existing subnet allocations for each project are - counted against the updated prefix space quota. - in: body - required: false - type: integer -default_tls_container_ref: - description: | - A reference to a container of TLS secrets. - in: body - required: false - type: string -default_tls_container_ref-response: - description: | - A reference to a container of TLS secrets. - in: body - required: true - type: string -delay: - description: | - The time, in seconds, between sending probes to - members. - in: body - required: true - type: integer -delay_1: - description: | - The amount of time, in seconds, between sending - probes to members. - in: body - required: true - type: integer -delay_2: - description: | - The amount of time, in seconds, between sending - probes to members. - in: body - required: false - type: integer -description: - description: | - A human-readable description for the resource. - in: body - required: true - type: string -description-request: - description: | - A human-readable description for the resource. - Default is an empty string. - in: body - required: false - type: string -description-request-put: - description: | - A human-readable description for the resource. - in: body - required: false - type: string -description_1: - description: | - A human-readable description for the firewall rule. - The maximum length is 1024 characters. No default. - in: body - required: false - type: string -description_10: - description: | - The QoS policy description. - in: body - required: false - type: string -description_11: - description: | - A human-readable description for the pool. - in: body - required: false - type: string -description_12: - description: | - The security group description. - in: body - required: false - type: string -description_13: - description: | - A human-readable description for the service - profile. - in: body - required: false - type: string -description_14: - description: | - A human-readable description for the VIP. - in: body - required: false - type: string -description_15: - description: | - A human-readable description for the VPN endpoint - group. - in: body - required: false - type: string -description_16: - description: | - A human-readable description for the VPN service. - in: body - required: false - type: string -description_17: - description: | - A human-readable description for the firewall - policy. - in: body - required: true - type: string -description_18: - description: | - The extension description. - in: body - required: true - type: string -description_19: - description: | - A human-readable description for the firewall rule. - in: body - required: true - type: string -description_2: - description: | - A human-readable description for the firewall - service. - in: body - required: false - type: string -description_20: - description: | - A human-readable description for the firewall - service. - in: body - required: true - type: string -description_21: - description: | - A human-readable description for the flavor. - in: body - required: true - type: string -description_22: - description: | - A human-readable description for the IKE policy. - in: body - required: true - type: string -description_23: - description: | - A human-readable description for the IPSec - connection. - in: body - required: true - type: string -description_24: - description: | - Detailed description of the listener. - in: body - required: true - type: string -description_25: - description: | - The load balancer description. - in: body - required: true - type: string -description_26: - description: | - Description for the metering label. - in: body - required: true - type: string -description_27: - description: | - The description of the QoS policy. - in: body - required: true - type: string -description_28: - description: | - The description for the pool. - in: body - required: true - type: string -description_29: - description: | - The security group description. - in: body - required: true - type: string -description_3: - description: | - A human-readable description for the flavor. - in: body - required: false - type: string -description_30: - description: | - A human-readable description for the service - profile. - in: body - required: true - type: string -description_31: - description: | - A human-readable description for the VIP. - in: body - required: true - type: string -description_32: - description: | - A human-readable description for the VPN endpoint - group. - in: body - required: true - type: string -description_33: - description: | - A human-readable description for the VPN service. - in: body - required: true - type: string -description_34: - description: | - New human-readable description for the flavor. - in: body - required: false - type: string -description_35: - description: | - Security group description. - in: body - required: false - type: string -description_4: - description: | - A human-readable description for the IKE policy. - in: body - required: false - type: string -description_5: - description: | - A human-readable description for the IPSec policy. - in: body - required: true - type: string -description_6: - description: | - A human-readable description for the IPSec - connection. - in: body - required: false - type: string -description_7: - description: | - Detailed description of the listener. - in: body - required: false - type: string -description_8: - description: | - The load balancer description. - in: body - required: false - type: string -description_9: - description: | - The description for the metering label. - in: body - required: false - type: string -description_resource: - description: | - The description for the resource. - in: body - required: true - type: string -destination_ip_address: - description: | - The destination IPv4 or IPv6 address or CIDR. No - default. - in: body - required: false - type: string -destination_ip_address-response: - description: | - The destination IPv4 or IPv6 address or CIDR. No - default. - in: body - required: true - type: string -destination_ip_address_1: - description: | - The destination IPv4 or IPv6 address or CIDR. - in: body - required: true - type: string -destination_port: - description: | - The destination port or port range. A valid - value is a port number, as an integer, or a port range, in the - format of a ``:`` separated range. For a port range, include both - ends of the range. For example, ``80:90``. - in: body - required: false - type: string -destination_port-response: - description: | - The destination port or port range. A valid - value is a port number, as an integer, or a port range, in the - format of a ``:`` separated range. For a port range, include both - ends of the range. For example, ``80:90``. - in: body - required: true - type: string -destination_port_1: - description: | - The destination port or port range. - in: body - required: true - type: string -device_id: - description: | - The ID of the device that uses this port. - For example, a server instance or a logical router. - in: body - required: true - type: string -device_id-request: - description: | - The ID of the device that uses this port. - For example, a server instance or a logical router. - in: body - required: false - type: string -device_owner: - description: | - The entity type that uses this port. - For example, ``compute:nova`` (server instance), ``network:dhcp`` - (DHCP agent) or ``network:router_interface`` (router interface). - in: body - required: true - type: string -device_owner-request: - description: | - The entity type that uses this port. - For example, ``compute:nova`` (server instance), ``network:dhcp`` - (DHCP agent) or ``network:router_interface`` (router interface). - in: body - required: false - type: string -direction: - description: | - Ingress or egress, which is the direction in - which the metering rule is applied. - in: body - required: true - type: string -direction_1: - description: | - Ingress or egress: The direction in which the - security group rule is applied. For a compute instance, an ingress - security group rule is applied to incoming (ingress) traffic for - that instance. An egress rule is applied to traffic leaving the - instance. - in: body - required: true - type: string -direction_2: - description: | - Ingress or egress: the direction in which the - security group rule is applied. For a compute instance, an ingress - security group rule is applied to incoming (ingress) traffic for - that instance. An egress rule is applied to traffic leaving the - instance. - in: body - required: true - type: string -dpd: - description: | - A dictionary with dead peer detection (DPD) - protocol controls. - in: body - required: false - type: object -driver: - description: | - Provider driver to use for this profile. Example: - ``neutron_lbaas.drivers.octavia.driver.OctaviaDriver`` - in: body - required: false - type: string -driver_1: - description: | - Driver to associate with profile. - in: body - required: true - type: string -driver_2: - description: | - Provider driver to use for this profile. Ex: - neutron_lbaas.drivers.octavia.driver.OctaviaDriver. - in: body - required: false - type: string -dscp_mark: - description: | - The DSCP mark value. - in: body - required: false - type: integer -dscp_mark-response: - description: | - The DSCP mark value. - in: body - required: true - type: integer -dscp_marking_rule: - description: | - A ``dscp_marking_rule`` object. - in: body - required: true - type: object -dscp_marking_rules: - description: | - A list of ``dscp_marking_rule`` objects. - in: body - required: true - type: array -egress_firewall_policy_id-body-optional: - description: | - The ID of the egress firewall policy for the firewall group. - in: body - required: false - type: string -egress_firewall_policy_id-body-required: - description: | - The ID of the egress firewall policy for the firewall group. - in: body - required: true - type: string -enabled: - description: | - Set to ``false`` to disable this rule in the - firewall policy. Facilitates selectively turning off rules without - having to disassociate the rule from the firewall policy. Valid - value is ``true`` or ``false``. Default is ``true``. - in: body - required: false - type: boolean -enabled-body-required: - description: | - Indicates whether this resource is enabled or - disabled. - in: body - required: true - type: boolean -enabled-response: - description: | - Set to ``false`` to disable this rule in the - firewall policy. Facilitates selectively turning off rules without - having to disassociate the rule from the firewall policy. Valid - value is ``true`` or ``false``. Default is ``true``. - in: body - required: true - type: boolean -enabled_1: - description: | - Indicates whether this flavor is enabled or - disabled. Default ``true``. - in: body - required: false - type: boolean -enabled_2: - description: | - Indicates whether this service profile is enabled - or disabled. Default ``true``. - in: body - required: false - type: boolean -enabled_3: - description: | - Indicates whether this rule is enabled or - disabled in the firewall policy. - in: body - required: true - type: boolean -enabled_4: - description: | - Indicates whether this flavor is enabled or - disabled. - in: body - required: true - type: boolean -enabled_5: - description: | - Indicates whether this service profile is enabled - or disabled. - in: body - required: true - type: boolean -enabled_6: - description: | - Indicates whether this flavor is enabled or - disabled. - in: body - required: false - type: boolean -enabled_7: - description: | - Indicates whether this service profile is enabled - or disabled. Default true. - in: body - required: false - type: boolean -encapsulation_mode: - description: | - The encapsulation mode. A valid value is - ``tunnel`` or ``transport``. Default is ``tunnel``. - in: body - required: false - type: string -encryption_algorithm: - description: | - The encryption algorithm. A valid value is - ``3des``, ``aes-128``, ``aes-192``, ``aes-256``, and so on. - Default is ``aes-128``. - in: body - required: false - type: string -endpoint_group_id-body-response: - description: | - The ID of the VPN endpoint group. - in: body - required: true - type: string -endpoints: - description: | - List of endpoints of the same type, for the - endpoint group. The values will depend on type. - in: body - required: true - type: array -ethertype: - description: | - Must be IPv4 or IPv6, and addresses represented - in CIDR must match the ingress or egress rules. - in: body - required: false - type: string -ethertype_1: - description: | - Must be IPv4 or IPv6, and addresses represented - in CIDR must match the ingress or egress rules. - in: body - required: true - type: string -excluded: - description: | - Indicates whether to count the traffic of a - specific IP address with the ``remote_ip_prefix`` value. Default - is ``false``. - in: body - required: false - type: boolean -'excluded ': - description: | - Indicates whether to count the traffic of a - specific IP address with the ``remote_ip_prefix`` value. Default - is ``false``. - in: body - required: true - type: boolean -expected_codes: - description: | - The list of HTTP status codes expected in - response from the member to declare it healthy. Specify one of the - following values: - - - A single value, such as ``200`` - - A list, such as ``200, 202`` - - A range, such as ``200-204`` - - The default is 200. - in: body - required: false - type: string -expected_codes-response: - description: | - The list of HTTP status codes expected in - response from the member to declare it healthy. Specify one of the - following values: - - - A single value, such as ``200`` - - A list, such as ``200, 202`` - - A range, such as ``200-204`` - - The default is 200. - in: body - required: true - type: string -extension: - description: | - An ``extension`` object. - in: body - required: true - type: object -extension-alias-body: - description: | - The alias for the extension. For example "quotas" or - "security-group". - in: body - required: true - type: string -extension-description: - description: | - The human-readable description for the resource. - in: body - required: true - type: string -extension-links: - description: | - List of links related to the extension. - in: body - required: true - type: array -extension-name: - description: | - Human-readable name of the resource. - in: body - required: true - type: string -extension-updated: - description: | - The date and timestamp when the extension was - last updated. - in: body - required: true - type: string -extensions: - description: | - A list of ``extension`` objects. - in: body - required: true - type: array -external_v4_ip: - description: | - Read-only external (public) IPv4 address that is - used for the VPN service. The VPN plugin sets this address if an - IPv4 interface is available. - in: body - required: true - type: string -external_v6_ip: - description: | - Read-only external (public) IPv6 address that is - used for the VPN service. The VPN plugin sets this address if an - IPv6 interface is available. - in: body - required: true - type: string -extra_dhcp_opts: - description: | - A set of zero or more extra DHCP option pairs. An - option pair consists of an option value and name. - in: body - required: true - type: array -extra_dhcp_opts-request: - description: | - A set of zero or more extra DHCP option pairs. An - option pair consists of an option value and name. - in: body - required: false - type: array -firewall: - description: | - A ``firewall`` object. - in: body - required: true - type: object -firewall-status: - description: | - The status of the firewall service. Values are - ``ACTIVE``, ``INACTIVE``, ``ERROR``, ``DOWN``, - ``PENDING_CREATE``, ``PENDING_UPDATE``, or ``PENDING_DELETE``. - in: body - required: true - type: string -firewall_audited-body-required: - description: | - Each time that the firewall policy or its - associated rules are changed, the API sets this attribute to - ``false``. To audit the policy, explicitly set this attribute to - ``true``. - in: body - required: true - type: boolean -firewall_group_admin_state_up-body-optional: - description: | - The administrative state of the firewall group, which - is up (``true``) or down (``false``). Default is ``true``. - in: body - required: false - type: boolean -firewall_group_admin_state_up-body-required: - description: | - The administrative state of the firewall group, which - is up (``true``) or down (``false``). Default is ``true``. - in: body - required: true - type: boolean -firewall_group_description-body-optional: - description: | - A human-readable description of the firewall group. - in: body - required: false - type: object -firewall_group_description-body-required: - description: | - A human-readable description of the firewall group. - in: body - required: true - type: object -firewall_group_id-body-required: - description: | - The ID of the firewall group. - in: body - required: true - type: string -firewall_group_list-body-required: - description: | - A list of the IDs of firewall groups associated with - the firewall policy. - in: body - required: true - type: array -firewall_group_name-body-optional: - description: | - A human-readable name for the firewall group. - in: body - required: false - type: string -firewall_group_name-body-required: - description: | - A human-readable name for the firewall group. - in: body - required: true - type: string -firewall_group_object: - description: | - A ``firewall_group`` object. - in: body - required: true - type: object -firewall_group_ports-body-optional: - description: | - A list of the IDs of the ports associated with the firewall group. - in: body - required: false - type: array -firewall_group_ports-body-required: - description: | - A list of the IDs of the ports associated with the firewall group. - in: body - required: true - type: array -firewall_group_shared-body-optional: - description: | - Indicates whether this firewall group is shared across all projects. - in: body - required: false - type: boolean -firewall_group_shared-body-required: - description: | - Indicates whether this firewall group is shared across all projects. - in: body - required: true - type: boolean -firewall_group_status-body-optional: - description: | - The status of the firewall group. Valid values are ``ACTIVE``, - ``INACTIVE``, ``ERROR``, ``PENDING_UPDATE``, or - ``PENDING_DELETE``. - in: body - required: false - type: string -firewall_group_status-body-required: - description: | - The status of the firewall group. Valid values are ``ACTIVE``, - ``INACTIVE``, ``ERROR``, ``PENDING_UPDATE``, or - ``PENDING_DELETE``. - in: body - required: true - type: string -firewall_groups_object: - description: | - A list of ``firewall_group`` objects. - in: body - required: true - type: array -firewall_id-body: - description: | - The ID of the FWaaS v1 firewall. - in: body - required: true - type: string -firewall_list: - description: | - A list of the IDs of firewalls associated with - the firewall policy. - in: body - required: true - type: array -firewall_log: - description: | - A ``firewall_log`` object. - in: body - required: true - type: object -firewall_log_id-body: - description: | - The ID of the firewall log resource. - in: body - required: true - type: string -firewall_logs: - description: | - A list of ``firewall_log`` objects. - in: body - required: true - type: array -firewall_policies: - description: | - A list of ``firewall_policy`` objects. - in: body - required: true - type: array -firewall_policies_object: - description: | - A list of ``firewall_policy`` objects. - in: body - required: true - type: array -firewall_policy: - description: | - A ``firewall_policy`` object. - in: body - required: true - type: object -firewall_policy_audited-body-optional: - description: | - Each time that the firewall policy or its associated rules are - changed, the API sets this attribute to ``false``. To audit the - policy, explicitly set this attribute to ``true``. - in: body - required: false - type: boolean -firewall_policy_audited-body-required: - description: | - Each time that the firewall policy or its associated rules are - changed, the API sets this attribute to ``false``. To audit the - policy, explicitly set this attribute to ``true``. - in: body - required: true - type: boolean -firewall_policy_description-body-optional: - description: | - A human-readable name of the firewall policy. - in: body - required: false - type: string -firewall_policy_description-body-required: - description: | - A human-readable name of the firewall policy. - in: body - required: true - type: string -firewall_policy_id: - description: | - Read-only attribute that the API populates with - the ID of the firewall policy when you associate this firewall - rule with a policy. You can associate a firewall rule with one - policy at a time. You can update this association can to a - different firewall policy. If you do not associate the rule with - any policy, this attribute is ``null``. - in: body - required: false - type: string -firewall_policy_id-body: - description: | - The ID of the policy that is associated with - the firewall. - in: body - required: true - type: string -firewall_policy_id-body-required: - description: | - The ID of the firewall policy. - in: body - required: true - type: string -firewall_policy_id_3: - description: | - The ID of the policy that is associated with - the firewall. - in: body - required: false - type: string -firewall_policy_id_description-body-optional: - description: | - A human-readable description of the firewall policy. - in: body - required: false - type: string -firewall_policy_id_description-body-required: - description: | - A human-readable description of the firewall policy. - in: body - required: true - type: string -firewall_policy_name-body-optional: - description: | - A human-readable name of the firewall policy. - in: body - required: false - type: string -firewall_policy_name-body-required: - description: | - A human-readable name of the firewall policy. - in: body - required: true - type: string -firewall_policy_object: - description: | - A ``firewall_policy`` object. - in: body - required: true - type: object -firewall_policy_shared-body-optional: - description: | - Set to ``true`` to make this firewall policy - visible to other projects. Default is ``false``. - in: body - required: false - type: boolean -firewall_policy_shared-body-required: - description: | - Set to ``true`` to make this firewall policy - visible to other projects. Default is ``false``. - in: body - required: true - type: boolean -firewall_rule: - description: | - A ``firewall_rule`` object. - in: body - required: true - type: object -firewall_rule_action-body-optional: - description: | - The action that the API performs on traffic that - matches the firewall rule. Valid values are ``allow`` or ``deny``. - Default is ``deny``. - in: body - required: false - type: string -firewall_rule_action-body-required: - description: | - The action that the API performs on traffic that - matches the firewall rule. Valid values are ``allow`` or ``deny``. - Default is ``deny``. - in: body - required: true - type: string -firewall_rule_description-body-optional: - description: | - A human-readable description of the firewall rule. - in: body - required: false - type: string -firewall_rule_description-body-required: - description: | - A human-readable description of the firewall rule. - in: body - required: true - type: string -firewall_rule_destination_ip_address-body-optional: - description: | - The destination IPv4 or IPv6 address or CIDR for the firewall rule. No - default. - in: body - required: false - type: string -firewall_rule_destination_ip_address-body-required: - description: | - The destination IPv4 or IPv6 address or CIDR for the firewall rule. No - default. - in: body - required: true - type: string -firewall_rule_destination_port-body-optional: - description: | - The destination port or port range for the firewall rule. A valid - value is a port number, as an integer, or a port range, in the - format of a ``:`` separated range. For a port range, include both - ends of the range. For example, ``80:90``. - in: body - required: false - type: string -firewall_rule_destination_port-body-required: - description: | - The destination port or port range for the firewall rule. A valid - value is a port number, as an integer, or a port range, in the - format of a ``:`` separated range. For a port range, include both - ends of the range. For example, ``80:90``. - in: body - required: true - type: string -firewall_rule_enabled-body-optional: - description: | - Set to ``false`` to disable this rule in the firewall policy. - Facilitates selectively turning off rules without having to - disassociate the rule from the firewall policy. Valid values are - ``true`` or ``false``. Default is ``true``. - in: body - required: false - type: boolean -firewall_rule_enabled-body-required: - description: | - Set to ``false`` to disable this rule in the firewall policy. - Facilitates selectively turning off rules without having to - disassociate the rule from the firewall policy. Valid values are - ``true`` or ``false``. Default is ``true``. - in: body - required: true - type: boolean -firewall_rule_id-body: - description: | - The ID of the firewall rule. - in: body - required: true - type: string -firewall_rule_id-body-required: - description: | - The ID of the firewall rule. - in: body - required: true - type: string -firewall_rule_insert_after-body-required: - description: | - The ID of the firewall_rule to insert the new rule after. The new - rule will be inserted immediately after the specified firewall_rule. - If both ``before`` and ``after`` values are supplied, the ``after`` value - will be ignored. To insert a rule into a policy with no rules yet, - the both the ``before`` and the ``after`` values must be "". - in: body - required: true - type: string -firewall_rule_insert_before-body-required: - description: | - The ID of the firewall_rule to insert the new rule before. The new - rule will be inserted immediately before the specified firewall_rule. - If both ``before`` and ``after`` values are supplied, the ``after`` value - will be ignored. To insert a rule into a policy with no rules yet, - the both the ``before`` and the ``after`` values must be "". - in: body - required: true - type: string -firewall_rule_ip_version-body-optional: - description: | - The IP protocol version for the firewall rule. Valid values are - ``4`` or ``6``. Default is ``4``. - in: body - required: false - type: integer -firewall_rule_ip_version-body-required: - description: | - The IP protocol version for the firewall rule. Valid values - are ``4`` or ``6``. Default is ``4``. - in: body - required: true - type: integer -firewall_rule_name-body-optional: - description: | - A human-readable name of the firewall rule. - in: body - required: false - type: string -firewall_rule_name-body-required: - description: | - A human-readable name of the firewall rule. - in: body - required: true - type: string -firewall_rule_object: - description: | - A ``firewall_rule`` object. - in: body - required: true - type: object -firewall_rule_position-body-optional: - description: | - Read-only attribute that the API assigns to this - rule when it associates it with a firewall policy. This value - indicates the position of this rule in that firewall policy. This - position number starts at 1. If the firewall rule is not - associated with any policy, the position is ``null``. - in: body - required: false - type: integer -firewall_rule_position-body-required: - description: | - Read-only attribute that the API assigns to this - rule when it associates it with a firewall policy. This value - indicates the position of this rule in that firewall policy. This - position number starts at 1. If the firewall rule is not - associated with any policy, the position is ``null``. - in: body - required: true - type: integer -firewall_rule_protocol-body-optional: - description: | - The IP protocol for the firewall rule. Possible values are ``icmp``, ``tcp``, - ``udp``, or ``null``. - in: body - required: false - type: string -firewall_rule_protocol-body-required: - description: | - The IP protocol for the firewall rule. Possible values are ``icmp``, ``tcp``, - ``udp``, or ``null``. - in: body - required: true - type: string -firewall_rule_shared-body-optional: - description: | - Indicates whether this firewall rule is shared across all projects. - in: body - required: false - type: boolean -firewall_rule_shared-body-required: - description: | - Indicates whether this firewall rule is shared across all projects. - in: body - required: true - type: boolean -firewall_rule_source_ip_address-body-optional: - description: | - The source IPv4 or IPv6 address or CIDR for the firewall rule. No - default. - in: body - required: false - type: string -firewall_rule_source_ip_address-body-required: - description: | - The source IPv4 or IPv6 address or CIDR for the firewall rule. No - default. - in: body - required: true - type: string -firewall_rule_source_port-body-optional: - description: | - The source port or port range for the firewall rule. A valid - value is a port number, as an integer, or a port range, in the - format of a ``:`` separated range. For a port range, include both - ends of the range. For example, ``80:90``. - in: body - required: false - type: string -firewall_rule_source_port-body-required: - description: | - The source port or port range for the firewall rule. A valid - value is a port number, as an integer, or a port range, in the - format of a ``:`` separated range. For a port range, include both - ends of the range. For example, ``80:90``. - in: body - required: true - type: string -firewall_rules: - description: | - A list of the IDs for firewall rule associated - with the firewall policy. - in: body - required: true - type: array -firewall_rules-body-optional: - description: | - A list of the IDs of the firewall rules associated - with the firewall policy. - in: body - required: false - type: array -firewall_rules-body-required: - description: | - A list of the IDs of the firewall rules associated - with the firewall policy. - in: body - required: true - type: array -firewall_rules_id: - description: | - A list of rules to associate with the firewall - policy. - in: body - required: false - type: array -firewall_rules_object: - description: | - A list of ``firewall_rule`` objects. - in: body - required: true - type: object -firewalls: - description: | - A list of ``firewall_rule`` objects. - in: body - required: true - type: array -firewalls_1: - description: | - A list of ``firewall`` objects. - in: body - required: true - type: array -fixed_ips: - description: | - The IP addresses for the port. If the port has multiple IP addresses, - this field has multiple entries. Each entry consists of IP address - (``ip_address``) and the subnet ID from which the IP address - is assigned (``subnet_id``). - in: body - required: true - type: array -fixed_ips-request: - description: | - The IP addresses for the port. - If you would like to assign multiple IP addresses for the port, - specify multiple entries in this field. - Each entry consists of IP address (``ip_address``) and the subnet ID - from which the IP address is assigned (``subnet_id``). - - * If you specify both a subnet ID and an IP address, OpenStack Networking - tries to allocate the IP address on that subnet to the port. - * If you specify only a subnet ID, OpenStack Networking allocates - an available IP from that subnet to the port. - * If you specify only an IP address, OpenStack Networking - tries to allocate the IP address if the address is a valid IP - for any of the subnets on the specified network. - in: body - required: false - type: array -flavor: - description: | - A ``flavor`` object. - in: body - required: true - type: object -flavor-description: - description: | - The human-readable description for the flavor. - in: body - required: true - type: string -flavor-description-request: - description: | - The human-readable description for the flavor. - in: body - required: false - type: string -flavor-enabled: - description: | - Indicates whether the flavor is enabled or not. Default is true. - in: body - required: true - type: boolean -flavor-enabled-request: - description: | - Indicates whether the flavor is enabled or not. Default is true. - in: body - required: false - type: boolean -flavor-id: - description: | - The ID of the flavor. - in: body - required: true - type: string -flavor-id-request: - description: | - The ID of the flavor. - in: body - required: false - type: string -flavor-id-response: - description: | - The ID of the flavor. - in: body - required: true - type: string -flavor-name: - description: | - Name of the flavor. - in: body - required: true - type: string -flavor-name-request: - description: | - Name of the flavor. - in: body - required: false - type: string -flavor-service_profiles: - description: | - Service profile UUIDs associated with this flavor. - in: body - required: true - type: array -flavor-service_profiles-request: - description: | - Service profile UUIDs associated with this flavor. - in: body - required: false - type: array -flavor-service_type: - description: | - Service type for the flavor. Example: LOADBALANCERV2. - in: body - required: true - type: string -flavor_1: - description: | - The UUID of a flavor. - in: body - required: false - type: string -flavor_2: - description: | - The UUID of a flavor if set. - in: body - required: false - type: string -flavors: - description: | - A list of ``flavor`` objects. - in: body - required: true - type: array -floating_ip_address: - description: | - The floating IP address. - in: body - required: true - type: string -floating_ip_address-request: - description: | - The floating IP address. - in: body - required: false - type: string -floating_network_id: - description: | - The ID of the network associated with the - floating IP. - in: body - required: true - type: string -floatingip: - description: | - A ``floatingip`` object. When you associate a - floating IP address with a VM, the instance has the same public IP - address each time that it boots, basically to maintain a - consistent IP address for maintaining DNS assignment. - in: body - required: true - type: object -floatingip-fixed_ip_address: - description: | - The fixed IP address that is associated with the - floating IP address. - in: body - required: true - type: string -floatingip-fixed_ip_address-request: - description: | - The fixed IP address that is associated with the floating IP. - If an internal port has multiple associated IP addresses, - the service chooses the first IP address unless you explicitly - define a fixed IP address in the ``fixed_ip_address`` parameter. - in: body - required: false - type: string -floatingip-id: - description: | - The ID of the floating IP address. - in: body - required: true - type: string -floatingip-port_id: - description: | - The ID of a port associated with the floating IP. - in: body - required: true - type: string -floatingip-port_id-post-request: - description: | - The ID of a port associated with the floating IP. - To associate the floating IP with a fixed IP at creation time, - you must specify the identifier of the internal port. - in: body - required: false - type: string -floatingip-port_id-put-request: - description: | - The ID of a port associated with the floating IP. - To associate the floating IP with a fixed IP, - you must specify the ID of the internal port. - To disassociate the floating IP, ``null`` should be specified. - in: body - required: true - type: string -floatingip-router_id: - description: | - The ID of the router for the floating IP. - in: body - required: true - type: string -floatingip-status: - description: | - The status of the floating IP. Values are - ``ACTIVE``, ``DOWN`` and ``ERROR``. - in: body - required: true - type: string -floatingip-subnet_id: - description: | - The subnet ID on which you want to create the floating IP. - in: body - required: false - type: string -floatingips: - description: | - A list of ``floatingip`` objects. - in: body - required: true - type: array -fw_event: - description: | - Type of firewall events to log. - ``ACCEPT``, ``DROP``, or ``ALL``. - in: body - required: true - type: string -fw_event-request: - description: | - Type of firewall events to log. - ``ACCEPT``, ``DROP``, or ``ALL``. - Default is ``ALL``. - in: body - required: false - type: string -fw_event-request-put: - description: | - Type of firewall events to log. - ``ACCEPT``, ``DROP``, or ``ALL``. - in: body - required: false - type: string -health_monitor: - description: | - A ``health_monitor`` object. - in: body - required: true - type: object -health_monitor-id: - description: | - The ID of the associated health monitor. - in: body - required: true - type: string -health_monitors-obj: - description: | - A list of ``health_monitor`` objects. - in: body - required: true - type: array -health_monitors-request: - description: | - List of health monitors to be associated with the pool. - The default is an empty list. - in: body - required: false - type: array -health_monitors-response: - description: | - List of health monitors that are associated with the pool. - in: body - required: true - type: array -health_monitors_status: - description: | - The statuses of the health monitors that are - associated with the pool. - in: body - required: true - type: string -healthmonitor: - description: | - The associated healthmonitor, if any. - in: body - required: true - type: object -healthmonitor_id: - description: | - The UUID of the health monitor. - in: body - required: false - type: string -http_method: - description: | - The HTTP method that the monitor uses for requests. - in: body - required: true - type: string -http_method-request: - description: | - The HTTP method that the monitor uses for requests. - The default is ``GET``. - in: body - required: false - type: string -id: - description: | - The ID of the resource. - in: body - required: true - type: string -id_1: - description: | - The UUID of the port. - in: body - required: true - type: string -id_12: - description: | - The UUID of the listener. - in: body - required: true - type: string -id_14: - description: | - The UUID for the member. - in: body - required: true - type: string -id_15: - description: | - The UUID for the metering label rule. - in: body - required: true - type: string -id_16: - description: | - The UUID of the metering label. - in: body - required: true - type: string -id_17: - description: | - The UUID of the network. - in: body - required: true - type: string -id_19: - description: | - The UUID for the pool. - in: body - required: true - type: string -id_2: - description: | - The UUID for the health monitor. - in: body - required: true - type: string -id_20: - description: | - The UUID of the security group rule. - in: body - required: true - type: string -id_21: - description: | - The UUID of the subnet pool. - in: body - required: true - type: string -id_22: - description: | - The UUID for the VIP. - in: body - required: true - type: string -id_25: - description: | - The UUID of network. - in: body - required: true - type: string -id_26: - description: | - The UUID of the security group. - in: body - required: true - type: string -id_3: - description: | - The UUID of the QoS policy rule. - in: body - required: true - type: string -id_4: - description: | - The UUID for the firewall policy. - in: body - required: true - type: string -id_5: - description: | - The generated UUID for the firewall rule object. - in: body - required: true - type: string -id_6: - description: | - The UUID for the firewall service. - in: body - required: true - type: string -id_7: - description: | - The UUID of the flavor. - in: body - required: true - type: string -id_9: - description: | - The UUID for the IKE policy. - in: body - required: true - type: string -id_resource: - description: | - The ID for the resource. - in: body - required: true - type: string -ike_version: - description: | - The IKE version. A valid value is ``v1`` or - ``v2``. Default is ``v1``. - in: body - required: false - type: string -ikepolicies: - description: | - A list of ``ikepolicy`` objects. - in: body - required: true - type: array -ikepolicy: - description: | - An ``ikepolicy`` object. - in: body - required: true - type: object -ikepolicy_id-body-request: - description: | - The ID of the IKE policy. - in: body - required: false - type: string -ikepolicy_id-body-response: - description: | - The ID of the IKE policy. - in: body - required: true - type: string -ingress_firewall_policy_id-body-optional: - description: | - The ID of the ingress firewall policy for the firewall group. - in: body - required: false - type: string -ingress_firewall_policy_id-body-required: - description: | - The ID of the ingress firewall policy for the firewall group. - in: body - required: true - type: string -initiator: - description: | - Indicates whether this VPN can only respond to - connections or both respond to and initiate connections. A valid - value is ``response- only`` or ``bi-directional``. Default is - ``bi-directional``. - in: body - required: false - type: string -insert_after: - description: | - The ID of the firewall_rule. A new - firewall_rule will be inserted after this firewall_rule. - in: body - required: false - type: string -insert_before: - description: | - The ID of the firewall_rule. A new - firewall_rule will be inserted before this firewall_rule. - in: body - required: false - type: string -interval: - description: | - The dead peer detection (DPD) interval, in - seconds. A valid value is a positive integer. Default is 30. - in: body - required: false - type: integer -interval_1: - description: | - The dead peer detection (DPD) interval, in - seconds. A valid value is a positive integer. Default is 30. - in: body - required: true - type: integer -ip_address: - description: | - The IP address of an allowed address pair. - in: body - required: false - type: string -ip_address_1: - description: | - The fixed IP address of the port. - in: body - required: true - type: string -ip_version: - description: | - The IP protocol version. Valid value is ``4`` or - ``6``. Default is ``4``. - in: body - required: false - type: integer -ip_version-response: - description: | - The IP protocol version. Valid value is ``4`` or - ``6``. Default is ``4``. - in: body - required: true - type: integer -ip_version_1: - description: | - The IP address family of the list of prefixes - passed to the ``prefixes`` attribute. - in: body - required: true - type: integer -ip_version_3: - description: | - The IP version (4 or 6) of the subnet. - in: body - required: true - type: integer -ipsec_site_connection: - description: | - An ``ipsec_site_connection`` object. - in: body - required: true - type: object -ipsec_site_connection-action: - description: | - The dead peer detection (DPD) action. A valid - value is ``clear``, ``hold``, ``restart``, ``disabled``, or - ``restart-by-peer``. Default value is ``hold``. - in: body - required: true - type: string -ipsec_site_connection-status: - description: | - Indicates whether the IPSec connection is - currently operational. Values are ``ACTIVE``, ``DOWN``, ``BUILD``, - ``ERROR``, ``PENDING_CREATE``, ``PENDING_UPDATE``, or - ``PENDING_DELETE``. - in: body - required: true - type: string -ipsec_site_connection-timeout: - description: | - The dead peer detection (DPD) timeout in seconds. - A valid value is a positive integer that is greater than the DPD - ``interval`` value. Default is 120. - in: body - required: true - type: integer -ipsecpolicies: - description: | - A list of ``ipsecpolicy`` objects. - in: body - required: true - type: array -ipsecpolicy: - description: | - An ``ipsecpolicy`` object. - in: body - required: true - type: object -ipsecpolicy_id-body-request: - description: | - The ID of the IPSec policy. - in: body - required: false - type: string -ipsecpolicy_id-body-response: - description: | - The ID of the IPSec policy. - in: body - required: true - type: string -lb_algorithm: - description: | - The load-balancer algorithm, which is round-robin - (``ROUND_ROBIN``), least-connections (``LEAST_CONNECTIONS``), - source IP (``SOURCE_IP``), and so on, that is used to distribute - traffic to the pool members. This value, which must be supported, - is dependent on the load-balancer provider. The round-robin - algorithm must be supported. - in: body - required: true - type: string -lb_method: - description: | - The load-balancer algorithm, which is round-robin - (``ROUND_ROBIN``), least-connections (``LEAST_CONNECTIONS``), - source IP (``SOURCE_IP``), and so on, that is used to distribute - traffic to the pool members. This value, which must be supported, - is dependent on the load-balancer provider. The round-robin - algorithm must be supported. - in: body - required: true - type: string -lb_method-request-put: - description: | - The load-balancer algorithm, which is round-robin - (``ROUND_ROBIN``), least-connections (``LEAST_CONNECTIONS``), - source IP (``SOURCE_IP``), and so on, that is used to distribute - traffic to the pool members. This value, which must be supported, - is dependent on the load-balancer provider. The round-robin - algorithm must be supported. - in: body - required: false - type: string -lifetime: - description: | - The lifetime of the security association. The - lifetime consists of a unit and integer value. You can omit either - the unit or value portion of the lifetime. Default unit is seconds - and default value is 3600. - in: body - required: false - type: object -links: - description: | - The share links. - in: body - required: true - type: array -listener: - description: | - A ``listener`` object. - in: body - required: true - type: object -listener-id-response: - description: | - The ID of the listener. - in: body - required: true - type: string -listener_id: - description: | - The ID of the listener. - in: body - required: false - type: string -listeners: - description: | - The associated listeners, if any. - in: body - required: true - type: array -listeners-response: - description: | - A list of ``listeners`` objects. - in: body - required: true - type: array -loadbalancer: - description: | - A ``loadbalancer`` object. - in: body - required: true - type: object -loadbalancer-id: - description: | - The ID of the load balancer. - in: body - required: true - type: string -loadbalancer-provider: - description: | - Provider name of the load balancer service. - in: body - required: true - type: string -loadbalancer-provider-request: - description: | - Provider name of the load balancer service. - in: body - required: false - type: string -loadbalancer-statuses: - description: | - The status tree of a load balancer object contains all - provisioning and operating statuses for its children. - in: body - required: true - type: object -loadbalancers: - description: | - A list of load balancer objects. - in: body - required: true - type: array -local_ep_group_id: - description: | - The ID for the endpoint group that contains - private subnets for the local side of the connection. Yo must - specify this parameter with the ``peer_ep_group_id`` parameter - unless in backward- compatible mode where ``peer_cidrs`` is - provided with a ``subnet_id`` for the VPN service. - in: body - required: false - type: string -local_id: - description: | - An ID to be used instead of the external IP address for a virtual - router used in traffic between instances on different networks in - east-west traffic. Most often, local ID would be domain name, email - address, etc. If this is not configured then the external IP address - will be used as the ID. - in: body - required: false - type: string -location: - description: | - Full URL to a service or server. - format: uri - in: body - required: true - type: string -log: - description: | - A ``log`` object. - in: body - required: true - type: object -log_enabled: - description: | - Indicates whether this log object is enabled or disabled. - in: body - required: true - type: boolean -log_enabled-request: - description: | - Indicates whether this log object is enabled or disabled. - Default is true. - in: body - required: false - type: boolean -log_enabled-request-put: - description: | - Indicates whether this log object is enabled or disabled. - in: body - required: false - type: boolean -log_event: - description: | - Type of security events to log. - ``ACCEPT``, ``DROP``, or ``ALL``. - in: body - required: true - type: string -log_event-request: - description: | - Type of security events to log. - ``ACCEPT``, ``DROP``, or ``ALL``. - Default is ``ALL``. - in: body - required: false - type: string -log_id: - description: | - The ID of the log object. - in: body - required: true - type: string -loggable_resources: - description: | - A list of ``loggable_resource`` object. - in: body - required: true - type: object -logging_resource: - description: | - A ``logging_resource`` object. - in: body - required: true - type: object -logging_resource_enabled: - description: | - Indicates whether this logging resource is enabled or disabled. - in: body - required: true - type: boolean -logging_resource_enabled-request: - description: | - Indicates whether this logging resource is enabled or disabled. - Default is false. - in: body - required: false - type: boolean -logging_resource_enabled-request-put: - description: | - Indicates whether this logging resource is enabled or disabled. - in: body - required: false - type: boolean -logging_resource_id-body: - description: | - The ID of the logging resource. - in: body - required: true - type: string -logging_resources: - description: | - A list of ``logging_resource`` objects. - in: body - required: true - type: array -logs: - description: | - A list of ``log`` objects. - in: body - required: true - type: array -mac_address: - description: | - The MAC address of the port. - in: body - required: true - type: string -mac_address-request: - description: | - The MAC address of the port. - If unspecified, a MAC address is automatically generated. - in: body - required: false - type: string -mac_address-request-put: - description: | - The MAC address of the port. - By default, only administrative users can change this value. - in: body - required: false - type: string -max_burst_kbps: - description: | - The maximum burst size (in kilobits). Default is ``0``. - in: body - required: false - type: integer -max_burst_kbps-response: - description: | - The maximum burst size (in kilobits). - in: body - required: true - type: integer -max_kbps: - description: | - The maximum KBPS (kilobits per second) value. If you specify this - value, must be greater than 0 otherwise max_kbps will have no value. - in: body - required: false - type: integer -max_kbps-response: - description: | - The maximum KBPS (kilobits per second) value. If you specify this - value, must be greater than 0 otherwise max_kbps will have no value. - in: body - required: true - type: integer -max_prefixlen: - description: | - The maximum prefix size that can be allocated - from the subnet pool. For IPv4 subnet pools, default is ``32``. - For IPv6 subnet pools, default is ``128``. - in: body - required: false - type: integer -max_prefixlen_1: - description: | - The maximum prefix size that can be allocated - from the subnet pool. - in: body - required: true - type: integer -max_retries: - description: | - The number of allowed connection failures before - changing the status of the member to ``INACTIVE``. A valid value - is from 1 to 10. - in: body - required: true - type: integer -member: - description: | - A ``member`` object. - in: body - required: true - type: object -member-id-response: - description: | - The ID of the member. - in: body - required: true - type: string -member-pool_id: - description: | - The ID of the pool which the member belongs to. - in: body - required: true - type: string -member-pool_id-request: - description: | - The ID of the pool which the member belongs to. - in: body - required: false - type: string -member-status: - description: | - The status of the member. Indicates whether the - member is operational. - in: body - required: true - type: string -member-weight: - description: | - The weight of a member determines the portion of - requests or connections it services compared to the other members - of the pool. For example, a member with a weight of 10 receives five - times as much traffic as a member with a weight of 2. - A value of 0 means the member does not participate in - load- balancing but still accepts persistent connections. A valid - value is from 0 to 256. - in: body - required: true - type: integer -member-weight-request: - description: | - The weight of a member determines the portion of - requests or connections it services compared to the other members - of the pool. For example, a member with a weight of 10 receives five - times as much traffic as a member with a weight of 2. - A value of 0 means the member does not participate in - load- balancing but still accepts persistent connections. A valid - value is from 0 to 256. The default is 1. - in: body - required: false - type: integer -members: - description: | - The list of members that belong to the pool. - in: body - required: true - type: array -members-obj: - description: | - A list of ``member`` objects. - in: body - required: true - type: array -members_2: - description: | - The associated members, if any. - in: body - required: true - type: array -metainfo: - description: | - JSON-formatted meta information. - in: body - required: false - type: string -metainfo_1: - description: | - JSON metainfo to associate with profile. - in: body - required: true - type: string -metering_label: - description: | - A ``metering_label`` object. - in: body - required: true - type: object -metering_label-id: - description: | - The ID of the metering label. - in: body - required: true - type: string -metering_label-id-response-body: - description: | - The metering label ID to associate with this - metering rule. - in: body - required: true - type: string -metering_label-shared: - description: | - Indicates whether this metering label is shared - across all projects. - in: body - required: true - type: boolean -metering_label-shared-request: - description: | - Indicates whether this metering label is shared - across all projects. - in: body - required: true - type: boolean -metering_label_rule: - description: | - A ``metering_label_rule`` object. - in: body - required: true - type: object -metering_label_rule-id: - description: | - The ID of the metering label rule. - in: body - required: true - type: string -metering_label_rules: - description: | - A list of ``metering_label_rule`` objects. - in: body - required: true - type: array -metering_labels: - description: | - A list of ``metering_label`` objects. - in: body - required: true - type: array -min_prefixlen: - description: | - The smallest prefix that can be allocated from a - subnet pool. For IPv4 subnet pools, default is ``8``. For IPv6 - subnet pools, default is ``64``. - in: body - required: false - type: integer -min_prefixlen_1: - description: | - The smallest prefix that can be allocated from a - subnet pool. - in: body - required: true - type: integer -mtu: - description: | - The maximum transmission unit (MTU) value to - address fragmentation. Minimum value is 68 for IPv4, and 1280 for - IPv6. - in: body - required: true - type: integer -mtu-request: - description: | - The maximum transmission unit (MTU) value to - address fragmentation. Minimum value is 68 for IPv4, and 1280 for - IPv6. - in: body - required: false - type: integer -name: - description: | - Human-readable name of the resource. - in: body - required: true - type: string -name-request: - description: | - Human-readable name of the resource. - Default is an empty string. - in: body - required: false - type: string -name-request-put: - description: | - Human-readable name of the resource. - in: body - required: false - type: string -name-segment: - description: | - Human-readable name of the segment. - in: body - required: false - type: string -name_1: - description: | - A symbolic name for the port. - in: body - required: false - type: string -name_11: - description: | - The QoS policy name. - in: body - required: false - type: string -name_12: - description: | - The pool name. Does not have to be unique. - in: body - required: false - type: string -name_14: - description: | - A symbolic name for the security group. Does not - have to be unique. - in: body - required: true - type: string -name_15: - description: | - A name for the subnet pool. - in: body - required: true - type: string -name_16: - description: | - Human-readable name for the VIP. Does not have to - be unique. - in: body - required: false - type: string -name_17: - description: | - Human-readable name for the VPN endpoint group. - Does not have to be unique. - in: body - required: false - type: string -name_18: - description: | - Human-readable name for the VPN service. Does not - have to be unique. - in: body - required: false - type: string -name_19: - description: | - Human-readable name for the firewall policy. Does - not have to be unique. - in: body - required: true - type: string -name_2: - description: | - The network name. - in: body - required: true - type: string -name_20: - description: | - The name of the extension. For example, "Fox In - Socks." - in: body - required: true - type: string -name_21: - description: | - A human-readable name for the firewall rule. - in: body - required: true - type: string -name_22: - description: | - Human-readable name for the firewall service. - Does not have to be unique. - in: body - required: true - type: string -name_23: - description: | - Human-readable name for the flavor. Can be "" and - non-unique. - in: body - required: true - type: string -name_24: - description: | - Human-readable name for the IKE policy. Does not - have to be unique. - in: body - required: true - type: string -name_25: - description: | - Human-readable name for the IPSec connection. - Does not have to be unique. - in: body - required: true - type: string -name_26: - description: | - The load balancer name. - in: body - required: true - type: string -name_27: - description: | - The network name. - in: body - required: true - type: string -name_28: - description: | - The name of the subnet. - in: body - required: true - type: string -name_29: - description: | - The name of the QoS policy. - in: body - required: true - type: string -name_3: - description: | - The port name. - in: body - required: true - type: string -name_30: - description: | - The pool name. Does not have to be unique. - in: body - required: true - type: string -name_31: - description: | - The router name. - in: body - required: true - type: string -name_32: - description: | - The security group name. - in: body - required: true - type: string -name_33: - description: | - The subnet pool name. - in: body - required: true - type: string -name_34: - description: | - Human-readable name for the VIP. Does not have to - be unique. - in: body - required: true - type: string -name_35: - description: | - Human-readable name for the VPN endpoint group. - Does not have to be unique. - in: body - required: true - type: string -name_36: - description: | - Human-readable name for the VPN service. Does not - have to be unique. - in: body - required: true - type: string -name_37: - description: | - New human-readable name for the flavor. Can be "" - and non-unique. - in: body - required: false - type: string -name_38: - description: | - Human-readable name for the pool. Does not have - to be unique. - in: body - required: false - type: string -name_39: - description: | - Human-readable name for the firewall policy. Does - not have to be unique. - in: body - required: false - type: string -name_4: - description: | - User-facing provider name. - in: body - required: true - type: string -name_40: - description: | - A human-readable name for the firewall rule. - Maximum length is 255 characters. Does not have to be unique. No - default. - in: body - required: false - type: string -name_41: - description: | - A human-readable name for the flavor. Can be "" and - non-unique. - in: body - required: false - type: string -name_42: - description: | - A human-readable name for the firewall service. - Does not have to be unique. - in: body - required: false - type: string -name_43: - description: | - Human-readable name for the IKE policy. Does not - have to be unique. - in: body - required: false - type: string -name_5: - description: | - A human-readable name for the IPSec policy. Does - not have to be unique. - in: body - required: true - type: string -name_6: - description: | - Human-readable name for the IPSec connection. - Does not have to be unique. - in: body - required: false - type: string -name_7: - description: | - The listener name. - in: body - required: true - type: string -name_8: - description: | - The load balancer name. Does not have to be - unique. - in: body - required: false - type: string -name_9: - description: | - The name of the metering label. - in: body - required: true - type: string -name_resource: - description: | - The name of the resource. - in: body - required: false - type: string -network: - description: | - A ``network`` object. - in: body - required: true - type: object -network-admin_state_up: - description: | - The administrative state of the network, which is - up (``true``) or down (``false``). - in: body - required: true - type: boolean -network-admin_state_up-request: - description: | - The administrative state of the network, which is - up (``true``) or down (``false``). - in: body - required: false - type: boolean -network-count: - description: | - The number of networks allowed for each tenant. - in: body - required: true - type: integer -network-count-request: - description: | - The number of networks allowed for each tenant. - in: body - required: false - type: integer -network-id: - description: | - The ID of the network. - in: body - required: true - type: string -network-name: - description: | - Human-readable name of the network. - in: body - required: true - type: string -network-name-request: - description: | - Human-readable name of the network. - in: body - required: False - type: string -network-port_security_enabled: - description: | - The port security status of the network. Valid values are - enabled (``true``) and disabled (``false``). - This value is used as the default value of ``port_security_enabled`` - field of a newly created port. - in: body - required: true - type: boolean -network-port_security_enabled-request: - description: | - The port security status of the network. Valid values are - enabled (``true``) and disabled (``false``). - This value is used as the default value of ``port_security_enabled`` - field of a newly created port. - in: body - required: false - type: boolean -network-shared: - description: | - Indicates whether this network is shared across all tenants. By default, - only administrative users can change this value. - in: body - required: true - type: boolean -network-shared-request: - description: | - Indicates whether this network is shared across all tenants. By default, - only administrative users can change this value. - in: body - required: false - type: boolean -network-status: - description: | - The network status. Values are ``ACTIVE``, ``DOWN``, ``BUILD`` or ``ERROR``. - in: body - required: true - type: string -network-subnets: - description: | - The associated subnets. - in: body - required: true - type: array -network_id: - description: | - The ID of the attached network. - in: body - required: true - type: string -network_ip_availabilities: - description: | - The ``network_ip_availabilities`` object. - in: body - required: true - type: array -network_ip_availability: - description: | - A ``network_ip_availability`` object. - in: body - required: true - type: object -network_ip_availability-network_id: - description: | - The ID of the network whose IP availability detail is reported. - in: body - required: true - type: string -network_ip_availability-subnet_id: - description: | - The ID of the subnet whose IP availability detail is reported. - in: body - required: true - type: string -network_type: - description: | - The type of physical network that maps to this - network resource. For example, ``flat``, ``vlan``, ``vxlan``, or - ``gre``. - in: body - required: true - type: string -networks: - description: | - A list of ``network`` objects. - in: body - required: true - type: array -object_id: - description: | - The ID of the ``object_type`` resource. An ``object_type`` of ``network`` - returns a network ID and an ``object_type`` of ``qos-policy`` returns - a QoS ID. - in: body - required: true - type: integer -object_type: - description: | - The type of the object that the RBAC policy affects. Types include - ``qos-policy`` or ``network``. - in: body - required: true - type: integer -operating_status: - description: | - The operating status of the load balancer. This - value is ``ONLINE`` or ``OFFLINE``. - in: body - required: true - type: string -peer_address: - description: | - The peer gateway public IPv4 or IPv6 address or - FQDN. - in: body - required: true - type: string -peer_cidrs: - description: | - (Deprecated) Unique list of valid peer private - CIDRs in the form < net_address > / < prefix > . - in: body - required: false - type: array -peer_ep_group_id: - description: | - The ID for the endpoint group that contains - private CIDRs in the form < net_address > / < prefix > for the - peer side of the connection. You must specify this parameter with - the ``local_ep_group_id`` parameter unless in backward-compatible - mode where ``peer_cidrs`` is provided with a ``subnet_id`` for the - VPN service. - in: body - required: false - type: string -peer_id: - description: | - The peer router identity for authentication. A - valid value is an IPv4 address, IPv6 address, e-mail address, key - ID, or FQDN. Typically, this value matches the ``peer_address`` - value. - in: body - required: true - type: string -pfs: - description: | - Perfect forward secrecy (PFS). A valid value is - ``Group2``, ``Group5``, ``Group14``, and so on. Default is - ``Group5``. - in: body - required: false - type: string -phase1_negotiation_mode: - description: | - The IKE mode. A valid value is ``main``, which is - the default. - in: body - required: false - type: string -policies: - description: | - A list of QoS ``policy`` objects. - in: body - required: true - type: array -policy: - description: | - A QoS ``policy`` object. - in: body - required: true - type: object -pool: - description: | - A ``pool`` object. - in: body - required: true - type: object -pool-id-response: - description: | - The ID of the pool. - in: body - required: true - type: string -pool-protocol: - description: | - The protocol of the pool, which is ``TCP``, - ``HTTP``, or ``HTTPS``. - in: body - required: true - type: string -pool-provider: - description: | - The provider name of the load balancer pool. - in: body - required: true - type: string -pool-provider-request: - description: | - The provider name of the load balancer pool. - in: body - required: false - type: string -pool-status: - description: | - The status of the pool. Indicates whether the - pool is operational. - in: body - required: true - type: string -pool-subnet_id: - description: | - The subnet on which the members of the pool will be located. - in: body - required: true - type: string -pool-subnet_id-request: - description: | - If you omit this parameter, LBaaS uses the - ``vip_subnet_id`` parameter value for the subnet UUID. - in: body - required: false - type: string -pools: - description: | - List of pools that are associated with the health - monitor. - in: body - required: true - type: array -pools-obj: - description: | - A list of ``pool`` objects. - in: body - required: true - type: array -pools_2: - description: | - The associated pools, if any. - in: body - required: true - type: array -port: - description: | - A ``port`` object. - in: body - required: true - type: object -port-security_groups: - description: | - The IDs of security groups applied to the port. - in: body - required: true - type: array -port-security_groups-request: - description: | - The IDs of security groups applied to the port. - in: body - required: false - type: array -port-status: - description: | - The port status. Values are ``ACTIVE``, ``DOWN``, - ``BUILD`` and ``ERROR``. - in: body - required: true - type: string -port_id: - description: | - The ID of the port. - in: body - required: true - type: string -port_id-request: - description: | - The ID of the port. - in: body - required: false - type: string -port_id_4: - description: | - The UUID of the port. - in: body - required: true - type: string -port_id_subport: - description: | - The ID of the subport. - in: body - required: true - type: string -port_range_max: - description: | - The maximum port number in the range that is - matched by the security group rule. The ``port_range_min`` - attribute constrains the ``port_range_max`` attribute. If the - protocol is ICMP, this value must be an ICMP type. - in: body - required: false - type: integer -port_range_max_1: - description: | - The maximum port number in the range that is - matched by the security group rule. The ``port_range_min`` - attribute constrains the ``port_range_max`` attribute. If the - protocol is ICMP, this value must be an ICMP type. - in: body - required: true - type: integer -port_range_min: - description: | - The minimum port number in the range that is - matched by the security group rule. If the protocol is TCP or UDP, - this value must be less than or equal to the ``port_range_max`` - attribute value. If the protocol is ICMP, this value must be an - ICMP type. - in: body - required: false - type: integer -port_range_min_1: - description: | - The minimum port number in the range that is - matched by the security group rule. If the protocol is TCP or UDP, - this value must be less than or equal to the ``port_range_max`` - attribute value. If the protocol is ICMP, this value must be an - ICMP type. - in: body - required: true - type: integer -port_security_enabled: - description: | - The port security status. A valid value is - enabled (``true``) or disabled (``false``). - If port security is enabled for the port, - security group rules and anti-spoofing rules are applied to - the traffic on the port. If disabled, no such rules are applied. - in: body - required: true - type: boolean -port_security_enabled-request: - description: | - The port security status. A valid value is - enabled (``true``) or disabled (``false``). - If port security is enabled for the port, - security group rules and anti-spoofing rules are applied to - the traffic on the port. If disabled, no such rules are applied. - in: body - required: false - type: boolean -ports: - description: | - A list of ``port`` objects. - in: body - required: true - type: array -position: - description: | - Read-only attribute that the API assigns to this - rule when it associates it with a firewall policy. This value - indicates the position of this rule in that firewall policy. This - position number starts at 1. If the firewall rule is not - associated with any policy, the position is ``null``. - in: body - required: true - type: integer -prefixes: - description: | - A list of subnet prefixes to assign to the subnet - pool. The API merges adjacent prefixes and treats them as a single - prefix. Each subnet prefix must be unique among all subnet - prefixes in all subnet pools that are associated with the address - scope. - in: body - required: true - type: array -prefixes_1: - description: | - A list of subnet prefixes that are assigned to - the subnet pool. The API merges adjacent prefixes and treats them - as a single prefix. - in: body - required: true - type: array -prefixes_2: - description: | - A list of subnet prefixes to assign to the subnet - pool. The API merges adjacent prefixes and treats them as a single - prefix. To update the subnet prefixes, pass a list that contains - the existing set of prefixes and the new set of prefixes. You - cannot shrink the prefix list of a subnet pool. You can only add - prefixes to it to expand it. Ensure that each subnet prefix is - unique among all subnet prefixes in all subnet pools that are - associated with the address scope. - in: body - required: true - type: array -project_id: - description: | - The ID of the project. - in: body - required: true - type: string -project_id-body-optional: - description: | - The ID of the project that owns the resource. - in: body - required: false - type: string -project_id-body-required: - description: | - The ID of the project that owns the resource. - in: body - required: true - type: string -project_id-request: - description: | - The ID of the project that owns the resource. - Only administrative users can specify a project ID other than their own. - You cannot change this value through authorization policies. - in: body - required: false - type: string -protocol: - description: | - The IP protocol. Valid value is ``icmp``, - ``tcp``, ``udp``, or ``null``. No default. - in: body - required: false - type: string -protocol-response: - description: | - The IP protocol. Valid value is ``icmp``, - ``tcp``, ``udp``, or ``null``. No default. - in: body - required: true - type: string -protocol_1: - description: | - The protocol to load balance. A valid value is - ``HTTP``, ``HTTPS``, ``TCP``, or ``TERMINATED_HTTPS``. - in: body - required: true - type: string -protocol_3: - description: | - The protocol that is matched by the security - group rule. Valid values are null, tcp, udp, and icmp. - in: body - required: false - type: string -protocol_4: - description: | - The protocol that is matched by the security - group rule. Value is ``null``, ``icmp``, ``icmpv6``, ``tcp``, or - ``udp``. - in: body - required: true - type: string -protocol_6: - description: | - The IP protocol. Value is ``icmp``, ``tcp``, - ``udp``, or ``null``. - in: body - required: true - type: string -protocol_port: - description: | - The TCP or UDP port on which to listen. - in: body - required: true - type: integer -protocol_port-request: - description: | - The TCP or UDP port on which to listen. - in: body - required: false - type: integer -provider:network_type: - description: | - The type of physical network that this network is mapped to. - For example, ``flat``, ``vlan``, ``vxlan``, or ``gre``. - Valid values depend on a networking back-end. - in: body - required: true - type: string -provider:network_type-request: - description: | - The type of physical network that this network should be mapped to. - For example, ``flat``, ``vlan``, ``vxlan``, or ``gre``. - Valid values depend on a networking back-end. - in: body - required: false - type: string -provider:physical_network: - description: | - The physical network where this network is implemented. - in: body - required: true - type: string -provider:physical_network-request: - description: | - The physical network where this network should be implemented. - The Networking API v2.0 does not provide a way to list available - physical networks. For example, the Open vSwitch plug-in configuration - file defines a symbolic name that maps to specific bridges on each - compute host. - in: body - required: false - type: string -provider:segmentation_id: - description: | - The ID of the isolated segment on the physical network. - The ``network_type`` attribute defines the segmentation model. - For example, if the ``network_type`` value is vlan, this ID is a vlan - identifier. If the ``network_type`` value is gre, this ID is a gre key. - in: body - required: true - type: integer -provider:segmentation_id-request: - description: | - The ID of the isolated segment on the physical network. - The ``network_type`` attribute defines the segmentation model. - For example, if the ``network_type`` value is vlan, this ID is a vlan - identifier. If the ``network_type`` value is gre, this ID is a gre key. - in: body - required: false - type: integer -provider_1: - description: | - The load-balancer provider. - in: body - required: true - type: string -provider_2: - description: | - The name of the provider. - in: body - required: true - type: string -provisioning_status: - description: | - The provisioning status of the load balancer. - This value is ``ACTIVE``, ``PENDING_CREATE`` or ``ERROR``. - in: body - required: true - type: string -psk: - description: | - The pre-shared key. A valid value is any string. - in: body - required: true - type: string -qos-rule-direction: - description: | - The direction of the traffic to which the QoS - rule is applied, as seen from the point of view - of the ``port``. - Valid values are ``egress`` and ``ingress``. - Default value is ``egress``. - in: body - required: false - type: string -qos-rule-direction-response: - description: | - The direction of the traffic to which the QoS - rule is applied, as seen from the point of view - of the ``port``. - Valid values are ``egress`` and ``ingress``. - Default value is ``egress``. - in: body - required: true - type: string -qos-rule-direction-update: - description: | - The direction of the traffic to which the QoS - rule is applied, as seen from the point of view - of the ``port``. - Valid values are ``egress`` and ``ingress``. - in: body - required: false - type: string -qos-rule-direction-update-response: - description: | - The direction of the traffic to which the QoS - rule is applied, as seen from the point of view - of the ``port``. - Valid values are ``egress`` and ``ingress``. - in: body - required: true - type: string -qos-rule-type: - description: | - The type of QoS rule. - in: body - required: true - type: string -qos-rule-types: - description: | - A list of QoS ``rule_type`` objects. - in: body - required: true - type: array -qos-rules: - description: | - A set of zero or more policy rules. - in: body - required: true - type: array -qos-shared: - description: | - Indicates whether this policy is shared across - all projects. - in: body - required: true - type: boolean -qos-shared-request: - description: | - Set to ``true`` to share this policy with other - projects. Default is ``false``. - in: body - required: false - type: boolean -qos_bandwidth_limit_rule-id: - description: | - The ID of the QoS Bandwidth limit rule. - in: body - required: true - type: string -qos_dscp_marking_rule-id: - description: | - The ID of the QoS DSCP marking rule. - in: body - required: true - type: string -qos_policy-name: - description: | - Human-readable name of the resource. - in: body - required: false - type: string -qos_policy_id: - description: | - The ID of the QoS policy. - in: body - required: true - type: string -qos_policy_id-body: - description: | - The ID of the QoS policy. - in: body - required: true - type: string -qos_policy_id-request: - description: | - The ID of the QoS policy. - in: body - required: false - type: string -quota: - description: | - A ``quota`` object. - in: body - required: true - type: object -quota-floatingip: - description: | - The number of floating IP addresses allowed for - each project. A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-floatingip-request: - description: | - The number of floating IP addresses allowed for - each project. A value of ``-1`` means no limit. - in: body - required: false - type: integer -quota-network: - description: | - The number of networks allowed for each project. - A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-network-request: - description: | - The number of networks allowed for each project. - A value of ``-1`` means no limit. - in: body - required: false - type: integer -quota-port: - description: | - The number of ports allowed for each project. - A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-port-request: - description: | - The number of ports allowed for each project. - A value of ``-1`` means no limit. - in: body - required: false - type: integer -quota-rbac_policy: - description: | - The number of role-based access control (RBAC) - policies for each project. A value of ``-1`` means - no limit. - in: body - required: true - type: integer -quota-rbac_policy-request: - description: | - The number of role-based access control (RBAC) - policies for each project. A value of ``-1`` means - no limit. - in: body - required: false - type: integer -quota-router: - description: | - The number of routers allowed for each project. - A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-router-request: - description: | - The number of routers allowed for each project. - A value of ``-1`` means no limit. - in: body - required: false - type: integer -quota-security_group: - description: | - The number of security groups allowed for each - project. A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-security_group-request: - description: | - The number of security groups allowed for each - project. A value of ``-1`` means no limit. - in: body - required: false - type: integer -quota-security_group_rule: - description: | - The number of security group rules allowed for - each project. A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-security_group_rule-request: - description: | - The number of security group rules allowed for - each project. A value of ``-1`` means no limit. - in: body - required: false - type: integer -quota-subnet: - description: | - The number of subnets allowed for each project. - A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-subnet-request: - description: | - The number of subnets allowed for each project. - A value of ``-1`` means no limit. - in: body - required: false - type: integer -quota-subnetpool: - description: | - The number of subnet pools allowed for each - project. A value of ``-1`` means no limit. - in: body - required: true - type: integer -quota-subnetpool-request: - description: | - The number of subnet pools allowed for each - project. A value of ``-1`` means no limit. - in: body - required: false - type: integer -quotas: - description: | - A list of quota objects. - in: body - required: true - type: array -rbac_action: - description: | - Action for the RBAC policy which is ``access_as_external`` or - ``access_as_shared``. - in: body - required: true - type: string -rbac_policy_id: - description: | - The ID of the RBAC policy. - in: body - required: true - type: integer -remote_group_id: - description: | - The remote group UUID to associate with this - security group rule. You can specify either the - ``remote_group_id`` or ``remote_ip_prefix`` attribute in the - request body. - in: body - required: false - type: string -remote_group_id_1: - description: | - The remote group UUID to associate with this - security group rule. You can specify either the - ``remote_group_id`` or ``remote_ip_prefix`` attribute in the - request body. - in: body - required: true - type: string -remote_ip_prefix: - description: | - The remote IP prefix to associate with this - metering rule packet. - in: body - required: true - type: string -remote_ip_prefix_1: - description: | - The remote IP prefix to associate with this - security group rule. You can specify either the - ``remote_group_id`` or ``remote_ip_prefix`` attribute in the - request body. This attribute matches the IP prefix as the source - IP address of the IP packet. - in: body - required: false - type: string -remote_ip_prefix_2: - description: | - The remote IP prefix to associate with this - security group rule. You can specify either the - ``remote_group_id`` or ``remote_ip_prefix`` attribute in the - request body. This attribute value matches the IP prefix as the - source IP address of the IP packet. - in: body - required: true - type: string -resource-collection: - description: | - Collection name of the resource. - in: body - required: true - type: string -resource-href: - description: | - Link to the resource. - in: body - required: true - type: string -resource-links: - description: | - List of links related to the resource. Each link is a dict with 'href' and 'rel'. - in: body - required: true - type: array -resource-name: - description: | - Name of the resource. - in: body - required: true - type: string -resource-rel: - description: | - Relationship between link and the resource. - in: body - required: true - type: string -resource_log_id: - description: | - The ID of resource log (e.g security group ID). - in: body - required: true - type: string -resource_log_id-request: - description: | - The ID of resource log (e.g security group ID). - in: body - required: false - type: string -resource_log_type: - description: | - The resource log type such as 'security_group'. - in: body - required: true - type: string -resource_target_log_id: - description: | - The ID of resource target log such as port ID. - in: body - required: true - type: string -resource_target_log_id-request: - description: | - The ID of resource target log such as port ID. - in: body - required: false - type: string -resources: - description: | - List of resource objects. - in: body - required: true - type: array -revision_number: - description: | - The revision number of the resource. - in: body - required: true - type: integer -route_mode: - description: | - The route mode. A valid value is ``static``, - which is the default. - in: body - required: false - type: string -route_mode_1: - description: | - The route mode. A valid value is ``static``, - which is the default. - in: body - required: true - type: string -router: - description: | - A ``router`` object. - in: body - required: true - type: object -router-availability_zone_hints: - description: | - The availability zone candidates for the router. - It is available when ``router_availability_zone`` extension is enabled. - in: body - required: true - type: array -router-availability_zone_hints-request: - description: | - The availability zone candidates for the router. - It is available when ``router_availability_zone`` extension is enabled. - in: body - required: false - type: array -router-availability_zones: - description: | - The availability zone(s) for the router. - It is available when ``router_availability_zone`` extension is enabled. - in: body - required: true - type: array -router-destination: - description: | - The destination CIDR. - in: body - required: true - type: string -router-distributed: - description: | - ``true`` indicates a distributed router. - It is available when ``dvr`` extension is enabled. - in: body - required: true - type: boolean -router-distributed-request: - description: | - ``true`` indicates a distributed router. - It is available when ``dvr`` extension is enabled. - in: body - required: false - type: boolean -router-enable_snat: - description: | - Enable Source NAT (SNAT) attribute. - ``true`` means Network Address Translation (NAT) is enabled - for traffic generated by subnets attached to the router - when the traffic is sent to/received from the external network. - ``false`` means no NAT is applied for traffic from/to the external network. - It is available when ``ext-gw-mode`` extension is enabled. - in: body - required: true - type: boolean -router-enable_snat-request: - description: | - Enable Source NAT (SNAT) attribute. Default is - ``true``. To persist this attribute value, set the - ``enable_snat_by_default`` option in the ``neutron.conf`` file. - It is available when ``ext-gw-mode`` extension is enabled. - in: body - required: false - type: boolean -router-external_fixed_ips: - description: | - IP address(es) of the external gateway of the router. - It is a list of IP addresses. Each element of the list - is a dictionary of ``ip_address`` and ``subnet_id``. - in: body - required: true - type: array -router-external_fixed_ips-request: - description: | - IP address(es) of the external gateway interface of the router. - It is a list of IP addresses you would like to assign to the - external gateway interface. Each element of ths list is - a dictionary of ``ip_address`` and ``subnet_id``. - in: body - required: false - type: array -router-external_gateway_info: - description: | - The external gateway information of the router. - If the router has an external gateway, this would be a dict with - ``network_id``, ``enable_snat`` and ``external_fixed_ips``. - Otherwise, this would be ``null``. - in: body - required: true - type: object -router-external_gateway_info-request: - description: | - The external gateway information of the router. - If the router has an external gateway, this would be a dict with - ``network_id``, ``enable_snat`` and ``external_fixed_ips``. - Otherwise, this would be ``null``. - in: body - required: false - type: object -router-ha: - description: | - ``true`` indicates a highly-available router. - It is available when ``l3-ha`` extension is enabled. - in: body - required: true - type: boolean -router-ha-request: - description: | - ``true`` indicates a highly-available router. - It is available when ``l3-ha`` extension is enabled. - in: body - required: false - type: boolean -router-id-body: - description: | - The ID of the router. - in: body - required: true - type: string -router-name-request: - description: | - The router name. - in: body - required: false - type: string -router-network_id: - description: | - Network ID which the router gateway is connected to. - in: body - required: true - type: string -router-network_id-interface: - description: | - Network ID which the router interface is connected to. - in: body - required: true - type: string -router-nexthop: - description: | - The IP address of the next hop for the corresponding destination. - The next hop IP address must be a part of one of the subnets to - which the router interfaces are connected. - in: body - required: true - type: string -router-port_id: - description: | - The ID of the port which represents the router interface. - in: body - required: true - type: string -router-port_id-request: - description: | - The ID of the port. - One of ``subnet_id`` or ``port_id`` must be specified. - in: body - required: false - type: string -router-project_id-interface: - description: | - The ID of the project who owns the router interface. - in: body - required: true - type: string -router-routes: - description: | - The extra routes configuration for L3 router. - A list of dictionaries with ``destination`` and ``nexthop`` parameters. - It is available when ``extraroute`` extension is enabled. - in: body - required: true - type: array -router-routes-request: - description: | - The extra routes configuration for L3 router. - A list of dictionaries with ``destination`` and ``nexthop`` parameters. - It is available when ``extraroute`` extension is enabled. - Default is an empty list (``[]``). - in: body - required: false - type: array -router-status: - description: | - The router status. - in: body - required: true - type: string -router-subnet_id: - description: | - The ID of the subnet which the router interface belongs to. - in: body - required: true - type: string -router-subnet_id-request: - description: | - The ID of the subnet. - One of ``subnet_id`` or ``port_id`` must be specified. - in: body - required: false - type: string -router-subnet_ids: - description: | - A list of the ID of the subnet which the router interface belongs to. - The list contains only one member. - in: body - required: true - type: array -router:external: - description: | - Indicates whether this network can provide floating IPs via a router. - in: body - required: true - type: boolean -router:external-request: - description: | - Indicates whether this network can provide floating IPs via a router. - in: body - required: false - type: boolean -router_id_1: - description: | - The UUID of the router. - in: body - required: true - type: string -router_id_2: - description: | - The UUID of the router to which the VPN service - is inserted. - in: body - required: true - type: string -router_id_3: - description: | - The UUID of the router into which the VPN service - is inserted. - in: body - required: true - type: string -router_ids: - description: | - A list of IDs for routers that are associated - with the firewall. - in: body - required: false - type: array -router_ids-1: - description: | - A list of IDs for routers that are associated - with the firewall. - in: body - required: true - type: array -router_ids-response: - description: | - A list of IDs for routers that are associated - with the firewall. - in: body - required: true - type: array -routers: - description: | - A list of ``router`` objects. - in: body - required: true - type: array -security_group: - description: | - A ``security_group`` object. - in: body - required: true - type: object -security_group-id: - description: | - The ID of the security group. - in: body - required: true - type: string -security_group_id: - description: | - The security group UUID to associate with this - security group rule. - in: body - required: true - type: string -security_group_rule: - description: | - A ``security_group_rule`` object. - in: body - required: true - type: object -security_group_rule-id: - description: | - The ID of the security group rule. - in: body - required: true - type: string -security_group_rule-security_group_id: - description: | - The security group ID to associate with this - security group rule. - in: body - required: true - type: string -security_group_rules: - description: | - A list of ``security_group_rule`` objects. - Refer to :ref:`Security group rules ` for details. - in: body - required: true - type: array -security_groups: - description: | - One or more security group UUIDs. - in: body - required: false - type: array -security_groups-obj: - description: | - A list of ``security_group`` objects. - in: body - required: true - type: array -segment_id: - description: | - The UUID of the segment. - in: body - required: true - type: string -segmentation_id: - description: | - The segmentation ID for the subport. - in: body - required: false - type: integer -segmentation_type: - description: | - The segmentation type for the subport. - in: body - required: false - type: string -segments: - description: | - A list of provider ``segment`` objects. - in: body - required: true - type: array -segments-request: - description: | - A list of provider ``segment`` objects. - in: body - required: false - type: array -service_profile: - description: | - A ``service_profile`` object. - in: body - required: true - type: object -service_profile-description: - description: | - The human-readable description for the service profile. - in: body - required: true - type: string -service_profile-description-request: - description: | - The human-readable description for the service profile. - in: body - required: false - type: string -service_profile-driver: - description: | - Provider driver to use for this profile. Example: - ``neutron_lbaas.drivers.octavia.driver.OctaviaDriver`` - in: body - required: true - type: string -service_profile-driver-request: - description: | - Provider driver to use for this profile. Example: - ``neutron_lbaas.drivers.octavia.driver.OctaviaDriver`` - in: body - required: false - type: string -service_profile-enabled: - description: | - Indicates whether this service profile is enabled or not. - Default is ``true``. - in: body - required: true - type: boolean -service_profile-enabled-request: - description: | - Indicates whether this service profile is enabled or not. - Default is ``true``. - in: body - required: false - type: boolean -service_profile-id: - description: | - The UUID of the service profile. - in: body - required: true - type: string -service_profile-metainfo: - description: | - JSON-formatted meta information of the service profile. - in: body - required: true - type: string -service_profile-metainfo-request: - description: | - JSON-formatted meta information of the service profile. - in: body - required: false - type: string -service_profiles: - description: | - Service profile UUIDs associated with this - flavor. - in: body - required: true - type: array -service_profiles_1: - description: | - A list of ``service_profile`` objects. - in: body - required: true - type: array -service_providers: - description: | - A list of ``service_provider`` objects. - in: body - required: true - type: array -service_type: - description: | - The service type, which is ``CORE``, ``DUMMY``, - ``FIREWALL``, ``FLAVORS``, ``L3_ROUTER_NAT``, ``LOADBALANCER``, - ``LOADBALANCERV2``, ``METERING``, ``QOS``, or ``VPN``. - in: body - required: true - type: string -service_type_1: - description: | - Service type (ex: LOADBALANCERV2) for the flavor. - in: body - required: true - type: string -shared: - description: | - Admin-only. Indicates whether this network is - shared across all projects. - in: body - required: false - type: boolean -shared-response: - description: | - Admin-only. Indicates whether this network is - shared across all tenants. - in: body - required: true - type: boolean -shared_11: - description: | - Indicates whether this subnet pool is shared - across all projects. - in: body - required: true - type: boolean -shared_12: - description: | - Set to ``true`` to make this firewall policy - visible to other projects. Default is ``false``. - in: body - required: false - type: boolean -shared_13: - description: | - Set to ``true`` to share this firewall rule with - other projects. Other projects can use a shared rule in firewall - policies that this project does not own. Valid value is ``true`` or - ``false``. Default is ``false``. - in: body - required: false - type: boolean -shared_3: - description: | - Admin-only. Indicates whether this network is - shared across all projects. - in: body - required: true - type: boolean -shared_5: - description: | - Admin-only. Indicates whether this subnet pool is - shared across all projects. - in: body - required: false - type: boolean -shared_6: - description: | - Indicates whether the firewall policy is shared - across all projects. - in: body - required: true - type: boolean -shared_7: - description: | - Indicates whether this firewall rule is shared - with other projects. Other projects can use a shared rule in - firewall policies that this project does not own. - in: body - required: true - type: boolean -shared_9: - description: | - Indicates whether this network is shared across - all projects. - in: body - required: true - type: boolean -sni_container_refs: - description: | - A list of references to TLS secrets. - in: body - required: false - type: array -sni_container_refs-response: - description: | - A list of references to TLS secrets. - in: body - required: true - type: array -source_ip_address: - description: | - The source IPv4 or IPv6 address or CIDR. - in: body - required: false - type: string -source_port: - description: | - The source port or port range. A valid value is - a port number, as an integer, or a port range, in the format of a - ``:`` separated range. For a port range, include both ends of the - range. For example, ``80:90``. - in: body - required: true - type: string -source_port-response: - description: | - The source port or port range. A valid value is - a port number, as an integer, or a port range, in the format of a - ``:`` separated range. For a port range, include both ends of the - range. For example, ``80:90``. - in: body - required: false - type: string -source_port_1: - description: | - The source port or port range. - in: body - required: true - type: string -status_description: - description: | - Human-readable description of the status. - in: body - required: true - type: string -sub_ports: - description: | - A list of ports associated with the trunk. - in: body - required: true - type: array -subnet-allocation_pools: - description: | - Allocation pools with ``start`` and ``end`` IP addresses - for this subnet. - in: body - required: true - type: array -subnet-allocation_pools-request: - description: | - Allocation pools with ``start`` and ``end`` IP addresses - for this subnet. If allocation_pools are not specified, OpenStack - Networking automatically allocates pools for covering all IP addresses - in the CIDR, excluding the address reserved for the subnet gateway by - default. - in: body - required: false - type: array -subnet-created_at: - description: | - Time at which the subnet has been created. - in: body - required: true - type: string -subnet-dns_nameservers: - description: | - List of dns name servers associated with the subnet. - in: body - required: true - type: array -subnet-dns_nameservers-request: - description: | - List of dns name servers associated with the subnet. Default is an - empty list. - in: body - required: false - type: array -subnet-enable_dhcp: - description: | - Indicates whether dhcp is enabled or disabled - for the subnet. - in: body - required: true - type: boolean -subnet-enable_dhcp-request: - description: | - Indicates whether dhcp is enabled or disabled - for the subnet. Default is ``true``. - in: body - required: false - type: boolean -subnet-gateway_ip: - description: | - Gateway IP of this subnet. If the value is ``null`` that implies no - gateway is associated with the subnet. - in: body - required: true - type: string -subnet-gateway_ip-request: - description: | - Gateway IP of this subnet. If the value is ``null`` that implies no - gateway is associated with the subnet. If the gateway_ip is not - specified, OpenStack Networking allocates an address from the CIDR - for the gateway for the subnet by default. - in: body - required: false - type: string -subnet-host_routes: - description: | - Additional routes for the subnet. A list of dictionaries with - ``destination`` and ``nexthop`` parameters. - in: body - required: true - type: array -subnet-host_routes-request: - description: | - Additional routes for the subnet. A list of dictionaries with - ``destination`` and ``nexthop`` parameters. Default value is - an empty list. - in: body - required: false - type: array -subnet-id-body: - description: | - The ID of the subnet. - in: body - required: true - type: string -subnet-ip_version: - description: | - The IP protocol version. Value is ``4`` or ``6``. - in: body - required: true - type: integer -subnet-ipv6_address_mode: - description: | - The IPv6 address modes specifies mechanisms for assigning IP addresses. - Value is ``slaac``, ``dhcpv6-stateful``, ``dhcpv6-stateless`` or ``null``. - in: body - required: true - type: string -subnet-ipv6_address_mode-request: - description: | - The IPv6 address modes specifies mechanisms for assigning IP addresses. - Value is ``slaac``, ``dhcpv6-stateful``, ``dhcpv6-stateless``. - in: body - required: false - type: string -subnet-ipv6_ra_mode: - description: | - The IPv6 router advertisement specifies whether the networking service - should transmit ICMPv6 packets, for a subnet. Value is ``slaac``, - ``dhcpv6-stateful``, ``dhcpv6-stateless`` or ``null``. - in: body - required: true - type: string -subnet-ipv6_ra_mode-request: - description: | - The IPv6 router advertisement specifies whether the networking service - should transmit ICMPv6 packets, for a subnet. Value is ``slaac``, - ``dhcpv6-stateful``, ``dhcpv6-stateless``. - in: body - required: false - type: string -subnet-name: - description: | - Human-readable name of the resource. - in: body - required: true - type: string -subnet-name-request: - description: | - Human-readable name of the resource. Default is an empty string. - in: body - required: false - type: string -subnet-name-update-request: - description: | - Human-readable name of the resource. - in: body - required: false - type: string -subnet-network_id: - description: | - The ID of the network to which the subnet belongs. - in: body - required: true - type: string -subnet-obj: - description: | - A ``subnet`` object. - in: body - required: true - type: string -subnet-revision_number: - description: | - The revision number of the subnet. - in: body - required: true - type: string -subnet-segment_id: - description: | - The ID of a network segment the subnet is associated with. - It is available when ``segment`` extension is enabled. - in: body - required: true - type: string -subnet-segment_id-request: - description: | - The ID of a network segment the subnet is associated with. - It is available when ``segment`` extension is enabled. - in: body - required: false - type: string -subnet-service_types: - description: | - The service types associated with the subnet. - in: body - required: true - type: string -subnet-subnetpool_id: - description: | - The ID of the subnet pool associated with the subnet. - in: body - required: true - type: string -subnet-subnetpool_id-request: - description: | - The ID of the subnet pool associated with the subnet. - in: body - required: false - type: string -subnet-updated_at: - description: | - Time at which the subnet has been updated. - in: body - required: true - type: string -subnet_id: - description: | - If you specify only a subnet UUID, OpenStack - Networking allocates an available IP from that subnet to the port. - If you specify both a subnet UUID and an IP address, OpenStack - Networking tries to allocate the address to the port. - in: body - required: false - type: string -subnet_ip_availability: - description: | - A list of dictionaries showing subnet IP availability. - It contains information for every subnet associated to the network. - in: body - required: true - type: array -subnet_name: - description: | - The name of the subnet. - in: body - required: true - type: string -subnetpool: - description: | - A ``subnetpool`` object. - in: body - required: true - type: object -subnetpool_id_body: - description: | - The ID of the subnet. - in: body - required: true - type: string -subnetpool_is_default: - description: | - The subnetpool is default pool or not. - in: body - required: true - type: boolean -subnetpool_revision_number: - description: | - The revision number of the subnetpool. - in: body - required: true - type: string -subnetpool_updated_at: - description: | - Time at which subnetpool has been updated. - in: body - required: true - type: string -subnetpools: - description: | - A list of ``subnetpool`` objects. - in: body - required: true - type: array -subnets-obj: - description: | - A list of ``subnet`` objects. - in: body - required: true - type: array -tags: - description: | - The list of tags on the resource. - in: body - required: true - type: array -target_tenant: - description: | - The ID of the tenant to which the RBAC policy will be enforced. - in: body - required: true - type: string -tenant_id: - description: | - The ID of the project that owns the resource. - in: body - required: false - type: string -tenant_id-request: - description: | - The ID of the tenant who owns the resource. - Only administrative users can specify a tenant ID other than their own. - You cannot change this value through authorization policies. - in: body - required: false - type: string -tenant_id_1: - description: | - The UUID of the tenant. - in: body - required: true - type: string -tenant_id_10: - description: | - The UUID of the tenant who owns the load - balancer. Only administrative users can specify a tenant UUID - other than their own. - in: body - required: true - type: string -tenant_id_11: - description: | - The UUID of the tenant who owns the member. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: true - type: string -tenant_id_12: - description: | - The UUID of the tenant who owns the member. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: false - type: string -tenant_id_13: - description: | - The tenant UUID for the metering label. - in: body - required: true - type: string -tenant_id_15: - description: | - The tenant UUID of QoS policy owner. Only - administrative users can specify a tenant UUID other than their - own. You cannot change this value through authorization policies. - in: body - required: false - type: string -tenant_id_16: - description: | - The UUID of the tenant who owns the pool. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: false - type: string -tenant_id_17: - description: | - The UUID of the tenant who owns the security - group rule. Only administrative users can specify a tenant UUID - other than their own. - in: body - required: true - type: string -tenant_id_18: - description: | - The UUID of the tenant who owns the security - group. Only administrative users can specify a tenant UUID other - than their own. - in: body - required: false - type: string -tenant_id_19: - description: | - The UUID of the tenant who owns the subnet pool. - Only administrative users can specify a tenant UUID other than - their own. You cannot change this value through authorization - policies. - in: body - required: false - type: string -tenant_id_20: - description: | - The UUID of the tenant who owns the VIP. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: false - type: string -tenant_id_21: - description: | - Owner of the VPN endpoint group. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: true - type: string -tenant_id_22: - description: | - Owner of the VPN service. Only administrative - users can specify a tenant UUID other than their own. - in: body - required: false - type: string -tenant_id_23: - description: | - The UUID of the tenant who owns the firewall - policy. - in: body - required: true - type: string -tenant_id_24: - description: | - The UUID of the tenant who owns the firewall - rule. - in: body - required: true - type: string -tenant_id_25: - description: | - The UUID of the tenant who owns the health - monitor. Only administrative users can specify a tenant UUID other - than their own. - in: body - required: true - type: string -tenant_id_26: - description: | - The owner of the VPN service. Only administrative - users can specify a tenant UUID other than their own. - in: body - required: true - type: string -tenant_id_27: - description: | - Owner of the VPN service. Only administrative - users can specify a tenant UUID other than their own. - in: body - required: true - type: string -tenant_id_28: - description: | - The UUID of the tenant who owns the VIP. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: true - type: string -tenant_id_29: - description: | - The UUID of the tenant who owns the network. - in: body - required: true - type: string -tenant_id_3: - description: | - The owner of the firewall service. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: true - type: string -tenant_id_30: - description: | - The UUID of tenant or project. - in: body - required: true - type: string -tenant_id_31: - description: | - The UUID of the tenant who owns the QoS policy. - in: body - required: true - type: string -tenant_id_32: - description: | - The UUID of the tenant who owns the pool. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: true - type: string -tenant_id_34: - description: | - The UUID of the tenant who owns the subnet pool. - in: body - required: true - type: string -tenant_id_35: - description: | - The UUID of the tenant. - in: body - required: true - type: string -tenant_id_36: - description: | - The owner of the firewall policy. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: false - type: string -tenant_id_37: - description: | - The UUID of the tenant who owns the firewall - rule. Only administrative users can specify a tenant UUID other - than their own. - in: body - required: true - type: string -tenant_id_4: - description: | - The UUID of the tenant. Only administrative users - can specify a tenant UUID other than their own. - in: body - required: false - type: string -tenant_id_5: - description: | - The UUID of the tenant who owns the health - monitor. Only administrative users can specify a tenant UUID other - than their own. - in: body - required: false - type: string -tenant_id_6: - description: | - The owner of the IKE policy. Only administrative - users can specify a tenant UUID other than their own. - in: body - required: true - type: string -tenant_id_7: - description: | - Owner of the IPSec policy. Only administrative - users can specify a tenant UUID other than their own. - in: body - required: true - type: string -tenant_id_8: - description: | - Owner of the IPSec connection. Only - administrative users can specify a tenant UUID other than their - own. - in: body - required: true - type: string -tenant_id_9: - description: | - The UUID of the tenant who owns the listener. - Only administrative users can specify a tenant UUID other than - their own. - in: body - required: true - type: string -timeout: - description: | - The maximum time, in seconds, that a monitor - waits to connect before it times out. This value must be less than - the delay value. - in: body - required: true - type: integer -total_ips: - description: | - The total number of IP addresses in a network. - in: body - required: true - type: integer -transform_protocol: - description: | - The transform protocol. A valid value is ``ESP``, - ``AH``, or ``AH- ESP``. Default is ``ESP``. - in: body - required: false - type: string -trunk-status: - description: | - The status for the trunk. Possible values are ``ACTIVE``, - ``DOWN``, ``BUILD``, ``DEGRADED``, and ``ERROR``. - in: body - required: true - type: string -trunk_details: - description: | - The details about the trunk. - in: body - required: false - type: dict -trunk_port_id: - description: | - The ID of the parent port. - in: body - required: true - type: string -type: - description: | - The type of probe sent by the load balancer to - verify the member state. A valid value is ``PING``, ``TCP``, - ``HTTP``, or ``HTTPS``. - in: body - required: true - type: string -type_2: - description: | - The type of the endpoints in the group. A valid - value is ``subnet``, ``cidr``, ``network``, ``router``, or - ``vlan``. - in: body - required: true - type: string -type_3: - description: | - The type of probe sent by the load balancer to - verify the member state, which is ``PING``, ``TCP``, ``HTTP``, or - ``HTTPS``. - in: body - required: true - type: string -units: - description: | - The units for the lifetime of the security - association. The lifetime consists of a unit and integer value. - You can omit either the unit or value portion of the lifetime. - Default unit is seconds and default value is 3600. - in: body - required: false - type: string -updated: - description: | - The date and time stamp when the extension was - last updated. - in: body - required: true - type: string -updated_at: - description: | - Time at which port has been updated. - in: body - required: true - type: string -updated_at_2: - description: | - Time at which subnetpool has been updated. - in: body - required: true - type: string -updated_at_resource: - description: | - Time at which the resource has been updated (in UTC ISO8601 format). - in: body - required: true - type: string -url_path: - description: | - The HTTP path of the request sent by the monitor - to test the health of a member. A valid value is a string that - begins with a forward slash (``/``). - in: body - required: false - type: string -url_path-response: - description: | - The HTTP path of the request sent by the monitor - to test the health of a member. Must be a string that begins with - a forward slash (``/``). The default is ``/``. - in: body - required: true - type: string -used_ips: - description: | - The number of used IP addresses of all subnets in - a network. - in: body - required: true - type: integer -value: - description: | - The lifetime value, as a positive integer. The - lifetime consists of a unit and integer value. You can omit either - the unit or value portion of the lifetime. Default unit is seconds - and default value is 3600. - in: body - required: false - type: integer -value_1: - description: | - The lifetime value, as a positive integer. The - lifetime consists of a unit and integer value. You can omit either - the unit or value portion of the lifetime. Default unit is seconds - and default value is 3600. - in: body - required: true - type: integer -version-href: - description: | - Link to the API. - in: body - required: true - type: string -version-id: - description: | - Version of the API. - in: body - required: true - type: string -version-links: - description: | - List of version links. Each link is a dict with 'href' and 'rel'. - in: body - required: true - type: array -version-rel: - description: | - Relationship of link with the version. - in: body - required: true - type: string -version-status: - description: | - Status of the API, which can be ``CURRENT``, ``STABLE`` or ``DEPRECATED``. - in: body - required: true - type: string -versions: - description: | - List of versions. - in: body - required: true - type: array -vip: - description: | - A ``vip`` object. - in: body - required: true - type: object -vip-address: - description: | - The IP address of the VIP. - format: ipv4 - in: body - required: true - type: string -vip-address-request: - description: | - The IP address of the VIP. - format: ipv4 - in: body - required: false - type: string -vip-id: - description: | - The ID of the virtual IP (VIP) address. - in: body - required: true - type: string -vip-pool_id: - description: | - The ID of the pool which the VIP belongs to. - in: body - required: true - type: string -vip-pool_id-request: - description: | - The ID of the pool which the VIP belongs to. - in: body - required: false - type: string -vip-port_id: - description: | - The ID of the VIP port. - in: body - required: true - type: string -vip-protocol: - description: | - The protocol of the virtual IP (VIP) address. A - valid value is ``TCP``, ``HTTP``, or ``HTTPS``. - in: body - required: true - type: string -vip-session_persistence: - description: | - Session persistence parameters for the VIP. Omit - the ``session_persistence`` parameter to prevent session - persistence. When no session persistence is used, the - ``session_persistence`` parameter does not appear in the API - response. - in: body - required: true - type: object -vip-session_persistence-request: - description: | - Session persistence parameters for the VIP. Omit - the ``session_persistence`` parameter to prevent session - persistence. When no session persistence is used, the - ``session_persistence`` parameter does not appear in the API - response. To clear session persistence for the VIP, set the - ``session_persistence`` parameter to ``null`` in a VIP update - request. The default is no session persistence. - in: body - required: false - type: object -vip-status: - description: | - The status of the VIP. Indicates whether the VIP - is operational. - in: body - required: true - type: string -vip-subnet_id: - description: | - The ID of the subnet on which to allocate the - virtual IP (VIP) address. - in: body - required: true - type: string -vip_address: - description: | - The IP address of the VIP . - format: ipv4 - in: body - required: true - type: string -vip_address-request: - description: | - The IP address of the VIP . - format: ipv4 - in: body - required: false - type: string -vip_id: - description: | - The ID of the virtual IP (VIP) address. - in: body - required: true - type: string -vip_network_id: - description: | - The ID of the network on which to allocate - the virtual IP (VIP) address. This option is - required if no vip_subnet_id is given. - in: body - required: false - type: string -vip_subnet_id: - description: | - The ID of the subnet on which to allocate the - virtual IP (VIP) address. This option is required - if no vip_network_id is given. - in: body - required: false - type: string -vips: - description: | - A list of ``vip`` objects. - in: body - required: true - type: array -vlan_transparent: - description: | - Indicates the VLAN transparency mode of the network, which is - VLAN transparent (``true``) or not VLAN transparent (``false``). - in: body - required: true - type: boolean -vlan_transparent-request: - description: | - Indicates the VLAN transparency mode of the network, which is - VLAN transparent (``true``) or not VLAN transparent (``false``). - in: body - required: false - type: boolean -vpnservice: - description: | - A ``vpnservice`` object. - in: body - required: true - type: object -vpnservice-status: - description: | - Indicates whether IPSec VPN service is currently - operational. Values are ``ACTIVE``, ``DOWN``, ``BUILD``, ``ERROR``, - ``PENDING_CREATE``, ``PENDING_UPDATE``, or ``PENDING_DELETE``. - in: body - required: true - type: string -vpnservice_id-body-request: - description: | - The ID of the VPN service. - in: body - required: false - type: string -vpnservice_id-body-response: - description: | - The ID of the VPN service. - in: body - required: true - type: string -vpnservices: - description: | - A list of VPN service objects. - in: body - required: true - type: array diff --git a/api-ref/source/v2/ports.inc b/api-ref/source/v2/ports.inc deleted file mode 100644 index 0af4fe8..0000000 --- a/api-ref/source/v2/ports.inc +++ /dev/null @@ -1,482 +0,0 @@ -.. -*- rst -*- - -===== -Ports -===== - -Lists, shows details for, creates, updates, and deletes ports. - -Port binding extended attributes -================================ - -The port binding extension (``binding``) allows administrative users -to specify and retrieve physical binding information of ports. -The extension defines several attributes whose names have a prefix -``binding:`` including ``binding:host_id``, ``binding:vnic_type``, -``binding:vif_type``, ``binding:vif_details``, and ``binding:profile``. - -| - -Data plane status extension -=========================== - -The data plane port extension (``data-plane-status``) adds a new attribute -``data_plane_status`` to represent the status of the underlying data plane. -This attribute is to be managed by entities outside of the Networking service, -while the ``status`` attribute is managed by Networking service. Both status -attributes are independent from one another. - -Supported data plane status values: - -- ``null``: no status being reported; default value -- ``ACTIVE``: the underlying data plane is up and running -- ``DOWN``: no traffic can flow from/to the port - - -Show port details -================= - -.. rest_method:: GET /v2.0/ports/{port_id} - -Shows details for a port. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. For information, see `Filtering and -Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - port_id: port_id-path - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - port: port - - admin_state_up: admin_state_up - - allowed_address_pairs: allowed_address_pairs - - binding:host_id: binding:host_id - - binding:profile: binding:profile - - binding:vif_details: binding:vif_details - - binding:vif_type: binding:vif_type - - binding:vnic_type: binding:vnic_type - - created_at: created_at - - data_plane_status: data_plane_status - - description: description - - device_id: device_id - - device_owner: device_owner - - extra_dhcp_opts: extra_dhcp_opts - - fixed_ips: fixed_ips - - id: id - - mac_address: mac_address - - name: name - - network_id: network_id - - port_security_enabled: port_security_enabled - - project_id: project_id - - security_groups: port-security_groups - - status: port-status - - tenant_id: project_id - - updated_at: updated_at - -Response Example ----------------- - -.. literalinclude:: samples/ports/port-show-response.json - :language: javascript - -Response Example (admin user) ------------------------------ - -.. literalinclude:: samples/ports/port-bind-show-response.json - :language: javascript - -Update port -=========== - -.. rest_method:: PUT /v2.0/ports/{port_id} - -Updates a port. - -You can update information for a port, such as its symbolic name -and associated IPs. When you update IPs for a port, any previously -associated IPs are removed, returned to the respective subnet -allocation pools, and replaced by the IPs in the request body. -Therefore, this operation replaces the ``fixed_ip`` attribute when -you specify it in the request body. If the updated IP addresses are -not valid or are already in use, the operation fails and the -existing IP addresses are not removed from the port. - -When you update security groups for a port and the operation -succeeds, any associated security groups are removed and replaced -by the security groups in the request body. Therefore, this -operation replaces the ``security_groups`` attribute when you -specify it in the request body. If the security groups are not -valid, the operation fails and the existing security groups are not -removed from the port. - -Only admins and users with a specific role can update the data plane status -(default role: ``data_plane_integrator``). - - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - port_id: port_id-path - - port: port - - admin_state_up: admin_state_up-request - - allowed_address_pairs: allowed_address_pairs-request - - binding:host_id: binding:host_id-request - - binding:profile: binding:profile-request - - binding:vnic_type: binding:vnic_type-request - - data_plane_status: data_plane_status-request - - description: description-request - - device_id: device_id-request - - device_owner: device_owner-request - - extra_dhcp_opts: extra_dhcp_opts-request - - fixed_ips: fixed_ips-request - - mac_address: mac_address-request-put - - name: name-request - - port_security_enabled: port_security_enabled-request - - security_groups: port-security_groups-request - -Request Example ---------------- - -.. literalinclude:: samples/ports/port-update-request.json - :language: javascript - -Request Example (admin user) ----------------------------- - -.. literalinclude:: samples/ports/port-bind-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - port: port - - admin_state_up: admin_state_up - - allowed_address_pairs: allowed_address_pairs - - binding:host_id: binding:host_id - - binding:profile: binding:profile - - binding:vif_details: binding:vif_details - - binding:vif_type: binding:vif_type - - binding:vnic_type: binding:vnic_type - - created_at: created_at - - data_plane_status: data_plane_status - - description: description - - device_id: device_id - - device_owner: device_owner - - extra_dhcp_opts: extra_dhcp_opts - - fixed_ips: fixed_ips - - id: id - - mac_address: mac_address - - name: name - - network_id: network_id - - port_security_enabled: port_security_enabled - - project_id: project_id - - security_groups: port-security_groups - - status: port-status - - tenant_id: project_id - - updated_at: updated_at - -Response Example ----------------- - -.. literalinclude:: samples/ports/port-update-response.json - :language: javascript - -Response Example (admin user) ------------------------------ - -.. literalinclude:: samples/ports/port-bind-update-response.json - :language: javascript - -Delete port -=========== - -.. rest_method:: DELETE /v2.0/ports/{port_id} - -Deletes a port. - -Any IP addresses that are associated with the port are returned to -the respective subnets allocation pools. - -Normal response codes: 204 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - port_id: port_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List ports -========== - -.. rest_method:: GET /v2.0/ports - -Lists ports to which the user has access. - -Default policy settings return only those ports that are owned by -the project of the user who submits the request, unless the request is submitted -by a user with administrative rights. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - admin_state_up: admin_state_up - - allowed_address_pairs: allowed_address_pairs - - binding:host_id: binding:host_id - - binding:profile: binding:profile - - binding:vif_details: binding:vif_details - - binding:vif_type: binding:vif_type - - binding:vnic_type: binding:vnic_type - - created_at: created_at - - data_plane_status: data_plane_status - - description: description - - device_id: device_id - - device_owner: device_owner - - extra_dhcp_opts: extra_dhcp_opts - - fixed_ips: fixed_ips - - id: id - - mac_address: mac_address - - name: name - - network_id: network_id - - port_security_enabled: port_security_enabled - - project_id: project_id - - security_groups: port-security_groups - - status: port-status - - tenant_id: project_id - - updated_at: updated_at - -Response Example ----------------- - -.. literalinclude:: samples/ports/ports-list-response.json - :language: javascript - -Response Example (admin user) ------------------------------ - -.. literalinclude:: samples/ports/ports-bind-list-response.json - :language: javascript - -Create port -=========== - -.. rest_method:: POST /v2.0/ports - -Creates a port on a network. - -To define the network in which to create the port, specify the -``network_id`` attribute in the request body. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - port: port - - admin_state_up: admin_state_up-request - - allowed_address_pairs: allowed_address_pairs-request - - binding:host_id: binding:host_id-request - - binding:profile: binding:profile-request - - binding:vnic_type: binding:vnic_type-request - - description: description-request - - device_id: device_id-request - - device_owner: device_owner-request - - extra_dhcp_opts: extra_dhcp_opts-request - - fixed_ips: fixed_ips-request - - mac_address: mac_address-request - - name: name-request - - network_id: network_id - - port_security_enabled: port_security_enabled-request - - project_id: project_id-request - - security_groups: port-security_groups-request - - tenant_id: project_id-request - -Request Example ---------------- - -.. literalinclude:: samples/ports/port-create-request.json - :language: javascript - -Request Example (admin user) ----------------------------- - -.. literalinclude:: samples/ports/port-bind-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - port: port - - admin_state_up: admin_state_up - - allowed_address_pairs: allowed_address_pairs - - binding:host_id: binding:host_id - - binding:profile: binding:profile - - binding:vif_details: binding:vif_details - - binding:vif_type: binding:vif_type - - binding:vnic_type: binding:vnic_type - - created_at: created_at - - data_plane_status: data_plane_status - - description: description - - device_id: device_id - - device_owner: device_owner - - extra_dhcp_opts: extra_dhcp_opts - - fixed_ips: fixed_ips - - id: id - - mac_address: mac_address - - name: name - - network_id: network_id - - port_security_enabled: port_security_enabled - - project_id: project_id - - security_groups: port-security_groups - - status: port-status - - tenant_id: project_id - - updated_at: updated_at - -Response Example ----------------- - -.. literalinclude:: samples/ports/port-create-response.json - :language: javascript - -Response Example (admin user) ------------------------------ - -.. literalinclude:: samples/ports/port-bind-create-response.json - :language: javascript - -Bulk create ports -================= - -.. rest_method:: POST /v2.0/ports - -Creates multiple ports in a single request. Specify a list of ports in the request body. - -Guarantees the atomic completion of the bulk operation. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - admin_state_up: admin_state_up-request - - allowed_address_pairs: allowed_address_pairs-request - - binding:host_id: binding:host_id-request - - binding:profile: binding:profile-request - - binding:vnic_type: binding:vnic_type-request - - description: description-request - - device_id: device_id-request - - device_owner: device_owner-request - - extra_dhcp_opts: extra_dhcp_opts-request - - fixed_ips: fixed_ips-request - - mac_address: mac_address-request - - name: name-request - - network_id: network_id - - port_security_enabled: port_security_enabled-request - - project_id: project_id-request - - security_groups: port-security_groups-request - - tenant_id: project_id-request - -Request Example ---------------- - -.. literalinclude:: samples/ports/ports-bulk-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ports: ports - - admin_state_up: admin_state_up - - allowed_address_pairs: allowed_address_pairs - - binding:host_id: binding:host_id - - binding:profile: binding:profile - - binding:vif_details: binding:vif_details - - binding:vif_type: binding:vif_type - - binding:vnic_type: binding:vnic_type - - created_at: created_at - - data_plane_status: data_plane_status - - description: description - - device_id: device_id - - device_owner: device_owner - - extra_dhcp_opts: extra_dhcp_opts - - fixed_ips: fixed_ips - - id: id - - mac_address: mac_address - - name: name - - network_id: network_id - - port_security_enabled: port_security_enabled - - project_id: project_id - - security_groups: port-security_groups - - status: port-status - - tenant_id: project_id - - updated_at: updated_at - -Response Example ----------------- - -.. literalinclude:: samples/ports/ports-bulk-create-response.json - :language: javascript diff --git a/api-ref/source/v2/qos.inc b/api-ref/source/v2/qos.inc deleted file mode 100644 index f2c315e..0000000 --- a/api-ref/source/v2/qos.inc +++ /dev/null @@ -1,639 +0,0 @@ -.. -*- rst -*- - -============== -QoS rule types -============== - -List QoS rule types available in current deployment. - -List QoS rule types -=================== - -.. rest_method:: GET /v2.0/qos/rule-types - -Lists available qos rule types. - -Normal response codes: 200 - -Error response codes: 401 - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - rule_types: qos-rule-types - - type: qos-rule-type - -Response Example ----------------- - -.. literalinclude:: samples/qos/rule_types-list-response.json - :language: javascript - -================== -QoS policies (qos) -================== - -Lists, creates, deletes, shows information for, and updates QoS policies. - -List QoS policies -================= - -.. rest_method:: GET /v2.0/qos/policies - -Lists all QoS policies associated with your project. - -The list might be empty. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - policies: policies - - description: description - - tenant_id: project_id - - project_id: project_id - - shared: qos-shared - - id: qos_policy_id - - rules: qos-rules - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/qos/policies-list-response.json - :language: javascript - -Create QoS policy -================= - -.. rest_method:: POST /v2.0/qos/policies - -Creates a QoS policy. - -Creates a QoS policy by using the configuration that you define in -the request object. A response object is returned. The object -contains a unique ID. - -By the default policy configuration, if the caller is not an administrative -user, this call returns the HTTP ``Forbidden (403)`` response code. - -Users with an administrative role can create policies on behalf of -other projects by specifying a project ID that is different than -their own. - -Normal response codes: 201 - -Error response codes: 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy: policy - - description: description-request - - tenant_id: project_id-request - - project_id: project_id-request - - shared: qos-shared-request - - name: qos_policy-name - -Request Example ---------------- - -.. literalinclude:: samples/qos/policy-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - policy: policy - - description: description - - tenant_id: project_id - - project_id: project_id - - shared: qos-shared - - rules: qos-rules - - id: qos_policy_id - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/qos/policy-create-response.json - :language: javascript - -Show QoS policy details -======================= - -.. rest_method:: GET /v2.0/qos/policies/{policy_id} - -Shows details for a QoS policy. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - policy: policy - - description: description - - tenant_id: project_id - - project_id: project_id - - shared: qos-shared - - rules: qos-rules - - id: qos_policy_id - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/qos/policy-show-response.json - :language: javascript - -Update QoS policy -================= - -.. rest_method:: PUT /v2.0/qos/policies/{policy_id} - -Updates a QoS policy. - -If the request is valid, the service returns the ``Accepted (202)`` -response code. - -Normal response codes: 202 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - policy: policy - - description: description-request - - shared: qos-shared-request - - name: qos_policy-name - -Request Example ---------------- - -.. literalinclude:: samples/qos/policy-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - policy: policy - - description: description - - tenant_id: project_id - - project_id: project_id - - shared: qos-shared - - id: qos_policy_id - - rules: qos-rules - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/qos/policy-update-response.json - :language: javascript - -Delete QoS policy -================= - -.. rest_method:: DELETE /v2.0/qos/policies/{policy_id} - -Deletes a QoS policy. - -Normal response codes: 204 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -========================= -QoS bandwidth limit rules -========================= - -Lists, creates, deletes, shows information for, and updates QoS bandwidth limit rules. - -List bandwidth limit rules for QoS policy -========================================= - -.. rest_method:: GET /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules - -Lists all bandwidth limit rules for a QoS policy. - -The list might be empty. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bandwidth_limit_rules: bandwidth_limit_rules - - max_kbps: max_kbps-response - - id: qos_bandwidth_limit_rule-id - - max_burst_kbps: max_burst_kbps-response - - direction: qos-rule-direction-response - -Response Example ----------------- - -.. literalinclude:: samples/qos/bandwidth_limit_rules-list-response.json - :language: javascript - -Create bandwidth limit rule -=========================== - -.. rest_method:: POST /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules - -Creates a bandwidth limit rule for a QoS policy. - -Normal response codes: 201 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - bandwidth_limit_rule: bandwidth_limit_rule - - max_kbps: max_kbps - - max_burst_kbps: max_burst_kbps - - direction: qos-rule-direction - -Request Example ---------------- - -.. literalinclude:: samples/qos/bandwidth_limit_rule-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bandwidth_limit_rule: bandwidth_limit_rule - - max_kbps: max_kbps-response - - id: qos_bandwidth_limit_rule-id - - max_burst_kbps: max_burst_kbps-response - - direction: qos-rule-direction-response - -Response Example ----------------- - -.. literalinclude:: samples/qos/bandwidth_limit_rule-create-response.json - :language: javascript - -Show bandwidth limit rule details -================================= - -.. rest_method:: GET /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules/{rule_id} - -Shows details for a bandwidth limit rule for a QoS policy. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - rule_id: qos-rule_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bandwidth_limit_rule: bandwidth_limit_rule - - max_kbps: max_kbps-response - - id: qos_bandwidth_limit_rule-id - - max_burst_kbps: max_burst_kbps-response - - direction: qos-rule-direction-response - -Response Example ----------------- - -.. literalinclude:: samples/qos/bandwidth_limit_rule-show-response.json - :language: javascript - -Update bandwidth limit rule -=========================== - -.. rest_method:: PUT /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules/{rule_id} - -Updates a bandwidth limit rule for a QoS policy. - -If the request is valid, the service returns the ``Accepted (202)`` -response code. - -Normal response codes: 202 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - rule_id: qos-rule_id - - bandwidth_limit_rule: bandwidth_limit_rule - - max_kbps: max_kbps - - max_burst_kbps: max_burst_kbps - - direction: qos-rule-direction-update - -Request Example ---------------- - -.. literalinclude:: samples/qos/bandwidth_limit_rule-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - bandwidth_limit_rule: bandwidth_limit_rule - - max_kbps: max_kbps-response - - id: qos_bandwidth_limit_rule-id - - max_burst_kbps: max_burst_kbps-response - - direction: qos-rule-direction-update-response - -Response Example ----------------- - -.. literalinclude:: samples/qos/bandwidth_limit_rule-update-response.json - :language: javascript - -Delete bandwidth limit rule -=========================== - -.. rest_method:: DELETE /v2.0/qos/policies/{policy_id}/bandwidth_limit_rules/{rule_id} - -Deletes a bandwidth limit rule for a QoS policy. - -Normal response codes: 204 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - rule_id: qos-rule_id - -Response --------- - -There is no body content for the response of a successful DELETE request. - -====================== -QoS DSCP marking rules -====================== - -Lists, creates, deletes, shows information for, and updates QoS DSCP marking rules. - -List DSCP marking rules for QoS policy -====================================== - -.. rest_method:: GET /v2.0/qos/policies/{policy_id}/dscp_marking_rules - -Lists all DSCP marking rules for a QoS policy. - -The list may be empty. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - dscp_marking_rules: dscp_marking_rules - - dscp_mark: dscp_mark-response - - id: qos_dscp_marking_rule-id - -Response Example ----------------- - -.. literalinclude:: samples/qos/dscp_marking_rules-list-response.json - :language: javascript - -Create DSCP marking rule -======================== - -.. rest_method:: POST /v2.0/qos/policies/{policy_id}/dscp_marking_rules - -Creates a DSCP marking rule for a QoS policy. - -Normal response codes: 201 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - dscp_marking_rule: dscp_marking_rule - - dscp_mark: dscp_mark - -Request Example ---------------- - -.. literalinclude:: samples/qos/dscp_marking_rule-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - dscp_marking_rule: dscp_marking_rule - - dscp_mark: dscp_mark-response - - id: qos_dscp_marking_rule-id - -Response Example ----------------- - -.. literalinclude:: samples/qos/dscp_marking_rule-create-response.json - :language: javascript - -Show DSCP marking rule details -============================== - -.. rest_method:: GET /v2.0/qos/policies/{policy_id}/dscp_marking_rules/{dscp_rule_id} - -Shows details for a DSCP marking rule for a QoS policy. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - dscp_rule_id: dscp_rule_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - dscp_marking_rule: dscp_marking_rule - - dscp_mark: dscp_mark - - id: qos_dscp_marking_rule-id - -Response Example ----------------- - -.. literalinclude:: samples/qos/dscp_marking_rule-show-response.json - :language: javascript - -Update DSCP marking rule -======================== - -.. rest_method:: PUT /v2.0/qos/policies/{policy_id}/dscp_marking_rules/{dscp_rule_id} - -Updates a DSCP marking rule for a QoS policy. - -If the request is valid, the service returns the ``Accepted (202)`` -response code. - -Normal response codes: 202 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - dscp_rule_id: dscp_rule_id - - dscp_marking_rule: dscp_marking_rule - - dscp_mark: dscp_mark - -Request Example ---------------- - -.. literalinclude:: samples/qos/dscp_marking_rule-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - dscp_marking_rule: dscp_marking_rule - - dscp_mark: dscp_mark-response - - id: qos_dscp_marking_rule-id - -Response Example ----------------- - -.. literalinclude:: samples/qos/dscp_marking_rule-update-response.json - :language: javascript - -Delete DSCP marking rule -======================== - -.. rest_method:: DELETE /v2.0/qos/policies/{policy_id}/dscp_marking_rules/{dscp_rule_id} - -Deletes a DSCP marking rule for a QoS policy. - -Normal response codes: 204 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - policy_id: qos-policy-id-path - - dscp_rule_id: dscp_rule_id - -Response --------- - -There is no body content for the response of a successful DELETE request. - diff --git a/api-ref/source/v2/quotas.inc b/api-ref/source/v2/quotas.inc deleted file mode 100644 index 4efa2cc..0000000 --- a/api-ref/source/v2/quotas.inc +++ /dev/null @@ -1,207 +0,0 @@ -.. -*- rst -*- - -========================= -Quotas extension (quotas) -========================= - -Lists default quotas, current quotas for projects with non-default quota -values, and shows, updates, and resets quotas for a project. - -A quota value of ``-1`` means that quota has no limit. - -List quotas for projects with non-default quota values -====================================================== - -.. rest_method:: GET /v2.0/quotas - -Lists quotas for projects with non-default quota values. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - quotas: quotas - - floatingip: quota-floatingip - - network: quota-network - - port: quota-port - - project_id: project_id - - rbac_policy: quota-rbac_policy - - router: quota-router - - security_group: quota-security_group - - security_group_rule: quota-security_group_rule - - subnet: quota-subnet - - subnetpool: quota-subnetpool - - tenant_id: project_id - -Response Example ----------------- - -.. literalinclude:: samples/quotas/quotas-list-response.json - :language: javascript - -List quotas for a project -========================= - -.. rest_method:: GET /v2.0/quotas/{project_id} - -Lists quotas for a project. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - project_id: project_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - quota: quota - - floatingip: quota-floatingip - - network: quota-network - - port: quota-port - - rbac_policy: quota-rbac_policy - - router: quota-router - - security_group: quota-security_group - - security_group_rule: quota-security_group_rule - - subnet: quota-subnet - - subnetpool: quota-subnetpool - -Response Example ----------------- - -.. literalinclude:: samples/quotas/quotas-list-for-project-response.json - :language: javascript - -Update quota for a project -========================== - -.. rest_method:: PUT /v2.0/quotas/{project_id} - -Updates quotas for a project. Use when non-default quotas are desired. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - project_id: project_id-path - - quota: quota - - floatingip: quota-floatingip-request - - network: quota-network-request - - port: quota-port-request - - rbac_policy: quota-rbac_policy-request - - router: quota-router-request - - security_group: quota-security_group-request - - security_group_rule: quota-security_group_rule-request - - subnet: quota-subnet-request - - subnetpool: quota-subnetpool-request - -Request Example ---------------- - -.. literalinclude:: samples/quotas/quotas-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - quota: quota - - floatingip: quota-floatingip - - network: quota-network - - port: quota-port - - rbac_policy: quota-rbac_policy - - router: quota-router - - security_group: quota-security_group - - security_group_rule: quota-security_group_rule - - subnet: quota-subnet - - subnetpool: quota-subnetpool - -Response Example ----------------- - -.. literalinclude:: samples/quotas/quotas-update-response.json - :language: javascript - -Reset quota for a project -========================= - -.. rest_method:: DELETE /v2.0/quotas/{project_id} - -Resets quotas to default values for a project. - -Normal response codes: 204 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - project_id: project_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List default quotas for a project -================================= - -.. rest_method:: GET /v2.0/quotas/{project_id}/default - -Lists default quotas for a project. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - project_id: project_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - quota: quota - - floatingip: quota-floatingip - - network: quota-network - - port: quota-port - - rbac_policy: quota-rbac_policy - - router: quota-router - - security_group: quota-security_group - - security_group_rule: quota-security_group_rule - - subnet: quota-subnet - - subnetpool: quota-subnetpool - -Response Example ----------------- - -.. literalinclude:: samples/quotas/quotas-list-for-project-response.json - :language: javascript diff --git a/api-ref/source/v2/rbac-policy.inc b/api-ref/source/v2/rbac-policy.inc deleted file mode 100644 index d322ae0..0000000 --- a/api-ref/source/v2/rbac-policy.inc +++ /dev/null @@ -1,206 +0,0 @@ -.. -*- rst -*- - -============= -RBAC Policies -============= - -Lists, shows details for, creates, updates, and deletes RBAC policies. - -Show RBAC policy details -======================== - -.. rest_method:: GET /v2.0/rbac-policies/{rbac_policy_id} - -Show details for a given RBAC policy. - -You can control which response parameters are returned by using the -fields query parameter. For information, see `Filtering and column -selection `__. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - rbac_policy_id: rbac_policy_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - target_tenant: target_tenant - - tenant_id: tenant_id - - object_type: object_type - - object_id: object_id - - action: rbac_action - - project_id: project_id - - id: rbac_policy_id - -Response Example ----------------- - -.. literalinclude:: samples/rbac_policy/rbac-policy-show-response.json - :language: javascript - -Update RBAC policy -================== - -.. rest_method:: PUT /v2.0/rbac-policies/{rbac_policy_id} - -Update RBAC policy for given tenant. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - rbac_policy_id: rbac_policy_id-path - - target_tenant: target_tenant - -Request Example ---------------- - -.. literalinclude:: samples/rbac_policy/rbac-policy-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - target_tenant: target_tenant - - tenant_id: tenant_id - - object_type: object_type - - object_id: object_id - - action: rbac_action - - project_id: project_id - - id: rbac_policy_id - -Response Example ----------------- - -.. literalinclude:: samples/rbac_policy/rbac-policy-update-response.json - :language: javascript - -Delete RBAC policy -================== - -.. rest_method:: DELETE /v2.0/rbac-policies/{rbac_policy_id} - -Delete an RBAC policy. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - rbac_policy_id: rbac_policy_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List RBAC policies -================== - -.. rest_method:: GET /v2.0/rbac-policies - -List RBAC policies that belong to a given tenant. - -Use the ``fields`` query parameter to filter the response. For -information, see `Filtering and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - target_tenant: target_tenant - - tenant_id: tenant_id - - object_type: object_type - - object_id: object_id - - action: rbac_action - - project_id: project_id - - id: rbac_policy_id - -Response Example ----------------- - -.. literalinclude:: samples/rbac_policy/rbac-policies-list-response.json - :language: javascript - -Create RBAC policy -================== - -.. rest_method:: POST /v2.0/rbac-policies - -Create RBAC policy for given tenant. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - rbac_policy_id: rbac_policy_id-path - - target_tenant: target_tenant - - object_type: object_type - - object_id: object_id - - action: rbac_action - -Request Example ---------------- - -.. literalinclude:: samples/rbac_policy/rbac-policy-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - target_tenant: target_tenant - - tenant_id: tenant_id - - object_type: object_type - - object_id: object_id - - action: rbac_action - - project_id: project_id - - id: rbac_policy_id - -Response Example ----------------- - -.. literalinclude:: samples/rbac_policy/rbac-policy-create-response.json - :language: javascript diff --git a/api-ref/source/v2/router-interface-fip.inc b/api-ref/source/v2/router-interface-fip.inc deleted file mode 100644 index d58bdb4..0000000 --- a/api-ref/source/v2/router-interface-fip.inc +++ /dev/null @@ -1,14 +0,0 @@ -.. -*- rst -*- - -============================ -Router Interface floating IP -============================ - -.. note:: Currently this extension ``router-interface-fip`` is only available for networking-midonet. - -This extension ``router-interface-fip`` indicates the ability to -associate floating IPs to internal interfaces of a router. -(Without this extension, floating IPs can be associated only to -the gateway interface of a router.) - -This extension does not introduce any resources or attributes. diff --git a/api-ref/source/v2/routers.inc b/api-ref/source/v2/routers.inc deleted file mode 100644 index 38c7693..0000000 --- a/api-ref/source/v2/routers.inc +++ /dev/null @@ -1,466 +0,0 @@ -.. -*- rst -*- - -================= -Routers (routers) -================= - -A ``router`` is a logical entity for forwarding packets across -internal subnets and NATting them on external networks through an -appropriate external gateway. - -This resource is provided when ``router`` extension is enabled. - -List routers -============ - -.. rest_method:: GET /v2.0/routers - -Lists logical routers that the project who submits the request can access. - -Default policy settings return only those routers that the project -who submits the request owns, unless an administrative user submits -the request. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - routers: routers - - id: router-id-body - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - admin_state_up: admin_state_up - - status: router-status - - external_gateway_info: router-external_gateway_info - - network_id: router-network_id - - enable_snat: router-enable_snat - - external_fixed_ips: router-external_fixed_ips - - routes: router-routes - - destination: router-destination - - nexthop: router-nexthop - - distributed: router-distributed - - ha: router-ha - - availability_zone_hints: router-availability_zone_hints - - availability_zones: router-availability_zones - -Response Example ----------------- - -.. literalinclude:: samples/routers/routers-list-response.json - :language: javascript - -Create router -============= - -.. rest_method:: POST /v2.0/routers - -Creates a logical router. - -This operation creates a logical router. The logical router does -not have any internal interface and it is not associated with any -subnet. You can optionally specify an external gateway for a router -at create time. The external gateway for the router must be plugged -into an external network. An external network has its -``router:external`` extended field set to ``true``. To specify an -external gateway, the ID of the external network must be passed -in the ``network_id`` parameter of the ``external_gateway_info`` -attribute in the request body. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - router: router - - tenant_id: project_id-request - - project_id: project_id-request - - name: name-request - - description: description-request - - admin_state_up: admin_state_up-request - - external_gateway_info: router-external_gateway_info-request - - network_id: router-network_id - - enable_snat: router-enable_snat-request - - external_fixed_ips: router-external_fixed_ips-request - - distributed: router-distributed-request - - ha: router-ha-request - - availability_zone_hints: router-availability_zone_hints-request - -Request Example ---------------- - -.. literalinclude:: samples/routers/router-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - router: router - - id: router-id-body - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - admin_state_up: admin_state_up - - status: router-status - - external_gateway_info: router-external_gateway_info - - network_id: router-network_id - - enable_snat: router-enable_snat - - external_fixed_ips: router-external_fixed_ips - - routes: router-routes - - destination: router-destination - - nexthop: router-nexthop - - distributed: router-distributed - - ha: router-ha - - availability_zone_hints: router-availability_zone_hints - - availability_zones: router-availability_zones - -Response Example ----------------- - -.. literalinclude:: samples/routers/router-create-response.json - :language: javascript - -Show router details -=================== - -.. rest_method:: GET /v2.0/routers/{router_id} - -Shows details for a router. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. For information, see `Filtering and -Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - router_id: router_id - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - router: router - - id: router-id-body - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - admin_state_up: admin_state_up - - status: router-status - - external_gateway_info: router-external_gateway_info - - network_id: router-network_id - - enable_snat: router-enable_snat - - external_fixed_ips: router-external_fixed_ips - - routes: router-routes - - destination: router-destination - - nexthop: router-nexthop - - distributed: router-distributed - - ha: router-ha - - availability_zone_hints: router-availability_zone_hints - - availability_zones: router-availability_zones - -Response Example ----------------- - -.. literalinclude:: samples/routers/router-show-response.json - :language: javascript - -Update router -============= - -.. rest_method:: PUT /v2.0/routers/{router_id} - -Updates a logical router. - -This operation does not enable the update of router interfaces. -To update a router intreface, use the add router interface and -remove router interface operations. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - router: router - - external_gateway_info: router-external_gateway_info - - enable_snat: router-enable_snat - - name: name - - admin_state_up: admin_state_up - - external_fixed_ips: router-external_fixed_ips - - router_id: router_id - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/routers/router-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - router: router - - id: router-id-body - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - admin_state_up: admin_state_up - - status: router-status - - external_gateway_info: router-external_gateway_info - - network_id: router-network_id - - enable_snat: router-enable_snat - - external_fixed_ips: router-external_fixed_ips - - routes: router-routes - - destination: router-destination - - nexthop: router-nexthop - - distributed: router-distributed - - ha: router-ha - - availability_zone_hints: router-availability_zone_hints - - availability_zones: router-availability_zones - -Response Example ----------------- - -.. literalinclude:: samples/routers/router-update-response.json - :language: javascript - -Delete router -============= - -.. rest_method:: DELETE /v2.0/routers/{router_id} - -Deletes a logical router and, if present, its external gateway interface. - -This operation fails if the router has attached interfaces. -Use the remove router interface operation to remove all router -interfaces before you delete the router. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - router_id: router_id - -Response --------- - -There is no body content for the response of a successful DELETE request. - -Add interface to router -======================= - -.. rest_method:: PUT /v2.0/routers/{router_id}/add_router_interface - -Adds an internal interface to a logical router. -This means a specified subnet is attached to a router -as an internal router interface. - -Specify the ID of a subnet or port in the request body: - -- Subnet ID. The gateway IP address for the subnet is used as - an IP address of the created router interface. - -- Port ID. The IP address associated with the port is used as - an IP address of the created router interface. - -When you specify an IPv6 subnet, this operation adds the subnet to -an existing internal port with same network ID, on the router. If -a port with the same network ID does not exist, this operation -creates a port on the router for that subnet. - -The limitation of one IPv4 subnet per router port remains, though a -port can contain any number of IPv6 subnets that belong to the same -network ID. - -When you use the ``port-create`` command to add a port and then -call ``router-interface-add`` with this port ID, this operation -adds the port to the router if the following conditions are met: - -- The port has no more than one IPv4 subnet. -- The IPv6 subnets, if any, on the port do not have same network - ID as the network ID of IPv6 subnets on any other ports. - -If you specify both subnet ID and port ID, -this operation returns the ``Bad Request (400)`` response code. - -If the port is already in use, this operation returns the -``Conflict (409)`` response code. - -This operation returns a port ID that is either: - -- The same ID that is passed in the request body - when a port is specified. -- The ID of a port that this operation creates to attach the - subnet to the router. - -After you run this operation, the operation sets: - -- The ``device_id`` attribute of this port to the router ID -- The ``device_owner`` attribute to ``network:router_interface`` - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - router_id: router_id - - subnet_id: router-subnet_id-request - - port_id: router-port_id-request - -Request Example ---------------- - -.. literalinclude:: samples/routers/router-add-interface-request.json - :language: javascript - -or - -.. literalinclude:: samples/routers/router-add-interface-request-with-port.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - id: router-id-body - - subnet_id: router-subnet_id - - subnet_ids: router-subnet_ids - - tenant_id: router-project_id-interface - - project_id: router-project_id-interface - - port_id: router-port_id - - network_id: router-network_id-interface - -Response Example ----------------- - -.. literalinclude:: samples/routers/router-add-interface-response.json - :language: javascript - -Remove interface from router -============================ - -.. rest_method:: PUT /v2.0/routers/{router_id}/remove_router_interface - -Deletes an internal interface from a logical router. - -This operation deletes an internal router interface, which detaches -a subnet from the router. If this subnet ID is the last subnet on -the port, this operation deletes the port itself. You must specify -either a subnet ID or port ID in the request body; the -operation uses this value to identify which router interface to -deletes. - -You can also specify both a subnet ID and port ID. If you -specify both IDs, the subnet ID must correspond to the subnet -ID of the first IP address on the port. Otherwise, this operation -returns the ``Conflict (409)`` response code with information about -the affected router and interface. - -If you try to delete the router interface for subnets that are used -by one or more ``routes``, this operation returns the ``Conflict (409)`` -response. In this case, you first need to delete such routes from -the router. - -If the router or the subnet and port do not exist or are not -visible to you, this operation returns the ``Not Found (404)`` -response code. As a consequence of this operation, the operation -removes the port connecting the router with the subnet from the -subnet for the network. - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - router_id: router_id - - subnet_id: router-subnet_id-request - - port_id: router-port_id-request - -Request Example ---------------- - -.. literalinclude:: samples/routers/router-remove-interface-request.json - :language: javascript - -or - -.. literalinclude:: samples/routers/router-remove-interface-request-with-port.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - id: router-id-body - - subnet_id: router-subnet_id - - subnet_ids: router-subnet_ids - - tenant_id: router-project_id-interface - - project_id: router-project_id-interface - - port_id: router-port_id - - network_id: router-network_id-interface - -Response Example ----------------- - -.. literalinclude:: samples/routers/router-remove-interface-response.json - :language: javascript - diff --git a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-request.json b/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-request.json deleted file mode 100644 index cfa431f..0000000 --- a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-request.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "bgpvpn": { - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "route_targets": "64512:1444", - "import_targets": "64512:1555", - "export_targets": "64512:1666", - "route_distinguishers": ["64512:1777", "64512:1888", "64512:1999"], - "type": "l3" - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-response.json b/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-response.json deleted file mode 100644 index dbecc06..0000000 --- a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-create-response.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "bgpvpn": { - "export_targets": [ - "64512:1666" - ], - "name": "", - "routers": [], - "route_distinguishers": [ - "64512:1777", - "64512:1888", - "64512:1999" - ], - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9", - "import_targets": [ - "64512:1555" - ], - "route_targets": [ - "64512:1444" - ], - "type": "l3", - "id": "0f9d472a-908f-40f5-8574-b4e8a63ccbf0", - "networks": [] - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-show-response.json b/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-show-response.json deleted file mode 100644 index 719e9c9..0000000 --- a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-show-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "bgpvpn": { - "id": "460ac411-3dfb-45bb-8116-ed1a7233d143", - "name": "foo", - "route_targets": ["64512:1444"], - "export_targets": [], - "import_targets": [], - "type": "l3", - "tenant_id": "f94ea398564d49dfb0d542f086c68ce7", - "project_id": "f94ea398564d49dfb0d542f086c68ce7", - "routers": [], - "route_distinguishers": [], - "networks": [ - "a4f2b8df-cb42-4893-a333-d0b5c36ade17" - ] - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-request.json b/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-request.json deleted file mode 100644 index 70c3577..0000000 --- a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "bgpvpn": { - "name": "foo", - "route_targets": ["64512:1444"], - "export_targets": [], - "import_targets": [] - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-response.json b/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-response.json deleted file mode 100644 index 0d6292f..0000000 --- a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpn-update-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "bgpvpn": { - "export_targets": [], - "name": "", - "routers": [], - "route_distinguishers": [ - "12345:1234" - ], - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "import_targets": [], - "route_targets": ["64512:1444"], - "type": "l3", - "id": "4d627abf-06dd-45ab-920b-8e61422bb984", - "networks": [] - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpns-list-response.json b/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpns-list-response.json deleted file mode 100644 index a173683..0000000 --- a/api-ref/source/v2/samples/bgpvpn/bgpvpns/bgpvpns-list-response.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "bgpvpns": [ - { - "export_targets": [ - "64512:1666" - ], - "name": "", - "routers": [], - "route_distinguishers": [ - "64512:1777", - "64512:1888", - "64512:1999" - ], - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9", - "import_targets": [ - "64512:1555" - ], - "route_targets": [ - "64512:1444" - ], - "type": "l3", - "id": "0f9d472a-908f-40f5-8574-b4e8a63ccbf0", - "networks": [] - } - ] -} diff --git a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-request.json b/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-request.json deleted file mode 100644 index 2edbd87..0000000 --- a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "network_association": { - "network_id": "8c5d88dc-60ac-4b02-a65a-36b65888ddcd" - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-response.json b/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-response.json deleted file mode 100644 index 8479e58..0000000 --- a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-create-response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "network_association": { - "network_id": "8c5d88dc-60ac-4b02-a65a-36b65888ddcd", - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9", - "id": "73238ca1-e05d-4c7a-b4d4-70407b4b8730" - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-list-response.json b/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-list-response.json deleted file mode 100644 index 3708618..0000000 --- a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-list-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "network_associations": [ - { - "network_id": "8c5d88dc-60ac-4b02-a65a-36b65888ddcd", - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9", - "id": "96227c78-6a0c-4d9d-b441-c4b8f6fb6c4a" - }, - { - "network_id": "a4f2b8df-cb42-4893-a333-d0b5c36ade17", - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9", - "id": "1b09fd12-c769-4be7-9c26-dececa474acf" - } - ] -} diff --git a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-show-response.json b/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-show-response.json deleted file mode 100644 index ff16bfc..0000000 --- a/api-ref/source/v2/samples/bgpvpn/network_associations/network_association-show-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "network_association": - { - "id": "1b09fd12-c769-4be7-9c26-dececa474acf", - "network_id": "a4f2b8df-cb42-4893-a333-d0b5c36ade17", - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9" - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-request.json b/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-request.json deleted file mode 100644 index 78348f1..0000000 --- a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "router_association": { - "router_id": "b58a6241-6e49-4b11-87c6-8e0606dde796" - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-response.json b/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-response.json deleted file mode 100644 index 4567d37..0000000 --- a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-create-response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "router_association": { - "router_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9", - "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3" - } -} diff --git a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-list-response.json b/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-list-response.json deleted file mode 100644 index 8ddf408..0000000 --- a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-list-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "router_associations": [ - { - "router_id": "61222227-49eb-4dcc-b2d6-66bbfb2fdd7a", - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9", - "id": "95277be7-a231-4e96-9625-8f9fe41de9d6" - } - ] -} diff --git a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-show-response.json b/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-show-response.json deleted file mode 100644 index a93b417..0000000 --- a/api-ref/source/v2/samples/bgpvpn/router_associations/router_association-show-response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "router_association": { - "id": "c63149a0-a0b3-4ca7-aba4-9aaa1b39d7f3", - "router_id": "46a1a80b-7c42-4c45-88fd-b531e636969f", - "tenant_id": "b7549121395844bea941bb92feb3fad9", - "project_id": "b7549121395844bea941bb92feb3fad9" - } -} diff --git a/api-ref/source/v2/samples/extensions/extension-show-response.json b/api-ref/source/v2/samples/extensions/extension-show-response.json deleted file mode 100644 index 800365e..0000000 --- a/api-ref/source/v2/samples/extensions/extension-show-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extension": { - "updated": "2013-02-03T10:00:00-00:00", - "name": "agent", - "links": [], - "alias": "agent", - "description": "The agent management extension." - } -} diff --git a/api-ref/source/v2/samples/extensions/extensions-list-response.json b/api-ref/source/v2/samples/extensions/extensions-list-response.json deleted file mode 100644 index b8c7400..0000000 --- a/api-ref/source/v2/samples/extensions/extensions-list-response.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "extensions": [ - { - "updated": "2013-01-20T00:00:00-00:00", - "name": "Neutron Service Type Management", - "links": [], - "alias": "service-type", - "description": "API for retrieving service providers for Neutron advanced services" - }, - { - "updated": "2012-10-05T10:00:00-00:00", - "name": "security-group", - "links": [], - "alias": "security-group", - "description": "The security groups extension." - }, - { - "updated": "2013-02-07T10:00:00-00:00", - "name": "L3 Agent Scheduler", - "links": [], - "alias": "l3_agent_scheduler", - "description": "Schedule routers among l3 agents" - }, - { - "updated": "2013-02-07T10:00:00-00:00", - "name": "Loadbalancer Agent Scheduler", - "links": [], - "alias": "lbaas_agent_scheduler", - "description": "Schedule pools among lbaas agents" - }, - { - "updated": "2013-03-28T10:00:00-00:00", - "name": "Neutron L3 Configurable external gateway mode", - "links": [], - "alias": "ext-gw-mode", - "description": "Extension of the router abstraction for specifying whether SNAT should occur on the external gateway" - }, - { - "updated": "2014-02-03T10:00:00-00:00", - "name": "Port Binding", - "links": [], - "alias": "binding", - "description": "Expose port bindings of a virtual port to external application" - }, - { - "updated": "2012-09-07T10:00:00-00:00", - "name": "Provider Network", - "links": [], - "alias": "provider", - "description": "Expose mapping of virtual networks to physical networks" - }, - { - "updated": "2013-02-03T10:00:00-00:00", - "name": "agent", - "links": [], - "alias": "agent", - "description": "The agent management extension." - }, - { - "updated": "2012-07-29T10:00:00-00:00", - "name": "Quota management support", - "links": [], - "alias": "quotas", - "description": "Expose functions for quotas management per tenant" - }, - { - "updated": "2013-02-07T10:00:00-00:00", - "name": "DHCP Agent Scheduler", - "links": [], - "alias": "dhcp_agent_scheduler", - "description": "Schedule networks among dhcp agents" - }, - { - "updated": "2013-06-27T10:00:00-00:00", - "name": "Multi Provider Network", - "links": [], - "alias": "multi-provider", - "description": "Expose mapping of virtual networks to multiple physical networks" - }, - { - "updated": "2013-01-14T10:00:00-00:00", - "name": "Neutron external network", - "links": [], - "alias": "external-net", - "description": "Adds external network attribute to network resource." - }, - { - "updated": "2012-07-20T10:00:00-00:00", - "name": "Neutron L3 Router", - "links": [], - "alias": "router", - "description": "Router abstraction for basic L3 forwarding between L2 Neutron networks and access to external networks via a NAT gateway." - }, - { - "updated": "2013-07-23T10:00:00-00:00", - "name": "Allowed Address Pairs", - "links": [], - "alias": "allowed-address-pairs", - "description": "Provides allowed address pairs" - }, - { - "updated": "2013-03-17T12:00:00-00:00", - "name": "Neutron Extra DHCP opts", - "links": [], - "alias": "extra_dhcp_opt", - "description": "Extra options configuration for DHCP. For example PXE boot options to DHCP clients can be specified (e.g. tftp-server, server-ip-address, bootfile-name)" - }, - { - "updated": "2012-10-07T10:00:00-00:00", - "name": "LoadBalancing service", - "links": [], - "alias": "lbaas", - "description": "Extension for LoadBalancing service" - }, - { - "updated": "2013-02-01T10:00:00-00:00", - "name": "Neutron Extra Route", - "links": [], - "alias": "extraroute", - "description": "Extra routes configuration for L3 router" - }, - { - "updated": "2016-01-24T10:00:00-00:00", - "name": "Neutron Port Data Plane Status", - "links": [], - "alias": "data-plane-status", - "description": "Status of the underlying data plane." - } - ] -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-group-create-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-group-create-request.json deleted file mode 100644 index 37444b2..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-group-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "firewall_group": { - "admin_state_up": false, - "egress_firewall_policy_id": "14c9d3c1-b472-44f9-8226-30dc4ffd454c", - "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-group-create-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-group-create-response.json deleted file mode 100644 index d510dfa..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-group-create-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "firewall_group": { - "admin_state_up": true, - "description": "", - "egress_firewall_policy_id": "1244ed87-b472-44f9-8226-30dc4ffd454c", - "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "", - "ports": [ - "650bfd2f-7766-4a0d-839f-218f33e16998" - ], - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "shared": true, - "status": "PENDING_CREATE", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-group-show-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-group-show-response.json deleted file mode 100644 index e2b556c..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-group-show-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "firewall_group": { - "admin_state_up": true, - "description": "", - "egress_firewall_policy_id": null, - "id": "07411bda-0147-418b-af05-c8665630d937", - "ingress_firewall_policy_id": null, - "name": "", - "project_id": "96108b04417b416e9b9bc788c11c42c9", - "shared": false, - "status": "INACTIVE", - "tenant_id": "96108b04417b416e9b9bc788c11c42c9" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-group-update-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-group-update-request.json deleted file mode 100644 index 4fe55c7..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-group-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "firewall_group": { - "admin_state_up": "false" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-group-update-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-group-update-response.json deleted file mode 100644 index 9a81859..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-group-update-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "firewall_group": { - "admin_state_up": false, - "description": "", - "egress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "", - "ports": [ - "650bfd2f-7766-4a0d-839f-218f33e16998" - ], - "shared": true, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "status": "PENDING_UPDATE", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-groups-list-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-groups-list-response.json deleted file mode 100644 index e037b20..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-groups-list-response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "firewall_groups": [ - { - "admin_state_up": true, - "description": "", - "egress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "ingress_firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "", - "ports": [ - "650bfd2f-7766-4a0d-839f-218f33e16998" - ], - "shared": true, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "status": "ACTIVE", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policies-list-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-policies-list-response.json deleted file mode 100644 index 9b95778..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policies-list-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "firewall_policies": [ - { - "audited": false, - "description": "", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "shared": false, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-request.json deleted file mode 100644 index c817c7c..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "firewall_policy": { - "name": "test-policy", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ] - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-response.json deleted file mode 100644 index 5d887b5..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-create-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "firewall_policy": { - "audited": false, - "description": "", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "shared": false, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-request.json deleted file mode 100644 index 94d9b8e..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", - "insert_after": "a08ef905-0ff6-4784-8374-175fffe7dade", - "insert_before": "" -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-response.json deleted file mode 100644 index 6494f0b..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-insert-rule-response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "audited": false, - "description": "", - "firewall_rules": [ - "acbdfead-eca2-4456-838c-8b531e47b9c7" - ], - "id": "c9e15d6e-b6ba-4ef4-8715-985d1f100467", - "name": "policy2", - "shared": false, - "project_id": "95573613ec554b4b8df9f2679c64557b", - "tenant_id": "95573613ec554b4b8df9f2679c64557b" -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-request.json deleted file mode 100644 index 7576442..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692" -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-response.json deleted file mode 100644 index cf79489..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-remove-rule-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "audited": false, - "description": "", - "firewall_rules": [], - "id": "c9e15d6e-b6ba-4ef4-8715-985d1f100467", - "name": "policy2", - "project_id": "95573613ec554b4b8df9f2679c64557b", - "shared": false, - "tenant_id": "95573613ec554b4b8df9f2679c64557b" -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-show-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-show-response.json deleted file mode 100644 index 5d887b5..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-show-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "firewall_policy": { - "audited": false, - "description": "", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "shared": false, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-request.json deleted file mode 100644 index 7d0a7b5..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "firewall_policy": { - "firewall_rules": [ - "a08ef905-0ff6-4784-8374-175fffe7dade", - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ] - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-response.json deleted file mode 100644 index 8c75cf2..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-policy-update-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "firewall_policy": { - "audited": false, - "description": "", - "firewall_rules": [ - "a08ef905-0ff6-4784-8374-175fffe7dade", - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "shared": false, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-request.json deleted file mode 100644 index 9a972d6..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "firewall_rule": { - "action": "allow", - "destination_port": "80", - "enabled": true, - "name": "ALLOW_HTTP", - "protocol": "tcp" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-response.json deleted file mode 100644 index 83f4305..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-rule-create-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "firewall_rule": { - "action": "deny", - "description": "", - "destination_ip_address": null, - "destination_port": null, - "enabled": true, - "id": "1fd59b2f-cc87-435f-a244-1df2c0cc3f70", - "ip_version": 4, - "name": "rule3", - "project_id": "95573613ec554b4b8df9f2679c64557b", - "protocol": null, - "shared": false, - "source_ip_address": null, - "source_port": null, - "tenant_id": "95573613ec554b4b8df9f2679c64557b" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-rule-show-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-rule-show-response.json deleted file mode 100644 index c5fe053..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-rule-show-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "firewall_rule": { - "action": "allow", - "description": "", - "destination_ip_address": null, - "destination_port": "80", - "enabled": true, - "firewall_policy_id": null, - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": null, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "protocol": "tcp", - "shared": false, - "source_ip_address": null, - "source_port": null, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-request.json b/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-request.json deleted file mode 100644 index 5b7b1e2..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "firewall_rule": { - "shared": true - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-response.json deleted file mode 100644 index 29abe36..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-rule-update-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "firewall_rule": { - "action": "allow", - "description": "", - "destination_ip_address": null, - "destination_port": "80", - "enabled": true, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": 1, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "protocol": "tcp", - "shared": true, - "source_ip_address": null, - "source_port": null, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewall-v2/firewall-rules-list-response.json b/api-ref/source/v2/samples/firewall-v2/firewall-rules-list-response.json deleted file mode 100644 index 309bbc4..0000000 --- a/api-ref/source/v2/samples/firewall-v2/firewall-rules-list-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "firewall_rules": [ - { - "action": "allow", - "description": "", - "destination_ip_address": null, - "destination_port": "80", - "enabled": true, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": 1, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "protocol": "tcp", - "shared": false, - "source_ip_address": null, - "source_port": null, - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] -} diff --git a/api-ref/source/v2/samples/firewall_log/firewall_log-create-request.json b/api-ref/source/v2/samples/firewall_log/firewall_log-create-request.json deleted file mode 100644 index 026ecc0..0000000 --- a/api-ref/source/v2/samples/firewall_log/firewall_log-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "firewall_log": { - "description": "my firewall log", - "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", - "fw_event": "DROP" - } -} diff --git a/api-ref/source/v2/samples/firewall_log/firewall_log-create-response.json b/api-ref/source/v2/samples/firewall_log/firewall_log-create-response.json deleted file mode 100644 index 6844e21..0000000 --- a/api-ref/source/v2/samples/firewall_log/firewall_log-create-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "firewall_log": { - "description": "my firewall log", - "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", - "fw_event": "DROP", - "id": "deb19331-e5d5-4a80-a37f-5e5ad407b353", - "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } -} diff --git a/api-ref/source/v2/samples/firewall_log/firewall_log-show-response.json b/api-ref/source/v2/samples/firewall_log/firewall_log-show-response.json deleted file mode 100644 index 0961fec..0000000 --- a/api-ref/source/v2/samples/firewall_log/firewall_log-show-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "firewall_log": { - "description": "my firewall log 3", - "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", - "fw_event": "ALL", - "id": "3969b708-d600-4343-93b9-01645f8e9a8a", - "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } -} diff --git a/api-ref/source/v2/samples/firewall_log/firewall_log-update-request.json b/api-ref/source/v2/samples/firewall_log/firewall_log-update-request.json deleted file mode 100644 index d7798f1..0000000 --- a/api-ref/source/v2/samples/firewall_log/firewall_log-update-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "firewall_log": { - "description": "my firewall log 3", - "fw_event": "ALL" - } -} diff --git a/api-ref/source/v2/samples/firewall_log/firewall_log-update-response.json b/api-ref/source/v2/samples/firewall_log/firewall_log-update-response.json deleted file mode 100644 index 0961fec..0000000 --- a/api-ref/source/v2/samples/firewall_log/firewall_log-update-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "firewall_log": { - "description": "my firewall log 3", - "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", - "fw_event": "ALL", - "id": "3969b708-d600-4343-93b9-01645f8e9a8a", - "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } -} diff --git a/api-ref/source/v2/samples/firewall_log/firewall_logs-list-response.json b/api-ref/source/v2/samples/firewall_log/firewall_logs-list-response.json deleted file mode 100644 index 5d81991..0000000 --- a/api-ref/source/v2/samples/firewall_log/firewall_logs-list-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "firewall_logs": [ - { - "description": "my firewall log 2", - "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", - "fw_event": "ACCEPT", - "id": "3969b708-d600-4343-93b9-01645f8e9a8a", - "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - }, - { - "description": "my firewall log", - "firewall_id": "a6564146-f8b3-49c3-add1-fb213455d5a8", - "fw_event": "DROP", - "id": "deb19331-e5d5-4a80-a37f-5e5ad407b353", - "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } - ] -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-create-request.json b/api-ref/source/v2/samples/firewalls/firewall-create-request.json deleted file mode 100644 index 6558993..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-create-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "firewall": { - "admin_state_up": true, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-create-response.json b/api-ref/source/v2/samples/firewalls/firewall-create-response.json deleted file mode 100644 index 4a46033..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-create-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "firewall": { - "admin_state_up": true, - "description": "", - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "", - "status": "PENDING_CREATE", - "router_ids": [ - "650bfd2f-7766-4a0d-839f-218f33e16998" - ], - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policies-list-response.json b/api-ref/source/v2/samples/firewalls/firewall-policies-list-response.json deleted file mode 100644 index c3d13aa..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policies-list-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "firewall_policies": [ - { - "audited": false, - "description": "", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "shared": false, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-create-request.json b/api-ref/source/v2/samples/firewalls/firewall-policy-create-request.json deleted file mode 100644 index 7811e95..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-create-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "firewall_policy": { - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "name": "test-policy" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-create-response.json b/api-ref/source/v2/samples/firewalls/firewall-policy-create-response.json deleted file mode 100644 index 40ea2a8..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-create-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "firewall_policy": { - "audited": false, - "description": "", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "shared": false, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-request.json b/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-request.json deleted file mode 100644 index 94d9b8e..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", - "insert_after": "a08ef905-0ff6-4784-8374-175fffe7dade", - "insert_before": "" -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-response.json b/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-response.json deleted file mode 100644 index f22ad96..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-insert-rule-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "audited": false, - "description": "", - "firewall_list": [], - "firewall_rules": [ - "a08ef905-0ff6-4784-8374-175fffe7dade", - "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692", - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "shared": false, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-request.json b/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-request.json deleted file mode 100644 index 7576442..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "firewall_rule_id": "7bc34b8c-8d3b-4ada-a9c8-1f4c11c65692" -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-response.json b/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-response.json deleted file mode 100644 index bd74142..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-remove-rule-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "audited": false, - "description": "", - "firewall_list": [], - "firewall_rules": [ - "a08ef905-0ff6-4784-8374-175fffe7dade", - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "shared": false, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-show-response.json b/api-ref/source/v2/samples/firewalls/firewall-policy-show-response.json deleted file mode 100644 index 40ea2a8..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-show-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "firewall_policy": { - "audited": false, - "description": "", - "firewall_rules": [ - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "shared": false, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-update-request.json b/api-ref/source/v2/samples/firewalls/firewall-policy-update-request.json deleted file mode 100644 index 7d0a7b5..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-update-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "firewall_policy": { - "firewall_rules": [ - "a08ef905-0ff6-4784-8374-175fffe7dade", - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ] - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-policy-update-response.json b/api-ref/source/v2/samples/firewalls/firewall-policy-update-response.json deleted file mode 100644 index 142fe78..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-policy-update-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "firewall_policy": { - "audited": false, - "description": "", - "firewall_rules": [ - "a08ef905-0ff6-4784-8374-175fffe7dade", - "8722e0e0-9cc9-4490-9660-8c9a5732fbb0" - ], - "id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "name": "test-policy", - "shared": false, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-rule-create-request.json b/api-ref/source/v2/samples/firewalls/firewall-rule-create-request.json deleted file mode 100644 index 9a972d6..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-rule-create-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "firewall_rule": { - "action": "allow", - "destination_port": "80", - "enabled": true, - "name": "ALLOW_HTTP", - "protocol": "tcp" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-rule-create-response.json b/api-ref/source/v2/samples/firewalls/firewall-rule-create-response.json deleted file mode 100644 index a614372..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-rule-create-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "firewall_rule": { - "action": "allow", - "description": "", - "destination_ip_address": null, - "destination_port": "80", - "enabled": true, - "firewall_policy_id": null, - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": null, - "protocol": "tcp", - "shared": false, - "source_ip_address": null, - "source_port": null, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-rule-show-response.json b/api-ref/source/v2/samples/firewalls/firewall-rule-show-response.json deleted file mode 100644 index a614372..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-rule-show-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "firewall_rule": { - "action": "allow", - "description": "", - "destination_ip_address": null, - "destination_port": "80", - "enabled": true, - "firewall_policy_id": null, - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": null, - "protocol": "tcp", - "shared": false, - "source_ip_address": null, - "source_port": null, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-rule-update-request.json b/api-ref/source/v2/samples/firewalls/firewall-rule-update-request.json deleted file mode 100644 index fbff43f..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-rule-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "firewall_rule": { - "shared": "true" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-rule-update-response.json b/api-ref/source/v2/samples/firewalls/firewall-rule-update-response.json deleted file mode 100644 index 527af3e..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-rule-update-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "firewall_rule": { - "action": "allow", - "description": "", - "destination_ip_address": null, - "destination_port": "80", - "enabled": true, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": 1, - "protocol": "tcp", - "shared": true, - "source_ip_address": null, - "source_port": null, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-rules-list-response.json b/api-ref/source/v2/samples/firewalls/firewall-rules-list-response.json deleted file mode 100644 index f145160..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-rules-list-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "firewall_rules": [ - { - "action": "allow", - "description": "", - "destination_ip_address": null, - "destination_port": "80", - "enabled": true, - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "8722e0e0-9cc9-4490-9660-8c9a5732fbb0", - "ip_version": 4, - "name": "ALLOW_HTTP", - "position": 1, - "protocol": "tcp", - "shared": false, - "source_ip_address": null, - "source_port": null, - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-show-response.json b/api-ref/source/v2/samples/firewalls/firewall-show-response.json deleted file mode 100644 index 7bbd815..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-show-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "firewall": { - "admin_state_up": true, - "description": "", - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "", - "status": "ACTIVE", - "router_ids": [ - "650bfd2f-7766-4a0d-839f-218f33e16998" - ], - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-update-request.json b/api-ref/source/v2/samples/firewalls/firewall-update-request.json deleted file mode 100644 index 2458f52..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "firewall": { - "admin_state_up": "false" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewall-update-response.json b/api-ref/source/v2/samples/firewalls/firewall-update-response.json deleted file mode 100644 index 49eddef..0000000 --- a/api-ref/source/v2/samples/firewalls/firewall-update-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "firewall": { - "admin_state_up": false, - "description": "", - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "", - "status": "PENDING_UPDATE", - "router_ids": [ - "650bfd2f-7766-4a0d-839f-218f33e16998" - ], - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } -} diff --git a/api-ref/source/v2/samples/firewalls/firewalls-list-response.json b/api-ref/source/v2/samples/firewalls/firewalls-list-response.json deleted file mode 100644 index dca72aa..0000000 --- a/api-ref/source/v2/samples/firewalls/firewalls-list-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "firewalls": [ - { - "admin_state_up": true, - "description": "", - "firewall_policy_id": "c69933c1-b472-44f9-8226-30dc4ffd454c", - "id": "3b0ef8f4-82c7-44d4-a4fb-6177f9a21977", - "name": "", - "status": "ACTIVE", - "router_ids": [ - "650bfd2f-7766-4a0d-839f-218f33e16998" - ], - "project_id": "45977fa2dbd7482098dd68d0d8970117", - "tenant_id": "45977fa2dbd7482098dd68d0d8970117" - } - ] -} diff --git a/api-ref/source/v2/samples/flavors/flavor-associate-request.json b/api-ref/source/v2/samples/flavors/flavor-associate-request.json deleted file mode 100644 index f2e491a..0000000 --- a/api-ref/source/v2/samples/flavors/flavor-associate-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "service_profile": { - "id": "4e5b9191-ffbe-4f7a-b112-2db98232fd32" - } -} diff --git a/api-ref/source/v2/samples/flavors/flavor-associate-response.json b/api-ref/source/v2/samples/flavors/flavor-associate-response.json deleted file mode 100644 index f2e491a..0000000 --- a/api-ref/source/v2/samples/flavors/flavor-associate-response.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "service_profile": { - "id": "4e5b9191-ffbe-4f7a-b112-2db98232fd32" - } -} diff --git a/api-ref/source/v2/samples/flavors/flavor-create-request.json b/api-ref/source/v2/samples/flavors/flavor-create-request.json deleted file mode 100644 index 859c945..0000000 --- a/api-ref/source/v2/samples/flavors/flavor-create-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "flavor": { - "service_type": "LOADBALANCERV2", - "enabled": true, - "name": "dummy", - "description": "Dummy flavor" - } -} diff --git a/api-ref/source/v2/samples/flavors/flavor-create-response.json b/api-ref/source/v2/samples/flavors/flavor-create-response.json deleted file mode 100644 index dac6fcc..0000000 --- a/api-ref/source/v2/samples/flavors/flavor-create-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "flavor": { - "id": "7fc0581b-4509-49e1-90eb-c953c877fa4c", - "name": "dummy", - "service_type": "LOADBALANCERV2", - "description": "Dummy flavor", - "enabled": true, - "service_profiles": [] - } -} diff --git a/api-ref/source/v2/samples/flavors/flavor-show-response.json b/api-ref/source/v2/samples/flavors/flavor-show-response.json deleted file mode 100644 index 176bc78..0000000 --- a/api-ref/source/v2/samples/flavors/flavor-show-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "flavor": { - "description": "", - "enabled": true, - "service_profiles": [], - "service_type": "LOADBALANCERV2", - "id": "f7b14d9a-b0dc-4fbe-bb14-a0f4970a69e0", - "name": "dummy" - } -} diff --git a/api-ref/source/v2/samples/flavors/flavor-update-request.json b/api-ref/source/v2/samples/flavors/flavor-update-request.json deleted file mode 100644 index 76b56e7..0000000 --- a/api-ref/source/v2/samples/flavors/flavor-update-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "flavor": { - "enabled": false, - "name": "newname", - "description": "New description" - } -} diff --git a/api-ref/source/v2/samples/flavors/flavor-update-response.json b/api-ref/source/v2/samples/flavors/flavor-update-response.json deleted file mode 100644 index 52f7814..0000000 --- a/api-ref/source/v2/samples/flavors/flavor-update-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "flavor": { - "description": "New description", - "enabled": false, - "service_profiles": [], - "service_type": "LOADBALANCERV2", - "id": "7fc0581b-4509-49e1-90eb-c953c877fa4c", - "name": "newname" - } -} diff --git a/api-ref/source/v2/samples/flavors/flavors-list-response.json b/api-ref/source/v2/samples/flavors/flavors-list-response.json deleted file mode 100644 index 3b2474d..0000000 --- a/api-ref/source/v2/samples/flavors/flavors-list-response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "flavors": [ - { - "description": "", - "enabled": true, - "service_profiles": [], - "service_type": "LOADBALANCERV2", - "id": "f7b14d9a-b0dc-4fbe-bb14-a0f4970a69e0", - "name": "dummy" - } - ] -} diff --git a/api-ref/source/v2/samples/flavors/service-profile-create-request.json b/api-ref/source/v2/samples/flavors/service-profile-create-request.json deleted file mode 100644 index aba70f3..0000000 --- a/api-ref/source/v2/samples/flavors/service-profile-create-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "service_profile": { - "enabled": "true", - "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", - "description": "Dummy profile", - "metainfo": "{'foo': 'bar'}" - } -} diff --git a/api-ref/source/v2/samples/flavors/service-profile-create-response.json b/api-ref/source/v2/samples/flavors/service-profile-create-response.json deleted file mode 100644 index 1556d72..0000000 --- a/api-ref/source/v2/samples/flavors/service-profile-create-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "service_profile": { - "enabled": true, - "metainfo": "{'foo': 'bar'}", - "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", - "id": "7c793e5f-9b64-44e0-8b1f-902e59c85a01", - "description": "Dummy profile" - } -} diff --git a/api-ref/source/v2/samples/flavors/service-profile-show-response.json b/api-ref/source/v2/samples/flavors/service-profile-show-response.json deleted file mode 100644 index 1556d72..0000000 --- a/api-ref/source/v2/samples/flavors/service-profile-show-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "service_profile": { - "enabled": true, - "metainfo": "{'foo': 'bar'}", - "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", - "id": "7c793e5f-9b64-44e0-8b1f-902e59c85a01", - "description": "Dummy profile" - } -} diff --git a/api-ref/source/v2/samples/flavors/service-profile-update-request.json b/api-ref/source/v2/samples/flavors/service-profile-update-request.json deleted file mode 100644 index f41101f..0000000 --- a/api-ref/source/v2/samples/flavors/service-profile-update-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "service_profile": { - "enabled": false, - "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", - "description": "New description", - "metainfo": "{'new': 'info'}" - } -} diff --git a/api-ref/source/v2/samples/flavors/service-profile-update-response.json b/api-ref/source/v2/samples/flavors/service-profile-update-response.json deleted file mode 100644 index 3090089..0000000 --- a/api-ref/source/v2/samples/flavors/service-profile-update-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "service_profile": { - "enabled": false, - "metainfo": "{'new': 'info'}", - "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", - "id": "7c793e5f-9b64-44e0-8b1f-902e59c85a01", - "description": "New description" - } -} diff --git a/api-ref/source/v2/samples/flavors/service-profiles-list-response.json b/api-ref/source/v2/samples/flavors/service-profiles-list-response.json deleted file mode 100644 index 0bb6915..0000000 --- a/api-ref/source/v2/samples/flavors/service-profiles-list-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "service_profiles": [ - { - "id": "4e5b9191-ffbe-4f7a-b112-2db98232fd32", - "enabled": true, - "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", - "description": "", - "metainfo": "{}" - }, - { - "id": "684322c5-703a-48a2-8138-34b99942a7ef", - "enabled": true, - "driver": "neutron_lbaas.drivers.octavia.driver.OctaviaDriver", - "description": "", - "metainfo": "{}" - } - ] -} diff --git a/api-ref/source/v2/samples/floatingips/floating-ips-list-response.json b/api-ref/source/v2/samples/floatingips/floating-ips-list-response.json deleted file mode 100644 index c1822f3..0000000 --- a/api-ref/source/v2/samples/floatingips/floating-ips-list-response.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "floatingips": [ - { - "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", - "description": "for test", - "created_at": "2016-12-21T10:55:50Z", - "updated_at": "2016-12-21T10:55:53Z", - "revision_number": 1, - "project_id": "4969c491a3c74ee4af974e6d800c62de", - "tenant_id": "4969c491a3c74ee4af974e6d800c62de", - "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", - "fixed_ip_address": "10.0.0.3", - "floating_ip_address": "172.24.4.228", - "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", - "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", - "status": "ACTIVE" - }, - { - "router_id": null, - "description": "for test", - "created_at": "2016-12-21T11:55:50Z", - "updated_at": "2016-12-21T11:55:53Z", - "revision_number": 2, - "project_id": "4969c491a3c74ee4af974e6d800c62de", - "tenant_id": "4969c491a3c74ee4af974e6d800c62de", - "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", - "fixed_ip_address": null, - "floating_ip_address": "172.24.4.227", - "port_id": null, - "id": "61cea855-49cb-4846-997d-801b70c71bdd", - "status": "DOWN" - } - ] -} diff --git a/api-ref/source/v2/samples/floatingips/floatingip-create-request.json b/api-ref/source/v2/samples/floatingips/floatingip-create-request.json deleted file mode 100644 index 3f26cb3..0000000 --- a/api-ref/source/v2/samples/floatingips/floatingip-create-request.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "floatingip": { - "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", - "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", - "subnet_id": "278d9507-36e7-403c-bb80-1d7093318fe6", - "fixed_ip_address": "10.0.0.3", - "floating_ip_address": "172.24.4.228", - "description": "floating ip for testing" - } -} diff --git a/api-ref/source/v2/samples/floatingips/floatingip-create-response.json b/api-ref/source/v2/samples/floatingips/floatingip-create-response.json deleted file mode 100644 index 39faf23..0000000 --- a/api-ref/source/v2/samples/floatingips/floatingip-create-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "floatingip": { - "fixed_ip_address": "10.0.0.3", - "floating_ip_address": "172.24.4.228", - "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", - "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", - "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", - "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", - "status": "ACTIVE", - "project_id": "4969c491a3c74ee4af974e6d800c62de", - "tenant_id": "4969c491a3c74ee4af974e6d800c62de", - "description": "floating ip for testing", - "created_at": "2016-12-21T01:36:04Z", - "updated_at": "2016-12-21T01:36:04Z", - "revision_number": 1 - } -} diff --git a/api-ref/source/v2/samples/floatingips/floatingip-disassociate-request.json b/api-ref/source/v2/samples/floatingips/floatingip-disassociate-request.json deleted file mode 100644 index 1800d32..0000000 --- a/api-ref/source/v2/samples/floatingips/floatingip-disassociate-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "floatingip": { - "port_id": null - } -} diff --git a/api-ref/source/v2/samples/floatingips/floatingip-disassociate-response.json b/api-ref/source/v2/samples/floatingips/floatingip-disassociate-response.json deleted file mode 100644 index 06e09b1..0000000 --- a/api-ref/source/v2/samples/floatingips/floatingip-disassociate-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "floatingip": { - "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", - "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", - "fixed_ip_address": null, - "floating_ip_address": "172.24.4.228", - "project_id": "4969c491a3c74ee4af974e6d800c62de", - "tenant_id": "4969c491a3c74ee4af974e6d800c62de", - "status": "ACTIVE", - "port_id": null, - "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", - "description": "for test", - "created_at": "2016-12-21T10:55:50Z", - "updated_at": "2016-12-22T03:13:49Z", - "revision_number": 3 - } -} diff --git a/api-ref/source/v2/samples/floatingips/floatingip-show-response.json b/api-ref/source/v2/samples/floatingips/floatingip-show-response.json deleted file mode 100644 index 92882fb..0000000 --- a/api-ref/source/v2/samples/floatingips/floatingip-show-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "floatingip": { - "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", - "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", - "fixed_ip_address": "10.0.0.3", - "floating_ip_address": "172.24.4.228", - "project_id": "4969c491a3c74ee4af974e6d800c62de", - "tenant_id": "4969c491a3c74ee4af974e6d800c62de", - "status": "ACTIVE", - "port_id": "ce705c24-c1ef-408a-bda3-7bbd946164ab", - "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", - "description": "floating ip for testing", - "created_at": "2016-12-21T01:36:04Z", - "updated_at": "2016-12-21T01:36:04Z", - "revision_number": 1 - } -} diff --git a/api-ref/source/v2/samples/floatingips/floatingip-update-request.json b/api-ref/source/v2/samples/floatingips/floatingip-update-request.json deleted file mode 100644 index 2772b5a..0000000 --- a/api-ref/source/v2/samples/floatingips/floatingip-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "floatingip": { - "port_id": "fc861431-0e6c-4842-a0ed-e2363f9bc3a8" - } -} diff --git a/api-ref/source/v2/samples/floatingips/floatingip-update-response.json b/api-ref/source/v2/samples/floatingips/floatingip-update-response.json deleted file mode 100644 index e4689ad..0000000 --- a/api-ref/source/v2/samples/floatingips/floatingip-update-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "floatingip": { - "created_at": "2016-12-21T10:55:50Z", - "description": "floating ip for testing", - "fixed_ip_address": "10.0.0.4", - "floating_ip_address": "172.24.4.228", - "floating_network_id": "376da547-b977-4cfe-9cba-275c80debf57", - "id": "2f245a7b-796b-4f26-9cf9-9e82d248fda7", - "port_id": "fc861431-0e6c-4842-a0ed-e2363f9bc3a8", - "project_id": "4969c491a3c74ee4af974e6d800c62de", - "revision_number": 3, - "router_id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f", - "status": "ACTIVE", - "tenant_id": "4969c491a3c74ee4af974e6d800c62de", - "updated_at": "2016-12-22T03:13:49Z" - } -} \ No newline at end of file diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-associate-request.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitor-associate-request.json deleted file mode 100644 index 9fe528a..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-associate-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "health_monitor": { - "id": "b624decf-d5d3-4c66-9a3d-f047e7786181" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-associate-response.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitor-associate-response.json deleted file mode 100644 index b70e511..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-associate-response.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "health_monitor": {} -} diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-create-request.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitor-create-request.json deleted file mode 100644 index 44c054f..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-create-request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": true, - "delay": 1, - "expected_codes": "200,201,202", - "http_method": "GET", - "max_retries": 5, - "pool_id": "74aa2010-a59f-4d35-a436-60a6da882819", - "timeout": 1, - "type": "HTTP", - "url_path": "/index.html" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-create-response.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitor-create-response.json deleted file mode 100644 index 707d397..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-create-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": true, - "delay": 1, - "expected_codes": "200,201,202", - "http_method": "GET", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "max_retries": 5, - "pools": [], - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "timeout": 1, - "type": "HTTP", - "url_path": "/index.html" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-show-response.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitor-show-response.json deleted file mode 100644 index 6beb497..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-show-response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": true, - "delay": 1, - "expected_codes": "200,201,202", - "http_method": "GET", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "max_retries": 5, - "pools": [ - { - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "status": "ACTIVE", - "status_description": null - } - ], - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "timeout": 1, - "type": "HTTP", - "url_path": "/index.html" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-update-request.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitor-update-request.json deleted file mode 100644 index 1991e3e..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-update-request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": false, - "delay": 2, - "expected_codes": "200", - "http_method": "POST", - "max_retries": 2, - "timeout": 2, - "url_path": "/page.html" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-update-response.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitor-update-response.json deleted file mode 100644 index c3e5ee2..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitor-update-response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": false, - "delay": 2, - "expected_codes": "200", - "http_method": "POST", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "max_retries": 2, - "pools": [ - { - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "status": "ACTIVE", - "status_description": null - } - ], - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "timeout": 2, - "type": "HTTP", - "url_path": "/page.html" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/healthmonitors-list-response.json b/api-ref/source/v2/samples/lbaas-v1/healthmonitors-list-response.json deleted file mode 100644 index f846ac0..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/healthmonitors-list-response.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "health_monitors": [ - { - "admin_state_up": true, - "delay": 1, - "expected_codes": "200,201,202", - "http_method": "GET", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "max_retries": 5, - "pools": [ - { - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "status": "ACTIVE", - "status_description": null - } - ], - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "timeout": 1, - "type": "HTTP", - "url_path": "/index.html" - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas-v1/member-create-request.json b/api-ref/source/v2/samples/lbaas-v1/member-create-request.json deleted file mode 100644 index 660429b..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/member-create-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "member": { - "address": "10.0.0.22", - "admin_state_up": true, - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "protocol_port": 90, - "weight": 1 - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/member-create-response.json b/api-ref/source/v2/samples/lbaas-v1/member-create-response.json deleted file mode 100644 index 35f7b8c..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/member-create-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "member": { - "address": "10.0.0.22", - "admin_state_up": true, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "protocol_port": 90, - "status": "ACTIVE", - "status_description": null, - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "weight": 1 - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/member-show-response.json b/api-ref/source/v2/samples/lbaas-v1/member-show-response.json deleted file mode 100644 index 046904e..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/member-show-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "member": { - "address": "10.0.1.22", - "admin_state_up": true, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "protocol_port": 90, - "status": "ACTIVE", - "status_description": null, - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "weight": 1 - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/member-update-request.json b/api-ref/source/v2/samples/lbaas-v1/member-update-request.json deleted file mode 100644 index b5bf2c8..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/member-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "member": { - "weight": 5 - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/member-update-response.json b/api-ref/source/v2/samples/lbaas-v1/member-update-response.json deleted file mode 100644 index 2cf4dae..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/member-update-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "member": { - "address": "10.0.0.22", - "admin_state_up": true, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "protocol_port": 90, - "status": "ACTIVE", - "status_description": null, - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "weight": 5 - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/members-list-response.json b/api-ref/source/v2/samples/lbaas-v1/members-list-response.json deleted file mode 100644 index b9318a5..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/members-list-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "members": [ - { - "address": "10.0.1.22", - "admin_state_up": true, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "protocol_port": 90, - "status": "ACTIVE", - "status_description": null, - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "weight": 1 - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas-v1/pool-create-request.json b/api-ref/source/v2/samples/lbaas-v1/pool-create-request.json deleted file mode 100644 index dc5d38a..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/pool-create-request.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "pool": { - "admin_state_up": true, - "description": "simple pool", - "lb_method": "ROUND_ROBIN", - "name": "my-pool", - "protocol": "HTTP", - "subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/pool-create-response.json b/api-ref/source/v2/samples/lbaas-v1/pool-create-response.json deleted file mode 100644 index a4a30dd..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/pool-create-response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "pool": { - "admin_state_up": true, - "description": "simple pool", - "health_monitors": [], - "health_monitors_status": [], - "id": "af95e0ce-8a26-4f29-9524-db41e7769c73", - "lb_method": "ROUND_ROBIN", - "members": [], - "name": "my-pool", - "protocol": "HTTP", - "provider": "haproxy", - "status": "PENDING_CREATE", - "status_description": null, - "subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "vip_id": null - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/pool-show-response.json b/api-ref/source/v2/samples/lbaas-v1/pool-show-response.json deleted file mode 100644 index 7a79359..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/pool-show-response.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "pool": { - "admin_state_up": true, - "description": "", - "health_monitors": [ - "b7633ade-24dc-4d72-8475-06aa22be5412" - ], - "health_monitors_status": [ - { - "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "status": "ACTIVE", - "status_description": null - } - ], - "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "lb_method": "ROUND_ROBIN", - "members": [ - "cf024846-7516-4e3a-b0fb-6590322c836f" - ], - "name": "pool1", - "protocol": "HTTP", - "provider": "haproxy", - "status": "ACTIVE", - "status_description": null, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/pool-update-request.json b/api-ref/source/v2/samples/lbaas-v1/pool-update-request.json deleted file mode 100644 index d523eea..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/pool-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "pool": { - "name": "SuperPool" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/pool-update-response.json b/api-ref/source/v2/samples/lbaas-v1/pool-update-response.json deleted file mode 100644 index 012de86..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/pool-update-response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "pool": { - "admin_state_up": true, - "description": "", - "health_monitors": [ - "b7633ade-24dc-4d72-8475-06aa22be5412" - ], - "health_monitors_status": [ - { - "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "status": "ACTIVE", - "status_description": null - } - ], - "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "lb_algorithm": "ROUND_ROBIN", - "members": [ - "cf024846-7516-4e3a-b0fb-6590322c836f" - ], - "name": "SuperPool", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "protocol": "HTTP", - "provider": "haproxy", - "status": "PENDING_UPDATE", - "status_description": null, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/pools-list-response.json b/api-ref/source/v2/samples/lbaas-v1/pools-list-response.json deleted file mode 100644 index 389fecd..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/pools-list-response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "pools": [ - { - "admin_state_up": true, - "description": "", - "health_monitors": [ - "b7633ade-24dc-4d72-8475-06aa22be5412" - ], - "health_monitors_status": [ - { - "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "status": "ACTIVE", - "status_description": null - } - ], - "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "lb_method": "ROUND_ROBIN", - "members": [ - "cf024846-7516-4e3a-b0fb-6590322c836f" - ], - "name": "pool1", - "protocol": "HTTP", - "provider": "haproxy", - "status": "ACTIVE", - "status_description": null, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba" - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas-v1/vip-create-request.json b/api-ref/source/v2/samples/lbaas-v1/vip-create-request.json deleted file mode 100644 index d9fae81..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/vip-create-request.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "vip": { - "admin_state_up": true, - "name": "NewVip", - "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", - "protocol": "HTTP", - "protocol_port": "80", - "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/vip-create-response.json b/api-ref/source/v2/samples/lbaas-v1/vip-create-response.json deleted file mode 100644 index 9870ecc..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/vip-create-response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "vip": { - "address": "10.0.0.4", - "admin_state_up": true, - "connection_limit": -1, - "description": "", - "id": "fa0373e0-9dd4-4ff7-98fc-8cceca9bdb4e", - "name": "NewVip", - "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", - "port_id": "0ba4cd9c-edb4-4594-bac4-b68b49d5f04c", - "protocol": "HTTP", - "protocol_port": 80, - "session_persistence": null, - "status": "PENDING_CREATE", - "status_description": null, - "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", - "tenant_id": "e68c3e65e1f34ee9b2357d0fe418a78b" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/vip-show-response.json b/api-ref/source/v2/samples/lbaas-v1/vip-show-response.json deleted file mode 100644 index 66ace79..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/vip-show-response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "vip": { - "address": "10.0.0.4", - "admin_state_up": true, - "connection_limit": -1, - "description": "", - "id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", - "name": "my-Vip", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "port_id": "5328aeea-2988-41c0-b5fe-0fd0660979d3", - "protocol": "HTTP", - "protocol_port": 80, - "session_persistence": null, - "status": "ACTIVE", - "status_description": null, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/vip-update-request.json b/api-ref/source/v2/samples/lbaas-v1/vip-update-request.json deleted file mode 100644 index a296936..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/vip-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "vip": { - "connection_limit": "1000" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/vip-update-response.json b/api-ref/source/v2/samples/lbaas-v1/vip-update-response.json deleted file mode 100644 index 38c1831..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/vip-update-response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "vip": { - "address": "10.0.0.4", - "admin_state_up": true, - "connection_limit": 1000, - "description": "", - "id": "fa0373e0-9dd4-4ff7-98fc-8cceca9bdb4e", - "name": "NewVip", - "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", - "port_id": "0ba4cd9c-edb4-4594-bac4-b68b49d5f04c", - "protocol": "HTTP", - "protocol_port": 80, - "session_persistence": null, - "status": "PENDING_UPDATE", - "status_description": null, - "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", - "tenant_id": "e68c3e65e1f34ee9b2357d0fe418a78b" - } -} diff --git a/api-ref/source/v2/samples/lbaas-v1/vips-list-response.json b/api-ref/source/v2/samples/lbaas-v1/vips-list-response.json deleted file mode 100644 index 6c7e9ea..0000000 --- a/api-ref/source/v2/samples/lbaas-v1/vips-list-response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "vips": [ - { - "address": "10.0.0.4", - "admin_state_up": true, - "connection_limit": -1, - "description": "", - "id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", - "name": "my-Vip", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "port_id": "5328aeea-2988-41c0-b5fe-0fd0660979d3", - "protocol": "HTTP", - "protocol_port": 80, - "session_persistence": null, - "status": "ACTIVE", - "status_description": null, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238" - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitor-associate-request.json b/api-ref/source/v2/samples/lbaas/healthmonitor-associate-request.json deleted file mode 100644 index 9fe528a..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitor-associate-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "health_monitor": { - "id": "b624decf-d5d3-4c66-9a3d-f047e7786181" - } -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitor-associate-response.json b/api-ref/source/v2/samples/lbaas/healthmonitor-associate-response.json deleted file mode 100644 index b70e511..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitor-associate-response.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "health_monitor": {} -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitor-create-request.json b/api-ref/source/v2/samples/lbaas/healthmonitor-create-request.json deleted file mode 100644 index 71fc423..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitor-create-request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "health_monitor": { - "pool_id": "74aa2010-a59f-4d35-a436-60a6da882819", - "admin_state_up": true, - "delay": "1", - "expected_codes": "200,201,202", - "http_method": "GET", - "max_retries": 5, - "timeout": 1, - "type": "HTTP", - "url_path": "/index.html" - } -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitor-create-response.json b/api-ref/source/v2/samples/lbaas/healthmonitor-create-response.json deleted file mode 100644 index 15c1e71..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitor-create-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": true, - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "delay": 1, - "expected_codes": "200,201,202", - "max_retries": 5, - "http_method": "GET", - "timeout": 1, - "pools": [], - "url_path": "/index.html", - "type": "HTTP", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412" - } -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitor-show-response.json b/api-ref/source/v2/samples/lbaas/healthmonitor-show-response.json deleted file mode 100644 index e9e269b..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitor-show-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": true, - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "delay": 1, - "expected_codes": "200,201,202", - "max_retries": 5, - "http_method": "GET", - "timeout": 1, - "pools": [ - { - "status": "ACTIVE", - "status_description": null, - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" - } - ], - "url_path": "/index.html", - "type": "HTTP", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412" - } -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitor-update-request.json b/api-ref/source/v2/samples/lbaas/healthmonitor-update-request.json deleted file mode 100644 index 5cfb536..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitor-update-request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": false, - "delay": "2", - "expected_codes": "200", - "http_method": "POST", - "max_retries": 2, - "timeout": 2, - "url_path": "/page.html" - } -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitor-update-response.json b/api-ref/source/v2/samples/lbaas/healthmonitor-update-response.json deleted file mode 100644 index a585b7f..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitor-update-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "health_monitor": { - "admin_state_up": false, - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "delay": 2, - "expected_codes": "200", - "max_retries": 2, - "http_method": "POST", - "timeout": 2, - "pools": [ - { - "status": "ACTIVE", - "status_description": null, - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" - } - ], - "url_path": "/page.html", - "type": "HTTP", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412" - } -} diff --git a/api-ref/source/v2/samples/lbaas/healthmonitors-list-response.json b/api-ref/source/v2/samples/lbaas/healthmonitors-list-response.json deleted file mode 100644 index 04c8fd0..0000000 --- a/api-ref/source/v2/samples/lbaas/healthmonitors-list-response.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "health_monitors": [ - { - "admin_state_up": true, - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "delay": 1, - "expected_codes": "200,201,202", - "max_retries": 5, - "http_method": "GET", - "timeout": 1, - "pools": [ - { - "status": "ACTIVE", - "status_description": null, - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" - } - ], - "url_path": "/index.html", - "type": "HTTP", - "id": "b7633ade-24dc-4d72-8475-06aa22be5412" - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/listener-create-request.json b/api-ref/source/v2/samples/lbaas/listener-create-request.json deleted file mode 100644 index bcfe992..0000000 --- a/api-ref/source/v2/samples/lbaas/listener-create-request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "listener": { - "admin_state_up": true, - "connection_limit": 100, - "description": "listener one", - "loadbalancer_id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "name": "listener1", - "protocol": "HTTP", - "protocol_port": "80", - "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "sni_container_refs": [ - "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", - "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" - ] - } -} diff --git a/api-ref/source/v2/samples/lbaas/listener-create-response.json b/api-ref/source/v2/samples/lbaas/listener-create-response.json deleted file mode 100644 index ee19fa1..0000000 --- a/api-ref/source/v2/samples/lbaas/listener-create-response.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "listener": { - "admin_state_up": true, - "connection_limit": 100, - "default_pool_id": null, - "description": "listener one", - "id": "39de4d56-d663-46e5-85a1-5b9d5fa17829", - "loadbalancers": [ - { - "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c" - } - ], - "name": "listener1", - "protocol": "HTTP", - "protocol_port": 80, - "project_id": "1a3e005cf9ce40308c900bcb08e5320c", - "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", - "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "sni_container_refs": [ - "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", - "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" - ] - } -} diff --git a/api-ref/source/v2/samples/lbaas/listener-show-response.json b/api-ref/source/v2/samples/lbaas/listener-show-response.json deleted file mode 100644 index d65053d..0000000 --- a/api-ref/source/v2/samples/lbaas/listener-show-response.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "listener": { - "admin_state_up": true, - "connection_limit": 100, - "default_pool_id": null, - "description": "", - "id": "35cb8516-1173-4035-8dae-0dae3453f37f", - "loadbalancers": [ - { - "id": "a9729389-6147-41a3-ab22-a24aed8692b2" - } - ], - "name": "", - "protocol": "HTTP", - "protocol_port": 80, - "project_id": "3e4d8bec50a845fcb09e03a4375c691d", - "tenant_id": "3e4d8bec50a845fcb09e03a4375c691d", - "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "sni_container_refs": [ - "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", - "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" - ] - } -} diff --git a/api-ref/source/v2/samples/lbaas/listener-update-request.json b/api-ref/source/v2/samples/lbaas/listener-update-request.json deleted file mode 100644 index aeb8120..0000000 --- a/api-ref/source/v2/samples/lbaas/listener-update-request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "listener": { - "admin_state_up": false, - "connection_limit": 200, - "description": "listener two", - "name": "listener2", - "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "sni_container_refs": [ - "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", - "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" - ] - } -} diff --git a/api-ref/source/v2/samples/lbaas/listener-update-response.json b/api-ref/source/v2/samples/lbaas/listener-update-response.json deleted file mode 100644 index 5a4eb94..0000000 --- a/api-ref/source/v2/samples/lbaas/listener-update-response.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "listener": { - "admin_state_up": false, - "connection_limit": 200, - "default_pool_id": null, - "description": "listener two", - "id": "39de4d56-d663-46e5-85a1-5b9d5fa17829", - "loadbalancers": [ - { - "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c" - } - ], - "name": "listener2", - "protocol": "HTTP", - "protocol_port": 80, - "project_id": "1a3e005cf9ce40308c900bcb08e5320c", - "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", - "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "sni_container_refs": [ - "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", - "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" - ] - } -} diff --git a/api-ref/source/v2/samples/lbaas/listeners-list-response.json b/api-ref/source/v2/samples/lbaas/listeners-list-response.json deleted file mode 100644 index 5e0f000..0000000 --- a/api-ref/source/v2/samples/lbaas/listeners-list-response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "listeners": [ - { - "admin_state_up": true, - "connection_limit": 100, - "default_pool_id": null, - "description": "", - "id": "35cb8516-1173-4035-8dae-0dae3453f37f", - "loadbalancers": [ - { - "id": "a9729389-6147-41a3-ab22-a24aed8692b2" - } - ], - "name": "", - "protocol": "HTTP", - "protocol_port": 80, - "project_id": "3e4d8bec50a845fcb09e03a4375c691d", - "tenant_id": "3e4d8bec50a845fcb09e03a4375c691d", - "default_tls_container_ref": "https://barbican.endpoint/containers/a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "sni_container_refs": [ - "https://barbican.endpoint/containers/b36c20d0-18e9-42ce-88fd-82a35977ee8d", - "https://barbican.endpoint/containers/c36c20d0-18e9-42ce-88fd-82a35977ee8e" - ] - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/loadbalancer-create-request.json b/api-ref/source/v2/samples/lbaas/loadbalancer-create-request.json deleted file mode 100644 index 5aa588b..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancer-create-request.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "loadbalancer": { - "name": "loadbalancer1", - "description": "simple lb", - "project_id": "b7c1a69e88bf4b21a8148f787aef2081", - "tenant_id": "b7c1a69e88bf4b21a8148f787aef2081", - "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", - "vip_address": "10.0.0.4", - "admin_state_up": true, - "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04" - } -} diff --git a/api-ref/source/v2/samples/lbaas/loadbalancer-create-response.json b/api-ref/source/v2/samples/lbaas/loadbalancer-create-response.json deleted file mode 100644 index bed439f..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancer-create-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "loadbalancer": { - "admin_state_up": true, - "description": "simple lb", - "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "listeners": [], - "name": "loadbalancer1", - "operating_status": "ONLINE", - "provisioning_status": "ACTIVE", - "project_id": "b7c1a69e88bf4b21a8148f787aef2081", - "tenant_id": "b7c1a69e88bf4b21a8148f787aef2081", - "vip_address": "10.0.0.4", - "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", - "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", - "provider": "sample_provider", - "pools": [] - } -} diff --git a/api-ref/source/v2/samples/lbaas/loadbalancer-show-response.json b/api-ref/source/v2/samples/lbaas/loadbalancer-show-response.json deleted file mode 100644 index ddaeeba..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancer-show-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "loadbalancer": { - "description": "simple lb", - "admin_state_up": true, - "project_id": "1a3e005cf9ce40308c900bcb08e5320c", - "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", - "provisioning_status": "ACTIVE", - "listeners": [], - "vip_address": "10.0.0.2", - "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", - "id": "a9729389-6147-41a3-ab22-a24aed8692b2", - "operating_status": "ONLINE", - "name": "loadbalancer1", - "pools": [] - } -} diff --git a/api-ref/source/v2/samples/lbaas/loadbalancer-status-tree.json b/api-ref/source/v2/samples/lbaas/loadbalancer-status-tree.json deleted file mode 100644 index 19535ab..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancer-status-tree.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "statuses": { - "loadbalancer": { - "name": "lb1", - "listeners": [ - { - "pools": [ - { - "name": "pool1", - "provisioning_status": "ACTIVE", - "health_monitor": { - "type": "HTTP", - "id": "90f7c765-0bc9-47c4-8513-4cc0c264c8f8", - "provisioning_status": "ACTIVE" - }, - "members": [ - { - "address": "10.0.0.4", - "protocol_port": 80, - "id": "32723bee-2484-4de3-b6fc-c0b98d35fc84", - "operating_status": "ONLINE", - "provisioning_status": "ACTIVE" - }, - { - "address": "10.0.0.3", - "protocol_port": 80, - "id": "173b8164-0c9a-43ec-ab33-4ae0e7a8f863", - "operating_status": "ONLINE", - "provisioning_status": "ACTIVE" - } - ], - "id": "ae6f93b8-a3f6-46cd-bb18-c2ab0308abf7", - "operating_status": "ONLINE" - } - ], - "name": "listener1", - "id": "c2a41fbe-b70a-4645-bb11-4d3c28f23a25", - "operating_status": "ONLINE", - "provisioning_status": "ACTIVE" - } - ], - "id": "a4c19566-6f81-4c96-ac11-33954a9825a2", - "operating_status": "ONLINE", - "provisioning_status": "ACTIVE" - } - } -} diff --git a/api-ref/source/v2/samples/lbaas/loadbalancer-update-request.json b/api-ref/source/v2/samples/lbaas/loadbalancer-update-request.json deleted file mode 100644 index a927251..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancer-update-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "loadbalancer": { - "admin_state_up": false, - "description": "simple lb2", - "name": "loadbalancer2" - } -} diff --git a/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.json b/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.json deleted file mode 100644 index d9916d3..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "loadbalancer": { - "admin_state_up": false, - "description": "simple lb2", - "id": "a36c20d0-18e9-42ce-88fd-82a35977ee8c", - "listeners": [], - "name": "loadbalancer2", - "operating_status": "ONLINE", - "provisioning_status": "PENDING_UPDATE", - "project_id": "b7c1a69e88bf4b21a8148f787aef2081", - "tenant_id": "b7c1a69e88bf4b21a8148f787aef2081", - "vip_address": "10.0.0.4", - "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", - "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", - "provider": "sample_provider", - "pools": [] - } -} diff --git a/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.txt b/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.txt deleted file mode 100644 index 314e15b..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancer-update-response.txt +++ /dev/null @@ -1,4 +0,0 @@ -#!wiki caution -Note - -A Load Balancer that is does not have a provisioning_status of ACTIVE cannot be updated. diff --git a/api-ref/source/v2/samples/lbaas/loadbalancers-list-response.json b/api-ref/source/v2/samples/lbaas/loadbalancers-list-response.json deleted file mode 100644 index 0ebbcbd..0000000 --- a/api-ref/source/v2/samples/lbaas/loadbalancers-list-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "loadbalancers": [ - { - "description": "simple lb", - "admin_state_up": true, - "project_id": "1a3e005cf9ce40308c900bcb08e5320c", - "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", - "provisioning_status": "ACTIVE", - "listeners": [], - "vip_address": "10.0.0.2", - "vip_subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", - "id": "a9729389-6147-41a3-ab22-a24aed8692b2", - "operating_status": "ONLINE", - "name": "loadbalancer1", - "flavor": "a7ae5d5a-d855-4f9a-b187-af66b53f4d04", - "provider": "sample-provider", - "pools": [] - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/member-create-request.json b/api-ref/source/v2/samples/lbaas/member-create-request.json deleted file mode 100644 index c045049..0000000 --- a/api-ref/source/v2/samples/lbaas/member-create-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "member": { - "address": "10.0.0.22", - "admin_state_up": true, - "protocol_port": "90", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "weight": "1" - } -} diff --git a/api-ref/source/v2/samples/lbaas/member-create-response.json b/api-ref/source/v2/samples/lbaas/member-create-response.json deleted file mode 100644 index 3866459..0000000 --- a/api-ref/source/v2/samples/lbaas/member-create-response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "member": { - "admin_state_up": true, - "weight": 1, - "address": "10.0.1.22", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "protocol_port": 90, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "subnet_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" - } -} diff --git a/api-ref/source/v2/samples/lbaas/member-show-response.json b/api-ref/source/v2/samples/lbaas/member-show-response.json deleted file mode 100644 index 3866459..0000000 --- a/api-ref/source/v2/samples/lbaas/member-show-response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "member": { - "admin_state_up": true, - "weight": 1, - "address": "10.0.1.22", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "protocol_port": 90, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "subnet_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" - } -} diff --git a/api-ref/source/v2/samples/lbaas/member-update-request.json b/api-ref/source/v2/samples/lbaas/member-update-request.json deleted file mode 100644 index b5bf2c8..0000000 --- a/api-ref/source/v2/samples/lbaas/member-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "member": { - "weight": 5 - } -} diff --git a/api-ref/source/v2/samples/lbaas/member-update-response.json b/api-ref/source/v2/samples/lbaas/member-update-response.json deleted file mode 100644 index fe681ac..0000000 --- a/api-ref/source/v2/samples/lbaas/member-update-response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "member": { - "admin_state_up": true, - "weight": 5, - "address": "10.0.1.22", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "protocol_port": 90, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "subnet_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" - } -} diff --git a/api-ref/source/v2/samples/lbaas/members-list-response.json b/api-ref/source/v2/samples/lbaas/members-list-response.json deleted file mode 100644 index f9d99a5..0000000 --- a/api-ref/source/v2/samples/lbaas/members-list-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "members": [ - { - "admin_state_up": true, - "status": "ACTIVE", - "status_description": null, - "weight": 1, - "address": "10.0.1.22", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "protocol_port": 90, - "id": "cf024846-7516-4e3a-b0fb-6590322c836f", - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332" - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/pool-create-request.json b/api-ref/source/v2/samples/lbaas/pool-create-request.json deleted file mode 100644 index fc6de73..0000000 --- a/api-ref/source/v2/samples/lbaas/pool-create-request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pool": { - "admin_state_up": true, - "description": "simple pool", - "lb_algorithm": "ROUND_ROBIN", - "name": "my-pool", - "protocol": "HTTP", - "subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d", - "listener_id": "39de4d56-d663-46e5-85a1-5b9d5fa17829" - } -} diff --git a/api-ref/source/v2/samples/lbaas/pool-create-response.json b/api-ref/source/v2/samples/lbaas/pool-create-response.json deleted file mode 100644 index 7ae2bd6..0000000 --- a/api-ref/source/v2/samples/lbaas/pool-create-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "pool": { - "status": "PENDING_CREATE", - "lb_algorithm": "ROUND_ROBIN", - "protocol": "HTTP", - "description": "simple pool", - "health_monitors": [], - "members": [], - "status_description": null, - "id": "af95e0ce-8a26-4f29-9524-db41e7769c73", - "vip_id": null, - "name": "my-pool", - "admin_state_up": true, - "subnet_id": "e301aed0-d9e7-498a-977c-1bbfaf14ed5d", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "health_monitors_status": [], - "provider": "haproxy" - } -} diff --git a/api-ref/source/v2/samples/lbaas/pool-members-list-response.json b/api-ref/source/v2/samples/lbaas/pool-members-list-response.json deleted file mode 100644 index f0ad50a..0000000 --- a/api-ref/source/v2/samples/lbaas/pool-members-list-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "members": [ - { - "address": "10.0.0.8", - "admin_state_up": true, - "id": "9a7aff27-fd41-4ec1-ba4c-3eb92c629313", - "protocol_port": 80, - "subnet_id": "013d3059-87a4-45a5-91e9-d721068ae0b2", - "project_id": "1a3e005cf9ce40308c900bcb08e5320c", - "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c", - "weight": 1 - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/pool-show-response.json b/api-ref/source/v2/samples/lbaas/pool-show-response.json deleted file mode 100644 index 0cab62e..0000000 --- a/api-ref/source/v2/samples/lbaas/pool-show-response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "pool": { - "status": "ACTIVE", - "lb_algorithm": "ROUND_ROBIN", - "protocol": "HTTP", - "description": "", - "health_monitors": [ - "b7633ade-24dc-4d72-8475-06aa22be5412" - ], - "members": [ - "cf024846-7516-4e3a-b0fb-6590322c836f" - ], - "status_description": null, - "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", - "name": "pool1", - "admin_state_up": true, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "health_monitors_status": [ - { - "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "status": "ACTIVE", - "status_description": null - } - ], - "provider": "haproxy" - } -} diff --git a/api-ref/source/v2/samples/lbaas/pool-update-request.json b/api-ref/source/v2/samples/lbaas/pool-update-request.json deleted file mode 100644 index d523eea..0000000 --- a/api-ref/source/v2/samples/lbaas/pool-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "pool": { - "name": "SuperPool" - } -} diff --git a/api-ref/source/v2/samples/lbaas/pool-update-response.json b/api-ref/source/v2/samples/lbaas/pool-update-response.json deleted file mode 100644 index 4ad5cbb..0000000 --- a/api-ref/source/v2/samples/lbaas/pool-update-response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "pool": { - "status": "PENDING_UPDATE", - "lb_algorithm": "ROUND_ROBIN", - "protocol": "HTTP", - "description": "", - "health_monitors": [ - "b7633ade-24dc-4d72-8475-06aa22be5412" - ], - "members": [ - "cf024846-7516-4e3a-b0fb-6590322c836f" - ], - "status_description": null, - "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", - "name": "SuperPool", - "admin_state_up": true, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "health_monitors_status": [ - { - "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "status": "ACTIVE", - "status_description": null - } - ], - "provider": "haproxy" - } -} diff --git a/api-ref/source/v2/samples/lbaas/pools-list-response.json b/api-ref/source/v2/samples/lbaas/pools-list-response.json deleted file mode 100644 index 4e50835..0000000 --- a/api-ref/source/v2/samples/lbaas/pools-list-response.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "pools": [ - { - "status": "ACTIVE", - "lb_algorithm": "ROUND_ROBIN", - "protocol": "HTTP", - "description": "", - "health_monitors": [ - "b7633ade-24dc-4d72-8475-06aa22be5412" - ], - "members": [ - "cf024846-7516-4e3a-b0fb-6590322c836f" - ], - "status_description": null, - "id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "vip_id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", - "name": "pool1", - "admin_state_up": true, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "health_monitors_status": [ - { - "monitor_id": "b7633ade-24dc-4d72-8475-06aa22be5412", - "status": "ACTIVE", - "status_description": null - } - ], - "provider": "haproxy" - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/pools-list-response2.json b/api-ref/source/v2/samples/lbaas/pools-list-response2.json deleted file mode 100644 index 4f511bc..0000000 --- a/api-ref/source/v2/samples/lbaas/pools-list-response2.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "pools": [ - { - "admin_state_up": true, - "description": "simple pool", - "healthmonitor_id": null, - "id": "4c0a0a5f-cf8f-44b7-b912-957daa8ce5e5", - "lb_algorithm": "ROUND_ROBIN", - "listeners": [ - { - "id": "35cb8516-1173-4035-8dae-0dae3453f37f" - } - ], - "members": [], - "name": "pool1", - "protocol": "HTTP", - "project_id": "1a3e005cf9ce40308c900bcb08e5320c", - "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c" - } - ] -} diff --git a/api-ref/source/v2/samples/lbaas/vip-create-request.json b/api-ref/source/v2/samples/lbaas/vip-create-request.json deleted file mode 100644 index 2dc444c..0000000 --- a/api-ref/source/v2/samples/lbaas/vip-create-request.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "vip": { - "protocol": "HTTP", - "name": "NewVip", - "admin_state_up": true, - "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", - "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", - "protocol_port": "80" - } -} diff --git a/api-ref/source/v2/samples/lbaas/vip-create-response.json b/api-ref/source/v2/samples/lbaas/vip-create-response.json deleted file mode 100644 index ecaea98..0000000 --- a/api-ref/source/v2/samples/lbaas/vip-create-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "vip": { - "status": "PENDING_CREATE", - "protocol": "HTTP", - "description": "", - "address": "10.0.0.4", - "protocol_port": 80, - "port_id": "0ba4cd9c-edb4-4594-bac4-b68b49d5f04c", - "id": "fa0373e0-9dd4-4ff7-98fc-8cceca9bdb4e", - "status_description": null, - "name": "NewVip", - "admin_state_up": true, - "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", - "project_id": "e68c3e65e1f34ee9b2357d0fe418a78b", - "tenant_id": "e68c3e65e1f34ee9b2357d0fe418a78b", - "connection_limit": -1, - "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", - "session_persistence": null - } -} diff --git a/api-ref/source/v2/samples/lbaas/vip-show-response.json b/api-ref/source/v2/samples/lbaas/vip-show-response.json deleted file mode 100644 index fe5d724..0000000 --- a/api-ref/source/v2/samples/lbaas/vip-show-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "vip": { - "status": "ACTIVE", - "protocol": "HTTP", - "description": "", - "address": "10.0.0.4", - "protocol_port": 80, - "port_id": "5328aeea-2988-41c0-b5fe-0fd0660979d3", - "id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", - "status_description": null, - "name": "my-Vip", - "admin_state_up": true, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "connection_limit": -1, - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "session_persistence": null - } -} diff --git a/api-ref/source/v2/samples/lbaas/vip-update-request.json b/api-ref/source/v2/samples/lbaas/vip-update-request.json deleted file mode 100644 index a296936..0000000 --- a/api-ref/source/v2/samples/lbaas/vip-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "vip": { - "connection_limit": "1000" - } -} diff --git a/api-ref/source/v2/samples/lbaas/vip-update-response.json b/api-ref/source/v2/samples/lbaas/vip-update-response.json deleted file mode 100644 index 735a9b2..0000000 --- a/api-ref/source/v2/samples/lbaas/vip-update-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "vip": { - "status": "PENDING_UPDATE", - "protocol": "HTTP", - "description": "", - "address": "10.0.0.4", - "protocol_port": 80, - "port_id": "0ba4cd9c-edb4-4594-bac4-b68b49d5f04c", - "id": "fa0373e0-9dd4-4ff7-98fc-8cceca9bdb4e", - "status_description": null, - "name": "NewVip", - "admin_state_up": true, - "subnet_id": "0ba2ef27-0054-4b28-a8fa-f215e8079272", - "project_id": "e68c3e65e1f34ee9b2357d0fe418a78b", - "tenant_id": "e68c3e65e1f34ee9b2357d0fe418a78b", - "connection_limit": 1000, - "pool_id": "105320c3-8416-4997-9c1c-4098b95fdaca", - "session_persistence": null - } -} diff --git a/api-ref/source/v2/samples/lbaas/vips-list-response.json b/api-ref/source/v2/samples/lbaas/vips-list-response.json deleted file mode 100644 index 0280460..0000000 --- a/api-ref/source/v2/samples/lbaas/vips-list-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "vips": [ - { - "status": "ACTIVE", - "protocol": "HTTP", - "description": "", - "address": "10.0.0.4", - "protocol_port": 80, - "port_id": "5328aeea-2988-41c0-b5fe-0fd0660979d3", - "id": "388c739a-6a57-4e74-bc7b-a5cd60248bba", - "status_description": null, - "name": "my-Vip", - "admin_state_up": true, - "subnet_id": "aa547115-d710-4d6d-bb2c-b038d9c2704b", - "project_id": "eabfefa3fd1740a88a47ad98e132d238", - "tenant_id": "eabfefa3fd1740a88a47ad98e132d238", - "connection_limit": -1, - "pool_id": "5a9a3e9e-d1aa-448e-af37-a70171f2a332", - "session_persistence": null - } - ] -} diff --git a/api-ref/source/v2/samples/logging_resource/logging_resource-create-request.json b/api-ref/source/v2/samples/logging_resource/logging_resource-create-request.json deleted file mode 100644 index a13c906..0000000 --- a/api-ref/source/v2/samples/logging_resource/logging_resource-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "logging_resource": { - "description": "my log", - "enabled": true, - "name": "log" - } -} diff --git a/api-ref/source/v2/samples/logging_resource/logging_resource-create-response.json b/api-ref/source/v2/samples/logging_resource/logging_resource-create-response.json deleted file mode 100644 index d273ab9..0000000 --- a/api-ref/source/v2/samples/logging_resource/logging_resource-create-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "logging_resource": { - "description": "my log", - "enabled": true, - "firewall_logs": [], - "id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "name": "log", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } -} diff --git a/api-ref/source/v2/samples/logging_resource/logging_resource-show-response.json b/api-ref/source/v2/samples/logging_resource/logging_resource-show-response.json deleted file mode 100644 index 6acd165..0000000 --- a/api-ref/source/v2/samples/logging_resource/logging_resource-show-response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "logging_resource": { - "description": "my log", - "enabled": true, - "firewall_logs": [ - { - "description": "", - "firewall_id": "682cfe44-5fcf-4c16-982e-1176493f6825", - "fw_event": "ALL", - "id": "1ee6fea7-c294-418e-9b97-06db48e3f3d5", - "logging_resource_id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } - ], - "id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "name": "log", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } -} diff --git a/api-ref/source/v2/samples/logging_resource/logging_resource-update-request.json b/api-ref/source/v2/samples/logging_resource/logging_resource-update-request.json deleted file mode 100644 index 819310e..0000000 --- a/api-ref/source/v2/samples/logging_resource/logging_resource-update-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "logging_resource": { - "description": "my log2", - "enabled": false - } -} diff --git a/api-ref/source/v2/samples/logging_resource/logging_resource-update-response.json b/api-ref/source/v2/samples/logging_resource/logging_resource-update-response.json deleted file mode 100644 index 5a9baa5..0000000 --- a/api-ref/source/v2/samples/logging_resource/logging_resource-update-response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "logging_resource": { - "description": "my log2", - "enabled": false, - "firewall_logs": [ - { - "description": "", - "firewall_id": "682cfe44-5fcf-4c16-982e-1176493f6825", - "fw_event": "ALL", - "id": "1ee6fea7-c294-418e-9b97-06db48e3f3d5", - "logging_resource_id": "335c7b7d-c4a9-423a-9c24-9f4982f31e24", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } - ], - "id": "335c7b7d-c4a9-423a-9c24-9f4982f31e24", - "name": "log2", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } -} diff --git a/api-ref/source/v2/samples/logging_resource/logging_resources-list-response.json b/api-ref/source/v2/samples/logging_resource/logging_resources-list-response.json deleted file mode 100644 index 03ffca8..0000000 --- a/api-ref/source/v2/samples/logging_resource/logging_resources-list-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "logging_resources": [ - { - "description": "my log", - "enabled": true, - "firewall_logs": [], - "id": "13b64f3c-20af-4741-b230-658ab7d5b257", - "name": "log", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - }, - { - "description": "my log2", - "enabled": true, - "firewall_logs": [], - "id": "335c7b7d-c4a9-423a-9c24-9f4982f31e24", - "name": "log2", - "project_id": "8d018258316e4f22890561e8780c85bb", - "tenant_id": "8d018258316e4f22890561e8780c85bb" - } - ] -} diff --git a/api-ref/source/v2/samples/logs/log-create-request.json b/api-ref/source/v2/samples/logs/log-create-request.json deleted file mode 100644 index 3f94feb..0000000 --- a/api-ref/source/v2/samples/logs/log-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "log": { - "name": "security group log", - "description": "Log for project demo.", - "resource_type": "security_group" - } -} diff --git a/api-ref/source/v2/samples/logs/log-create-response.json b/api-ref/source/v2/samples/logs/log-create-response.json deleted file mode 100644 index 38e1c84..0000000 --- a/api-ref/source/v2/samples/logs/log-create-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "log": { - "name": "security group log", - "description": "Log for project demo.", - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "project_id": "92a5a4f4245a4abbafacb7ca73b027b0", - "tenant_id": "92a5a4f4245a4abbafacb7ca73b027b0", - "enabled": true, - "resource_type": "security_group", - "resource_id": null, - "target_id": null, - "event": "ALL" - } -} diff --git a/api-ref/source/v2/samples/logs/log-list-response.json b/api-ref/source/v2/samples/logs/log-list-response.json deleted file mode 100644 index 011760a..0000000 --- a/api-ref/source/v2/samples/logs/log-list-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "logs": [ - { - "name": "security group log", - "description": "Log for project demo.", - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "project_id": "92a5a4f4245a4abbafacb7ca73b027b0", - "tenant_id": "92a5a4f4245a4abbafacb7ca73b027b0", - "enabled": true, - "resource_type": "security_group", - "resource_id": null, - "target_id": null, - "event": "ALL" - } - ] -} diff --git a/api-ref/source/v2/samples/logs/log-show-response.json b/api-ref/source/v2/samples/logs/log-show-response.json deleted file mode 100644 index c5040ee..0000000 --- a/api-ref/source/v2/samples/logs/log-show-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "log": { - "name": "security group log", - "description": "Log for project demo.", - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "enabled": true, - "resource_type": "security_group", - "resource_id": null, - "target_id": null, - "event": "ACCEPT" - } -} diff --git a/api-ref/source/v2/samples/logs/log-update-request.json b/api-ref/source/v2/samples/logs/log-update-request.json deleted file mode 100644 index 6f39545..0000000 --- a/api-ref/source/v2/samples/logs/log-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "log": { - "enabled": false - } -} diff --git a/api-ref/source/v2/samples/logs/log-update-response.json b/api-ref/source/v2/samples/logs/log-update-response.json deleted file mode 100644 index 270da5d..0000000 --- a/api-ref/source/v2/samples/logs/log-update-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "log": { - "name": "security group log", - "description": "Log for project demo.", - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "enabled": false, - "resource_type": "security_group", - "resource_id": null, - "target_id": null, - "event": "DROP" - } -} diff --git a/api-ref/source/v2/samples/logs/loggable_resources-list-response.json b/api-ref/source/v2/samples/logs/loggable_resources-list-response.json deleted file mode 100644 index 10a8da3..0000000 --- a/api-ref/source/v2/samples/logs/loggable_resources-list-response.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "loggable_resources": [ - { - "type": "security_group" - } - ] -} diff --git a/api-ref/source/v2/samples/metering/metering-label-create-request.json b/api-ref/source/v2/samples/metering/metering-label-create-request.json deleted file mode 100644 index 5bf6500..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-create-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "metering_label": { - "name": "label1", - "description": "description of label1" - } -} diff --git a/api-ref/source/v2/samples/metering/metering-label-create-response.json b/api-ref/source/v2/samples/metering/metering-label-create-response.json deleted file mode 100644 index 15a6b3b..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-create-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "metering_label": { - "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "description": "description of label1", - "name": "label1", - "id": "bc91b832-8465-40a7-a5d8-ba87de442266", - "shared": false - } -} diff --git a/api-ref/source/v2/samples/metering/metering-label-delete-request-json-http.txt b/api-ref/source/v2/samples/metering/metering-label-delete-request-json-http.txt deleted file mode 100644 index 48f7647..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-delete-request-json-http.txt +++ /dev/null @@ -1,6 +0,0 @@ -DELETE /v2.0/metering/metering-labels/a6700594-5b7a-4105-8bfe-723b346ce866 HTTP/1.1 -Host: controlnode:9696 -User-Agent: python-neutronclient -Content-Type: application/json -Accept: application/json -X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 diff --git a/api-ref/source/v2/samples/metering/metering-label-delete-response-json-http.txt b/api-ref/source/v2/samples/metering/metering-label-delete-response-json-http.txt deleted file mode 100644 index bfbfad6..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-delete-response-json-http.txt +++ /dev/null @@ -1 +0,0 @@ -status: 204 diff --git a/api-ref/source/v2/samples/metering/metering-label-rule-create-request.json b/api-ref/source/v2/samples/metering/metering-label-rule-create-request.json deleted file mode 100644 index cac3744..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rule-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "metering_label_rule": { - "remote_ip_prefix": "10.0.1.0/24", - "direction": "ingress", - "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812" - } -} diff --git a/api-ref/source/v2/samples/metering/metering-label-rule-create-response.json b/api-ref/source/v2/samples/metering/metering-label-rule-create-response.json deleted file mode 100644 index 364d102..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rule-create-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "metering_label_rule": { - "remote_ip_prefix": "10.0.1.0/24", - "direction": "ingress", - "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", - "id": "00e13b58-b4f2-4579-9c9c-7ac94615f9ae", - "excluded": false - } -} diff --git a/api-ref/source/v2/samples/metering/metering-label-rule-delete-request-json-http.txt b/api-ref/source/v2/samples/metering/metering-label-rule-delete-request-json-http.txt deleted file mode 100644 index 3b74b68..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rule-delete-request-json-http.txt +++ /dev/null @@ -1,6 +0,0 @@ -DELETE /v2.0/metering/metering-labels/37b31179-71ee-4f0a-b130-0eeb28e7ede7 HTTP/1.1 -Host: controlnode:9696 -User-Agent: python-neutronclient -Content-Type: application/json -Accept: application/json -X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 diff --git a/api-ref/source/v2/samples/metering/metering-label-rule-delete-response-json-http.txt b/api-ref/source/v2/samples/metering/metering-label-rule-delete-response-json-http.txt deleted file mode 100644 index bfbfad6..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rule-delete-response-json-http.txt +++ /dev/null @@ -1 +0,0 @@ -status: 204 diff --git a/api-ref/source/v2/samples/metering/metering-label-rule-show-request-json-http.txt b/api-ref/source/v2/samples/metering/metering-label-rule-show-request-json-http.txt deleted file mode 100644 index 0e3c164..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rule-show-request-json-http.txt +++ /dev/null @@ -1,6 +0,0 @@ -GET /v2.0/metering/metering-label-rules/9536641a-7d14-4dc5-afaf-93a973ce0eb8 HTTP/1.1 -Host: controlnode:9696 -User-Agent: python-neutronclient -Content-Type: application/json -Accept: application/json -X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 diff --git a/api-ref/source/v2/samples/metering/metering-label-rule-show-response.json b/api-ref/source/v2/samples/metering/metering-label-rule-show-response.json deleted file mode 100644 index 4b0c3bc..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rule-show-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "metering_label_rule": { - "remote_ip_prefix": "20.0.0.0/24", - "direction": "ingress", - "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", - "id": "9536641a-7d14-4dc5-afaf-93a973ce0eb8", - "excluded": false - } -} diff --git a/api-ref/source/v2/samples/metering/metering-label-rules-list-request-json-http.txt b/api-ref/source/v2/samples/metering/metering-label-rules-list-request-json-http.txt deleted file mode 100644 index 354d8a5..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rules-list-request-json-http.txt +++ /dev/null @@ -1,6 +0,0 @@ -GET /v2.0/metering/metering-label-rules HTTP/1.1 -Host: controlnode:9696 -User-Agent: python-neutronclient -Content-Type: application/json -Accept: application/json -X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 diff --git a/api-ref/source/v2/samples/metering/metering-label-rules-list-response.json b/api-ref/source/v2/samples/metering/metering-label-rules-list-response.json deleted file mode 100644 index 7144cfa..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-rules-list-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "metering_label_rules": [ - { - "remote_ip_prefix": "20.0.0.0/24", - "direction": "ingress", - "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", - "id": "9536641a-7d14-4dc5-afaf-93a973ce0eb8", - "excluded": false - }, - { - "remote_ip_prefix": "10.0.0.0/24", - "direction": "ingress", - "metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", - "id": "ffc6fd15-40de-4e7d-b617-34d3f7a93aec", - "excluded": false - } - ] -} diff --git a/api-ref/source/v2/samples/metering/metering-label-show-request-json-http.txt b/api-ref/source/v2/samples/metering/metering-label-show-request-json-http.txt deleted file mode 100644 index 7387aeb..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-show-request-json-http.txt +++ /dev/null @@ -1,6 +0,0 @@ -GET /v2.0/metering/metering-labels/a6700594-5b7a-4105-8bfe-723b346ce866 HTTP/1.1 -Host: controlnode:9696 -User-Agent: python-neutronclient -Content-Type: application/json -Accept: application/json -X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 diff --git a/api-ref/source/v2/samples/metering/metering-label-show-response.json b/api-ref/source/v2/samples/metering/metering-label-show-response.json deleted file mode 100644 index b0917c8..0000000 --- a/api-ref/source/v2/samples/metering/metering-label-show-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "metering_label": { - "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "description": "label1 description", - "name": "label1", - "id": "a6700594-5b7a-4105-8bfe-723b346ce866", - "shared": false - } -} diff --git a/api-ref/source/v2/samples/metering/metering-labels-list-request-json-http.txt b/api-ref/source/v2/samples/metering/metering-labels-list-request-json-http.txt deleted file mode 100644 index e1df3f2..0000000 --- a/api-ref/source/v2/samples/metering/metering-labels-list-request-json-http.txt +++ /dev/null @@ -1,6 +0,0 @@ -GET /v2.0/metering/metering-labels HTTP/1.1 -Host: controlnode:9696 -User-Agent: python-neutronclient -Content-Type: application/json -Accept: application/json -X-Auth-Token: c52a1b304fec4ca0ac85dc1741eec6e2 diff --git a/api-ref/source/v2/samples/metering/metering-labels-list-response.json b/api-ref/source/v2/samples/metering/metering-labels-list-response.json deleted file mode 100644 index c26988c..0000000 --- a/api-ref/source/v2/samples/metering/metering-labels-list-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "metering_labels": [ - { - "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "description": "label1 description", - "name": "label1", - "id": "a6700594-5b7a-4105-8bfe-723b346ce866", - "shared": false - }, - { - "project_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "tenant_id": "45345b0ee1ea477fac0f541b2cb79cd4", - "description": "label2 description", - "name": "label2", - "id": "e131d186-b02d-4c0b-83d5-0c0725c4f812", - "shared": false - } - ] -} diff --git a/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-list.json b/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-list.json deleted file mode 100644 index 59d68ef..0000000 --- a/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-list.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "network_ip_availabilities": [ - { - "network_id": "4cf895c9-c3d1-489e-b02e-59b5c8976809", - "network_name": "public", - "subnet_ip_availability": [ - { - "cidr": "2001:db8::/64", - "ip_version": 6, - "subnet_id": "ca3f46c4-c6ff-4272-9be4-0466f84c6077", - "subnet_name": "ipv6-public-subnet", - "total_ips": 18446744073709552000, - "used_ips": 1 - }, - { - "cidr": "172.24.4.0/24", - "ip_version": 4, - "subnet_id": "cc02efc1-9d47-46bd-bab6-760919c836b5", - "subnet_name": "public-subnet", - "total_ips": 253, - "used_ips": 1 - } - ], - "project_id": "1a02cc95f1734fcc9d3c753818f03002", - "tenant_id": "1a02cc95f1734fcc9d3c753818f03002", - "total_ips": 253, - "used_ips": 2 - }, - { - "network_id": "6801d9c8-20e6-4b27-945d-62499f00002e", - "network_name": "private", - "subnet_ip_availability": [ - { - "cidr": "10.0.0.0/24", - "ip_version": 4, - "subnet_id": "44e70d00-80a2-4fb1-ab59-6190595ceb61", - "subnet_name": "private-subnet", - "total_ips": 253, - "used_ips": 2 - }, - { - "ip_version": 6, - "cidr": "fdbf:ac66:9be8::/64", - "subnet_id": "a90623df-00e1-4902-a675-40674385d74c", - "subnet_name": "ipv6-private-subnet", - "total_ips": 18446744073709552000, - "used_ips": 2 - } - ], - "project_id": "d56d3b8dd6894a508cf41b96b522328c", - "tenant_id": "d56d3b8dd6894a508cf41b96b522328c", - "total_ips": 18446744073709552000, - "used_ips": 4 - } - ] -} diff --git a/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-show.json b/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-show.json deleted file mode 100644 index 33cbbee..0000000 --- a/api-ref/source/v2/samples/network-ip-availability/network-ip-availability-show.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "network_ip_availability": { - "used_ips": 4, - "subnet_ip_availability": [ - { - "used_ips": 2, - "subnet_id": "44e70d00-80a2-4fb1-ab59-6190595ceb61", - "subnet_name": "private-subnet", - "ip_version": 4, - "cidr": "10.0.0.0/24", - "total_ips": 253 - }, - { - "used_ips": 2, - "subnet_id": "a90623df-00e1-4902-a675-40674385d74c", - "subnet_name": "ipv6-private-subnet", - "ip_version": 6, - "cidr": "fdbf:ac66:9be8::/64", - "total_ips": 18446744073709552000 - } - ], - "network_id": "6801d9c8-20e6-4b27-945d-62499f00002e", - "project_id": "d56d3b8dd6894a508cf41b96b522328c", - "tenant_id": "d56d3b8dd6894a508cf41b96b522328c", - "total_ips": 18446744073709552000, - "network_name": "private" - } -} diff --git a/api-ref/source/v2/samples/networks/network-create-request.json b/api-ref/source/v2/samples/networks/network-create-request.json deleted file mode 100644 index 7d339cf..0000000 --- a/api-ref/source/v2/samples/networks/network-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "network": { - "name": "sample_network", - "admin_state_up": true, - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" - } -} diff --git a/api-ref/source/v2/samples/networks/network-create-response.json b/api-ref/source/v2/samples/networks/network-create-response.json deleted file mode 100644 index 778bd63..0000000 --- a/api-ref/source/v2/samples/networks/network-create-response.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "network": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", - "mtu": 1500, - "name": "net1", - "port_security_enabled": true, - "project_id": "9bacb3c5d39d41a79512987f338cf177", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [], - "tenant_id": "9bacb3c5d39d41a79512987f338cf177", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } -} diff --git a/api-ref/source/v2/samples/networks/network-multi-create-request.json b/api-ref/source/v2/samples/networks/network-multi-create-request.json deleted file mode 100644 index 2e19b98..0000000 --- a/api-ref/source/v2/samples/networks/network-multi-create-request.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "network": { - "segments": [ - { - "provider:segmentation_id": 2, - "provider:physical_network": "public", - "provider:network_type": "vlan" - }, - { - "provider:physical_network": "default", - "provider:network_type": "flat" - } - ], - "name": "net1", - "admin_state_up": true, - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" - } -} diff --git a/api-ref/source/v2/samples/networks/network-multi-create-response.json b/api-ref/source/v2/samples/networks/network-multi-create-response.json deleted file mode 100644 index 212e30f..0000000 --- a/api-ref/source/v2/samples/networks/network-multi-create-response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "network": { - "status": "ACTIVE", - "subnets": [], - "name": "net1", - "admin_state_up": true, - "project_id": "9bacb3c5d39d41a79512987f338cf177", - "tenant_id": "9bacb3c5d39d41a79512987f338cf177", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "segments": [ - { - "provider:segmentation_id": 2, - "provider:physical_network": "public", - "provider:network_type": "vlan" - }, - { - "provider:segmentation_id": null, - "provider:physical_network": "default", - "provider:network_type": "flat" - } - ], - "shared": false, - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/networks/network-multi-show-response.json b/api-ref/source/v2/samples/networks/network-multi-show-response.json deleted file mode 100644 index d823b66..0000000 --- a/api-ref/source/v2/samples/networks/network-multi-show-response.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "network": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", - "mtu": 1500, - "name": "net1", - "port_security_enabled": true, - "project_id": "9bacb3c5d39d41a79512987f338cf177", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "segments": [ - { - "provider:network_type": "vlan", - "provider:physical_network": "public", - "provider:segmentation_id": 2 - }, - { - "provider:network_type": "flat", - "provider:physical_network": "default", - "provider:segmentation_id": 0 - } - ], - "shared": false, - "status": "ACTIVE", - "subnets": [ - "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" - ], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } -} diff --git a/api-ref/source/v2/samples/networks/network-multi-update-request.json b/api-ref/source/v2/samples/networks/network-multi-update-request.json deleted file mode 100644 index ba22471..0000000 --- a/api-ref/source/v2/samples/networks/network-multi-update-request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "network": { - "segments": [ - { - "provider:segmentation_id": 2, - "provider:physical_network": "public", - "provider:network_type": "vlan" - }, - { - "provider:physical_network": "default", - "provider:network_type": "flat" - } - ] - } -} diff --git a/api-ref/source/v2/samples/networks/network-provider-create-request.json b/api-ref/source/v2/samples/networks/network-provider-create-request.json deleted file mode 100644 index 3957e3f..0000000 --- a/api-ref/source/v2/samples/networks/network-provider-create-request.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "network": { - "admin_state_up": true, - "name": "net1", - "provider:network_type": "vlan", - "provider:physical_network": "public", - "provider:segmentation_id": 2, - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" - } -} diff --git a/api-ref/source/v2/samples/networks/network-provider-create-response.json b/api-ref/source/v2/samples/networks/network-provider-create-response.json deleted file mode 100644 index 8a75382..0000000 --- a/api-ref/source/v2/samples/networks/network-provider-create-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "network": { - "status": "ACTIVE", - "subnets": [], - "availability_zone_hints": [], - "name": "net1", - "provider:physical_network": "public", - "admin_state_up": true, - "project_id": "9bacb3c5d39d41a79512987f338cf177", - "tenant_id": "9bacb3c5d39d41a79512987f338cf177", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "provider:network_type": "vlan", - "mtu": 1500, - "shared": false, - "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c", - "provider:segmentation_id": 2, - "description": "" - } -} diff --git a/api-ref/source/v2/samples/networks/network-provider-show-response.json b/api-ref/source/v2/samples/networks/network-provider-show-response.json deleted file mode 100644 index f782c64..0000000 --- a/api-ref/source/v2/samples/networks/network-provider-show-response.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "network": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "mtu": 1500, - "name": "private-network", - "port_security_enabled": true, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "provider:network_type": "local", - "provider:physical_network": null, - "provider:segmentation_id": null, - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": true, - "status": "ACTIVE", - "subnets": [ - "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" - ], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } -} diff --git a/api-ref/source/v2/samples/networks/network-provider-update-request.json b/api-ref/source/v2/samples/networks/network-provider-update-request.json deleted file mode 100644 index 7d1e1a5..0000000 --- a/api-ref/source/v2/samples/networks/network-provider-update-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "network": { - "provider:network_type": "vlan", - "provider:physical_network": "public", - "provider:segmentation_id": 2 - } -} diff --git a/api-ref/source/v2/samples/networks/network-show-response.json b/api-ref/source/v2/samples/networks/network-show-response.json deleted file mode 100644 index 5a41810..0000000 --- a/api-ref/source/v2/samples/networks/network-show-response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "network": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "mtu": 1500, - "name": "private-network", - "port_security_enabled": true, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": true, - "status": "ACTIVE", - "subnets": [ - "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" - ], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } -} diff --git a/api-ref/source/v2/samples/networks/network-update-request.json b/api-ref/source/v2/samples/networks/network-update-request.json deleted file mode 100644 index c0da18d..0000000 --- a/api-ref/source/v2/samples/networks/network-update-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "network": { - "name": "sample_network_5_updated", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" - } -} diff --git a/api-ref/source/v2/samples/networks/network-update-response.json b/api-ref/source/v2/samples/networks/network-update-response.json deleted file mode 100644 index a5f41b9..0000000 --- a/api-ref/source/v2/samples/networks/network-update-response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "network": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "1f370095-98f6-4079-be64-6d3d4a6adcc6", - "mtu": 1500, - "name": "sample_network_5_updated", - "port_security_enabled": true, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [ - "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" - ], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } -} diff --git a/api-ref/source/v2/samples/networks/networks-bulk-create-request.json b/api-ref/source/v2/samples/networks/networks-bulk-create-request.json deleted file mode 100644 index 59212ee..0000000 --- a/api-ref/source/v2/samples/networks/networks-bulk-create-request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "networks": [ - { - "admin_state_up": true, - "name": "sample_network3", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" - }, - { - "admin_state_up": true, - "name": "sample_network4", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e" - } - ] -} diff --git a/api-ref/source/v2/samples/networks/networks-bulk-create-response.json b/api-ref/source/v2/samples/networks/networks-bulk-create-response.json deleted file mode 100644 index 4b987ac..0000000 --- a/api-ref/source/v2/samples/networks/networks-bulk-create-response.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "networks": [ - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "bc1a76cb-8767-4c3a-bb95-018b822f2130", - "mtu": 1500, - "name": "sample_network3", - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - }, - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "af374017-c9ae-4a1d-b799-ab73111476e2", - "mtu": 1500, - "name": "sample_network4", - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/networks/networks-list-response.json b/api-ref/source/v2/samples/networks/networks-list-response.json deleted file mode 100644 index d4f86b5..0000000 --- a/api-ref/source/v2/samples/networks/networks-list-response.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "networks": [ - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "mtu": 1500, - "name": "net1", - "port_security_enabled": true, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e", - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [ - "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" - ], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": true, - "description": "" - }, - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", - "mtu": 1500, - "name": "net2", - "port_security_enabled": true, - "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819", - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [ - "08eae331-0402-425a-923c-34f7cfe39c1b" - ], - "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/networks/networks-provider-list-response.json b/api-ref/source/v2/samples/networks/networks-provider-list-response.json deleted file mode 100644 index 87d0120..0000000 --- a/api-ref/source/v2/samples/networks/networks-provider-list-response.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "networks": [ - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "created_at": "2016-03-08T20:19:41", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "mtu": 1500, - "name": "net1", - "port_security_enabled": true, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "provider:network_type": "vlan", - "provider:physical_network": "public", - "provider:segmentation_id": 3, - "router:external": false, - "shared": false, - "status": "ACTIVE", - "subnets": [ - "54d6f61d-db07-451c-9ab3-b9609b6b6f0b" - ], - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": true, - "description": "" - }, - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", - "mtu": 1450, - "name": "net2", - "port_security_enabled": true, - "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "provider:network_type": "local", - "provider:physical_network": null, - "provider:segmentation_id": null, - "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819", - "router:external": false, - "segments": [ - { - "provider:network_type": "vlan", - "provider:physical_network": "public", - "provider:segmentation_id": 2 - }, - { - "provider:network_type": "vxlan", - "provider:physical_network": "default", - "provider:segmentation_id": 1000 - } - ], - "shared": false, - "status": "ACTIVE", - "subnets": [ - "08eae331-0402-425a-923c-34f7cfe39c1b" - ], - "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "updated_at": "2016-03-08T20:19:41", - "vlan_transparent": false, - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/networks/version-show-response.json b/api-ref/source/v2/samples/networks/version-show-response.json deleted file mode 100644 index ad6369a..0000000 --- a/api-ref/source/v2/samples/networks/version-show-response.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "resources": [ - { - "links": [ - { - "href": "http://23.253.228.211:9696/v2.0/subnets", - "rel": "self" - } - ], - "name": "subnet", - "collection": "subnets" - }, - { - "links": [ - { - "href": "http://23.253.228.211:9696/v2.0/networks", - "rel": "self" - } - ], - "name": "network", - "collection": "networks" - }, - { - "links": [ - { - "href": "http://23.253.228.211:9696/v2.0/ports", - "rel": "self" - } - ], - "name": "port", - "collection": "ports" - } - ] -} diff --git a/api-ref/source/v2/samples/networks/versions-list-response.json b/api-ref/source/v2/samples/networks/versions-list-response.json deleted file mode 100644 index a20ed98..0000000 --- a/api-ref/source/v2/samples/networks/versions-list-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "versions": [ - { - "status": "CURRENT", - "id": "v2.0", - "links": [ - { - "href": "http://23.253.228.211:9696/v2.0", - "rel": "self" - } - ] - } - ] -} diff --git a/api-ref/source/v2/samples/ports/port-bind-create-request.json b/api-ref/source/v2/samples/ports/port-bind-create-request.json deleted file mode 100644 index cbe8734..0000000 --- a/api-ref/source/v2/samples/ports/port-bind-create-request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "port": { - "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad", - "binding:profile": { - "local_link_information": [ - { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - } - ] - }, - "binding:vnic_type": "baremetal", - "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "device_owner": "baremetal:none" - } -} diff --git a/api-ref/source/v2/samples/ports/port-bind-create-response.json b/api-ref/source/v2/samples/ports/port-bind-create-response.json deleted file mode 100644 index 49aa8b6..0000000 --- a/api-ref/source/v2/samples/ports/port-bind-create-response.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "allowed_address_pairs": [], - "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad", - "binding:profile": { - "local_link_information": [ - { - "port_id": "Ethernet3/1", - "switch_id": "0a:1b:2c:3d:4e:5f", - "switch_info": "switch1" - } - ] - }, - "binding:vif_details": {}, - "binding:vif_type": "unbound", - "binding:vnic_type": "other", - "data_plane_status": null, - "description": "", - "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "device_owner": "baremetal:none", - "fixed_ips": [ - { - "ip_address": "10.0.0.2", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "65c0ee9f-d634-4522-8954-51021b570b0d", - "mac_address": "fa:16:3e:c9:cb:f0", - "name": "private-port", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", - "security_groups": [ - "f0ac4394-7e4a-4409-9701-ba8be283dbc3" - ], - "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" - } -} diff --git a/api-ref/source/v2/samples/ports/port-bind-show-response.json b/api-ref/source/v2/samples/ports/port-bind-show-response.json deleted file mode 100644 index 24961d5..0000000 --- a/api-ref/source/v2/samples/ports/port-bind-show-response.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "allowed_address_pairs": [], - "binding:host_id": "devstack", - "binding:profile": {}, - "binding:vif_details": { - "ovs_hybrid_plug": true, - "port_filter": true - }, - "binding:vif_type": "ovs", - "binding:vnic_type": "normal", - "created_at": "2016-03-08T20:19:41", - "data_plane_status": "ACTIVE", - "description": "", - "device_id": "5e3898d7-11be-483e-9732-b2f5eccd2b2e", - "device_owner": "network:router_interface", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "10.0.0.1", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2", - "mac_address": "fa:16:3e:23:fd:d7", - "name": "", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "port_security_enabled": false, - "project_id": "7e02058126cc4950b75f9970368ba177", - "security_groups": [], - "status": "ACTIVE", - "tenant_id": "7e02058126cc4950b75f9970368ba177", - "updated_at": "2016-03-08T20:19:41" - } -} diff --git a/api-ref/source/v2/samples/ports/port-bind-update-request.json b/api-ref/source/v2/samples/ports/port-bind-update-request.json deleted file mode 100644 index 4118974..0000000 --- a/api-ref/source/v2/samples/ports/port-bind-update-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "port": { - "binding:host_id": "test_for_port_update_host", - "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "data_plane_status": "DOWN", - "device_owner": "compute:nova" - } -} diff --git a/api-ref/source/v2/samples/ports/port-bind-update-response.json b/api-ref/source/v2/samples/ports/port-bind-update-response.json deleted file mode 100644 index a515f30..0000000 --- a/api-ref/source/v2/samples/ports/port-bind-update-response.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "allowed_address_pairs": [], - "binding:host_id": "test_for_port_update_host", - "binding:profile": {}, - "binding:vif_details": {}, - "binding:vif_type": "binding_failed", - "binding:vnic_type": "normal", - "data_plane_status": "DOWN", - "description": "", - "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "device_owner": "compute:nova", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "20.20.0.4", - "subnet_id": "898dec4a-74df-4193-985f-c76721bcc746" - } - ], - "id": "43c831e0-19ce-4a76-9a49-57b57e69428b", - "mac_address": "fa:16:3e:11:11:5e", - "name": "test-for-port-update", - "network_id": "883fc383-5ea1-4c8b-8916-e1ddb0a9f365", - "project_id": "522eda8d23124b25bf03fe44f1986b74", - "security_groups": [ - "ce0179d6-8a94-4f7c-91c2-f3038e2acbd0" - ], - "status": "DOWN", - "tenant_id": "522eda8d23124b25bf03fe44f1986b74" - } -} diff --git a/api-ref/source/v2/samples/ports/port-create-request.json b/api-ref/source/v2/samples/ports/port-create-request.json deleted file mode 100644 index 7557c56..0000000 --- a/api-ref/source/v2/samples/ports/port-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "name": "private-port", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7" - } -} diff --git a/api-ref/source/v2/samples/ports/port-create-response.json b/api-ref/source/v2/samples/ports/port-create-response.json deleted file mode 100644 index 3d64312..0000000 --- a/api-ref/source/v2/samples/ports/port-create-response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "allowed_address_pairs": [], - "created_at": "2016-03-08T20:19:41", - "data_plane_status": null, - "description": "", - "device_id": "", - "device_owner": "", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "10.0.0.2", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "65c0ee9f-d634-4522-8954-51021b570b0d", - "mac_address": "fa:16:3e:c9:cb:f0", - "name": "private-port", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "port_security_enabled": true, - "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", - "security_groups": [ - "f0ac4394-7e4a-4409-9701-ba8be283dbc3" - ], - "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", - "updated_at": "2016-03-08T20:19:41" - } -} diff --git a/api-ref/source/v2/samples/ports/port-show-response.json b/api-ref/source/v2/samples/ports/port-show-response.json deleted file mode 100644 index 1469d71..0000000 --- a/api-ref/source/v2/samples/ports/port-show-response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "allowed_address_pairs": [], - "created_at": "2016-03-08T20:19:41", - "data_plane_status": "ACTIVE", - "description": "", - "device_id": "5e3898d7-11be-483e-9732-b2f5eccd2b2e", - "device_owner": "network:router_interface", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "10.0.0.1", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2", - "mac_address": "fa:16:3e:23:fd:d7", - "name": "", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "port_security_enabled": false, - "project_id": "7e02058126cc4950b75f9970368ba177", - "security_groups": [], - "status": "ACTIVE", - "tenant_id": "7e02058126cc4950b75f9970368ba177", - "updated_at": "2016-03-08T20:19:41" - } -} diff --git a/api-ref/source/v2/samples/ports/port-update-request.json b/api-ref/source/v2/samples/ports/port-update-request.json deleted file mode 100644 index a1b6f72..0000000 --- a/api-ref/source/v2/samples/ports/port-update-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "device_owner": "compute:nova", - "name": "test-for-port-update" - } -} diff --git a/api-ref/source/v2/samples/ports/port-update-response.json b/api-ref/source/v2/samples/ports/port-update-response.json deleted file mode 100644 index 22a0a7d..0000000 --- a/api-ref/source/v2/samples/ports/port-update-response.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "port": { - "admin_state_up": true, - "allowed_address_pairs": [], - "binding:host_id": "test_for_port_update_host", - "binding:profile": {}, - "binding:vif_details": {}, - "binding:vif_type": "binding_failed", - "binding:vnic_type": "normal", - "data_plane_status": "ACTIVE", - "description": "", - "device_id": "d90a13da-be41-461f-9f99-1dbcf438fdf2", - "device_owner": "compute:nova", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "20.20.0.4", - "subnet_id": "898dec4a-74df-4193-985f-c76721bcc746" - } - ], - "id": "43c831e0-19ce-4a76-9a49-57b57e69428b", - "mac_address": "fa:16:3e:11:11:5e", - "name": "test-for-port-update", - "network_id": "883fc383-5ea1-4c8b-8916-e1ddb0a9f365", - "project_id": "522eda8d23124b25bf03fe44f1986b74", - "security_groups": [ - "ce0179d6-8a94-4f7c-91c2-f3038e2acbd0" - ], - "status": "DOWN", - "tenant_id": "522eda8d23124b25bf03fe44f1986b74" - } -} diff --git a/api-ref/source/v2/samples/ports/ports-bind-list-response.json b/api-ref/source/v2/samples/ports/ports-bind-list-response.json deleted file mode 100644 index d4ea09f..0000000 --- a/api-ref/source/v2/samples/ports/ports-bind-list-response.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "ports": [ - { - "admin_state_up": true, - "allowed_address_pairs": [], - "binding:host_id": "devstack", - "binding:profile": {}, - "binding:vif_details": { - "ovs_hybrid_plug": true, - "port_filter": true - }, - "binding:vif_type": "ovs", - "binding:vnic_type": "normal", - "data_plane_status": null, - "description": "", - "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", - "device_owner": "network:router_gateway", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "172.24.4.2", - "subnet_id": "008ba151-0b8c-4a67-98b5-0d2b87666062" - } - ], - "id": "d80b1a3b-4fc1-49f3-952e-1e2ab7081d8b", - "mac_address": "fa:16:3e:58:42:ed", - "name": "", - "network_id": "70c1db1f-b701-45bd-96e0-a313ee3430b3", - "port_security_enabled": true, - "project_id": "", - "security_groups": [], - "status": "ACTIVE", - "tenant_id": "" - }, - { - "admin_state_up": true, - "allowed_address_pairs": [], - "binding:host_id": "devstack", - "binding:profile": {}, - "binding:vif_details": { - "ovs_hybrid_plug": true, - "port_filter": true - }, - "binding:vif_type": "ovs", - "binding:vnic_type": "normal", - "data_plane_status": null, - "description": "", - "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", - "device_owner": "network:router_interface", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "10.0.0.1", - "subnet_id": "288bf4a1-51ba-43b6-9d0a-520e9005db17" - } - ], - "id": "f71a6703-d6de-4be1-a91a-a570ede1d159", - "mac_address": "fa:16:3e:bb:3c:e4", - "name": "", - "network_id": "f27aa545-cbdd-4907-b0c6-c9e8b039dcc2", - "port_security_enabled": true, - "project_id": "d397de8a63f341818f198abb0966f6f3", - "security_groups": [], - "status": "ACTIVE", - "tenant_id": "d397de8a63f341818f198abb0966f6f3" - } - ] -} diff --git a/api-ref/source/v2/samples/ports/ports-bulk-create-request.json b/api-ref/source/v2/samples/ports/ports-bulk-create-request.json deleted file mode 100644 index 9e5e341..0000000 --- a/api-ref/source/v2/samples/ports/ports-bulk-create-request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ports": [ - { - "admin_state_up": false, - "name": "sample_port_1", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7" - }, - { - "admin_state_up": false, - "name": "sample_port_2", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7" - } - ] -} diff --git a/api-ref/source/v2/samples/ports/ports-bulk-create-response.json b/api-ref/source/v2/samples/ports/ports-bulk-create-response.json deleted file mode 100644 index 6bc894b..0000000 --- a/api-ref/source/v2/samples/ports/ports-bulk-create-response.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "ports": [ - { - "admin_state_up": false, - "allowed_address_pairs": [], - "data_plane_status": null, - "description": "", - "device_id": "", - "device_owner": "", - "fixed_ips": [ - { - "ip_address": "10.0.0.5", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "94225baa-9d3f-4b93-bf12-b41e7ce49cdb", - "mac_address": "fa:16:3e:48:b8:9f", - "name": "sample_port_1", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", - "security_groups": [ - "f0ac4394-7e4a-4409-9701-ba8be283dbc3" - ], - "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" - }, - { - "admin_state_up": false, - "allowed_address_pairs": [], - "data_plane_status": null, - "description": "", - "device_id": "", - "device_owner": "", - "fixed_ips": [ - { - "ip_address": "10.0.0.6", - "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" - } - ], - "id": "235b09e0-63c4-47f1-b221-66ba54c21760", - "mac_address": "fa:16:3e:f4:73:df", - "name": "sample_port_2", - "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", - "project_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", - "security_groups": [ - "f0ac4394-7e4a-4409-9701-ba8be283dbc3" - ], - "status": "DOWN", - "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa" - } - ] -} diff --git a/api-ref/source/v2/samples/ports/ports-list-response.json b/api-ref/source/v2/samples/ports/ports-list-response.json deleted file mode 100644 index b44f3a2..0000000 --- a/api-ref/source/v2/samples/ports/ports-list-response.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "ports": [ - { - "admin_state_up": true, - "allowed_address_pairs": [], - "data_plane_status": null, - "description": "", - "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", - "device_owner": "network:router_gateway", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "172.24.4.2", - "subnet_id": "008ba151-0b8c-4a67-98b5-0d2b87666062" - } - ], - "id": "d80b1a3b-4fc1-49f3-952e-1e2ab7081d8b", - "mac_address": "fa:16:3e:58:42:ed", - "name": "", - "network_id": "70c1db1f-b701-45bd-96e0-a313ee3430b3", - "project_id": "", - "security_groups": [], - "status": "ACTIVE", - "tenant_id": "" - }, - { - "admin_state_up": true, - "allowed_address_pairs": [], - "data_plane_status": null, - "description": "", - "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", - "device_owner": "network:router_interface", - "extra_dhcp_opts": [], - "fixed_ips": [ - { - "ip_address": "10.0.0.1", - "subnet_id": "288bf4a1-51ba-43b6-9d0a-520e9005db17" - } - ], - "id": "f71a6703-d6de-4be1-a91a-a570ede1d159", - "mac_address": "fa:16:3e:bb:3c:e4", - "name": "", - "network_id": "f27aa545-cbdd-4907-b0c6-c9e8b039dcc2", - "project_id": "d397de8a63f341818f198abb0966f6f3", - "security_groups": [], - "status": "ACTIVE", - "tenant_id": "d397de8a63f341818f198abb0966f6f3" - } - ] -} diff --git a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-request.json b/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-request.json deleted file mode 100644 index 8234acf..0000000 --- a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "bandwidth_limit_rule": { - "max_kbps": "10000" - } -} diff --git a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-response.json b/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-response.json deleted file mode 100644 index 868e484..0000000 --- a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-create-response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "bandwidth_limit_rule": { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", - "max_kbps": 10000, - "max_burst_kbps": 0, - "direction": "egress" - } -} diff --git a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-show-response.json b/api-ref/source/v2/samples/qos/bandwidth_limit_rule-show-response.json deleted file mode 100644 index 868e484..0000000 --- a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-show-response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "bandwidth_limit_rule": { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", - "max_kbps": 10000, - "max_burst_kbps": 0, - "direction": "egress" - } -} diff --git a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-request.json b/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-request.json deleted file mode 100644 index 8234acf..0000000 --- a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "bandwidth_limit_rule": { - "max_kbps": "10000" - } -} diff --git a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-response.json b/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-response.json deleted file mode 100644 index 868e484..0000000 --- a/api-ref/source/v2/samples/qos/bandwidth_limit_rule-update-response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "bandwidth_limit_rule": { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", - "max_kbps": 10000, - "max_burst_kbps": 0, - "direction": "egress" - } -} diff --git a/api-ref/source/v2/samples/qos/bandwidth_limit_rules-list-response.json b/api-ref/source/v2/samples/qos/bandwidth_limit_rules-list-response.json deleted file mode 100644 index a7a9590..0000000 --- a/api-ref/source/v2/samples/qos/bandwidth_limit_rules-list-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "bandwidth_limit_rules": [ - { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", - "max_kbps": 10000, - "max_burst_kbps": 0, - "direction": "egress" - } - ] -} diff --git a/api-ref/source/v2/samples/qos/dscp_marking_rule-create-request.json b/api-ref/source/v2/samples/qos/dscp_marking_rule-create-request.json deleted file mode 100644 index f33c4df..0000000 --- a/api-ref/source/v2/samples/qos/dscp_marking_rule-create-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dscp_marking_rule": { - "dscp_mark": "26" - } -} diff --git a/api-ref/source/v2/samples/qos/dscp_marking_rule-create-response.json b/api-ref/source/v2/samples/qos/dscp_marking_rule-create-response.json deleted file mode 100644 index b80a1d0..0000000 --- a/api-ref/source/v2/samples/qos/dscp_marking_rule-create-response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dscp_marking_rule": { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", - "dscp_mark": 26 - } -} diff --git a/api-ref/source/v2/samples/qos/dscp_marking_rule-show-response.json b/api-ref/source/v2/samples/qos/dscp_marking_rule-show-response.json deleted file mode 100644 index b80a1d0..0000000 --- a/api-ref/source/v2/samples/qos/dscp_marking_rule-show-response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dscp_marking_rule": { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", - "dscp_mark": 26 - } -} diff --git a/api-ref/source/v2/samples/qos/dscp_marking_rule-update-request.json b/api-ref/source/v2/samples/qos/dscp_marking_rule-update-request.json deleted file mode 100644 index 8d56a5d..0000000 --- a/api-ref/source/v2/samples/qos/dscp_marking_rule-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dscp_marking_rule": { - "dscp_mark": "16" - } -} diff --git a/api-ref/source/v2/samples/qos/dscp_marking_rule-update-response.json b/api-ref/source/v2/samples/qos/dscp_marking_rule-update-response.json deleted file mode 100644 index 5401edc..0000000 --- a/api-ref/source/v2/samples/qos/dscp_marking_rule-update-response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dscp_marking_rule": { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", - "dscp_mark": 16 - } -} diff --git a/api-ref/source/v2/samples/qos/dscp_marking_rules-list-response.json b/api-ref/source/v2/samples/qos/dscp_marking_rules-list-response.json deleted file mode 100644 index 39a84cb..0000000 --- a/api-ref/source/v2/samples/qos/dscp_marking_rules-list-response.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dscp_marking_rules": [ - { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", - "dscp_mark": 26 - } - ] -} diff --git a/api-ref/source/v2/samples/qos/policies-list-response.json b/api-ref/source/v2/samples/qos/policies-list-response.json deleted file mode 100644 index 0e507f1..0000000 --- a/api-ref/source/v2/samples/qos/policies-list-response.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "policies": [ - { - "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "name": "10Mbit", - "description": "This policy limits the ports to 10Mbit max.", - "shared": false, - "rules": [ - { - "max_kbps": 10000, - "type": "bandwidth_limit", - "id": "b1866696-032a-4228-857f-846075f63487", - "max_burst_kbps": 0, - "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4" - }, - { - "dscp_mark": 20, - "type": "dscp_marking", - "id": "d9c021d5-5433-4d7c-8bfa-69cca486aac8", - "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4" - } - ] - } - ] -} diff --git a/api-ref/source/v2/samples/qos/policy-create-request.json b/api-ref/source/v2/samples/qos/policy-create-request.json deleted file mode 100644 index da99be2..0000000 --- a/api-ref/source/v2/samples/qos/policy-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "policy": { - "name": "10Mbit", - "description": "This policy limits the ports to 10Mbit max.", - "shared": false - } -} diff --git a/api-ref/source/v2/samples/qos/policy-create-response.json b/api-ref/source/v2/samples/qos/policy-create-response.json deleted file mode 100644 index 3979010..0000000 --- a/api-ref/source/v2/samples/qos/policy-create-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "policy": { - "name": "10Mbit", - "description": "This policy limits the ports to 10Mbit max.", - "rules": [], - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "shared": false - } -} diff --git a/api-ref/source/v2/samples/qos/policy-show-response.json b/api-ref/source/v2/samples/qos/policy-show-response.json deleted file mode 100644 index e732df8..0000000 --- a/api-ref/source/v2/samples/qos/policy-show-response.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "policy": { - "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "name": "10Mbit", - "description": "This policy limits the ports to 10Mbit max.", - "shared": false, - "rules": [ - { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c793", - "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "max_kbps": 10000, - "max_burst_kbps": 0, - "type": "bandwidth_limit" - }, - { - "id": "5f126d84-551a-4dcf-bb01-0e9c0df0c794", - "qos_policy_id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "dscp_mark": 26, - "type": "dscp_marking" - } - ] - } -} diff --git a/api-ref/source/v2/samples/qos/policy-update-request.json b/api-ref/source/v2/samples/qos/policy-update-request.json deleted file mode 100644 index da99be2..0000000 --- a/api-ref/source/v2/samples/qos/policy-update-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "policy": { - "name": "10Mbit", - "description": "This policy limits the ports to 10Mbit max.", - "shared": false - } -} diff --git a/api-ref/source/v2/samples/qos/policy-update-response.json b/api-ref/source/v2/samples/qos/policy-update-response.json deleted file mode 100644 index ab0d6b9..0000000 --- a/api-ref/source/v2/samples/qos/policy-update-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "policy": { - "name": "10Mbit", - "description": "This policy limits the ports to 10Mbit max.", - "id": "46ebaec0-0570-43ac-82f6-60d2b03168c4", - "project_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "tenant_id": "8d4c70a21fed4aeba121a1a429ba0d04", - "shared": false - } -} diff --git a/api-ref/source/v2/samples/qos/rule_types-list-response.json b/api-ref/source/v2/samples/qos/rule_types-list-response.json deleted file mode 100644 index c2983a0..0000000 --- a/api-ref/source/v2/samples/qos/rule_types-list-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "rule_types": [ - { - "type": "bandwidth_limit" - }, - { - "type": "dscp_marking" - } - ] -} diff --git a/api-ref/source/v2/samples/quotas/quotas-list-for-project-response.json b/api-ref/source/v2/samples/quotas/quotas-list-for-project-response.json deleted file mode 100644 index 589bc8f..0000000 --- a/api-ref/source/v2/samples/quotas/quotas-list-for-project-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "quota": { - "floatingip": 50, - "network": 10, - "port": 50, - "rbac_policy": -1, - "router": 10, - "security_group": 10, - "security_group_rule": 100, - "subnet": 10, - "subnetpool": -1 - } -} diff --git a/api-ref/source/v2/samples/quotas/quotas-list-response.json b/api-ref/source/v2/samples/quotas/quotas-list-response.json deleted file mode 100644 index 489e52a..0000000 --- a/api-ref/source/v2/samples/quotas/quotas-list-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "quotas": [ - { - "floatingip": 50, - "network": 15, - "port": 50, - "project_id": "bab7d5c60cd041a0a36f7c4b6e1dd978", - "rbac_policy": -1, - "router": 10, - "security_group": 10, - "security_group_rule": 100, - "subnet": 10, - "subnetpool": -1, - "tenant_id": "bab7d5c60cd041a0a36f7c4b6e1dd978" - } - ] -} diff --git a/api-ref/source/v2/samples/quotas/quotas-update-request.json b/api-ref/source/v2/samples/quotas/quotas-update-request.json deleted file mode 100644 index 589bc8f..0000000 --- a/api-ref/source/v2/samples/quotas/quotas-update-request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "quota": { - "floatingip": 50, - "network": 10, - "port": 50, - "rbac_policy": -1, - "router": 10, - "security_group": 10, - "security_group_rule": 100, - "subnet": 10, - "subnetpool": -1 - } -} diff --git a/api-ref/source/v2/samples/quotas/quotas-update-response.json b/api-ref/source/v2/samples/quotas/quotas-update-response.json deleted file mode 100644 index 90892c6..0000000 --- a/api-ref/source/v2/samples/quotas/quotas-update-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "quota": { - "subnet": 10, - "network": 15, - "floatingip": 50, - "subnetpool": -1, - "security_group_rule": 100, - "security_group": 10, - "router": 10, - "rbac_policy": -1, - "port": 50 - } -} diff --git a/api-ref/source/v2/samples/rbac_policy/rbac-policies-list-response.json b/api-ref/source/v2/samples/rbac_policy/rbac-policies-list-response.json deleted file mode 100644 index eadbb19..0000000 --- a/api-ref/source/v2/samples/rbac_policy/rbac-policies-list-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "rbac_policies": [ - { - "target_tenant": "*", - "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "object_type": "network", - "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", - "action": "access_as_external", - "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "id":"6d4c666e-1aad-465e-b670-4d112b760137" - } - ] -} \ No newline at end of file diff --git a/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-request.json b/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-request.json deleted file mode 100644 index 2bca23f..0000000 --- a/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "rbac_policy": { - "action": "access_as_shared", - "object_type": "network", - "target_tenant": "0670b690f27e47a58b6a479d26004715", - "object_id": "1f32f072-4d17-4811-b619-3623d018bd40" - } -} \ No newline at end of file diff --git a/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-response.json b/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-response.json deleted file mode 100644 index ceedd35..0000000 --- a/api-ref/source/v2/samples/rbac_policy/rbac-policy-create-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "rbac_policy": { - "target_tenant": "0670b690f27e47a58b6a479d26004715", - "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "object_type": "network", - "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", - "action": "access_as_shared", - "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c" - } -} \ No newline at end of file diff --git a/api-ref/source/v2/samples/rbac_policy/rbac-policy-show-response.json b/api-ref/source/v2/samples/rbac_policy/rbac-policy-show-response.json deleted file mode 100644 index 7684815..0000000 --- a/api-ref/source/v2/samples/rbac_policy/rbac-policy-show-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "rbac_policy": { - "target_tenant": "*", - "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "object_type": "network", - "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", - "action": "access_as_external", - "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "id": "6d4c666e-1aad-465e-b670-4d112b760137" - } -} \ No newline at end of file diff --git a/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-request.json b/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-request.json deleted file mode 100644 index 57d5a6a..0000000 --- a/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rbac_policy": { - "target_tenant": "*" - } -} \ No newline at end of file diff --git a/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-response.json b/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-response.json deleted file mode 100644 index 7684815..0000000 --- a/api-ref/source/v2/samples/rbac_policy/rbac-policy-update-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "rbac_policy": { - "target_tenant": "*", - "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "object_type": "network", - "object_id": "1f32f072-4d17-4811-b619-3623d018bd40", - "action": "access_as_external", - "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832", - "id": "6d4c666e-1aad-465e-b670-4d112b760137" - } -} \ No newline at end of file diff --git a/api-ref/source/v2/samples/routers/router-add-interface-request-with-port.json b/api-ref/source/v2/samples/routers/router-add-interface-request-with-port.json deleted file mode 100644 index 4270a8c..0000000 --- a/api-ref/source/v2/samples/routers/router-add-interface-request-with-port.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "port_id": "2dc46bcc-d1f2-4077-b99e-91ee28afaff0" -} diff --git a/api-ref/source/v2/samples/routers/router-add-interface-request.json b/api-ref/source/v2/samples/routers/router-add-interface-request.json deleted file mode 100644 index 107e6e4..0000000 --- a/api-ref/source/v2/samples/routers/router-add-interface-request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1" -} diff --git a/api-ref/source/v2/samples/routers/router-add-interface-response.json b/api-ref/source/v2/samples/routers/router-add-interface-response.json deleted file mode 100644 index cf7d87b..0000000 --- a/api-ref/source/v2/samples/routers/router-add-interface-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "915a14a6-867b-4af7-83d1-70efceb146f9", - "network_id": "91c013e2-d65a-474e-9177-c3e1799ca726", - "port_id": "2dc46bcc-d1f2-4077-b99e-91ee28afaff0", - "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1", - "subnet_ids": [ - "a2f1f29d-571b-4533-907f-5803ab96ead1" - ], - "project_id": "0bd18306d801447bb457a46252d82d13", - "tenant_id": "0bd18306d801447bb457a46252d82d13" -} diff --git a/api-ref/source/v2/samples/routers/router-create-request.json b/api-ref/source/v2/samples/routers/router-create-request.json deleted file mode 100644 index e9e332f..0000000 --- a/api-ref/source/v2/samples/routers/router-create-request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "router": { - "name": "router1", - "external_gateway_info": { - "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3", - "enable_snat": true, - "external_fixed_ips": [ - { - "ip_address": "172.24.4.6", - "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" - } - ] - }, - "admin_state_up": true - } -} diff --git a/api-ref/source/v2/samples/routers/router-create-response.json b/api-ref/source/v2/samples/routers/router-create-response.json deleted file mode 100644 index 966694b..0000000 --- a/api-ref/source/v2/samples/routers/router-create-response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "router": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "description": "", - "distributed": false, - "external_gateway_info": { - "enable_snat": true, - "external_fixed_ips": [ - { - "ip_address": "172.24.4.6", - "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" - } - ], - "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" - }, - "ha": false, - "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", - "name": "router1", - "routes": [], - "status": "ACTIVE", - "project_id": "0bd18306d801447bb457a46252d82d13", - "tenant_id": "0bd18306d801447bb457a46252d82d13" - } -} diff --git a/api-ref/source/v2/samples/routers/router-remove-interface-request-with-port.json b/api-ref/source/v2/samples/routers/router-remove-interface-request-with-port.json deleted file mode 100644 index 4270a8c..0000000 --- a/api-ref/source/v2/samples/routers/router-remove-interface-request-with-port.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "port_id": "2dc46bcc-d1f2-4077-b99e-91ee28afaff0" -} diff --git a/api-ref/source/v2/samples/routers/router-remove-interface-request.json b/api-ref/source/v2/samples/routers/router-remove-interface-request.json deleted file mode 100644 index 107e6e4..0000000 --- a/api-ref/source/v2/samples/routers/router-remove-interface-request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1" -} diff --git a/api-ref/source/v2/samples/routers/router-remove-interface-response.json b/api-ref/source/v2/samples/routers/router-remove-interface-response.json deleted file mode 100644 index a3fd08c..0000000 --- a/api-ref/source/v2/samples/routers/router-remove-interface-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "915a14a6-867b-4af7-83d1-70efceb146f9", - "network_id": "91c013e2-d65a-474e-9177-c3e1799ca726", - "port_id": "a5b7d209-dc02-4c46-a51f-805eadd3de64", - "subnet_id": "4e5fe97c-82bc-432e-87d8-06d7e157dffa", - "subnet_ids": [ - "4e5fe97c-82bc-432e-87d8-06d7e157dffa" - ], - "project_id": "0bd18306d801447bb457a46252d82d13", - "tenant_id": "0bd18306d801447bb457a46252d82d13" -} diff --git a/api-ref/source/v2/samples/routers/router-show-response.json b/api-ref/source/v2/samples/routers/router-show-response.json deleted file mode 100644 index cdc9f57..0000000 --- a/api-ref/source/v2/samples/routers/router-show-response.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "router": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "description": "", - "distributed": false, - "external_gateway_info": { - "enable_snat": true, - "external_fixed_ips": [ - { - "ip_address": "172.24.4.6", - "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" - }, - { - "ip_address": "2001:db8::9", - "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" - } - ], - "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" - }, - "ha": false, - "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", - "name": "router1", - "routes": [], - "status": "ACTIVE", - "project_id": "0bd18306d801447bb457a46252d82d13", - "tenant_id": "0bd18306d801447bb457a46252d82d13" - } -} diff --git a/api-ref/source/v2/samples/routers/router-update-request.json b/api-ref/source/v2/samples/routers/router-update-request.json deleted file mode 100644 index 93e2705..0000000 --- a/api-ref/source/v2/samples/routers/router-update-request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "router": { - "external_gateway_info": { - "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3", - "enable_snat": true, - "external_fixed_ips": [ - { - "ip_address": "172.24.4.6", - "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" - } - ] - } - } -} diff --git a/api-ref/source/v2/samples/routers/router-update-response.json b/api-ref/source/v2/samples/routers/router-update-response.json deleted file mode 100644 index 966694b..0000000 --- a/api-ref/source/v2/samples/routers/router-update-response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "router": { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "description": "", - "distributed": false, - "external_gateway_info": { - "enable_snat": true, - "external_fixed_ips": [ - { - "ip_address": "172.24.4.6", - "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" - } - ], - "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" - }, - "ha": false, - "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", - "name": "router1", - "routes": [], - "status": "ACTIVE", - "project_id": "0bd18306d801447bb457a46252d82d13", - "tenant_id": "0bd18306d801447bb457a46252d82d13" - } -} diff --git a/api-ref/source/v2/samples/routers/routers-list-response.json b/api-ref/source/v2/samples/routers/routers-list-response.json deleted file mode 100644 index 7b36b3b..0000000 --- a/api-ref/source/v2/samples/routers/routers-list-response.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "routers": [ - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "description": "", - "distributed": false, - "external_gateway_info": { - "enable_snat": true, - "external_fixed_ips": [ - { - "ip_address": "172.24.4.3", - "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" - }, - { - "ip_address": "2001:db8::c", - "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" - } - ], - "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" - }, - "ha": false, - "id": "915a14a6-867b-4af7-83d1-70efceb146f9", - "name": "router2", - "routes": [], - "status": "ACTIVE", - "project_id": "0bd18306d801447bb457a46252d82d13", - "tenant_id": "0bd18306d801447bb457a46252d82d13" - }, - { - "admin_state_up": true, - "availability_zone_hints": [], - "availability_zones": [ - "nova" - ], - "description": "", - "distributed": false, - "external_gateway_info": { - "enable_snat": true, - "external_fixed_ips": [ - { - "ip_address": "172.24.4.6", - "subnet_id": "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" - }, - { - "ip_address": "2001:db8::9", - "subnet_id": "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" - } - ], - "network_id": "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" - }, - "ha": false, - "id": "f8a44de0-fc8e-45df-93c7-f79bf3b01c95", - "name": "router1", - "routes": [], - "status": "ACTIVE", - "project_id": "0bd18306d801447bb457a46252d82d13", - "tenant_id": "0bd18306d801447bb457a46252d82d13" - } - ] -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-create-request.json b/api-ref/source/v2/samples/security-groups/security-group-create-request.json deleted file mode 100644 index 8a93ef9..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-create-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "security_group": { - "name": "new-webservers", - "description": "security group for webservers" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-create-response.json b/api-ref/source/v2/samples/security-groups/security-group-create-response.json deleted file mode 100644 index 1c33ce1..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-create-response.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "security_group": { - "description": "security group for webservers", - "id": "2076db17-a522-4506-91de-c6dd8e837028", - "name": "new-webservers", - "security_group_rules": [ - { - "direction": "egress", - "ethertype": "IPv4", - "id": "38ce2d8e-e8f1-48bd-83c2-d33cb9f50c3d", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "egress", - "ethertype": "IPv6", - "id": "565b9502-12de-4ffd-91e9-68885cff6ae1", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - } - ], - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-delete-request-json-http.txt b/api-ref/source/v2/samples/security-groups/security-group-delete-request-json-http.txt deleted file mode 100644 index fa14410..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-delete-request-json-http.txt +++ /dev/null @@ -1,3 +0,0 @@ -DELETE /v2.0/security-groups/e470bdfc-4869-459b-a561-cb3377efae59 -Content-Type: application/json -Accept: application/json \ No newline at end of file diff --git a/api-ref/source/v2/samples/security-groups/security-group-delete-response-json-http.txt b/api-ref/source/v2/samples/security-groups/security-group-delete-response-json-http.txt deleted file mode 100644 index f81fef7..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-delete-response-json-http.txt +++ /dev/null @@ -1 +0,0 @@ -status: 204 \ No newline at end of file diff --git a/api-ref/source/v2/samples/security-groups/security-group-rule-create-request.json b/api-ref/source/v2/samples/security-groups/security-group-rule-create-request.json deleted file mode 100644 index 959be0f..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rule-create-request.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "security_group_rule": { - "direction": "ingress", - "port_range_min": "80", - "ethertype": "IPv4", - "port_range_max": "80", - "protocol": "tcp", - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-rule-create-response.json b/api-ref/source/v2/samples/security-groups/security-group-rule-create-response.json deleted file mode 100644 index 4335a92..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rule-create-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "security_group_rule": { - "direction": "ingress", - "ethertype": "IPv4", - "id": "2bc0accf-312e-429a-956e-e4407625eb62", - "port_range_max": 80, - "port_range_min": 80, - "protocol": "tcp", - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "remote_ip_prefix": null, - "security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-rule-delete-request-json-http.txt b/api-ref/source/v2/samples/security-groups/security-group-rule-delete-request-json-http.txt deleted file mode 100644 index 920073a..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rule-delete-request-json-http.txt +++ /dev/null @@ -1,3 +0,0 @@ -DELETE /v2.0/security-group-rules/fc3c327a-b5b5-4cd3-9577-52893289ce08 -Content-Type: application/json -Accept: application/json \ No newline at end of file diff --git a/api-ref/source/v2/samples/security-groups/security-group-rule-delete-response-json-http.txt b/api-ref/source/v2/samples/security-groups/security-group-rule-delete-response-json-http.txt deleted file mode 100644 index f81fef7..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rule-delete-response-json-http.txt +++ /dev/null @@ -1 +0,0 @@ -status: 204 \ No newline at end of file diff --git a/api-ref/source/v2/samples/security-groups/security-group-rule-show-request-json-http.txt b/api-ref/source/v2/samples/security-groups/security-group-rule-show-request-json-http.txt deleted file mode 100644 index 655ee69..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rule-show-request-json-http.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET /v2.0/security-group-rules/3c0e45ff-adaf-4124-b083-bf390e5482ff -Accept: application/json diff --git a/api-ref/source/v2/samples/security-groups/security-group-rule-show-response.json b/api-ref/source/v2/samples/security-groups/security-group-rule-show-response.json deleted file mode 100644 index 309decd..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rule-show-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "security_group_rule": { - "direction": "egress", - "ethertype": "IPv6", - "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-rules-list-request-json-http.txt b/api-ref/source/v2/samples/security-groups/security-group-rules-list-request-json-http.txt deleted file mode 100644 index a0a7038..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rules-list-request-json-http.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET /v2.0/security-group-rules/ -Accept: application/json \ No newline at end of file diff --git a/api-ref/source/v2/samples/security-groups/security-group-rules-list-response.json b/api-ref/source/v2/samples/security-groups/security-group-rules-list-response.json deleted file mode 100644 index a715ce3..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-rules-list-response.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "security_group_rules": [ - { - "direction": "egress", - "ethertype": "IPv6", - "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "egress", - "ethertype": "IPv4", - "id": "93aa42e5-80db-4581-9391-3a608bd0e448", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "ingress", - "ethertype": "IPv6", - "id": "c0b09f00-1d49-4e64-a0a7-8a186d928138", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "ingress", - "ethertype": "IPv4", - "id": "f7d45c89-008e-4bab-88ad-d6811724c51c", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-show-request-json-http.txt b/api-ref/source/v2/samples/security-groups/security-group-show-request-json-http.txt deleted file mode 100644 index 56592f3..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-show-request-json-http.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET /v2.0/security-groups/85cc3048-abc3-43cc-89b3-377341426ac5 -Accept: application/json \ No newline at end of file diff --git a/api-ref/source/v2/samples/security-groups/security-group-show-response.json b/api-ref/source/v2/samples/security-groups/security-group-show-response.json deleted file mode 100644 index 151166f..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-show-response.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "security_group": { - "description": "default", - "id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "name": "default", - "security_group_rules": [ - { - "direction": "egress", - "ethertype": "IPv6", - "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "egress", - "ethertype": "IPv4", - "id": "93aa42e5-80db-4581-9391-3a608bd0e448", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "ingress", - "ethertype": "IPv6", - "id": "c0b09f00-1d49-4e64-a0a7-8a186d928138", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "ingress", - "ethertype": "IPv4", - "id": "f7d45c89-008e-4bab-88ad-d6811724c51c", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - } - ], - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-update-request.json b/api-ref/source/v2/samples/security-groups/security-group-update-request.json deleted file mode 100644 index 67bfda2..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-update-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "security_group": { - "name": "mysecgroup", - "description": "my security group" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-group-update-response.json b/api-ref/source/v2/samples/security-groups/security-group-update-response.json deleted file mode 100644 index c6a77c2..0000000 --- a/api-ref/source/v2/samples/security-groups/security-group-update-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "security_group": { - "security_group_rules": [], - "project_id": "a52cdb9cc7854a39a23d3af73a40899e", - "tenant_id": "a52cdb9cc7854a39a23d3af73a40899e", - "id": "01fbade5-b664-42f6-83ae-4e214f4263fa", - "name": "mysecgroup", - "description": "my security group" - } -} diff --git a/api-ref/source/v2/samples/security-groups/security-groups-list-request-json-http.txt b/api-ref/source/v2/samples/security-groups/security-groups-list-request-json-http.txt deleted file mode 100644 index aa84978..0000000 --- a/api-ref/source/v2/samples/security-groups/security-groups-list-request-json-http.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET /v2.0/security-groups -Accept: application/json \ No newline at end of file diff --git a/api-ref/source/v2/samples/security-groups/security-groups-list-response.json b/api-ref/source/v2/samples/security-groups/security-groups-list-response.json deleted file mode 100644 index 6479fb8..0000000 --- a/api-ref/source/v2/samples/security-groups/security-groups-list-response.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "security_groups": [ - { - "description": "default", - "id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "name": "default", - "security_group_rules": [ - { - "direction": "egress", - "ethertype": "IPv6", - "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "egress", - "ethertype": "IPv4", - "id": "93aa42e5-80db-4581-9391-3a608bd0e448", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": null, - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "ingress", - "ethertype": "IPv6", - "id": "c0b09f00-1d49-4e64-a0a7-8a186d928138", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - }, - { - "direction": "ingress", - "ethertype": "IPv4", - "id": "f7d45c89-008e-4bab-88ad-d6811724c51c", - "port_range_max": null, - "port_range_min": null, - "protocol": null, - "remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "remote_ip_prefix": null, - "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5", - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "description": "" - } - ], - "project_id": "e4f50856753b4dc6afee5fa6b9b6c550", - "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550" - } - ] -} diff --git a/api-ref/source/v2/samples/segments/segment-create-request.json b/api-ref/source/v2/samples/segments/segment-create-request.json deleted file mode 100644 index c79b5ee..0000000 --- a/api-ref/source/v2/samples/segments/segment-create-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "segment": { - "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", - "segmentation_id": 2000, - "network_type": "vlan", - "physical_network": "segment-1" - } -} diff --git a/api-ref/source/v2/samples/segments/segment-create-response.json b/api-ref/source/v2/samples/segments/segment-create-response.json deleted file mode 100644 index bc066c7..0000000 --- a/api-ref/source/v2/samples/segments/segment-create-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "segment": { - "name": null, - "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", - "segmentation_id": 2000, - "network_type": "vlan", - "physical_network": "segment-1", - "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", - "description": null - } -} diff --git a/api-ref/source/v2/samples/segments/segment-show-response.json b/api-ref/source/v2/samples/segments/segment-show-response.json deleted file mode 100644 index bc066c7..0000000 --- a/api-ref/source/v2/samples/segments/segment-show-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "segment": { - "name": null, - "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", - "segmentation_id": 2000, - "network_type": "vlan", - "physical_network": "segment-1", - "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", - "description": null - } -} diff --git a/api-ref/source/v2/samples/segments/segment-update-request.json b/api-ref/source/v2/samples/segments/segment-update-request.json deleted file mode 100644 index 0e25b11..0000000 --- a/api-ref/source/v2/samples/segments/segment-update-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "segment": { - "name": "1", - "description": "Segment One" - } -} diff --git a/api-ref/source/v2/samples/segments/segment-update-response.json b/api-ref/source/v2/samples/segments/segment-update-response.json deleted file mode 100644 index b9a1846..0000000 --- a/api-ref/source/v2/samples/segments/segment-update-response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "segment": { - "name": "1", - "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", - "segmentation_id": 2000, - "network_type": "vlan", - "physical_network": "segment-1", - "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", - "description": "Segment One" - } -} diff --git a/api-ref/source/v2/samples/segments/segments-list-response.json b/api-ref/source/v2/samples/segments/segments-list-response.json deleted file mode 100644 index c1b713a..0000000 --- a/api-ref/source/v2/samples/segments/segments-list-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "segments": [ - { - "name": null, - "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", - "segmentation_id": 2000, - "network_type": "vlan", - "physical_network": "segment-1", - "id": "57fe85e4-ca2f-4192-b3cd-d5c249d7a21f", - "description": null - }, - { - "name": null, - "network_id": "5c0cb560-4089-41dd-be29-469907a23b49", - "segmentation_id": 2000, - "network_type": "vlan", - "physical_network": "segment-2", - "id": "f1364c3a-4fc1-4206-b2dc-3254bc25cbfc", - "description": null - } - ] -} diff --git a/api-ref/source/v2/samples/service-type-response.json b/api-ref/source/v2/samples/service-type-response.json deleted file mode 100644 index 276a826..0000000 --- a/api-ref/source/v2/samples/service-type-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "service_providers": [ - { - "service_type": "LOADBALANCER", - "default": true, - "name": "haproxy" - } - ] -} diff --git a/api-ref/source/v2/samples/subnets/subnet-create-request.json b/api-ref/source/v2/samples/subnets/subnet-create-request.json deleted file mode 100644 index f5f1884..0000000 --- a/api-ref/source/v2/samples/subnets/subnet-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "subnet": { - "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "ip_version": 4, - "cidr": "192.168.199.0/24" - } -} diff --git a/api-ref/source/v2/samples/subnets/subnet-create-response.json b/api-ref/source/v2/samples/subnets/subnet-create-response.json deleted file mode 100644 index 27c1e0b..0000000 --- a/api-ref/source/v2/samples/subnets/subnet-create-response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "subnet": { - "name": "", - "enable_dhcp": true, - "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "segment_id": null, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "dns_nameservers": [], - "allocation_pools": [ - { - "start": "192.168.199.2", - "end": "192.168.199.254" - } - ], - "host_routes": [], - "ip_version": 4, - "gateway_ip": "192.168.199.1", - "cidr": "192.168.199.0/24", - "id": "3b80198d-4f7b-4f77-9ef5-774d54e17126", - "created_at": "2016-10-10T14:35:47Z", - "description": "", - "ipv6_address_mode": null, - "ipv6_ra_mode": null, - "revision_number": 2, - "service_types": [], - "subnetpool_id": null, - "updated_at": "2016-10-10T14:35:47Z" - } -} diff --git a/api-ref/source/v2/samples/subnets/subnet-show-response.json b/api-ref/source/v2/samples/subnets/subnet-show-response.json deleted file mode 100644 index 52e1b3c..0000000 --- a/api-ref/source/v2/samples/subnets/subnet-show-response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "subnet": { - "name": "my_subnet", - "enable_dhcp": true, - "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "segment_id": null, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "created_at": "2016-03-08T20:19:41", - "dns_nameservers": [], - "allocation_pools": [ - { - "start": "192.0.0.2", - "end": "192.255.255.254" - } - ], - "host_routes": [], - "ip_version": 4, - "gateway_ip": "192.0.0.1", - "cidr": "192.0.0.0/8", - "updated_at": "2016-03-08T20:19:41", - "id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b", - "description": "", - "ipv6_address_mode": null, - "ipv6_ra_mode": null, - "revision_number": 2, - "service_types": [], - "subnetpool_id": null - } -} diff --git a/api-ref/source/v2/samples/subnets/subnet-update-request.json b/api-ref/source/v2/samples/subnets/subnet-update-request.json deleted file mode 100644 index 0481b47..0000000 --- a/api-ref/source/v2/samples/subnets/subnet-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "subnet": { - "name": "my_subnet" - } -} diff --git a/api-ref/source/v2/samples/subnets/subnet-update-response.json b/api-ref/source/v2/samples/subnets/subnet-update-response.json deleted file mode 100644 index c49c48b..0000000 --- a/api-ref/source/v2/samples/subnets/subnet-update-response.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "subnet": { - "name": "my_subnet", - "enable_dhcp": true, - "network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", - "segment_id": null, - "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "dns_nameservers": [], - "allocation_pools": [ - { - "start": "10.0.0.2", - "end": "10.0.0.254" - } - ], - "host_routes": [], - "ip_version": 4, - "gateway_ip": "10.0.0.1", - "cidr": "10.0.0.0/24", - "id": "08eae331-0402-425a-923c-34f7cfe39c1b", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/subnets/subnetpool-create-request.json b/api-ref/source/v2/samples/subnets/subnetpool-create-request.json deleted file mode 100644 index 4058fea..0000000 --- a/api-ref/source/v2/samples/subnets/subnetpool-create-request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "subnetpool": { - "name": "my-subnet-pool", - "prefixes": [ - "192.168.0.0/16", - "10.10.0.0/21" - ], - "default_prefixlen": 25, - "min_prefixlen": 24, - "max_prefixlen": 30, - "shared": "false" - } -} diff --git a/api-ref/source/v2/samples/subnets/subnetpool-create-response.json b/api-ref/source/v2/samples/subnets/subnetpool-create-response.json deleted file mode 100644 index 4153542..0000000 --- a/api-ref/source/v2/samples/subnets/subnetpool-create-response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "subnetpool": { - "address_scope_id": null, - "default_prefixlen": 25, - "default_quota": null, - "description": "", - "id": "f49a1319-423a-4ee6-ba54-1d95a4f6cc68", - "ip_version": 4, - "is_default": false, - "max_prefixlen": 30, - "min_prefixlen": 24, - "name": "my-subnet-pool", - "prefixes": [ - "10.10.0.0/21", - "192.168.0.0/16" - ], - "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "shared": false, - "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08" - } -} diff --git a/api-ref/source/v2/samples/subnets/subnetpool-show-response.json b/api-ref/source/v2/samples/subnets/subnetpool-show-response.json deleted file mode 100644 index 44bb66f..0000000 --- a/api-ref/source/v2/samples/subnets/subnetpool-show-response.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "subnetpool": { - "min_prefixlen": "64", - "address_scope_id": null, - "default_prefixlen": "64", - "id": "03f761e6-eee0-43fc-a921-8acf64c14988", - "max_prefixlen": "64", - "name": "my-subnet-pool", - "default_quota": null, - "is_default": false, - "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "created_at": "2016-03-08T20:19:41", - "prefixes": [ - "2001:db8:0:2::/64", - "2001:db8::/63" - ], - "updated_at": "2016-03-08T20:19:41", - "ip_version": 6, - "shared": false, - "description": "", - "revision_number": 2 - } -} diff --git a/api-ref/source/v2/samples/subnets/subnetpool-update-request.json b/api-ref/source/v2/samples/subnets/subnetpool-update-request.json deleted file mode 100644 index 2c9bcef..0000000 --- a/api-ref/source/v2/samples/subnets/subnetpool-update-request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "subnetpool": { - "name": "my-new-subnetpool-name", - "prefixes": [ - "2001:db8::/64", - "2001:db8:0:1::/64", - "2001:db8:0:2::/64" - ], - "min_prefixlen": 64, - "default_prefixlen": 64, - "max_prefixlen": 64 - } -} diff --git a/api-ref/source/v2/samples/subnets/subnetpool-update-response.json b/api-ref/source/v2/samples/subnets/subnetpool-update-response.json deleted file mode 100644 index 1239174..0000000 --- a/api-ref/source/v2/samples/subnets/subnetpool-update-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "subnetpool": { - "name": "my-new-subnetpool-name", - "default_quota": null, - "is_default": false, - "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "prefixes": [ - "2001:db8::/63", - "2001:db8:0:2::/64" - ], - "min_prefixlen": 64, - "address_scope_id": null, - "ip_version": 6, - "shared": false, - "default_prefixlen": 64, - "id": "03f761e6-eee0-43fc-a921-8acf64c14988", - "max_prefixlen": 64, - "description": "", - "revision_number": 2 - } -} diff --git a/api-ref/source/v2/samples/subnets/subnetpools-list-response.json b/api-ref/source/v2/samples/subnets/subnetpools-list-response.json deleted file mode 100644 index 5ffc57e..0000000 --- a/api-ref/source/v2/samples/subnets/subnetpools-list-response.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "subnetpools": [ - { - "min_prefixlen": "64", - "address_scope_id": null, - "default_prefixlen": "64", - "id": "03f761e6-eee0-43fc-a921-8acf64c14988", - "max_prefixlen": "64", - "name": "my-subnet-pool-ipv6", - "default_quota": null, - "is_default": false, - "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "prefixes": [ - "2001:db8:0:2::/64", - "2001:db8::/63" - ], - "ip_version": 6, - "shared": false, - "description": "", - "revision_number": 2 - }, - { - "min_prefixlen": "24", - "address_scope_id": null, - "default_prefixlen": "25", - "id": "f49a1319-423a-4ee6-ba54-1d95a4f6cc68", - "max_prefixlen": "30", - "name": "my-subnet-pool-ipv4", - "default_quota": null, - "is_default": false, - "project_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08", - "prefixes": [ - "10.10.0.0/21", - "192.168.0.0/16" - ], - "ip_version": 4, - "shared": false, - "description": "", - "revision_number": 2 - } - ] -} diff --git a/api-ref/source/v2/samples/subnets/subnets-create-bulk-request.json b/api-ref/source/v2/samples/subnets/subnets-create-bulk-request.json deleted file mode 100644 index 0bb8460..0000000 --- a/api-ref/source/v2/samples/subnets/subnets-create-bulk-request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "subnets": [ - { - "cidr": "192.168.199.0/24", - "ip_version": 4, - "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406" - }, - { - "cidr": "10.56.4.0/22", - "ip_version": 4, - "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa" - } - ] -} diff --git a/api-ref/source/v2/samples/subnets/subnets-create-bulk-response.json b/api-ref/source/v2/samples/subnets/subnets-create-bulk-response.json deleted file mode 100644 index d890e35..0000000 --- a/api-ref/source/v2/samples/subnets/subnets-create-bulk-response.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "subnets": [ - { - "allocation_pools": [ - { - "end": "192.168.199.254", - "start": "192.168.199.2" - } - ], - "cidr": "192.168.199.0/24", - "dns_nameservers": [], - "enable_dhcp": true, - "gateway_ip": "192.168.199.1", - "host_routes": [], - "id": "0468a7a7-290d-4127-aedd-6c9449775a24", - "ip_version": 4, - "name": "", - "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406", - "segment_id": null, - "project_id": "d19231fc08ec4bc4829b668040d34512", - "tenant_id": "d19231fc08ec4bc4829b668040d34512", - "created_at": "2016-10-10T14:35:47Z", - "description": "", - "ipv6_address_mode": null, - "ipv6_ra_mode": null, - "revision_number": 2, - "service_types": [], - "subnetpool_id": null, - "updated_at": "2016-10-10T14:35:47Z" - }, - { - "allocation_pools": [ - { - "end": "10.56.7.254", - "start": "10.56.4.2" - } - ], - "cidr": "10.56.4.0/22", - "dns_nameservers": [], - "enable_dhcp": true, - "gateway_ip": "10.56.4.1", - "host_routes": [], - "id": "b0e7435c-1512-45fb-aa9e-9a7c5932fb30", - "ip_version": 4, - "name": "", - "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa", - "segment_id": null, - "project_id": "d19231fc08ec4bc4829b668040d34512", - "tenant_id": "d19231fc08ec4bc4829b668040d34512", - "created_at": "2016-10-10T14:35:34Z", - "description": "", - "ipv6_address_mode": null, - "ipv6_ra_mode": null, - "revision_number": 2, - "service_types": [], - "subnetpool_id": null, - "updated_at": "2016-10-10T14:35:34Z" - } - ] -} diff --git a/api-ref/source/v2/samples/subnets/subnets-list-response.json b/api-ref/source/v2/samples/subnets/subnets-list-response.json deleted file mode 100644 index 2eeefa6..0000000 --- a/api-ref/source/v2/samples/subnets/subnets-list-response.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "subnets": [ - { - "name": "private-subnet", - "enable_dhcp": true, - "network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324", - "segment_id": null, - "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e", - "dns_nameservers": [], - "allocation_pools": [ - { - "start": "10.0.0.2", - "end": "10.0.0.254" - } - ], - "host_routes": [], - "ip_version": 4, - "gateway_ip": "10.0.0.1", - "cidr": "10.0.0.0/24", - "id": "08eae331-0402-425a-923c-34f7cfe39c1b", - "created_at": "2016-10-10T14:35:34Z", - "description": "", - "ipv6_address_mode": null, - "ipv6_ra_mode": null, - "revision_number": 2, - "service_types": [], - "subnetpool_id": null, - "updated_at": "2016-10-10T14:35:34Z" - }, - { - "name": "my_subnet", - "enable_dhcp": true, - "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "segment_id": null, - "project_id": "4fd44f30292945e481c7b8a0c8908869", - "tenant_id": "4fd44f30292945e481c7b8a0c8908869", - "dns_nameservers": [], - "allocation_pools": [ - { - "start": "192.0.0.2", - "end": "192.255.255.254" - } - ], - "host_routes": [], - "ip_version": 4, - "gateway_ip": "192.0.0.1", - "cidr": "192.0.0.0/8", - "id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b", - "created_at": "2016-10-10T14:35:47Z", - "description": "", - "ipv6_address_mode": null, - "ipv6_ra_mode": null, - "revision_number": 2, - "service_types": [], - "subnetpool_id": null, - "updated_at": "2016-10-10T14:35:47Z" - } - ] -} diff --git a/api-ref/source/v2/samples/tag/tag-obtain-response.json b/api-ref/source/v2/samples/tag/tag-obtain-response.json deleted file mode 100644 index f047e8e..0000000 --- a/api-ref/source/v2/samples/tag/tag-obtain-response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "tags": [ - "red", - "blue" - ] -} diff --git a/api-ref/source/v2/samples/tag/tag-update-request.json b/api-ref/source/v2/samples/tag/tag-update-request.json deleted file mode 100644 index f047e8e..0000000 --- a/api-ref/source/v2/samples/tag/tag-update-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "tags": [ - "red", - "blue" - ] -} diff --git a/api-ref/source/v2/samples/tag/tag-update-response.json b/api-ref/source/v2/samples/tag/tag-update-response.json deleted file mode 100644 index f047e8e..0000000 --- a/api-ref/source/v2/samples/tag/tag-update-response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "tags": [ - "red", - "blue" - ] -} diff --git a/api-ref/source/v2/samples/trunks/trunk-add-subports-request.json b/api-ref/source/v2/samples/trunks/trunk-add-subports-request.json deleted file mode 100644 index 27bfcde..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-add-subports-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "sub_ports": [ - { - "segmentation_id": 44, - "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", - "segmentation_type": "vlan" - } - ] -} diff --git a/api-ref/source/v2/samples/trunks/trunk-add-subports-response.json b/api-ref/source/v2/samples/trunks/trunk-add-subports-response.json deleted file mode 100644 index d90cec4..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-add-subports-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "status": "DOWN", - "sub_ports": [ - { - "segmentation_type": "vlan", - "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", - "segmentation_id": 44 - } - ], - "name": "test", - "admin_state_up": true, - "project_id": "145a14e4a64b49bf98baad8945dbd4f1", - "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", - "created_at": "2016-10-05T22:31:37Z", - "updated_at": "2016-10-05T22:52:04Z", - "revision_number": 2, - "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "id": "114a26b1-d124-4835-bb4f-021d3d886023", - "description": "" -} diff --git a/api-ref/source/v2/samples/trunks/trunk-create-request.json b/api-ref/source/v2/samples/trunks/trunk-create-request.json deleted file mode 100644 index c08688d..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-create-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "trunk": { - "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "name": "test", - "admin_state_up": true - } -} diff --git a/api-ref/source/v2/samples/trunks/trunk-details-show-response.json b/api-ref/source/v2/samples/trunks/trunk-details-show-response.json deleted file mode 100644 index 933d2ce..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-details-show-response.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "port": { - "status": "DOWN", - "created_at": "2016-10-05T20:05:14Z", - "description": "", - "admin_state_up": true, - "network_id": "1cf9e069-365f-4a78-8784-616bc12c4c5a", - "project_id": "313be01bd0744cea86643c711c57012b", - "tenant_id": "313be01bd0744cea86643c711c57012b", - "extra_dhcp_opts": [], - "updated_at": "2016-10-05T20:05:14Z", - "name": "test", - "device_owner": "", - "trunk_details": { - "trunk_id": "8905d084-010c-46e8-a863-f21cb4441ab1", - "sub_ports": [ - { - "segmentation_id": 33, - "port_id": "70df9f3e-b409-4761-8304-ce029b2079f5", - "segmentation_type": "vlan", - "mac_address": "fa:16:3e:86:9b:dc" - }, - { - "segmentation_id": 44, - "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", - "segmentation_type": "vlan", - "mac_address": "fa:16:3e:fe:29:97" - } - ] - }, - "revision_number": 5, - "mac_address": "fa:16:3e:5c:e9:a3", - "fixed_ips": [ - { - "subnet_id": "76a059c0-b189-479f-882c-5e8bd464ea49", - "ip_address": "40.0.0.3" - } - ], - "id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "security_groups": ["da88a249-12ac-4221-9565-c406b6feeb48"], - "device_id": "" - } -} diff --git a/api-ref/source/v2/samples/trunks/trunk-list-subports-response.json b/api-ref/source/v2/samples/trunks/trunk-list-subports-response.json deleted file mode 100644 index 95c4c70..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-list-subports-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "sub_ports": [ - { - "segmentation_type": "vlan", - "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", - "segmentation_id": 44 - } - ] -} diff --git a/api-ref/source/v2/samples/trunks/trunk-remove-subports-request.json b/api-ref/source/v2/samples/trunks/trunk-remove-subports-request.json deleted file mode 100644 index cf1ac11..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-remove-subports-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sub_ports": [ - { - "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155" - } - ] -} diff --git a/api-ref/source/v2/samples/trunks/trunk-remove-subports-response.json b/api-ref/source/v2/samples/trunks/trunk-remove-subports-response.json deleted file mode 100644 index 7ed2ea0..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-remove-subports-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "status": "DOWN", - "sub_ports": [], - "name": "test", - "admin_state_up": true, - "project_id": "145a14e4a64b49bf98baad8945dbd4f1", - "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", - "created_at": "2016-10-05T22:31:37Z", - "updated_at": "2016-10-05T22:57:44Z", - "revision_number": 3, - "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "id": "114a26b1-d124-4835-bb4f-021d3d886023", - "description": "" -} diff --git a/api-ref/source/v2/samples/trunks/trunk-show-response.json b/api-ref/source/v2/samples/trunks/trunk-show-response.json deleted file mode 100644 index f9597ba..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-show-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "trunk": { - "status": "DOWN", - "sub_ports": [ - { - "segmentation_type": "vlan", - "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", - "segmentation_id": 44 - } - ], - "name": "foo", - "admin_state_up": true, - "project_id": "145a14e4a64b49bf98baad8945dbd4f1", - "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", - "created_at": "2016-10-05T22:31:37Z", - "updated_at": "2016-10-05T23:28:17Z", - "revision_number": 9, - "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "id": "114a26b1-d124-4835-bb4f-021d3d886023", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/trunks/trunk-update-request.json b/api-ref/source/v2/samples/trunks/trunk-update-request.json deleted file mode 100644 index 2727237..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-update-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trunk": { - "name": "foo", - "admin_state_up": true - } -} diff --git a/api-ref/source/v2/samples/trunks/trunk-update-response.json b/api-ref/source/v2/samples/trunks/trunk-update-response.json deleted file mode 100644 index 77e103a..0000000 --- a/api-ref/source/v2/samples/trunks/trunk-update-response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "trunk": { - "status": "DOWN", - "sub_ports": [ - { - "segmentation_type": "vlan", - "port_id": "4b4c691b-086d-43d2-8a65-5487e9434155", - "segmentation_id": 44 - } - ], - "name": "foo", - "admin_state_up": true, - "project_id": "145a14e4a64b49bf98baad8945dbd4f1", - "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", - "created_at": "2016-10-05T22:31:37Z", - "updated_at": "2016-10-05T23:28:17Z", - "revision_number": 9, - "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "id": "114a26b1-d124-4835-bb4f-021d3d886023", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/trunks/trunks-create-response.json b/api-ref/source/v2/samples/trunks/trunks-create-response.json deleted file mode 100644 index ff831dc..0000000 --- a/api-ref/source/v2/samples/trunks/trunks-create-response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "trunk": { - "status": "DOWN", - "sub_ports": [], - "name": "test", - "admin_state_up": true, - "project_id": "145a14e4a64b49bf98baad8945dbd4f1", - "tenant_id": "145a14e4a64b49bf98baad8945dbd4f1", - "created_at": "2016-10-05T22:31:37Z", - "updated_at": "2016-10-05T22:31:37Z", - "revision_number": 1, - "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "id": "114a26b1-d124-4835-bb4f-021d3d886023", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/trunks/trunks-list-response.json b/api-ref/source/v2/samples/trunks/trunks-list-response.json deleted file mode 100644 index 19bf2e7..0000000 --- a/api-ref/source/v2/samples/trunks/trunks-list-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "trunks": [ - { - "status": "DOWN", - "sub_ports": [], - "name": "test", - "admin_state_up": true, - "project_id": "313be01bd0744cea86643c711c57012b", - "tenant_id": "313be01bd0744cea86643c711c57012b", - "created_at": "2016-10-05T20:11:16Z", - "updated_at": "2016-10-05T20:11:16Z", - "revision_number": 1, - "port_id": "8027c4da-772f-4e43-bfbf-023b4a4e63de", - "id": "ee98bdb4-a817-43af-943f-4318bff98f51", - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/vpn/ikepolicies-list-response.json b/api-ref/source/v2/samples/vpn/ikepolicies-list-response.json deleted file mode 100644 index 40f7e82..0000000 --- a/api-ref/source/v2/samples/vpn/ikepolicies-list-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ikepolicies": [ - { - "name": "ikepolicy1", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "auth_algorithm": "sha1", - "encryption_algorithm": "aes-256", - "pfs": "group5", - "phase1_negotiation_mode": "main", - "lifetime": { - "units": "seconds", - "value": 3600 - }, - "ike_version": "v1", - "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/vpn/ikepolicy-create-request.json b/api-ref/source/v2/samples/vpn/ikepolicy-create-request.json deleted file mode 100644 index 87cf674..0000000 --- a/api-ref/source/v2/samples/vpn/ikepolicy-create-request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ikepolicy": { - "phase1_negotiation_mode": "main", - "auth_algorithm": "sha1", - "encryption_algorithm": "aes-128", - "pfs": "group5", - "lifetime": { - "units": "seconds", - "value": 7200 - }, - "ike_version": "v1", - "name": "ikepolicy1" - } -} diff --git a/api-ref/source/v2/samples/vpn/ikepolicy-create-response.json b/api-ref/source/v2/samples/vpn/ikepolicy-create-response.json deleted file mode 100644 index 1ad2230..0000000 --- a/api-ref/source/v2/samples/vpn/ikepolicy-create-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ikepolicy": { - "name": "ikepolicy1", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "auth_algorithm": "sha1", - "encryption_algorithm": "aes-128", - "pfs": "group5", - "phase1_negotiation_mode": "main", - "lifetime": { - "units": "seconds", - "value": 7200 - }, - "ike_version": "v1", - "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/ikepolicy-show-response.json b/api-ref/source/v2/samples/vpn/ikepolicy-show-response.json deleted file mode 100644 index b2429f2..0000000 --- a/api-ref/source/v2/samples/vpn/ikepolicy-show-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ikepolicy": { - "name": "ikepolicy1", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "auth_algorithm": "sha1", - "encryption_algorithm": "aes-256", - "pfs": "group5", - "phase1_negotiation_mode": "main", - "lifetime": { - "units": "seconds", - "value": 3600 - }, - "ike_version": "v1", - "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/ikepolicy-update-request.json b/api-ref/source/v2/samples/vpn/ikepolicy-update-request.json deleted file mode 100644 index 99a74af..0000000 --- a/api-ref/source/v2/samples/vpn/ikepolicy-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ikepolicy": { - "encryption_algorithm": "aes-256" - } -} diff --git a/api-ref/source/v2/samples/vpn/ikepolicy-update-response.json b/api-ref/source/v2/samples/vpn/ikepolicy-update-response.json deleted file mode 100644 index b2429f2..0000000 --- a/api-ref/source/v2/samples/vpn/ikepolicy-update-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ikepolicy": { - "name": "ikepolicy1", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "auth_algorithm": "sha1", - "encryption_algorithm": "aes-256", - "pfs": "group5", - "phase1_negotiation_mode": "main", - "lifetime": { - "units": "seconds", - "value": 3600 - }, - "ike_version": "v1", - "id": "5522aff7-1b3c-48dd-9c3c-b50f016b73db", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-request.json b/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-request.json deleted file mode 100644 index 584a748..0000000 --- a/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ipsec_site_connection": { - "psk": "secret", - "initiator": "bi-directional", - "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", - "admin_state_up": true, - "mtu": "1500", - "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", - "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", - "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", - "peer_address": "172.24.4.233", - "peer_id": "172.24.4.233", - "name": "vpnconnection1" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-response.json b/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-response.json deleted file mode 100644 index 5169ea6..0000000 --- a/api-ref/source/v2/samples/vpn/ipsec-site-connection-create-response.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "ipsec_site_connection": { - "status": "PENDING_CREATE", - "psk": "secret", - "initiator": "bi-directional", - "name": "vpnconnection1", - "admin_state_up": true, - "project_id": "10039663455a446d8ba2cbb058b0f578", - "tenant_id": "10039663455a446d8ba2cbb058b0f578", - "auth_mode": "psk", - "peer_cidrs": [], - "mtu": 1500, - "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", - "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", - "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "dpd": { - "action": "hold", - "interval": 30, - "timeout": 120 - }, - "route_mode": "static", - "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", - "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", - "peer_address": "172.24.4.233", - "peer_id": "172.24.4.233", - "id": "851f280f-5639-4ea3-81aa-e298525ab74b", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsec-site-connection-show-response.json b/api-ref/source/v2/samples/vpn/ipsec-site-connection-show-response.json deleted file mode 100644 index b62296f..0000000 --- a/api-ref/source/v2/samples/vpn/ipsec-site-connection-show-response.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "ipsec_site_connection": { - "status": "DOWN", - "psk": "secret", - "initiator": "bi-directional", - "name": "vpnconnection1", - "admin_state_up": true, - "project_id": "10039663455a446d8ba2cbb058b0f578", - "tenant_id": "10039663455a446d8ba2cbb058b0f578", - "auth_mode": "psk", - "peer_cidrs": [], - "mtu": 1500, - "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", - "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", - "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "dpd": { - "action": "hold", - "interval": 30, - "timeout": 120 - }, - "route_mode": "static", - "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", - "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", - "peer_address": "172.24.4.226", - "peer_id": "172.24.4.226", - "id": "851f280f-5639-4ea3-81aa-e298525ab74b", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-request.json b/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-request.json deleted file mode 100644 index 16ef5ce..0000000 --- a/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ipsec_site_connection": { - "mtu": "2000" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-response.json b/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-response.json deleted file mode 100644 index d244b9b..0000000 --- a/api-ref/source/v2/samples/vpn/ipsec-site-connection-update-response.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "ipsec_site_connection": { - "status": "DOWN", - "psk": "secret", - "initiator": "bi-directional", - "name": "vpnconnection1", - "admin_state_up": true, - "project_id": "10039663455a446d8ba2cbb058b0f578", - "tenant_id": "10039663455a446d8ba2cbb058b0f578", - "auth_mode": "psk", - "peer_cidrs": [], - "mtu": 2000, - "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", - "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", - "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "dpd": { - "action": "hold", - "interval": 30, - "timeout": 120 - }, - "route_mode": "static", - "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", - "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", - "peer_address": "172.24.4.233", - "peer_id": "172.24.4.233", - "id": "851f280f-5639-4ea3-81aa-e298525ab74b", - "description": "New description" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsec-site-connections-list-response.json b/api-ref/source/v2/samples/vpn/ipsec-site-connections-list-response.json deleted file mode 100644 index 0260cb0..0000000 --- a/api-ref/source/v2/samples/vpn/ipsec-site-connections-list-response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ipsec_site_connections": [ - { - "status": "PENDING CREATE", - "psk": "secret", - "initiator": "bi-directional", - "name": "vpnconnection1", - "admin_state_up": true, - "project_id": "10039663455a446d8ba2cbb058b0f578", - "tenant_id": "10039663455a446d8ba2cbb058b0f578", - "auth_mode": "psk", - "peer_cidrs": [], - "mtu": 1500, - "peer_ep_group_id": "9ad5a7e0-6dac-41b4-b20d-a7b8645fddf1", - "ikepolicy_id": "9b00d6b0-6c93-4ca5-9747-b8ade7bb514f", - "vpnservice_id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "dpd": { - "action": "hold", - "interval": 30, - "timeout": 120 - }, - "route_mode": "static", - "ipsecpolicy_id": "e6e23d0c-9519-4d52-8ea4-5b1f96d857b1", - "local_ep_group_id": "3e1815dd-e212-43d0-8f13-b494fa553e68", - "peer_address": "172.24.4.226", - "peer_id": "172.24.4.226", - "id": "851f280f-5639-4ea3-81aa-e298525ab74b", - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/vpn/ipsecpolicies-list-response.json b/api-ref/source/v2/samples/vpn/ipsecpolicies-list-response.json deleted file mode 100644 index 14bb6d7..0000000 --- a/api-ref/source/v2/samples/vpn/ipsecpolicies-list-response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ipsecpolicies": [ - { - "name": "ipsecpolicy1", - "transform_protocol": "esp", - "auth_algorithm": "sha1", - "encapsulation_mode": "tunnel", - "encryption_algorithm": "aes-128", - "pfs": "group14", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "lifetime": { - "units": "seconds", - "value": 3600 - }, - "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", - "description": "" - } - ] -} diff --git a/api-ref/source/v2/samples/vpn/ipsecpolicy-create-request.json b/api-ref/source/v2/samples/vpn/ipsecpolicy-create-request.json deleted file mode 100644 index 0ed0215..0000000 --- a/api-ref/source/v2/samples/vpn/ipsecpolicy-create-request.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ipsecpolicy": { - "name": "ipsecpolicy1", - "transform_protocol": "esp", - "auth_algorithm": "sha1", - "encapsulation_mode": "tunnel", - "encryption_algorithm": "aes-128", - "pfs": "group5", - "lifetime": { - "units": "seconds", - "value": 7200 - } - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsecpolicy-create-response.json b/api-ref/source/v2/samples/vpn/ipsecpolicy-create-response.json deleted file mode 100644 index a0c6c47..0000000 --- a/api-ref/source/v2/samples/vpn/ipsecpolicy-create-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ipsecpolicy": { - "name": "ipsecpolicy1", - "transform_protocol": "esp", - "auth_algorithm": "sha1", - "encapsulation_mode": "tunnel", - "encryption_algorithm": "aes-128", - "pfs": "group5", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "lifetime": { - "units": "seconds", - "value": 7200 - }, - "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsecpolicy-show-response.json b/api-ref/source/v2/samples/vpn/ipsecpolicy-show-response.json deleted file mode 100644 index 5ef7700..0000000 --- a/api-ref/source/v2/samples/vpn/ipsecpolicy-show-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ipsecpolicy": { - "name": "ipsecpolicy1", - "transform_protocol": "esp", - "auth_algorithm": "sha1", - "encapsulation_mode": "tunnel", - "encryption_algorithm": "aes-128", - "pfs": "group14", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "lifetime": { - "units": "seconds", - "value": 3600 - }, - "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsecpolicy-update-request.json b/api-ref/source/v2/samples/vpn/ipsecpolicy-update-request.json deleted file mode 100644 index 9b2a816..0000000 --- a/api-ref/source/v2/samples/vpn/ipsecpolicy-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ipsecpolicy": { - "pfs": "group14" - } -} diff --git a/api-ref/source/v2/samples/vpn/ipsecpolicy-update-response.json b/api-ref/source/v2/samples/vpn/ipsecpolicy-update-response.json deleted file mode 100644 index 5ef7700..0000000 --- a/api-ref/source/v2/samples/vpn/ipsecpolicy-update-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ipsecpolicy": { - "name": "ipsecpolicy1", - "transform_protocol": "esp", - "auth_algorithm": "sha1", - "encapsulation_mode": "tunnel", - "encryption_algorithm": "aes-128", - "pfs": "group14", - "project_id": "ccb81365fe36411a9011e90491fe1330", - "tenant_id": "ccb81365fe36411a9011e90491fe1330", - "lifetime": { - "units": "seconds", - "value": 3600 - }, - "id": "5291b189-fd84-46e5-84bd-78f40c05d69c", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-request.json b/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-request.json deleted file mode 100644 index ea22109..0000000 --- a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-request.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "endpoint_group": { - "endpoints": [ - "10.2.0.0/24", - "10.3.0.0/24" - ], - "type": "cidr", - "name": "peers" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-response.json b/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-response.json deleted file mode 100644 index a2935b2..0000000 --- a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-create-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "endpoint_group": { - "description": "", - "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "endpoints": [ - "10.2.0.0/24", - "10.3.0.0/24" - ], - "type": "cidr", - "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", - "name": "peers" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-show-response.json b/api-ref/source/v2/samples/vpn/vpn-endpoint-group-show-response.json deleted file mode 100644 index a2935b2..0000000 --- a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-show-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "endpoint_group": { - "description": "", - "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "endpoints": [ - "10.2.0.0/24", - "10.3.0.0/24" - ], - "type": "cidr", - "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", - "name": "peers" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-request.json b/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-request.json deleted file mode 100644 index 2b60b96..0000000 --- a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "endpoint_group": { - "description": "New description" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-response.json b/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-response.json deleted file mode 100644 index 31f484e..0000000 --- a/api-ref/source/v2/samples/vpn/vpn-endpoint-group-update-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "endpoint_group": { - "description": "New description", - "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "endpoints": [ - "10.2.0.0/24", - "10.3.0.0/24" - ], - "type": "cidr", - "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", - "name": "peers" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpn-endpoint-groups-list-response.json b/api-ref/source/v2/samples/vpn/vpn-endpoint-groups-list-response.json deleted file mode 100644 index e73458f..0000000 --- a/api-ref/source/v2/samples/vpn/vpn-endpoint-groups-list-response.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "endpoint_groups": [ - { - "description": "", - "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "endpoints": [ - "a3da778c-adfb-46db-88b3-d2ce53290a89" - ], - "type": "subnet", - "id": "6bf34c7c-864c-4948-a6d4-db791669f9d4", - "name": "locals" - }, - { - "description": "", - "project_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "tenant_id": "4ad57e7ce0b24fca8f12b9834d91079d", - "endpoints": [ - "10.2.0.0/24", - "10.3.0.0/24" - ], - "type": "cidr", - "id": "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", - "name": "peers" - } - ] -} diff --git a/api-ref/source/v2/samples/vpn/vpnservice-create-request.json b/api-ref/source/v2/samples/vpn/vpnservice-create-request.json deleted file mode 100644 index 01828b8..0000000 --- a/api-ref/source/v2/samples/vpn/vpnservice-create-request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "vpnservice": { - "subnet_id": null, - "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", - "name": "myservice", - "admin_state_up": true - } -} diff --git a/api-ref/source/v2/samples/vpn/vpnservice-create-response.json b/api-ref/source/v2/samples/vpn/vpnservice-create-response.json deleted file mode 100644 index 7e8dc1a..0000000 --- a/api-ref/source/v2/samples/vpn/vpnservice-create-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "vpnservice": { - "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", - "status": "PENDING_CREATE", - "name": "myservice", - "external_v6_ip": "2001:db8::1", - "admin_state_up": true, - "subnet_id": null, - "project_id": "10039663455a446d8ba2cbb058b0f578", - "tenant_id": "10039663455a446d8ba2cbb058b0f578", - "external_v4_ip": "172.32.1.11", - "id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpnservice-show-response.json b/api-ref/source/v2/samples/vpn/vpnservice-show-response.json deleted file mode 100644 index 7e8dc1a..0000000 --- a/api-ref/source/v2/samples/vpn/vpnservice-show-response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "vpnservice": { - "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", - "status": "PENDING_CREATE", - "name": "myservice", - "external_v6_ip": "2001:db8::1", - "admin_state_up": true, - "subnet_id": null, - "project_id": "10039663455a446d8ba2cbb058b0f578", - "tenant_id": "10039663455a446d8ba2cbb058b0f578", - "external_v4_ip": "172.32.1.11", - "id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "description": "" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpnservice-update-request.json b/api-ref/source/v2/samples/vpn/vpnservice-update-request.json deleted file mode 100644 index 1e80c51..0000000 --- a/api-ref/source/v2/samples/vpn/vpnservice-update-request.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "vpnservice": { - "description": "Updated description" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpnservice-update-response.json b/api-ref/source/v2/samples/vpn/vpnservice-update-response.json deleted file mode 100644 index 1c70579..0000000 --- a/api-ref/source/v2/samples/vpn/vpnservice-update-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "vpnservice": { - "router_id": "881b7b30-4efb-407e-a162-5630a7af3595", - "status": "ACTIVE", - "name": "myvpn", - "admin_state_up": true, - "subnet_id": null, - "project_id": "26de9cd6cae94c8cb9f79d660d628e1f", - "tenant_id": "26de9cd6cae94c8cb9f79d660d628e1f", - "id": "41bfef97-af4e-4f6b-a5d3-4678859d2485", - "description": "Updated description" - } -} diff --git a/api-ref/source/v2/samples/vpn/vpnservices-list-response.json b/api-ref/source/v2/samples/vpn/vpnservices-list-response.json deleted file mode 100644 index 2783c74..0000000 --- a/api-ref/source/v2/samples/vpn/vpnservices-list-response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "vpnservices": [ - { - "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa", - "status": "PENDING_CREATE", - "name": "myservice", - "external_v6_ip": "2001:db8::1", - "admin_state_up": true, - "subnet_id": null, - "project_id": "10039663455a446d8ba2cbb058b0f578", - "tenant_id": "10039663455a446d8ba2cbb058b0f578", - "external_v4_ip": "172.32.1.11", - "id": "5c561d9d-eaea-45f6-ae3e-08d1a7080828", - "description": "" - } - ] -} diff --git a/api-ref/source/v2/security-group-rules.inc b/api-ref/source/v2/security-group-rules.inc deleted file mode 100644 index f97ebe9..0000000 --- a/api-ref/source/v2/security-group-rules.inc +++ /dev/null @@ -1,190 +0,0 @@ -.. -*- rst -*- - -.. _security_group_rules: - -=========================================== -Security group rules (security-group-rules) -=========================================== - -Lists, creates, shows information for, and deletes security group -rules. - -List security group rules -========================= - -.. rest_method:: GET /v2.0/security-group-rules - -Lists a summary of all OpenStack Networking security group rules that the project can access. - -The list provides the ID for each security group rule. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_group_rules: security_group_rules - - remote_group_id: remote_group_id - - direction: direction - - protocol: protocol - - ethertype: ethertype - - port_range_max: port_range_max - - security_group_id: security_group_rule-security_group_id - - tenant_id: project_id - - project_id: project_id - - port_range_min: port_range_min - - remote_ip_prefix: remote_ip_prefix - - id: security_group_rule-id - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-rules-list-response.json - :language: javascript - -Create security group rule -========================== - -.. rest_method:: POST /v2.0/security-group-rules - -Creates an OpenStack Networking security group rule. - -Normal response codes: 201 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_rule: security_group_rule - - remote_group_id: remote_group_id - - direction: direction - - protocol: protocol - - ethertype: ethertype - - port_range_max: port_range_max - - security_group_id: security_group_rule-security_group_id - - port_range_min: port_range_min - - remote_ip_prefix: remote_ip_prefix - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/security-groups/security-group-rule-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_group_rule: security_group_rule - - remote_group_id: remote_group_id - - direction: direction - - protocol: protocol - - ethertype: ethertype - - port_range_max: port_range_max - - security_group_id: security_group_rule-security_group_id - - tenant_id: project_id - - project_id: project_id - - port_range_min: port_range_min - - remote_ip_prefix: remote_ip_prefix - - id: security_group_rule-id - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-rule-create-response.json - :language: javascript - -Show security group rule -======================== - -.. rest_method:: GET /v2.0/security-group-rules/{security_group_rule_id} - -Shows detailed information for a security group rule. - -The response body contains the following information about the -security group rule: - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_rule_id: security_group_rule-id-path - - verbose: verbose - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_group_rule: security_group_rule - - remote_group_id: remote_group_id - - direction: direction - - protocol: protocol - - ethertype: ethertype - - port_range_max: port_range_max - - security_group_id: security_group_rule-security_group_id - - tenant_id: project_id - - project_id: project_id - - port_range_min: port_range_min - - remote_ip_prefix: remote_ip_prefix - - id: security_group_rule-id - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-rule-show-response.json - :language: javascript - -Delete security group rule -========================== - -.. rest_method:: DELETE /v2.0/security-group-rules/{security_group_rule_id} - -Deletes a rule from an OpenStack Networking security group. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_rule_id: security_group_rule-id-path - -Response --------- - -There is no body content is returned on a successful DELETE request. diff --git a/api-ref/source/v2/security-groups.inc b/api-ref/source/v2/security-groups.inc deleted file mode 100644 index 960f705..0000000 --- a/api-ref/source/v2/security-groups.inc +++ /dev/null @@ -1,234 +0,0 @@ -.. -*- rst -*- - -================================= -Security groups (security-groups) -================================= - -Lists, creates, shows information for, updates, and deletes -security groups. - -List security groups -==================== - -.. rest_method:: GET /v2.0/security-groups - -Lists OpenStack Networking security groups to which the project has access. - -The response is an array of ``security_group`` objects which contains a list of -``security_group_rules`` objects. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_groups: security_groups-obj - - id: security_group-id - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - security_group_rules: security_group_rules - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-groups-list-response.json - :language: javascript - -Create security group -===================== - -.. rest_method:: POST /v2.0/security-groups - -Creates an OpenStack Networking security group. - -This operation creates a security group with default security group -rules for the IPv4 and IPv6 ether types. - -Normal response codes: 201 - -Error response codes: 400, 401, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group: security_group - - tenant_id: project_id - - project_id: project_id - - description: description-request - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/security-groups/security-group-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_group: security_group - - id: security_group-id - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - security_group_rules: security_group_rules - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-create-response.json - :language: javascript - -Show security group -=================== - -.. rest_method:: GET /v2.0/security-groups/{security_group_id} - -Shows details for a security group. - -The associated security group rules are contained in the response. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_id: security_group-id-path - - verbose: verbose - - fields: fields - -Request Example ---------------- - -.. literalinclude:: samples/security-groups/security-group-show-request-json-http.txt - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_group: security_group - - id: security_group-id - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - security_group_rules: security_group_rules - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-show-response.json - :language: javascript - -Update security group -===================== - -.. rest_method:: PUT /v2.0/security-groups/{security_group_id} - -Updates a security group. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_id: security_group-id-path - - security_group: security_group - - description: description-request - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/security-groups/security-group-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_group: security_group - - id: security_group-id - - tenant_id: project_id - - project_id: project_id - - name: name - - description: description - - security_group_rules: security_group_rules - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-update-response.json - :language: javascript - -Delete security group -===================== - -.. rest_method:: DELETE /v2.0/security-groups/{security_group_id} - -Deletes an OpenStack Networking security group. - -This operation deletes an OpenStack Networking security group and -its associated security group rules, provided that a port is not -associated with the security group. If a port is associated with the security -group 409 (Conflict) is returned. - -This operation does not require a request body. This operation does -not return a response body. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_id: security_group-id-path - -Request Example ---------------- - -.. literalinclude:: samples/security-groups/security-group-delete-request-json-http.txt - :language: javascript - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/api-ref/source/v2/segments.inc b/api-ref/source/v2/segments.inc deleted file mode 100644 index f40bb0a..0000000 --- a/api-ref/source/v2/segments.inc +++ /dev/null @@ -1,209 +0,0 @@ -.. -*- rst -*- - -======== -Segments -======== - -Lists, shows details for, creates, updates, and deletes segments. The -segments API is admin-only. - -Show segment details -==================== - -.. rest_method:: GET /v2.0/segments/{segment_id} - -Shows details for a segment. - -You can control which response parameters are returned by using the -fields query parameter. For information, see `Filtering and column -selection `__. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - segment_id: segment_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - id: segment_id - - network_id: network_id - - physical_network: provider:physical_network - - network_type: network_type - - segmentation_id: provider:segmentation_id - - name: name - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/segments/segment-show-response.json - :language: javascript - -Update segment -============== - -.. rest_method:: PUT /v2.0/segments/{segment_id} - -Updates a segment. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - segment_id: segment_id-path - - name: name-segment - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/segments/segment-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - id: segment_id - - network_id: network_id - - physical_network: provider:physical_network - - network_type: network_type - - segmentation_id: provider:segmentation_id - - name: name - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/segments/segment-update-response.json - :language: javascript - -Delete segment -============== - -.. rest_method:: DELETE /v2.0/segments/{segment_id} - -Deletes a segment and its associated resources. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - segment_id: segment_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List segments -============= - -.. rest_method:: GET /v2.0/segments - -Lists segments to which the project has access. - -Use the ``fields`` query parameter to filter the response. For -information, see `Filtering and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - id: segment_id - - network_id: network_id - - physical_network: provider:physical_network - - network_type: network_type - - segmentation_id: provider:segmentation_id - - name: name - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/segments/segments-list-response.json - :language: javascript - -Create segment -============== - -.. rest_method:: POST /v2.0/segments - -Creates a segment. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - network_id: network_id - - physical_network: provider:physical_network - - network_type: network_type - - segmentation_id: provider:segmentation_id - - name: name-segment - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/segments/segment-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - id: segment_id - - network_id: network_id - - physical_network: provider:physical_network - - network_type: network_type - - segmentation_id: provider:segmentation_id - - name: name - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/segments/segment-create-response.json - :language: javascript diff --git a/api-ref/source/v2/service-providers.inc b/api-ref/source/v2/service-providers.inc deleted file mode 100644 index 90fb4fa..0000000 --- a/api-ref/source/v2/service-providers.inc +++ /dev/null @@ -1,47 +0,0 @@ -.. -*- rst -*- - -================= -Service providers -================= - -Lists service providers. - -List service providers -====================== - -.. rest_method:: GET /v2.0/service-providers - -Lists service providers and their associated service types. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - service_providers: service_providers - - service_type: service_type - - name: name - - default: default - -Response Example ----------------- - -.. literalinclude:: samples/service-type-response.json - :language: javascript diff --git a/api-ref/source/v2/subnetpools.inc b/api-ref/source/v2/subnetpools.inc deleted file mode 100644 index 4e52f08..0000000 --- a/api-ref/source/v2/subnetpools.inc +++ /dev/null @@ -1,275 +0,0 @@ -.. -*- rst -*- - -==================================== -Subnet pools extension (subnetpools) -==================================== - -Lists, creates, shows details for, updates, and deletes subnet -pools. - -Show subnet pool -================ - -.. rest_method:: GET /v2.0/subnetpools/{subnetpool_id} - -Shows information for a subnet pool. - -Use the ``fields`` query parameter to control which fields are returned in the response body. -Additionally, you can filter results by using query string parameters. -For information, see `Filtering and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnetpool_id: subnetpool_id - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnetpool: subnetpool - - id: subnetpool_id_body - - name: name - - default_quota: default_quota - - tenant_id: project_id - - project_id: project_id - - created_at: created_at - - updated_at: updated_at - - prefixes: prefixes - - min_prefixlen: min_prefixlen - - address_scope_id: address_scope_id - - ip_version: ip_version - - shared: shared - - default_prefixlen: default_prefixlen - - max_prefixlen: max_prefixlen - - description: description - - is_default: subnetpool_is_default - - revision_number: subnetpool_revision_number - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnetpool-show-response.json - :language: javascript - -Update subnet pool -================== - -.. rest_method:: PUT /v2.0/subnetpools/{subnetpool_id} - -Updates a subnet pool. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnetpool_id: subnetpool_id - - subnetpool: subnetpool - - name: name - - default_quota: default_quota - - tenant_id: project_id - - project_id: project_id - - prefixes: prefixes - - min_prefixlen: min_prefixlen - - address_scope_id: address_scope_id - - default_prefixlen: default_prefixlen - - max_prefixlen: max_prefixlen - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/subnets/subnetpool-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnetpool: subnetpool - - id: subnetpool_id_body - - name: name - - default_quota: default_quota - - tenant_id: project_id - - project_id: project_id - - created_at: created_at - - updated_at: updated_at - - prefixes: prefixes - - min_prefixlen: min_prefixlen - - address_scope_id: address_scope_id - - ip_version: ip_version - - shared: shared - - default_prefixlen: default_prefixlen - - max_prefixlen: max_prefixlen - - description: description - - is_default: subnetpool_is_default - - revision_number: subnetpool_revision_number - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnetpool-update-response.json - :language: javascript - -Delete subnet pool -================== - -.. rest_method:: DELETE /v2.0/subnetpools/{subnetpool_id} - -Deletes a subnet pool. - -The operation fails if any subnets allocated from the subnet pool -are still in use. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnetpool_id: subnetpool_id - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List subnet pools -================= - -.. rest_method:: GET /v2.0/subnetpools - -Lists subnet pools that the project has access to. - -Default policy settings return only the subnet pools owned by -the project of the user submitting the request, unless the -user has administrative role. - -Use the ``fields`` query parameter to control which fields are returned in the response body. -Additionally, you can filter results by using query string parameters. -For information, see `Filtering and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnetpools: subnetpools - - id: subnetpool_id_body - - name: name - - default_quota: default_quota - - tenant_id: project_id - - project_id: project_id - - created_at: created_at - - updated_at: updated_at - - prefixes: prefixes - - min_prefixlen: min_prefixlen - - address_scope_id: address_scope_id - - ip_version: ip_version - - shared: shared - - default_prefixlen: default_prefixlen - - max_prefixlen: max_prefixlen - - description: description - - is_default: subnetpool_is_default - - revision_number: subnetpool_revision_number - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnetpools-list-response.json - :language: javascript - -Create subnet pool -================== - -.. rest_method:: POST /v2.0/subnetpools - -Creates a subnet pool. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnetpool: subnetpool - - name: name - - default_quota: default_quota - - tenant_id: project_id - - project_id: project_id - - prefixes: prefixes - - min_prefixlen: min_prefixlen - - address_scope_id: address_scope_id - - shared: shared - - default_prefixlen: default_prefixlen - - max_prefixlen: max_prefixlen - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/subnets/subnetpool-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnetpool: subnetpool - - id: subnetpool_id_body - - name: name - - default_quota: default_quota - - tenant_id: project_id - - project_id: project_id - - created_at: created_at - - updated_at: updated_at - - prefixes: prefixes - - min_prefixlen: min_prefixlen - - address_scope_id: address_scope_id - - ip_version: ip_version - - shared: shared - - default_prefixlen: default_prefixlen - - max_prefixlen: max_prefixlen - - description: description - - is_default: subnetpool_is_default - - revision_number: subnetpool_revision_number - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnetpool-create-response.json - :language: javascript \ No newline at end of file diff --git a/api-ref/source/v2/subnets.inc b/api-ref/source/v2/subnets.inc deleted file mode 100644 index 78c830e..0000000 --- a/api-ref/source/v2/subnets.inc +++ /dev/null @@ -1,408 +0,0 @@ -.. -*- rst -*- - -======= -Subnets -======= - -Lists, shows details for, creates, updates, and deletes subnet -resources. - -List subnets -============ - -.. rest_method:: GET /v2.0/subnets - -Lists subnets that the project has access to. - -Default policy settings return only subnets owned by the -project of the user submitting the request, unless the -user has administrative role. You can control which attributes -are returned by using the fields query parameter. You can filter -results by using query string parameters. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnets: subnets-obj - - id: subnet-id-body - - tenant_id: project_id - - project_id: project_id - - name: subnet-name - - enable_dhcp: subnet-enable_dhcp - - network_id: subnet-network_id - - dns_nameservers: subnet-dns_nameservers - - allocation_pools: subnet-allocation_pools - - host_routes: subnet-host_routes - - ip_version: subnet-ip_version - - gateway_ip: subnet-gateway_ip - - cidr: cidr - - created_at: subnet-created_at - - description: description - - ipv6_address_mode: subnet-ipv6_address_mode - - ipv6_ra_mode: subnet-ipv6_ra_mode - - revision_number: subnet-revision_number - - segment_id: subnet-segment_id - - service_types: subnet-service_types - - subnetpool_id: subnet-subnetpool_id - - updated_at: subnet-updated_at - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnets-list-response.json - :language: javascript - -Create subnet -============= - -.. rest_method:: POST /v2.0/subnets - -Creates a subnet on a network. - -OpenStack Networking does not try to derive the correct IP version -from the CIDR. If you do not specify the ``gateway_ip`` attribute, -OpenStack Networking allocates an address from the CIDR for the -gateway for the subnet. - -To specify a subnet without a gateway, set the ``gateway_ip`` -attribute to ``null`` in the request body. If you do not specify -the ``allocation_pools`` attribute, OpenStack Networking -automatically allocates pools for covering all IP addresses in the -CIDR, excluding the address reserved for the subnet gateway. -Otherwise, you can explicitly specify allocation pools as shown in -the following example. - -When you specify both the ``allocation_pools`` and ``gateway_ip`` -attributes, you must ensure that the gateway IP does not overlap -with the allocation pools; otherwise, the call returns the -``Conflict (409)`` response code. - -A subnet can have one or more name servers and host routes. Hosts -in this subnet use the name servers. Devices with IP addresses from -this subnet, not including the local subnet route, use the host -routes. - -Specify the ``ipv6_ra_mode`` and ``ipv6_address_mode`` attributes -to create subnets that support IPv6 configurations, such as -stateless address autoconfiguration (SLAAC), DHCPv6 stateful, and -DHCPv6 stateless configurations. - -A subnet can optionally be associated with a network segment when -it is created by specifying the ``segment_id`` of a valid segment -on the specified network. A network with subnets associated in this -way is called a routed network. On any given network, all of the -subnets must be associated with segments or none of them can be. -Neutron enforces this invariant. Currently, routed networks are -only supported for provider networks. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnet: subnet-obj - - tenant_id: project_id-request - - project_id: project_id-request - - name: subnet-name-request - - enable_dhcp: subnet-enable_dhcp-request - - network_id: subnet-network_id - - dns_nameservers: subnet-dns_nameservers-request - - allocation_pools: subnet-allocation_pools-request - - host_routes: subnet-host_routes-request - - ip_version: subnet-ip_version - - gateway_ip: subnet-gateway_ip-request - - cidr: cidr - - description: description-request - - ipv6_address_mode: subnet-ipv6_address_mode-request - - ipv6_ra_mode: subnet-ipv6_ra_mode-request - - segment_id: subnet-segment_id-request - - subnetpool_id: subnet-subnetpool_id-request - -Request Example ---------------- - -.. literalinclude:: samples/subnets/subnet-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnet: subnet-obj - - id: subnet-id-body - - tenant_id: project_id - - project_id: project_id - - name: subnet-name - - enable_dhcp: subnet-enable_dhcp - - network_id: subnet-network_id - - dns_nameservers: subnet-dns_nameservers - - allocation_pools: subnet-allocation_pools - - host_routes: subnet-host_routes - - ip_version: subnet-ip_version - - gateway_ip: subnet-gateway_ip - - cidr: cidr - - created_at: subnet-created_at - - description: description - - ipv6_address_mode: subnet-ipv6_address_mode - - ipv6_ra_mode: subnet-ipv6_ra_mode - - revision_number: subnet-revision_number - - service_types: subnet-service_types - - subnetpool_id: subnet-subnetpool_id - - segment_id: subnet-segment_id - - updated_at: subnet-updated_at - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnet-create-response.json - :language: javascript - -Bulk create subnet -================== - -.. rest_method:: POST /v2.0/subnets - -Creates multiple subnets in a single request. Specify a list of subnets in the request body. - -The bulk create operation is always atomic. Either all or no -subnets in the request body are created. - -Normal response codes: 201 - -Error response codes: 400, 401, 403, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnets: subnets-obj - - tenant_id: project_id-request - - project_id: project_id-request - - name: subnet-name-request - - enable_dhcp: subnet-enable_dhcp-request - - network_id: subnet-network_id - - dns_nameservers: subnet-dns_nameservers-request - - allocation_pools: subnet-allocation_pools-request - - host_routes: subnet-host_routes-request - - ip_version: subnet-ip_version - - gateway_ip: subnet-gateway_ip-request - - cidr: cidr - - description: description-request - - ipv6_address_mode: subnet-ipv6_address_mode-request - - ipv6_ra_mode: subnet-ipv6_ra_mode-request - - segment_id: subnet-segment_id-request - - subnetpool_id: subnet-subnetpool_id-request - -Request Example ---------------- - -.. literalinclude:: samples/subnets/subnets-create-bulk-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnets: subnets-obj - - id: subnet-id-body - - tenant_id: project_id - - project_id: project_id - - name: subnet-name - - enable_dhcp: subnet-enable_dhcp - - network_id: subnet-network_id - - dns_nameservers: subnet-dns_nameservers - - allocation_pools: subnet-allocation_pools - - host_routes: subnet-host_routes - - ip_version: subnet-ip_version - - gateway_ip: subnet-gateway_ip - - cidr: cidr - - created_at: subnet-created_at - - description: description - - ipv6_address_mode: subnet-ipv6_address_mode - - ipv6_ra_mode: subnet-ipv6_ra_mode - - revision_number: subnet-revision_number - - segment_id: subnet-segment_id - - service_types: subnet-service_types - - subnetpool_id: subnet-subnetpool_id - - updated_at: subnet-updated_at - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnets-create-bulk-response.json - :language: javascript - -Show subnet details -=================== - -.. rest_method:: GET /v2.0/subnets/{subnet_id} - -Shows details for a subnet. - -Use the fields query parameter to filter the results. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnet_id: subnet_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnet: subnet-obj - - id: subnet-id-body - - tenant_id: project_id - - project_id: project_id - - created_at: subnet-created_at - - name: subnet-name - - enable_dhcp: subnet-enable_dhcp - - network_id: subnet-network_id - - dns_nameservers: subnet-dns_nameservers - - allocation_pools: subnet-allocation_pools - - host_routes: subnet-host_routes - - ip_version: subnet-ip_version - - gateway_ip: subnet-gateway_ip - - cidr: cidr - - updated_at: subnet-updated_at - - description: description - - ipv6_address_mode: subnet-ipv6_address_mode - - ipv6_ra_mode: subnet-ipv6_ra_mode - - revision_number: subnet-revision_number - - segment_id: subnet-segment_id - - service_types: subnet-service_types - - subnetpool_id: subnet-subnetpool_id - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnet-show-response.json - :language: javascript - -Update subnet -============= - -.. rest_method:: PUT /v2.0/subnets/{subnet_id} - -Updates a subnet. - -Some attributes, such as IP version (ip_version), CIDR (cidr), and -segment (segment_id) cannot be updated. Attempting to update these -attributes results in a ``400 Bad Request`` error. - -Normal response codes: 200 - -Error response codes: 400, 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnet_id: subnet_id-path - - name: subnet-name-update-request - - enable_dhcp: subnet-enable_dhcp-request - - dns_nameservers: subnet-dns_nameservers-request - - allocation_pools: subnet-allocation_pools-request - - host_routes: subnet-host_routes-request - - gateway_ip: subnet-gateway_ip-request - - description: description-request - -Request Example ---------------- - -.. literalinclude:: samples/subnets/subnet-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - subnet: subnet-obj - - id: subnet-id-body - - tenant_id: project_id - - project_id: project_id - - name: subnet-name - - enable_dhcp: subnet-enable_dhcp - - network_id: subnet-network_id - - dns_nameservers: subnet-dns_nameservers - - allocation_pools: subnet-allocation_pools - - host_routes: subnet-host_routes - - ip_version: subnet-ip_version - - gateway_ip: subnet-gateway_ip - - cidr: cidr - - created_at: subnet-created_at - - description: description - - ipv6_address_mode: subnet-ipv6_address_mode - - ipv6_ra_mode: subnet-ipv6_ra_mode - - revision_number: subnet-revision_number - - segment_id: subnet-segment_id - - service_types: subnet-service_types - - subnetpool_id: subnet-subnetpool_id - - updated_at: subnet-updated_at - -Response Example ----------------- - -.. literalinclude:: samples/subnets/subnet-update-response.json - :language: javascript - -Delete subnet -============= - -.. rest_method:: DELETE /v2.0/subnets/{subnet_id} - -Deletes a subnet. - -The operation fails if subnet IP addresses are still allocated. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - subnet_id: subnet_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - diff --git a/api-ref/source/v2/tags.inc b/api-ref/source/v2/tags.inc deleted file mode 100644 index 9731aff..0000000 --- a/api-ref/source/v2/tags.inc +++ /dev/null @@ -1,193 +0,0 @@ - -==================== -Tag extension (tags) -==================== - -Shows details for, updates, and deletes tags. - -The maximum number of characters allowed in a tag is 60. If the length -is longer than 60, the API returns the HTTP ``Bad Request (400)`` response -code with 'invalid input for operation' error message. - -Tag Extension -============= - -The ``tag`` extension allows users to set tags on their networks. -This extension supports networks only. - -Enhanced Tag Extension -====================== - -The ``tag-ext`` extension allows users to set tags on their resources. -This extension supports subnets, ports, routers, and subnet pools. - -Replace all tags -================ - -.. rest_method:: PUT /v2.0/{resource_type}/{resource_id}/tags - -Replaces all tags on the resource. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - resource_type: resource_type - - resource_id: resource_id - - tags: tags - -Request Example ---------------- - -.. literalinclude:: samples/tag/tag-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - tags: tags - -Response Example ----------------- - -.. literalinclude:: samples/tag/tag-update-response.json - :language: javascript - -Remove all tags -=============== - -.. rest_method:: DELETE /v2.0/{resource_type}/{resource_id}/tags - -Removes all tags on the resource. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - resource_type: resource_type - - resource_id: resource_id - -Response --------- - -There is no body content for the response of a successful DELETE request. - -Confirm a tag -============= - -.. rest_method:: GET /v2.0/{resource_type}/{resource_id}/tags/{tag} - -Confirms a given tag is set on the resource. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - resource_type: resource_type - - resource_id: resource_id - - tag: tag - -Response --------- - -There is no body content for the response of a successful GET request. - -Add a tag -========= - -.. rest_method:: PUT /v2.0/{resource_type}/{resource_id}/tags/{tag} - -Adds a tag on the resource. - -Normal response codes: 201 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - resource_type: resource_type - - resource_id: resource_id - - tag: tag - -Response --------- - -There is no body content for the response of a successful PUT request. - -Obtain Tag List -=============== - -.. rest_method:: GET /v2.0/{resource_type}/{resource_id}/tags - -Obtains the tags for a resource. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - resource_type: resource_type - - resource_id: resource_id - -Response --------- - -.. rest_parameters:: parameters.yaml - - - tags: tags - -Response Example ----------------- - -.. literalinclude:: samples/tag/tag-obtain-response.json - :language: javascript - -Remove a tag -============ - -.. rest_method:: DELETE /v2.0/{resource_type}/{resource_id}/tags/{tag} - -Removes a tag on the resource. - -Normal response codes: 204 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - resource_type: resource_type - - resource_id: resource_id - - tag: tag - -Response --------- - -There is no body content for the response of a successful DELETE request. - diff --git a/api-ref/source/v2/trunk-details.inc b/api-ref/source/v2/trunk-details.inc deleted file mode 100644 index 326b1a8..0000000 --- a/api-ref/source/v2/trunk-details.inc +++ /dev/null @@ -1,43 +0,0 @@ -.. -*- rst -*- - -========================================= -Trunk details extended attributes (ports) -========================================= - -The trunk_details extension attribute is available when showing a -port resource that participates in a trunk as parent. The extension -is useful for REST clients that may want to access trunk details -when getting the parent port, and it allows them to avoid extra -lookups. - -Show trunk details -================== - -.. rest_method:: GET /v2.0/ports/{port_id} - -Shows details for a port. The details available in the `trunk_details` -attribute contain the trunk ID and the array showing information -about the subports that belong to the trunk: the port UUID, the -segmentation type, the segmentation ID, and the MAC address. - -Normal response codes: 200 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - port_id: port_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - trunk_details: trunk_details - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-details-show-response.json - :language: javascript diff --git a/api-ref/source/v2/trunk.inc b/api-ref/source/v2/trunk.inc deleted file mode 100644 index ed08981..0000000 --- a/api-ref/source/v2/trunk.inc +++ /dev/null @@ -1,394 +0,0 @@ -.. -*- rst -*- - -================ -Trunk networking -================ - -The trunk extension can be used to multiplex packets coming from and going to -multiple neutron logical networks using a single neutron logical port. A trunk -is modeled in neutron as a collection of neutron logical ports. One port, -called parent port, must be associated to a trunk and it is *the* port to -be used to connect instances with neutron. A sequence of subports (or -sub_ports) each typically belonging to distinct neutron networks, is also -associated to a trunk, and each subport may have a segmentation type and ID -used to mux/demux the traffic coming in and out of the parent port. - -In more details, the extension introduces the following resources: - -- **trunk**. A top level logical entity to model the group of neutron - logical networks whose traffic flows through the trunk. - -- **sub_port**. An association to a neutron logical port with attributes - segmentation_id and segmentation_type. - - -List trunks -=========== - -.. rest_method:: GET /v2.0/trunks - -Lists trunks that are accessible to the user who submits the request. - -Default policy settings return only those trunks that are -owned by the user who submits the request, unless an admin user -submits the request. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see the Filtering_ -section for more details. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - admin_state_up: admin_state_up_trunk - - created_at: created_at_resource - - description: description_resource - - id: id_resource - - name: name_resource - - port_id: trunk_port_id - - revision_number: revision_number - - status: trunk-status - - tenant_id: project_id-request - - project_id: project_id-request - - sub_ports: sub_ports - - updated_at: updated_at_resource - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunks-list-response.json - :language: javascript - - -Create trunk -============ - -.. rest_method:: POST /v2.0/trunks - -Error codes: - -- ``400`` The operation returns this error code if the request is malformed, - e.g. there are missing or invalid parameters in the request. - -- ``401`` The operation is not authorized. - -- ``404`` If the extension is not available or the port UUID of any of the - specified ports is not found. - -- ``409`` The operation returns this error code for one of these - reasons: - - - A port to be used as subport is in use by another trunk. - - - The segmentation type and segmentation ID are already in use in the trunk. - - - A port to be used as parent port is in use by another trunk or cannot be trunked. - - - A system configuration prevents the operation from succeeding. - - -Normal response codes: 201 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - tenant_id: project_id - - project_id: project_id - - port_id: trunk_port_id - - name: name_resource - - description: description_resource - - admin_state_up: admin_state_up_trunk - - sub_ports: sub_ports - -Request Example ---------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - admin_state_up: admin_state_up_trunk - - created_at: created_at_resource - - description: description_resource - - id: id_resource - - name: name_resource - - port_id: trunk_port_id - - revision_number: revision_number - - status: trunk-status - - tenant_id: project_id - - project_id: project_id - - sub_ports: sub_ports - - updated_at: updated_at_resource - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunks-create-response.json - :language: javascript - -Add subports to trunk -===================== - -.. rest_method:: PUT /v2.0/trunks/{trunk_id}/add_subports - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - trunk_id: trunk_id - - segmentation_id: segmentation_id - - segmentation_type: segmentation_type - - port_id: port_id_subport - -Request Example ---------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-add-subports-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - admin_state_up: admin_state_up_trunk - - created_at: created_at_resource - - description: description_resource - - id: id_resource - - name: name_resource - - port_id: trunk_port_id - - revision_number: revision_number - - status: trunk-status - - tenant_id: project_id - - project_id: project_id - - sub_ports: sub_ports - - updated_at: updated_at_resource - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-add-subports-response.json - :language: javascript - - -Delete subports from trunk -========================== - -.. rest_method:: PUT /v2.0/trunks/{trunk_id}/remove_subports - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - trunk_id: trunk_id - - port_id: port_id - -Request Example ---------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-remove-subports-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - admin_state_up: admin_state_up_trunk - - created_at: created_at_resource - - description: description_resource - - id: id_resource - - name: name_resource - - port_id: trunk_port_id - - revision_number: revision_number - - status: trunk-status - - tenant_id: project_id - - project_id: project_id - - sub_ports: sub_ports - - updated_at: updated_at_resource - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-remove-subports-response.json - :language: javascript - - -List subports for trunk -======================= - -.. rest_method:: GET /v2.0/trunks/{trunk_id}/get_subports - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - trunk_id: trunk_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - port_id: port_id_subport - - segmentation_type: segmentation_type - - segmentation_id: segmentation_id - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-list-subports-response.json - :language: javascript - - -Update trunk -============ - -.. rest_method:: PUT /v2.0/trunks/{trunk_id} - -The update request is only for changing fields like name, description or -admin_state_up. Setting the admin_state_up to False locks the trunk in -that it prevents operations such as as adding/removing subports. - -Normal response codes: 200 - -Error response codes: 400, 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - name_resource: name_resource - - admin_state_up_trunk: admin_state_up - - description_resource: description_resource - - trunk_id: trunk_id - -Request Example ---------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - - admin_state_up: admin_state_up_trunk - - created_at: created_at_resource - - description: description_resource - - id: id_resource - - name: name_resource - - port_id: trunk_port_id - - revision_number: revision_number - - status: trunk-status - - tenant_id: project_id - - project_id: project_id - - sub_ports: sub_ports - - updated_at: updated_at_resource - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-update-response.json - :language: javascript - - -Show trunk -========== - -.. rest_method:: GET /v2.0/trunks/{trunk_id} - -Shows details for a trunk. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. For information, see `Filtering and -Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - trunk_id: trunk_id - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - admin_state_up: admin_state_up_trunk - - created_at: created_at_resource - - description: description_resource - - id: id_resource - - name: name_resource - - port_id: trunk_port_id - - revision_number: revision_number - - status: trunk-status - - tenant_id: project_id - - project_id: project_id - - sub_ports: sub_ports - - updated_at: updated_at_resource - -Response Example ----------------- - -.. literalinclude:: ../v2/samples/trunks/trunk-show-response.json - :language: javascript - - -Delete trunk -============ - -.. rest_method:: DELETE /v2.0/trunks/{trunk_id} - -Deletes a trunk, if its state allows it. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - trunk_id: trunk_id diff --git a/api-ref/source/v2/versions.inc b/api-ref/source/v2/versions.inc deleted file mode 100644 index b2c2caa..0000000 --- a/api-ref/source/v2/versions.inc +++ /dev/null @@ -1,74 +0,0 @@ -.. -*- rst -*- -.. needs:example_verification - -============ -API versions -============ - -Lists information for all Networking API versions. - -List API versions -================= - -.. rest_method:: GET / - -Lists information about all Networking API versions. - -Normal response codes: 200 - -Request -------- - -.. .. rest_parameters:: parameters.yaml - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - versions: versions - - status: version-status - - id: version-id - - links: version-links - - href: version-href - - rel: version-rel - -Response Example ----------------- - -.. literalinclude:: samples/networks/versions-list-response.json - :language: javascript - -Show API v2 details -=================== - -.. rest_method:: GET /v2.0/ - -Shows details for Networking API v2.0. - -Normal response codes: 200 - -Error response codes: 401 - -Request -------- - -.. .. rest_parameters:: parameters.yaml - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - resources: resources - - name: resource-name - - collection: resource-collection - - links: resource-links - - href: resource-href - - rel: resource-rel - -Response Example ----------------- - -.. literalinclude:: samples/networks/version-show-response.json - :language: javascript diff --git a/api-ref/source/v2/vpnaas.inc b/api-ref/source/v2/vpnaas.inc deleted file mode 100644 index 2f0eb41..0000000 --- a/api-ref/source/v2/vpnaas.inc +++ /dev/null @@ -1,1277 +0,0 @@ -.. -*- rst -*- - -=================================================================================================================================================================================================== -VPNaaS 2.0 (`UNMAINTAINED `_) (vpn, vpnservices, ikepolicies, ipsecpolicies, endpoint-groups, ipsec-site-connections) -=================================================================================================================================================================================================== - -The Virtual-Private-Network-as-a-Service (VPNaaS) extension enables -OpenStack projects to extend private networks across the public -telecommunication infrastructure. - -This initial implementation of the VPNaaS extension provides: - -- Site-to-site VPN that connects two private networks. - -- Multiple VPN connections per project. - -- IKEv1 policy support with 3des, aes-128, aes-256, or aes-192 - encryption. - -- IPSec policy support with 3des, aes-128, aes-192, or aes-256 - encryption, sha1 authentication, ESP, AH, or AH-ESP transform - protocol, and tunnel or transport mode encapsulation. - -- Dead Peer Detection (DPD) with hold, clear, restart, disabled, or - restart-by-peer actions. - -This extension introduces these resources: - -- ``service``. A parent object that associates VPN with a specific - subnet and router. - -- ``ikepolicy``. The Internet Key Exchange (IKE) policy that - identifies the authentication and encryption algorithm to use - during phase one and two negotiation of a VPN connection. - -- ``ipsecpolicy``. The IP security policy that specifies the - authentication and encryption algorithm and encapsulation mode to - use for the established VPN connection. - -- ``ipsec-site-connection``. Details for the site-to-site IPsec - connection, including the peer CIDRs, MTU, authentication mode, - peer address, DPD settings, and status. - -- ``endpoint-groups``. Defines one or more endpoints of a specific type, - and can be used to specify both local and peer endpoints for - IPSec Connections. - -List IKE policies -================= - -.. rest_method:: GET /v2.0/vpn/ikepolicies - -Lists IKE policies. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ikepolicies: ikepolicies - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - phase1_negotiation_mode: phase1_negotiation_mode - - units: units - - lifetime: lifetime - - id: ikepolicy_id-body-response - - ike_version: ike_version - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ikepolicies-list-response.json - :language: javascript - -Create IKE policy -================= - -.. rest_method:: POST /v2.0/vpn/ikepolicies - -Creates an IKE policy. - -The IKE policy is used for phases one and two negotiation of the -VPN connection. You can specify both the authentication and -encryption algorithms for connections. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ikepolicy: ikepolicy - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - phase1_negotiation_mode: phase1_negotiation_mode - - units: units - - lifetime: lifetime - - ike_version: ike_version - -Request Example ---------------- - -.. literalinclude:: samples/vpn/ikepolicy-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ikepolicies: ikepolicies - - ikepolicy: ikepolicy - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - phase1_negotiation_mode: phase1_negotiation_mode - - units: units - - lifetime: lifetime - - id: ikepolicy_id-body-response - - ike_version: ike_version - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ikepolicy-create-response.json - :language: javascript - -Show IKE policy details -======================= - -.. rest_method:: GET /v2.0/vpn/ikepolicies/{ikepolicy_id} - -Shows details for an IKE policy. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ikepolicy_id: ikepolicy_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ikepolicies: ikepolicies - - ikepolicy: ikepolicy - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - phase1_negotiation_mode: phase1_negotiation_mode - - units: units - - lifetime: lifetime - - id: ikepolicy_id-body-response - - ike_version: ike_version - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ikepolicy-show-response.json - :language: javascript - -Update IKE policy -================= - -.. rest_method:: PUT /v2.0/vpn/ikepolicies/{ikepolicy_id} - -Updates policy settings in an IKE policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ikepolicy_id: ikepolicy_id-path - - ikepolicy: ikepolicy - - description: description - - auth_algorithm: auth_algorithm - - name: name - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - phase1_negotiation_mode: phase1_negotiation_mode - - units: units - - lifetime: lifetime - - ike_version: ike_version - -Request Example ---------------- - -.. literalinclude:: samples/vpn/ikepolicy-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ikepolicies: ikepolicies - - ikepolicy: ikepolicy - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - name: name - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - phase1_negotiation_mode: phase1_negotiation_mode - - units: units - - lifetime: lifetime - - id: ikepolicy_id-body-response - - ike_version: ike_version - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ikepolicy-update-response.json - :language: javascript - -Remove IKE policy -================= - -.. rest_method:: DELETE /v2.0/vpn/ikepolicies/{ikepolicy_id} - -Removes an IKE policy. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ikepolicy_id: ikepolicy_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List IPSec policies -=================== - -.. rest_method:: GET /v2.0/vpn/ipsecpolicies - -Lists all IPSec policies. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicies: ipsecpolicies - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encapsulation_mode: encapsulation_mode - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - transform_protocol: transform_protocol - - units: units - - lifetime: lifetime - - id: ipsecpolicy_id-body-response - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsecpolicies-list-response.json - :language: javascript - -Create IPSec policy -=================== - -.. rest_method:: POST /v2.0/vpn/ipsecpolicies - -Creates an IP security (IPSec) policy. - -The IPsec policy specifies the authentication and encryption -algorithms and encapsulation mode to use for the established VPN -connection. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicy: ipsecpolicy - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encapsulation_mode: encapsulation_mode - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - transform_protocol: transform_protocol - - units: units - - lifetime: lifetime - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/vpn/ipsecpolicy-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicies: ipsecpolicies - - ipsecpolicy: ipsecpolicy - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encapsulation_mode: encapsulation_mode - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - transform_protocol: transform_protocol - - units: units - - lifetime: lifetime - - id: ipsecpolicy_id-body-response - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsecpolicy-create-response.json - :language: javascript - -Show IPSec policy -================= - -.. rest_method:: GET /v2.0/vpn/ipsecpolicies/{ipsecpolicy_id} - -Shows details for an IPSec policy. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicy_id: ipsecpolicy_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicies: ipsecpolicies - - ipsecpolicy: ipsecpolicy - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encapsulation_mode: encapsulation_mode - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - transform_protocol: transform_protocol - - units: units - - lifetime: lifetime - - id: ipsecpolicy_id-body-response - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsecpolicy-show-response.json - :language: javascript - -Update IPSec policy -=================== - -.. rest_method:: PUT /v2.0/vpn/ipsecpolicies/{ipsecpolicy_id} - -Updates policy settings in an IPSec policy. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicy_id: ipsecpolicy_id-path - - ipsecpolicy: ipsecpolicy - - description: description - - transform_protocol: transform_protocol - - auth_algorithm: auth_algorithm - - encapsulation_mode: encapsulation_mode - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - units: units - - lifetime: lifetime - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/vpn/ipsecpolicy-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicies: ipsecpolicies - - ipsecpolicy: ipsecpolicy - - description: description - - tenant_id: project_id - - project_id: project_id - - auth_algorithm: auth_algorithm - - encapsulation_mode: encapsulation_mode - - encryption_algorithm: encryption_algorithm - - pfs: pfs - - value: value - - transform_protocol: transform_protocol - - units: units - - lifetime: lifetime - - id: ipsecpolicy_id-body-response - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsecpolicy-update-response.json - :language: javascript - -Remove IPSec policy -=================== - -.. rest_method:: DELETE /v2.0/vpn/ipsecpolicies/{ipsecpolicy_id} - -Removes an IPSec policy. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ipsecpolicy_id: ipsecpolicy_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List IPSec connections -====================== - -.. rest_method:: GET /v2.0/vpn/ipsec-site-connections - -Lists all IPSec connections. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. For information, see `Filtering and -Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - auth_mode: auth_mode - - ikepolicy_id: ikepolicy_id-body-response - - vpnservice_id: vpnservice_id-body-response - - local_ep_group_id: local_ep_group_id - - peer_address: peer_address - - id: connection_id-body-response - - route_mode: route_mode - - ipsecpolicy_id: ipsecpolicy_id-body-response - - peer_id: peer_id - - status: ipsec_site_connection-status - - psk: psk - - description: description - - initiator: initiator - - peer_cidrs: peer_cidrs - - name: name - - admin_state_up: admin_state_up - - tenant_id: project_id - - project_id: project_id - - interval: interval - - mtu: mtu - - peer_ep_group_id: peer_ep_group_id - - dpd: dpd - - timeout: ipsec_site_connection-timeout - - action: ipsec_site_connection-action - - local_id: local_id - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsec-site-connections-list-response.json - :language: javascript - -Create IPSec connection -======================= - -.. rest_method:: POST /v2.0/vpn/ipsec-site-connections - -Creates a site-to-site IPSec connection for a service. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - ipsec_site_connection: ipsec_site_connection - - auth_mode: auth_mode - - ikepolicy_id: ikepolicy_id-body-request - - vpnservice_id: vpnservice_id-body-request - - local_ep_group_id: local_ep_group_id - - peer_address: peer_address - - route_mode: route_mode - - ipsecpolicy_id: ipsecpolicy_id-body-request - - peer_id: peer_id - - psk: psk - - description: description - - initiator: initiator - - peer_cidrs: peer_cidrs - - name: name - - admin_state_up: admin_state_up - - tenant_id: project_id - - project_id: project_id - - interval: interval - - mtu: mtu - - peer_ep_group_id: peer_ep_group_id - - dpd: dpd - - timeout: ipsec_site_connection-timeout - - action: ipsec_site_connection-action - - local_id: local_id - -Request Example ---------------- - -.. literalinclude:: samples/vpn/ipsec-site-connection-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - ipsec_site_connection: ipsec_site_connection - - auth_mode: auth_mode - - ikepolicy_id: ikepolicy_id-body-response - - vpnservice_id: vpnservice_id-body-response - - local_ep_group_id: local_ep_group_id - - peer_address: peer_address - - id: connection_id-body-response - - route_mode: route_mode - - ipsecpolicy_id: ipsecpolicy_id-body-response - - peer_id: peer_id - - status: ipsec_site_connection-status - - psk: psk - - description: description - - initiator: initiator - - peer_cidrs: peer_cidrs - - name: name - - admin_state_up: admin_state_up - - tenant_id: project_id - - project_id: project_id - - interval: interval - - mtu: mtu - - peer_ep_group_id: peer_ep_group_id - - dpd: dpd - - timeout: ipsec_site_connection-timeout - - action: ipsec_site_connection-action - - local_id: local_id - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsec-site-connection-create-response.json - :language: javascript - -Show IPSec connection -===================== - -.. rest_method:: GET /v2.0/vpn/ipsec-site-connections/{connection_id} - -Shows details for an IPSec connection. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - connection_id: connection_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - auth_mode: auth_mode - - ikepolicy_id: ikepolicy_id-body-response - - vpnservice_id: vpnservice_id-body-response - - local_ep_group_id: local_ep_group_id - - peer_address: peer_address - - id: connection_id-body-response - - ipsec_site_connection: ipsec_site_connection - - route_mode: route_mode - - ipsecpolicy_id: ipsecpolicy_id-body-response - - peer_id: peer_id - - status: ipsec_site_connection-status - - psk: psk - - description: description - - initiator: initiator - - peer_cidrs: peer_cidrs - - name: name - - admin_state_up: admin_state_up - - tenant_id: project_id - - project_id: project_id - - interval: interval - - mtu: mtu - - peer_ep_group_id: peer_ep_group_id - - dpd: dpd - - timeout: ipsec_site_connection-timeout - - action: ipsec_site_connection-action - - local_id: local_id - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsec-site-connection-show-response.json - :language: javascript - -Update IPSec connection -======================= - -.. rest_method:: PUT /v2.0/vpn/ipsec-site-connections/{connection_id} - -Updates connection settings for an IPSec connection. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - connection_id: connection_id-path - - ipsec_site_connection: ipsec_site_connection - - psk: psk - - initiator: initiator - - description: description - - admin_state_up: admin_state_up - - interval: interval - - peer_cidrs: peer_cidrs - - mtu: mtu - - peer_ep_group_id: peer_ep_group_id - - local_ep_group_id: local_ep_group_id - - dpd: dpd - - timeout: ipsec_site_connection-timeout - - action: ipsec_site_connection-action - - peer_address: peer_address - - peer_id: peer_id - - name: name - - local_id: local_id - -Request Example ---------------- - -.. literalinclude:: samples/vpn/ipsec-site-connection-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - auth_mode: auth_mode - - ikepolicy_id: ikepolicy_id-body-response - - vpnservice_id: vpnservice_id-body-response - - local_ep_group_id: local_ep_group_id - - peer_address: peer_address - - id: connection_id-body-response - - ipsec_site_connection: ipsec_site_connection - - route_mode: route_mode - - ipsecpolicy_id: ipsecpolicy_id-body-response - - peer_id: peer_id - - status: ipsec_site_connection-status - - psk: psk - - description: description - - initiator: initiator - - peer_cidrs: peer_cidrs - - name: name - - admin_state_up: admin_state_up - - tenant_id: project_id - - project_id: project_id - - interval: interval - - mtu: mtu - - peer_ep_group_id: peer_ep_group_id - - dpd: dpd - - timeout: ipsec_site_connection-timeout - - action: ipsec_site_connection-action - - local_id: local_id - -Response Example ----------------- - -.. literalinclude:: samples/vpn/ipsec-site-connection-update-response.json - :language: javascript - -Remove IPSec connection -======================= - -.. rest_method:: DELETE /v2.0/vpn/ipsec-site-connections/{connection_id} - -Removes an IPSec connection. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - connection_id: connection_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List VPN endpoint groups -======================== - -.. rest_method:: GET /v2.0/vpn/endpoint-groups - -Lists VPN endpoint groups. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - endpoints: endpoints - - name: name - - description: description - - tenant_id: project_id - - project_id: project_id - - type: type - - id: endpoint_group_id-body-response - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpn-endpoint-groups-list-response.json - :language: javascript - -Create VPN endpoint group -========================= - -.. rest_method:: POST /v2.0/vpn/endpoint-groups - -Creates a VPN endpoint group. - -The endpoint group contains one or more endpoints of a specific -type that you can use to create a VPN connections. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - tenant_id: project_id - - project_id: project_id - - endpoints: endpoints - - type: type - - description: description - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/vpn/vpn-endpoint-group-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - endpoints: endpoints - - description: description - - tenant_id: project_id - - project_id: project_id - - type: type - - id: endpoint_group_id-body-response - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpn-endpoint-group-create-response.json - :language: javascript - -Show VPN endpoint group -======================= - -.. rest_method:: GET /v2.0/vpn/endpoint-groups/{endpoint_group_id} - -Shows details for a VPN endpoint group. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - endpoint_group_id: endpoint_group_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - endpoints: endpoints - - description: description - - tenant_id: project_id - - project_id: project_id - - type: type - - id: endpoint_group_id-body-response - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpn-endpoint-group-show-response.json - :language: javascript - -Update VPN endpoint group -========================= - -.. rest_method:: PUT /v2.0/vpn/endpoint-groups/{endpoint_group_id} - -Updates settings for a VPN endpoint group. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - description: description - - name: name - - endpoint_group_id: endpoint_group_id-path - -Request Example ---------------- - -.. literalinclude:: samples/vpn/vpn-endpoint-group-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - endpoints: endpoints - - description: description - - tenant_id: project_id - - project_id: project_id - - type: type - - id: endpoint_group_id-body-response - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpn-endpoint-group-update-response.json - :language: javascript - -Remove VPN endpoint group -========================= - -.. rest_method:: DELETE /v2.0/vpn/endpoint-groups/{endpoint_group_id} - -Removes a VPN endpoint group. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - endpoint_group_id: endpoint_group_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. - -List VPN services -================= - -.. rest_method:: GET /v2.0/vpn/vpnservices - -Lists all VPN services. - -The list might be empty. - -Use the ``fields`` query parameter to control which fields are -returned in the response body. Additionally, you can filter results -by using query string parameters. For information, see `Filtering -and Column Selection `__. - -Normal response codes: 200 - -Error response codes: 401, 403 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vpnservices: vpnservices - - router_id: router_id - - status: vpnservice-status - - name: name - - external_v6_ip: external_v6_ip - - admin_state_up: admin_state_up - - subnet_id: subnet_id - - tenant_id: project_id - - project_id: project_id - - external_v4_ip: external_v4_ip - - id: vpnservice_id-body-response - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpnservices-list-response.json - :language: javascript - -Create VPN service -================== - -.. rest_method:: POST /v2.0/vpn/vpnservices - -Creates a VPN service. - -The service is associated with a router. After you create the -service, it can contain multiple VPN connections. - -Normal response codes: 201 - -Error response codes: 400, 401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - vpnservice: vpnservice - - router_id: router_id - - description: description - - admin_state_up: admin_state_up - - subnet_id: subnet_id - - tenant_id: project_id - - project_id: project_id - - name: name - -Request Example ---------------- - -.. literalinclude:: samples/vpn/vpnservice-create-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vpnservice: vpnservice - - router_id: router_id - - status: vpnservice-status - - name: name - - external_v6_ip: external_v6_ip - - admin_state_up: admin_state_up - - subnet_id: subnet_id - - tenant_id: project_id - - project_id: project_id - - external_v4_ip: external_v4_ip - - id: vpnservice_id-body-response - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpnservice-create-response.json - :language: javascript - -Show VPN service details -======================== - -.. rest_method:: GET /v2.0/vpn/vpnservices/{service_id} - -Shows details for a VPN service. - -If the user is not an administrative user and the VPN service -object does not belong to the tenant account for the user, the -operation returns the ``Forbidden (403)`` response code. - -Normal response codes: 200 - -Error response codes: 401, 403, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - service_id: vpnservice_id-path - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vpnservice: vpnservice - - router_id: router_id - - status: vpnservice-status - - name: name - - external_v6_ip: external_v6_ip - - admin_state_up: admin_state_up - - subnet_id: subnet_id - - tenant_id: project_id - - project_id: project_id - - external_v4_ip: external_v4_ip - - id: vpnservice_id-body-response - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpnservice-show-response.json - :language: javascript - -Update VPN service -================== - -.. rest_method:: PUT /v2.0/vpn/vpnservices/{service_id} - -Updates a VPN service. - -Updates the attributes of a VPN service. You cannot update a -service with a ``PENDING_*`` status. - -Normal response codes: 200 - -Error response codes: 400, 401, 404 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - vpnservice: vpnservice - - description: description - - name: name - - admin_state_up: admin_state_up - - service_id: vpnservice_id-path - -Request Example ---------------- - -.. literalinclude:: samples/vpn/vpnservice-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - vpnservice: vpnservice - - router_id: router_id - - status: vpnservice-status - - name: name - - external_v6_ip: external_v6_ip - - admin_state_up: admin_state_up - - subnet_id: subnet_id - - tenant_id: project_id - - project_id: project_id - - external_v4_ip: external_v4_ip - - id: vpnservice_id-body-response - - description: description - -Response Example ----------------- - -.. literalinclude:: samples/vpn/vpnservice-update-response.json - :language: javascript - -Remove VPN service -================== - -.. rest_method:: DELETE /v2.0/vpn/vpnservices/{service_id} - -Removes a VPN service. - -If the service has connections, the request is rejected. - -Normal response codes: 204 - -Error response codes: 401, 404, 409 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - service_id: vpnservice_id-path - -Response --------- - -There is no body content for the response of a successful DELETE request. diff --git a/babel.cfg b/babel.cfg deleted file mode 100644 index 15cd6cb..0000000 --- a/babel.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[python: **.py] - diff --git a/doc/source/conf.py b/doc/source/conf.py deleted file mode 100755 index 9a3444b..0000000 --- a/doc/source/conf.py +++ /dev/null @@ -1,239 +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. - -# Build configuration file that is execfile()'d with the current directory -# set to it's containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import os -import subprocess -import sys -import warnings - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -ROOT_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) -sys.path.insert(0, ROOT_DIR) - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.coverage', - 'sphinx.ext.ifconfig', - 'sphinx.ext.graphviz', - 'sphinx.ext.todo', - 'openstackdocstheme',] - -todo_include_todos = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = [] -if os.getenv('HUDSON_PUBLISH_DOCS'): - templates_path = ['_ga', '_templates'] -else: - templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8' - -# The master doctree document. -master_doc = 'index' - -# General information about the project. -project = u'Neutron Library' -copyright = u'2015-present, OpenStack Foundation.' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# Version info -from neutron_lib.version import version_info as neutron_lib_version -release = neutron_lib_version.release_string() -# The short X.Y version. -version = neutron_lib_version.version_string() - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of documents that shouldn't be included in the build. -# unused_docs = [] - -# List of directories, relative to source directory, that shouldn't be searched -# for source files. -exclude_trees = [] - -# The reST default role (for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -show_authors = True - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -modindex_common_prefix = ['neutron_lib.'] - -# -- Options for man page output -------------------------------------------- - -# Grouping the document tree for man pages. -# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' - -# man_pages = [ -# ('man/neutron-lib', 'neutron-lib', u'Neutron Library', -# [u'OpenStack'], 1) -# ] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -# html_theme_path = ["."] -# html_theme = '_theme' -html_theme = 'openstackdocs' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = ['_theme'] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' -html_last_updated_fmt = '%Y-%m-%d %H:%M' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_use_modindex = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' - -# Output file base name for HTML help builder. -#htmlhelp_basename = 'neutronlibdoc' - - -# -- Options for LaTeX output ------------------------------------------------ - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, -# documentclass [howto/manual]). -# latex_documents = [ -# ('index', 'NeutronLib.tex', u'Neutron Library Documentation', -# u'Neutron development team', 'manual'), -# ] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_use_modindex = True - -# -- Options for openstackdocstheme ------------------------------------------- -repository_name = 'openstack/neutron-lib' -bug_project = 'neutron' -bug_tag = 'doc' diff --git a/doc/source/contributor/api_attributes.rst b/doc/source/contributor/api_attributes.rst deleted file mode 100644 index 34a728f..0000000 --- a/doc/source/contributor/api_attributes.rst +++ /dev/null @@ -1,90 +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. - - - Convention for heading levels in Neutron devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - - -API Attributes -============== - -Neutron's resource attributes are defined in dictionaries -in ``api/definitions``. - -The map containing all installed resources (for core and active extensions) -is in ``api/attributes.py``. - - -Attribute map structure ------------------------ - -Example attribute definitions for ``dns_name``: - -.. code-block:: python - - 'dns_name': { - 'allow_post': True, - 'allow_put': True, - 'default': '', - 'convert_to': convert_to_lowercase, - 'validate': {'type:dns_name': FQDN_MAX_LEN}, - 'is_visible': True - }, - - -The ``validate`` item specifies rules for `validating `_ -the attribute. - -The ``convert_to`` item specifies rules for `converting `_ -the attribute. - -Example attribute definitions for ``gateway_ip``: - -.. code-block:: python - - 'gateway_ip': { - 'allow_post': True, - 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:ip_address_or_none': None}, - 'is_visible': True - } - -Note: a default of ``ATTR_NOT_SPECIFIED`` indicates that an attribute is not -required, but will be generated by the plugin if it is not specified. -Particularly, a value of ``ATTR_NOT_SPECIFIED`` is different from an -attribute that has been specified with a value of ``None``. For example, -if ``gateway_ip`` is omitted in a request to create a subnet, the plugin -will receive ``ATTR_NOT_SPECIFIED`` and the default gateway IP will be -generated. However, if ``gateway_ip`` is specified as ``None``, this means -that the subnet does not have a gateway IP. - -The following are the defined keys for attribute maps: - -====================== ====== -``default`` default value of the attribute (if missing, the attribute becomes mandatory) -``allow_post`` the attribute can be used on ``POST`` requests -``allow_put`` the attribute can be used on ``PUT`` requests -``validate`` specifies rules for validating data in the attribute -``convert_to`` transformation to apply to the value before it is returned -``convert_list_to`` if the value is a list, apply this transformation to the value before it is returned -``is_visible`` the attribute is returned in ``GET`` responses -``required_by_policy`` the attribute is required by the policy engine and should therefore be filled by the API layer even if not present in request body -``enforce_policy`` the attribute is actively part of the policy enforcing mechanism, ie: there might be rules which refer to this attribute -====================== ====== diff --git a/doc/source/contributor/api_converters.rst b/doc/source/contributor/api_converters.rst deleted file mode 100644 index 3679b0b..0000000 --- a/doc/source/contributor/api_converters.rst +++ /dev/null @@ -1,97 +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. - - - Convention for heading levels in Neutron devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - - -API Converters -============== - -Definitions for REST API attributes, can include conversion methods -to help normalize user input or transform the input into a form that -can be used. - - -Defining A Converter Method ---------------------------- - -By convention, the name should start with ``convert_to_``, and will -take a single argument for the data to be converted. The method -should return the converted data (which, if the input is None, -and no conversion is performed, the implicit None returned by the -method may be used). If the conversion is impossible, an -InvalidInput exception should be raised, indicating what is wrong. -For example, here is one that converts a variety of user inputs -to a boolean value. -:: - - def convert_to_boolean(data): - if isinstance(data, six.string_types): - val = data.lower() - if val == "true" or val == "1": - return True - if val == "false" or val == "0": - return False - elif isinstance(data, bool): - return data - elif isinstance(data, int): - if data == 0: - return False - elif data == 1: - return True - msg = _("'%s' cannot be converted to boolean") % data - raise n_exc.InvalidInput(error_message=msg) - - -Using Validators ----------------- - -In client code, the conversion can be used in a REST API -definition, by specifying the name of the method as a value for -the 'convert_to' key on an attribute. For example: - -:: - - 'admin_state_up': {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': conversions.convert_to_boolean, - 'is_visible': True}, - -Here, the admin_state_up is a boolean, so the converter is used to -take user's (string) input and transform it to a boolean. - - -Test The Validator ------------------- - -Do the right thing, and make sure you've created a unit test for any -converter that you add to verify that it works as expected. - -IPv6 canonical address formatter --------------------------------- - -There are several ways to display an IPv6 address, which can lead to a lot -of confusion for users, engineers and operators alike. To reduce the impact -of the multifaceted style of writing an IPv6 address, it is proposed that -the IPv6 address in Neutron should be saved in the canonical format. - -If a user passes an IPv6 address, it will be saved in the canonical format. - -The full document is found at : http://tools.ietf.org/html/rfc5952 diff --git a/doc/source/contributor/api_extensions.rst b/doc/source/contributor/api_extensions.rst deleted file mode 100644 index 95fe1a4..0000000 --- a/doc/source/contributor/api_extensions.rst +++ /dev/null @@ -1,77 +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. - - - Convention for heading levels in Neutron devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - - -API Extensions -============== - -API extensions provide a standardized way of introducing new API functionality. -While the ``neutron-lib`` project itself does not serve an API, the ``neutron`` -project does and leverages the API extension framework from ``neutron-lib``. - -API extensions consist of the following high-level constructs: - -- API definitions that specify the extension's static metadata. This metadata - includes basic details about the extension such as its name, description, - alias, etc. as well as its extended resources/sub-resources and - required/optional extensions. These definitions live in the - ``neutron_lib.api.definitions`` package. -- API reference documenting the APIs/resources added/modified by the extension. - This documentation is in ``rst`` format and is used to generate the - `openstack API reference `_. The API reference lives under the ``api-ref/source/v2`` - directory of the ``neutron-lib`` project repository. -- An extension descriptor class that must be defined in an extension directory - for ``neutron`` or other sub-project that supports extensions. This concrete - class provides the extension's metadata to the API server. These extension - classes reside outside of ``neutron-lib``, but leverage the base classes - from ``neutron_lib.api.extensions``. For more details see the section below - on using neutron-lib's extension classes. -- The API extension plugin implementation itself. This is the code that - implements the extension's behavior and should carry out the operations - defined by the extension. This code resides under its respective project - repository, not in ``neutron-lib``. For more details see the `neutron api - extension dev-ref `_. - - -Using neutron-lib's base extension classes ------------------------------------------- - -The ``neutron_lib.api.extensions`` module provides a set of base extension -descriptor classes consumers can use to define their extension descriptor(s). -For those extensions that have an API definition in -``neutron_lib.api.definitions``, the ``APIExtensionDescriptor`` class can -be used. For example:: - - from neutron_lib.api.definitions import provider_net - from neutron_lib.api import extensions - - - class Providernet(extensions.APIExtensionDescriptor): - api_definition = provider_net - # nothing else needed if default behavior is acceptable - - -For extensions that do not yet have a definition in -``neutron_lib.api.definitions``, they can continue to use the -``ExtensionDescriptor`` as has been done historically. diff --git a/doc/source/contributor/api_validators.rst b/doc/source/contributor/api_validators.rst deleted file mode 100644 index cee8709..0000000 --- a/doc/source/contributor/api_validators.rst +++ /dev/null @@ -1,100 +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. - - - Convention for heading levels in Neutron devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - - -API Validators -============== - -For the REST API, attributes may have custom validators defined. Each -validator will have a method to perform the validation, and a type -definition string, so that the validator can be referenced. - - -Defining A Validator Method ---------------------------- - -The validation method will have a positional argument for the data to -be validated, and may have additional (optional) keyword arguments that -can be used during validation. The method must handle any exceptions -and either return None (success) or a i18n string indicating the -validation failure message. By convention, the method name is prefixed -with ``validate_`` and then includes the data type. For example: - -:: - - def validate_uuid(data, valid_values=None): - if not uuidutils.is_uuid_like(data): - msg = _("'%s' is not a valid UUID") % data - LOG.debug(msg) - return msg - -There is a validation dictionary that maps the method to a validation -type that can be referred to in REST API definitions. An entry in the -dictionary would look like the following: - -:: - - 'type:uuid': validate_uuid, - - -Using Validators ----------------- - -In client code, the validator can be used in a REST API by using the -dictionary key for the validator. For example: - -:: - - NETWORKS: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': NAME_MAX_LEN}, - 'default': '', 'is_visible': True}} - -Here, the networks resource has an 'id' attribute with a UUID validator, -as seen by the 'validate' key containing a dictionary with a key of -'type:uuid'. - -Any addition arguments for the validator can be specified as values for -the dictionary entry (None in this case, NAME_MAX_LEN in the 'name' -attribute that uses a string validator). In a IP version attribute, one -could have a validator defined as follows: - -:: - - 'ip_version': {'allow_post': True, 'allow_put': False, - 'convert_to': conversions.convert_to_int, - 'validate': {'type:values': [4, 6]}, - 'is_visible': True}} - -Here, the validate_values() method will take the list of values as the -allowable values that can be specified for this attribute. - -Test The Validator ------------------- - -Do the right thing, and make sure you've created a unit test for any -validator that you add to verify that it works as expected, even for -simple validators. diff --git a/doc/source/contributor/callbacks.rst b/doc/source/contributor/callbacks.rst deleted file mode 100644 index 28f0863..0000000 --- a/doc/source/contributor/callbacks.rst +++ /dev/null @@ -1,574 +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. - - - Convention for heading levels in Neutron devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - - -Neutron Callback System -======================= - -In Neutron, core and service components may need to cooperate during the -execution of certain operations, or they may need to react upon the occurrence -of certain events. For instance, when a Neutron resource is associated to -multiple services, the components in charge of these services may need to play -an active role in determining what the right state of the resource needs to be. - -The cooperation may be achieved by making each object aware of each other, but -this leads to tight coupling, or alternatively it can be achieved by using a -callback-based system, where the same objects are allowed to cooperate in a -loose manner. - -This is particularly important since the spin off of the advanced services like -VPN, Firewall and Load Balancer, where each service's codebase lives independently -from the core and from one another. This means that the tight coupling is no longer -a practical solution for object cooperation. In addition to this, if more services -are developed independently, there is no viable integration between them and the -Neutron core. A callback system, and its registry, tries to address these issues. - -In object-oriented software systems, method invocation is also known as message -passing: an object passes a message to another object, and it may or may not expect -a message back. This point-to-point interaction can take place between the parties -directly involved in the communication, or it can happen via an intermediary. The -intermediary is then in charge of keeping track of who is interested in the messages -and in delivering the messages forth and back, when required. As mentioned earlier, -the use of an intermediary has the benefit of decoupling the parties involved -in the communications, as now they only need to know about the intermediary; the -other benefit is that the use of an intermediary opens up the possibility of -multiple party communication: more than one object can express interest in -receiving the same message, and the same message can be delivered to more than -one object. To this aim, the intermediary is the entity that exists throughout -the system lifecycle, as it needs to be able to track whose interest is associated -to what message. - -In a design for a system that enables callback-based communication, the following -aspects need to be taken into account: - -* how to become consumer of messages (i.e. how to be on the receiving end of the message); -* how to become producer of messages (i.e. how to be on the sending end of the message); -* how to consume/produce messages selectively; - -Translate and narrow this down to Neutron needs, and this means the design of a callback -system where messages are about lifecycle events (e.g. before creation, before -deletion, etc.) of Neutron resources (e.g. networks, routers, ports, etc.), where the -various parties can express interest in knowing when these events for a specific -resources take place. - -Rather than keeping the conversation abstract, let us delve into some examples, that would -help understand better some of the principles behind the provided mechanism. - - -Event payloads --------------- - -The use of ``**kwargs`` for callback event payloads is deprecated (slated to be -removed in 'Queens') in favor of standardized event payload objects as -described herein. - -The event payloads are defined in ``neutron_lib.callbacks.events`` and define a -set of payload objects based on consumption pattern. The following event -objects are defined today: - -- ``EventPayload``: Base object for all other payloads and define the common set - of attributes used by events. The ``EventPayload`` can also be used directly - for basic payloads that don't need to transport additional values. -- ``DBEventPayload``: Payloads pertaining to database callbacks. These objects - capture both the pre and post state (among other things) for database - changes. -- ``APIEventPayload``: Payloads pertaining to API callbacks. These objects - capture details relating to an API event; such as the method name and API - action. - -Each event object is described in greater detail in its own subsection below. - -For backwards compatibility the callback registry and manager still provide -the ``notify`` method for passing ``**kwargs``, but also provide the -``publish`` method for passing an event object. - - -Event objects: EventPayload -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``EventPayload`` object is the parent class of all other payload objects -and defines the common set of attributes applicable to most events. For -example, the ``EventPayload`` contains the ``context``, ``request_body``, etc. -In addition, a ``metadata`` attribute is available to transport event data -that's not yet standardized. While the ``metadata`` attribute is there for -use, it should only be used in special cases like phasing in new payload -attributes. - -Payload objects also transport resource state via the ``states`` attribute. -This collection of resource objects tracks the state changes for the respective -resource related to the event. For example database changes might have a -pre and post updated resource that's used as ``states``. Tracking states -allows consumers to inspect the various changes in the resource and take -action as needed; for example checking the pre and post object to determine -the delta. State object types are event specific; API events may use python -``dicts`` as state objects whereas database events use resource/OVO model objects. - -Note that states as well as any other event payload attributes are not copied; -subscribers obtain a direct reference to event payload objects (states, -metadata, etc.) and should not be modified by subscribers. - - -Event objects: DBEventPayload -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For datastore/database events, ``DBEventPayload`` can be used as the payload -event object. In addition to the attributes inherited from ``EventPayload``, -database payloads also contain an additional ``desired_state``. The desired state -is intended for use with pre create/commit scenarios where the publisher -has a resource object (yet to be persisted) that's used in the event payload. - -These event objects are suitable for the standard before/after database -events we have today as well as any that might arise in the future. - -Example usage:: - - # BEFORE_CREATE: - DBEventPayload(context, - request_body=params_of_create_request, - resource_id=id_of_resource_if_avail, - desired_state=db_resource_to_commit) - - # AFTER_CREATE: - DBEventPayload(context, - request_body=params_of_create_request, - states=[my_new_copy_after_create], - resource_id=id_of_resource) - - # PRECOMMIT_CREATE: - DBEventPayload(context, - request_body=params_of_create_request, - resource_id=id_of_resource_if_avail, - desired_state=db_resource_to_commit) - - # BEFORE_DELETE: - DBEventPayload(context, - states=[resource_to_delete], - resource_id=id_of_resource) - - # AFTER_DELETE: - DBEventPayload(context, - states=[copy_of_deleted_resource], - resource_id=id_of_resource) - - # BEFORE_UPDATE: - DBEventPayload(context, - request_body=body_of_update_request, - states=[original_db_resource], - resource_id=id_of_resource - desired_state=updated_db_resource_to_commit) - - # AFTER_UPDATE: - DBEventPayload(context, - request_body=body_of_update_request, - states=[original_db_resource, updated_db_resource], - resource_id=id_of_resource) - - -Event objects: APIEventPayload -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For API related callbacks, the ``APIEventPayload`` object can be used to -transport callback payloads. For example, the REST API resource controller can -use API events for pre/post operation callbacks. - -In addition to transporting all the attributes of ``EventPayload``, the -``APIEventPayload`` object also includes the ``action``, ``method_name`` and -``collection_name`` payload attributes permitting API components to -pass along API controller specifics. - -Sample usage:: - - # BEFORE_RESPONSE for create: - APIEventPayload(context, notifier_method, action, - request_body=req_body, - states=[create_result], - collection_name=self._collection_name) - - # BEFORE_RESPONSE for delete: - APIEventPayload(context, notifier_method, action, - states=[copy_of_deleted_resource], - collection_name=self._collection_name) - - # BEFORE_RESPONSE for update: - APIEventPayload(context, notifier_method, action, - states=[original, updated], - collection_name=self._collection_name) - - -Subscribing to events ---------------------- - -Imagine that you have entity A, B, and C that have some common business over router creation. -A wants to tell B and C that the router has been created and that they need to get on and -do whatever they are supposed to do. In a callback-less world this would work like so: - -:: - - # A is done creating the resource - # A gets hold of the references of B and C - # A calls B - # A calls C - B->my_random_method_for_knowing_about_router_created() - C->my_random_very_difficult_to_remember_method_about_router_created() - -If B and/or C change, things become sour. In a callback-based world, things become a lot -more uniform and straightforward: - -:: - - # B and C ask I to be notified when A is done creating the resource - - # ... - # A is done creating the resource - # A gets hold of the reference to the intermediary I - # A calls I - I->notify() - -Since B and C will have expressed interest in knowing about A's business, 'I' will -deliver the messages to B and C. If B and C changes, A and 'I' do not need to change. - -In practical terms this scenario would be translated in the code below: - -:: - - from neutron_lib.callbacks import events - from neutron_lib.callbacks import resources - from neutron_lib.callbacks import registry - - - def callback1(resource, event, trigger, payload): - print('Callback1 called by trigger: ', trigger) - print('payload: ', payload) - - def callback2(resource, event, trigger, payload): - print('Callback2 called by trigger: ', trigger) - print('payload: ', payload) - - - # B and C express interest with I - registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) - registry.subscribe(callback2, resources.ROUTER, events.BEFORE_CREATE) - print('Subscribed') - - - # A notifies - def do_notify(): - registry.publish(resources.ROUTER, events.BEFORE_CREATE, - do_notify, events.EventPayload(None)) - - - print('Notifying...') - do_notify() - - -The output is: - -:: - - > Subscribed - > Notifying... - > Callback2 called by trigger: - > payload: - > Callback1 called by trigger: - > payload: - -Thanks to the intermediary existence throughout the life of the system, A, B, and C -are flexible to evolve their internals, dynamics, and lifecycles. - - -Subscribing and aborting events -------------------------------- - -Interestingly in Neutron, certain events may need to be forbidden from happening due to the -nature of the resources involved. To this aim, the callback-based mechanism has been designed -to support a use case where, when callbacks subscribe to specific events, the action that -results from it, may lead to the propagation of a message back to the sender, so that it itself -can be alerted and stop the execution of the activity that led to the message dispatch in the -first place. - -The typical example is where a resource, like a router, is used by one or more high-level -service(s), like a VPN or a Firewall, and actions like interface removal or router destruction -cannot not take place, because the resource is shared. - -To address this scenario, special events are introduced, 'BEFORE_*' events, to which callbacks -can subscribe and have the opportunity to 'abort', by raising an exception when notified. - -Since multiple callbacks may express an interest in the same event for a particular resource, -and since callbacks are executed independently from one another, this may lead to situations -where notifications that occurred before the exception must be aborted. To this aim, when an -exception occurs during the notification process, an abort_* event is propagated immediately -after. It is up to the callback developer to determine whether subscribing to an abort -notification is required in order to revert the actions performed during the initial execution -of the callback (when the BEFORE_* event was fired). Exceptions caused by callbacks registered -to abort events are ignored. The snippet below shows this in action: - -:: - - from neutron_lib.callbacks import events - from neutron_lib.callbacks import exceptions - from neutron_lib.callbacks import resources - from neutron_lib.callbacks import registry - - - def callback1(resource, event, trigger, payload=None): - raise Exception('I am failing!') - - def callback2(resource, event, trigger, payload=None): - print('Callback2 called by %s on event %s' % (trigger, event)) - - - registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) - registry.subscribe(callback2, resources.ROUTER, events.BEFORE_CREATE) - registry.subscribe(callback2, resources.ROUTER, events.ABORT_CREATE) - print('Subscribed') - - - def do_notify(): - registry.publish(resources.ROUTER, events.BEFORE_CREATE, do_notify) - - print('Notifying...') - try: - do_notify() - except exceptions.CallbackFailure as e: - print("Error: %s" % e) - -The output is: - -:: - - > Subscribed - > Notifying... - > Callback2 called by on event before_create - > Callback2 called by on event abort_create - > Error: Callback __main__.callback1 failed with "I am failing!" - -In this case, upon the notification of the BEFORE_CREATE event, Callback1 triggers an exception -that can be used to stop the action from taking place in do_notify(). On the other end, Callback2 -will be executing twice, once for dealing with the BEFORE_CREATE event, and once to undo the -actions during the ABORT_CREATE event. It is worth noting that it is not mandatory to have -the same callback register to both BEFORE_* and the respective ABORT_* event; as a matter of -fact, it is best to make use of different callbacks to keep the two logic separate. - - -Unsubscribing to events ------------------------ - -There are a few options to unsubscribe registered callbacks: - -* clear(): it unsubscribes all subscribed callbacks: this can be useful especially when - winding down the system, and notifications shall no longer be triggered. -* unsubscribe(): it selectively unsubscribes a callback for a specific resource's event. - Say callback C has subscribed to event A for resource R, any notification of event A - for resource R will no longer be handed over to C, after the unsubscribe() invocation. -* unsubscribe_by_resource(): say that callback C has subscribed to event A, B, and C for - resource R, any notification of events related to resource R will no longer be handed - over to C, after the unsubscribe_by_resource() invocation. -* unsubscribe_all(): say that callback C has subscribed to events A, B for resource R1, - and events C, D for resource R2, any notification of events pertaining resources R1 and - R2 will no longer be handed over to C, after the unsubscribe_all() invocation. - -The snippet below shows these concepts in action: - -:: - - from neutron_lib.callbacks import events - from neutron_lib.callbacks import exceptions - from neutron_lib.callbacks import resources - from neutron_lib.callbacks import registry - - - def callback1(resource, event, trigger, payload=None): - print('Callback1 called by %s on event %s for resource %s' % (trigger, event, resource)) - - - def callback2(resource, event, trigger, payload=None): - print('Callback2 called by %s on event %s for resource %s' % (trigger, event, resource)) - - - registry.subscribe(callback1, resources.ROUTER, events.BEFORE_READ) - registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) - registry.subscribe(callback1, resources.ROUTER, events.AFTER_DELETE) - registry.subscribe(callback1, resources.PORT, events.BEFORE_UPDATE) - registry.subscribe(callback2, resources.ROUTER_GATEWAY, events.BEFORE_UPDATE) - print('Subscribed') - - - def do_notify(): - print('Notifying...') - registry.publish(resources.ROUTER, events.BEFORE_READ, do_notify) - registry.publish(resources.ROUTER, events.BEFORE_CREATE, do_notify) - registry.publish(resources.ROUTER, events.AFTER_DELETE, do_notify) - registry.publish(resources.PORT, events.BEFORE_UPDATE, do_notify) - registry.publish(resources.ROUTER_GATEWAY, events.BEFORE_UPDATE, do_notify) - - - do_notify() - registry.unsubscribe(callback1, resources.ROUTER, events.BEFORE_READ) - do_notify() - registry.unsubscribe_by_resource(callback1, resources.PORT) - do_notify() - registry.unsubscribe_all(callback1) - do_notify() - registry.clear() - do_notify() - -The output is: - -:: - - Subscribed - Notifying... - Callback1 called by on event before_read for resource router - Callback1 called by on event before_create for resource router - Callback1 called by on event after_delete for resource router - Callback1 called by on event before_update for resource port - Callback2 called by on event before_update for resource router_gateway - Notifying... - Callback1 called by on event before_create for resource router - Callback1 called by on event after_delete for resource router - Callback1 called by on event before_update for resource port - Callback2 called by on event before_update for resource router_gateway - Notifying... - Callback1 called by on event before_create for resource router - Callback1 called by on event after_delete for resource router - Callback2 called by on event before_update for resource router_gateway - Notifying... - Callback2 called by on event before_update for resource router_gateway - Notifying... - - -Testing with callbacks ----------------------- - -A python `fixture `_ is provided for implementations that need to -unit test and mock the callback registry. This can be used for example, when your code publishes callback events -that you need to verify. Consumers can use ``neutron_lib.tests.unit.callbacks.base.CallbackRegistryFixture`` -in their unit test classes with the ``useFixture()`` method passing along a ``CallbackRegistryFixture`` instance. -If mocking of the actual singleton callback manager is necessary, consumers can pass a value to -with the ``callback_manager`` kwarg. For example:: - - def setUp(self): - super(MyTestClass, self).setUp() - self.registry_fixture = callback_base.CallbackRegistryFixture() - self.useFixture(self.registry_fixture) - # each test now uses an isolated callback manager - - -FAQ ---- - -Can I use the callbacks registry to subscribe and notify non-core resources and events? - - Short answer is yes. The callbacks module defines literals for what are considered core Neutron - resources and events. However, the ability to subscribe/notify is not limited to these as you - can use your own defined resources and/or events. Just make sure you use string literals, as - typos are common, and the registry does not provide any runtime validation. Therefore, make - sure you test your code! - -What is the relationship between Callbacks and Taskflow? - - There is no overlap between Callbacks and Taskflow or mutual exclusion; as matter of fact they - can be combined; You could have a callback that goes on and trigger a taskflow. It is a nice - way of separating implementation from abstraction, because you can keep the callback in place - and change Taskflow with something else. - -Is there any ordering guarantee during notifications? - - No, the ordering in which callbacks are notified is completely arbitrary by design: callbacks - should know nothing about each other, and ordering should not matter; a callback will always be - notified and its outcome should always be the same regardless as to in which order is it - notified. Priorities can be a future extension, if a use case arises that require enforced - ordering. - -How is the notifying object expected to interact with the subscribing objects? - - The ``notify`` method implements a one-way communication paradigm: the notifier sends a message - without expecting a response back (in other words it fires and forget). However, due to the nature - of Python, the payload can be mutated by the subscribing objects, and this can lead to unexpected - behavior of your code, if you assume that this is the intentional design. Bear in mind, that - passing-by-value using deepcopy was not chosen for efficiency reasons. Having said that, if you - intend for the notifier object to expect a response, then the notifier itself would need to act - as a subscriber. - -Is the registry thread-safe? - - Short answer is no: it is not safe to make mutations while callbacks are being called (more - details as to why can be found `here `_). - A mutation could happen if a 'subscribe'/'unsubscribe' operation interleaves with the execution - of the notify loop. Albeit there is a possibility that things may end up in a bad state, the - registry works correctly under the assumption that subscriptions happen at the very beginning - of the life of the process and that the unsubscriptions (if any) take place at the very end. - In this case, chances that things do go badly may be pretty slim. Making the registry - thread-safe will be considered as a future improvement. - -What kind of function can be a callback? - - Anything you fancy: lambdas, 'closures', class, object or module methods. For instance: - -:: - - from neutron_lib.callbacks import events - from neutron_lib.callbacks import resources - from neutron_lib.callbacks import registry - - - def callback1(resource, event, trigger, payload): - print('module callback') - - - class MyCallback(object): - - def callback2(self, resource, event, trigger, payload): - print('object callback') - - @classmethod - def callback3(cls, resource, event, trigger, payload): - print('class callback') - - - c = MyCallback() - registry.subscribe(callback1, resources.ROUTER, events.BEFORE_CREATE) - registry.subscribe(c.callback2, resources.ROUTER, events.BEFORE_CREATE) - registry.subscribe(MyCallback.callback3, resources.ROUTER, events.BEFORE_CREATE) - - def do_notify(): - def nested_subscribe(resource, event, trigger, payload): - print('nested callback') - - registry.subscribe(nested_subscribe, resources.ROUTER, events.BEFORE_CREATE) - - registry.publish(resources.ROUTER, events.BEFORE_CREATE, - do_notify, events.EventPayload(None)) - - - print('Notifying...') - do_notify() - -And the output is going to be: - -:: - - Notifying... - module callback - object callback - class callback - nested callback diff --git a/doc/source/contributor/contributing.rst b/doc/source/contributor/contributing.rst deleted file mode 100644 index 1401d91..0000000 --- a/doc/source/contributor/contributing.rst +++ /dev/null @@ -1,155 +0,0 @@ -============ -Contributing -============ - -.. include:: ../../../CONTRIBUTING.rst - -As your code is subject to the `review guidelines <./review-guidelines.html>`_, -please take the time to familiarize yourself with those guidelines. - - -Rehoming Existing Code ----------------------- - -The checklist below aims to provide guidance for developers rehoming (moving) code into -neutron-lib. Rehoming approaches that fall outside the scope herein will need to be -considered on a case by case basis. - -The rehoming workflow procedure has four main phases: - -#. `Phase 1: Rehome`_ the code from neutron into neutron-lib. -#. `Phase 2: Enhance`_ the code in neutron-lib if necessary. -#. `Phase 3: Release`_ neutron-lib with the code so consumers can use it. -#. `Phase 4: Consume`_ by removing the rehomed code from its source and changing references - to use neutron-lib. - -Phase 1: Rehome -~~~~~~~~~~~~~~~ - -#. Identify the chunk of code for rehoming. Applicable code includes common - classes/functions/modules/etc. that are consumed by networking project(s) outside of - neutron. Optimal consumption patterns of the code at hand must also be considered to - ensure the rehomed code addresses any technical debt. Finally, leave low-hanging - fruit for last and tackle the most commonly used code first. If you have any doubt - about the applicability of code for rehoming, reach out to one of the neutron core - developers before digging in. - -#. Find and identify any unit tests for the code being rehomed. These unit tests - can often be moved into neutron-lib with minimal effort. After inspecting the - applicable unit tests, rewrite any that are non-optimal. - -#. Search and understand the consumers of the code being rehomed. This must include other - networking projects in addition to neutron itself. At this point it may be determined - that the code should be refactored before it is consumed. There are a few common - strategies for refactoring, and the one chosen will depend on the nature of the code - at hand: - - - Refactor/enhance the code as part of the initial neutron-lib patch. If this change - will be disruptive to consumers, clearly communicate the change via email list or - `meeting topic `_. - - Leave the refactoring to the next (Enhance) phase. In this rehome phase, copy the code - as-is into a private module according to our `conventions <./conventions.html>`_. This - approach is slower, but may be necessary in some cases. - -#. Understand existing work underway which may impact the rehomed code, for example, - in-flight patch sets that update the code being rehomed. In some cases it may make - sense to let the in-flight patch merge and solidify a bit before rehoming. - -#. Prepare the code for neutron-lib. This may require replacing existing imports - with those provided by neutron-lib and/or rewriting/rearchitecting non-optimal - code (see above). The interfaces in the rehomed code are subject to our - `conventions <./conventions.html>`_. - -#. Prepare the unit test code for neutron-lib. As indicated in the `review guidelines - <./review-guidelines.html>`_ we are looking for a high code coverage by tests. This may - require adding additional tests if neutron was lacking in coverage. - -#. Submit and shepherd your patch through its neutron-lib review. Include a - `release note `_ that describes the code's - old neutron location and new neutron-lib location. Also note that in some cases it makes - sense to prototype a change in a consumer project to better understand the impacts of - the change, which can be done using the ``Depends-On:`` approach described in the - `review guidelines <./review-guidelines.html>`_ - -Examples: - -- `319769 `_ brought over a number of common - utility functions as-is from neutron into a new package structure within neutron-lib. -- `253661 `_ rehomed neutron callbacks into a - private package that's enhanced via `346554 `_. -- `319386 `_ rehomes a validator from neutron - into neutron-lib. - -Phase 2: Enhance -~~~~~~~~~~~~~~~~ - -If the rehomed code is not applicable for enhancements and wasn't made private in Phase 1, -you can skip this step. - -Develop and shepherd the enhancements to the private rehomed code applicable at this time. -Private APIs made public as part of this phase will also need -`release notes `_ indicating the new public -functionality. - -Examples: - -- `346554 `_ enhances the rehomed private callback - API in neutron-lib. - -Phase 3: Release -~~~~~~~~~~~~~~~~ - -A new neutron-lib release can be cut at any time. You can also request a release by following -the README instructions in the `openstack/releases `_ -project. - -Once a release is cut, an openstack infra proposal bot will submit patches to the master branch -of all projects that consume neutron-lib to set the new release as the minimum requirement. -Someone from the neutron release team can bump `global requirements` (g-r); for example -`review 393600 `_. - -When the bot-proposed requirement patches have merged, your rehomed code can be consumed. - -Phase 4: Consume -~~~~~~~~~~~~~~~~ - -It's critical that before you submit your patch to remove the rehomed code from its source that -you perform a diff between it and the rehomed version in neutron-lib to ensure nothing has -changed in the source. If something has changed in the source, you need to push and shepherd a -patch to neutron-lib with the difference(s) before proceeding with this consumption phase. - -The following guidelines are intended to provide a smooth transition to the rehomed code -in neutron-lib and minimize impacts to subprojects consuming the rehomed code from its -source. - -- If the change to consume the code from neutron-lib is widespread and/or "important", - introduce your intentions for the change via the Neutron team - `meeting slot `_ - for neutron-lib. Subsequently follow-up with an email to openstack-dev list using a - subject with ``[neutron] neutron-lib impact`` providing additional details as necessary. - Ideally we can identify the main impacted subprojects by - `grepping the OpenStack code `_. -- Prepare a neutron core patch to remove and update the rehomed code from its source. - This can be done without a `debtcollector `_ - notice by following the steps here. In the patch's commit message include the ``NeutronLibImpact`` - so that we can easily `query `_ - for such changes. Mark the patch as a work in progress with a -1 workflow vote. -- If the change is significant enough, it may warrant a "reference implementation" in an - impacted subproject to ensure the impacts are fully understood. Testing this - change can be done using the ``Depends-On:`` approach described in the - `review guidelines <./review-guidelines.html>`_. -- If you are a core reviewer and about to approve a NeutronLibImpact change, please consider - checking the state of all Stadium subprojects by looking at the - `grafana periodic dashboard `_. - This dashboard shows the status of subprojects' unit tests against neutron and neutron-lib - master branches, and even though it is not exactly validating unit tests against a released - version of neutron-lib it may be enough of an alarm bell to indicate that something might - be wrong because of a patch that recently landed in neutron (assuming that the subprojects - still has direct neutron imports). The check happens daily therefore consider waiting to - approve if you are either aware of another impactful change recently merged that has not - been yet processed or you see failure rates spiking. - -Examples: - -- `348472 `_ removes a validator in neutron that - was rehomed to neutron-lib. diff --git a/doc/source/contributor/conventions.rst b/doc/source/contributor/conventions.rst deleted file mode 100644 index eae910c..0000000 --- a/doc/source/contributor/conventions.rst +++ /dev/null @@ -1,78 +0,0 @@ -======================= -Neutron-Lib Conventions -======================= - -Summary -------- - -* Standard modules - current cycle + 2 deprecation policy -* Legacy modules - current cycle + 1 deprecation policy -* Private modules - no deprecation warnings of any kind - -Interface Contract ------------------- - -The neutron-lib repo exists to provide code with a long-term stable interface -for subprojects. If we do need to deprecate something, a debtcollector -warning will be added, the neutron-lib core team will make every effort to -update any neutron stadium project for you, and you will get at least the -current release plus two cycles before it disappears. - -In keeping with how hard it is to remove things, the change velocity of this -library will be slower than neutron. There are two notable cases where code -should go into standard neutron instead of this lib (or your repo): - -* It is something common, but changes a lot. An example is something like - the neutron Port object. Everyone uses it, but it changes frequently. - You don't want to wait for a library release to tweak some neutron feature, - and we are not going to force releases quickly because you tried to put - it here. Those items will need to be addressed in some other manner - (in the case of the Port object, it'll be via an auto-magic container - object that mimics it.) - -* It is something common, but you need it now. Put it in the repo that needs - it, get your stuff working. Then consider making it available in the lib, - and eventually remove it from your repo when the lib is publishing it. - An example would be a new neutron constant. The process would be, put it - in neutron along with your change, submit it to the lib, when that constant - is eventually available, remove it from neutron and use the lib version. - -Private Interfaces ------------------- - -Private interfaces are *PRIVATE*. They will disappear, be renamed, and -absolutely no regard will be given to anyone that is using them. They are -for internal library use only. - -DO NOT USE THEM. THEY WILL CHANGE. - -Private interfaces in this library will always have a leading underscore, -on the module or function name. - -Legacy Modules --------------- - -This library has a special namespace called neutron_lib.legacy. - -Anything in this directory will likely get a new interface in the top-level -library sometime in the near future, and then a debtcollector deprecation -notice. Expect to get current cycle plus one release of maintenance at that -point, and then they will be removed. - -Why this intermediary step? Because neutron has some serious dependency -issues with its subprojects that need breaking, we do not want to rush -some of the refactors to our interfaces that need to happen, we have -limited resources, but we still need to make addressing those dependency -issues a high priority. - -The legacy module is for those existing modules in neutron that are in -wide use by subprojects, but which are not super interfaces. The legacy -submodule is for routines that will still be maintained with a long-term -backwards compatibility interface contract, but which are not considered -"library worthy" by the neutron core team. - -This can easily be abused as a kitchen sink to just move stuff and make -fast progress. Please do not do this, and do not expect this kind of thing -to be favorably reviewed. Good candidates for this area are things that -we want to refactor, but are lower priority, AND they have been around for -a long time with no changes (i.e. an existing history of stability). diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst deleted file mode 100644 index 9b4b4c9..0000000 --- a/doc/source/contributor/index.rst +++ /dev/null @@ -1,36 +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. - - Convention for heading levels in Neutron lib devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - - -Contributor Guide -================= - -In the Contributor Guide, you will find information on the Neutron Library -components and in how to use them, from a development standpoint. - -.. toctree:: - :maxdepth: 2 - - conventions - review-guidelines - contributing - releasing - internals diff --git a/doc/source/contributor/internals.rst b/doc/source/contributor/internals.rst deleted file mode 100644 index 8d22a23..0000000 --- a/doc/source/contributor/internals.rst +++ /dev/null @@ -1,33 +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. - - Convention for heading levels in Neutron lib devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - -===================== -Neutron Lib Internals -===================== - -.. toctree:: - :maxdepth: 3 - - api_attributes - api_extensions - api_converters - api_validators - callbacks diff --git a/doc/source/contributor/releasing.rst b/doc/source/contributor/releasing.rst deleted file mode 100644 index 3e2ae00..0000000 --- a/doc/source/contributor/releasing.rst +++ /dev/null @@ -1,31 +0,0 @@ -========= -Releasing -========= - -Before you intend to release a new version of neutron-lib consider posting -a `sentinel patch `_ -that will allow to validate that the neutron-lib hash chosen for tagging is -not breaking gate or check jobs affecting a project you care about, first -and foremost Neutron. - -As the patch shows, upper-constraints must be bypassed and that may itself -lead to failures due to upstream package changes. The patch also shows (expected) -Grenade failures in that Grenade pulls its own upper-constraints -file during the upgrade phase. In general a newer version of neutron-lib is -validated through the Tempest -full job (and Grenade runs a subset of it), so -Grenade failures can be safely ignored. - -In any other case consider (for failures caused by unpinned global requirements) -hard-coding a dummy upper-constraints file that itself uses the specific -neutron-lib hash you want to test. Furthermore, consider using a commit header -that starts with DNM (Do Not Merge) to indicate that the change is just a test, -or -2, if you have the right access permissions. - -It is also worth noting that every Stadium project will have a periodic job -running unit tests and pep8 against the master version of neutron-lib -(`periodic-neutron-py35-with-neutron-lib-master `_ -being an example). Checking Grafana's `periodic `_ -dashboard can give you a glimpse into the sanity of the integration between -neutron-lib and the Stadium projects, and can be considered the quick check -before going ahead with a full blown sentinel patch. Periodic failures can be -debugged by viewing the `periodic logs `_ diff --git a/doc/source/contributor/review-guidelines.rst b/doc/source/contributor/review-guidelines.rst deleted file mode 100644 index aeeccb8..0000000 --- a/doc/source/contributor/review-guidelines.rst +++ /dev/null @@ -1,79 +0,0 @@ -================= -Review Guidelines -================= - -When reviewing neutron-lib changes, please be aware: - -* When code is moved from neutron, please evaluate with the following - criteria: - - - Is all of the code shared? Don't move neutron-only code. - - Is the interface good, or does it need to be refactored? If refactoring - is required it must be done before the public interface is released to - PyPI as once released it must follow our `conventions <./conventions.html>`_. - - Does it need new tests, specifically around the interface? We want - a global unit coverage greater than 90%, and a per-module coverage - greater than 80%. If neutron does not yet have a test, it needs to - be added. Note that tests on things like constants are uninteresting, - but any code or interface should have a unit test, if you cannot - tell for sure that it is not going to be traversed in some alternative - way (e.g. tempest/functional coverage). - - Do the public APIs have their parameters and return values documented - using reStructuredText docstring format (see below)? - - In certain cases, it may be beneficial to determine how the neutron-lib - code changes impact neutron `master`. This can be done as follows: - - - Publish a 'Do Not Merge' dummy patch to neutron that uses the code - changes proposed (or already in) neutron-lib. Make sure to mark this - neutron change as a 'DNM' (or 'WIP') and use -1 for workflow to indicate. - - Publish a change to neutron-lib that uses `Depends-On:` for the - dummy change in neutron; this pulls the neutron dummy change into the - neutron-lib gate job. For example - `386846 `_ uses a dummy - neutron-lib patch to test code that already exists in neutron-lib - `master` whereas `346554 `_ - tests the neutron-lib patch's code itself. - - View neutron-lib gate job results and repeat as necessary. - -* Public APIs should be documented using `reST style docstrings `_ - that include an overview as well as parameter and return documentation. - The format of docstrings can be found in the `OpenStack developer hacking docs `_. - Note that public API documentation is a bonus, not a requirement. - -* Once public classes and methods are pushed to PyPI as part of a neutron-lib - release, they must not be destructively changed without following the full - OpenStack deprecation path. - - For example, do not: - - - Change names of classes or methods - - Reorder method arguments - - Change side effects - - Alternatives: - - - Add a second method with the new signature - - Add keyword arguments - - The above implies that if you add something, we are stuck with that interface - for a long time, so be careful. - -* Removing the code from neutron can be done without a temporary `debtcollector - `_ notice by following - the steps described in the 'Consume' phase of the - `contributing doc <./contributing.html>`_. - -* Any code that imports/uses the following python modules should not be - moved into neutron-lib: - - - eventlet - -* With respect to `Oslo config options `_: - - - Config options should only be included in neutron-lib when the respective - functionality that uses the options lives in neutron-lib. In this case the - options will need to be exposed as entry points for - `config generation `_. - - Common functionality in neutron-lib that accesses config values should - assume the caller has registered them and document such in the docstring for - the respective functionality in neutron-lib. diff --git a/doc/source/index.rst b/doc/source/index.rst deleted file mode 100644 index 1ea28fb..0000000 --- a/doc/source/index.rst +++ /dev/null @@ -1,52 +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. - -Welcome to Neutron Lib documentation! -===================================== - -Neutron-lib is an OpenStack library project used by Neutron, Advanced Services, -and third-party projects that aims to provide common functionality across all -such consumers. The library is developed with the following goals in mind: - -- Decouple sub-projects from Neutron (i.e. no direct neutron imports in - sub-projects). -- Pay down Neutron technical debt via refactoring/re-architecting of - sub-optimal patterns in their respective neutron-lib implementation. - -This document describes the library for contributors of the project, and assumes -that you are already familiar with Neutron from an `end-user perspective`_. - -.. _`end-user perspective`: http://docs.openstack.org/trunk/openstack-network/admin/content/index.html - -This documentation is generated by the Sphinx toolkit and lives in the source -tree. Additional documentation on Neutron and other components of OpenStack -can be found on the `OpenStack wiki`_ and the `Neutron section of the wiki`. -The `Neutron Development wiki`_ is also a good resource for new contributors. - -.. _`OpenStack wiki`: http://wiki.openstack.org -.. _`Neutron section of the wiki`: http://wiki.openstack.org/Neutron -.. _`Neutron Development wiki`: http://wiki.openstack.org/NeutronDevelopment - -Enjoy! - -.. toctree:: - :maxdepth: 2 - - install/index - user/index - contributor/index - -.. toctree:: - :maxdepth: 1 - - reference/index diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst deleted file mode 100644 index 5fbe1b7..0000000 --- a/doc/source/install/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -============ -Installation -============ - -At the command line:: - - $ pip install neutron-lib - -Or, if you have virtualenvwrapper installed:: - - $ mkvirtualenv neutron-lib - $ pip install neutron-lib diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst deleted file mode 100644 index 9d1af1c..0000000 --- a/doc/source/reference/index.rst +++ /dev/null @@ -1,33 +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. - - Convention for heading levels in Neutron lib devref: - ======= Heading 0 (reserved for the title in a document) - ------- Heading 1 - ~~~~~~~ Heading 2 - +++++++ Heading 3 - ''''''' Heading 4 - (Avoid deeper levels because they do not render well.) - -================ -Module Reference -================ - -.. toctree:: - :maxdepth: 1 - :glob: - - modules/* - -* :ref:`genindex` -* :ref:`search` diff --git a/doc/source/user/hacking.rst b/doc/source/user/hacking.rst deleted file mode 100644 index 0638443..0000000 --- a/doc/source/user/hacking.rst +++ /dev/null @@ -1,65 +0,0 @@ -============== -Hacking Checks -============== - -The ``neutron_lib.hacking`` package implements a number of public -`hacking checks `_ intended to help -adopters validate their compliance with the latest hacking standards. - -To adopt neutron-lib's hacking checks: - -#. Update your project's ``tox.ini`` to use - ``neutron_lib.hacking.checks.factory`` for its ``local-check-factory``. - - For example in your ``tox.ini``:: - - [hacking] - local-check-factory = neutron_lib.hacking.checks.factory - - If your project needs to register additional project specific hacking - checks, you can define your own factory function that calls neutron-lib's - ``factory`` function. - - For example in your project's python source:: - - def my_factory(register): - # register neutron-lib checks - neutron_lib_checks.factory(register) - # register project specific checks - register(my_project_check) - - And use your project's own factory in ``tox.ini``:: - - [hacking] - local-check-factory = myproject.mypkg.my_factory - -#. Update your project's ``tox.ini`` enable any flake8 extensions neutron-lib's - ``tox.ini`` does. These are hacking checks otherwise disabled by default - that neutron-lib expects to run. - - For example in neutron-lib's ``tox.ini``:: - - [flake8] - # H904: Delay string interpolations at logging calls - enable-extensions=H904 - - In the example above, adopters should also add ``H904`` to the - ``enable-extensions`` in their ``tox.ini``. - -#. Actively adopt neutron-lib hacking checks by running and monitoring - the neutron-lib `periodic job `_ (as per `stadium guidelines - `_ and - watching for announcements. Announcements regarding neutron-lib adopter - hacking checks will be communicated via openstack-dev email list - and `neutron meetings `_. - - Under certain circumstances, adopters may need to ignore specific - neutron-lib hacking checks temporarily. This can be done using the - ``ignore`` property in the ``[flake8]`` section of your ``tox.ini``. - For example, to ignore the hacking check ``N536`` your tox.ini might - have:: - - [flake8] - # temporarily ignore N536 while fixing failing checks - ignore = N536 diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst deleted file mode 100644 index 8eaebfc..0000000 --- a/doc/source/user/index.rst +++ /dev/null @@ -1,8 +0,0 @@ -===== -Usage -===== - -.. toctree:: - :maxdepth: 2 - - hacking diff --git a/neutron_lib/__init__.py b/neutron_lib/__init__.py deleted file mode 100644 index b1a9779..0000000 --- a/neutron_lib/__init__.py +++ /dev/null @@ -1,17 +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. - -import pbr.version - - -__version__ = pbr.version.VersionInfo( - 'neutron_lib').version_string() diff --git a/neutron_lib/_i18n.py b/neutron_lib/_i18n.py deleted file mode 100644 index fa8cc2a..0000000 --- a/neutron_lib/_i18n.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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. -# -# INTERNAL INTERFACE: PLEASE NOTE THE LEADING _ ON THIS FILE. THIS IS -# NOT A LIBRARY INTERFACE. IF YOU WISH TO USE OSLO_I18N, please refer -# to https://docs.openstack.org/oslo.i18n/latest/user/usage.html - -import oslo_i18n - -_translators = oslo_i18n.TranslatorFactory(domain='neutron_lib') - -# The translation function using the well-known name "_" -_ = _translators.primary diff --git a/neutron_lib/_policy.py b/neutron_lib/_policy.py deleted file mode 100644 index 1bd16cc..0000000 --- a/neutron_lib/_policy.py +++ /dev/null @@ -1,67 +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 oslo_config import cfg -from oslo_policy import policy - - -_ROLE_ENFORCER = None -_ADMIN_CTX_POLICY = 'context_is_admin' -_ADVSVC_CTX_POLICY = 'context_is_advsvc' - - -def init(conf=cfg.CONF, policy_file=None): - """Initialize the global enforcer if not already initialized. - - Initialize the global enforcer (and load its rules) if not already - initialized; otherwise this is a no-op. - - :param conf: The configuration to initialize the global enforcer with. - Defaults to oslo_config.cfg.CONF. - :param policy_file: The policy file to initialize the global enforcer - with. - :returns: None. - """ - - global _ROLE_ENFORCER - if not _ROLE_ENFORCER: - _ROLE_ENFORCER = policy.Enforcer(conf, policy_file=policy_file) - _ROLE_ENFORCER.load_rules(True) - - -def _check_rule(context, rule): - init() - # the target is user-self - credentials = context.to_policy_values() - if rule not in _ROLE_ENFORCER.rules: - return False - return _ROLE_ENFORCER.enforce(rule, credentials, credentials) - - -def check_is_admin(context): - """Verify context has admin rights according to the global policy settings. - - :param context: The context object. - :returns: True if the context has admin rights (as per the global - enforcer) and False otherwise. - """ - return _check_rule(context, _ADMIN_CTX_POLICY) - - -def check_is_advsvc(context): - """Verify context has advsvc rights according to global policy settings. - - :param context: The context object. - :returns: True if the context has advsvc rights (as per the global - enforcer) and False otherwise. - """ - return _check_rule(context, _ADVSVC_CTX_POLICY) diff --git a/neutron_lib/agent/__init__.py b/neutron_lib/agent/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/agent/constants.py b/neutron_lib/agent/constants.py deleted file mode 100644 index 2c08057..0000000 --- a/neutron_lib/agent/constants.py +++ /dev/null @@ -1,32 +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. - -################################### -# Agent extension related constants -################################### -# Extension driver type for Open vSwitch mech driver -OVS_EXTENSION_DRIVER = 'ovs' -# Extension driver type for Linux Bridge mech driver -LB_EXTENSION_DRIVER = 'linuxbridge' -# Extension driver type for macvtap mech driver -MACVTAP_EXTENSION_DRIVER = 'macvtap' -# Extension driver type for SR-IOV mech driver -SRIOV_EXTENSION_DRIVER = 'sriov' - - -# Agent states as detected by server, used to reply on agent's state report -# agent has just been registered -AGENT_NEW = 'new' -# agent is alive -AGENT_ALIVE = 'alive' -# agent has just returned to alive after being dead -AGENT_REVIVED = 'revived' diff --git a/neutron_lib/agent/extension.py b/neutron_lib/agent/extension.py deleted file mode 100644 index d814cc8..0000000 --- a/neutron_lib/agent/extension.py +++ /dev/null @@ -1,48 +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. - -import abc - -import six - - -@six.add_metaclass(abc.ABCMeta) -class AgentExtension(object): - """Define stable abstract interface for agent extensions. - - An agent extension extends the agent core functionality. - """ - - @abc.abstractmethod - def initialize(self, connection, driver_type): - """Perform agent core resource extension initialization. - - :param connection: RPC connection that can be reused by the extension - to define its RPC endpoints - :param driver_type: String that defines the agent type to the - extension. Can be used to choose the right backend - implementation. - - Called after all extensions have been loaded. - No resource (port, policy, router, etc.) handling will be called before - this method. - """ - - def consume_api(self, agent_api): - """Consume the AgentAPI instance from the AgentExtensionsManager. - - Allows an extension to gain access to resources internal to the - neutron agent and otherwise unavailable to the extension. Examples of - such resources include bridges, ports, and routers. - - :param agent_api: An instance of an agent-specific API. - """ diff --git a/neutron_lib/agent/l2_extension.py b/neutron_lib/agent/l2_extension.py deleted file mode 100644 index 6d7daad..0000000 --- a/neutron_lib/agent/l2_extension.py +++ /dev/null @@ -1,55 +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. - -import abc - -import six - -from neutron_lib.agent import extension - - -@six.add_metaclass(abc.ABCMeta) -class L2AgentExtension(extension.AgentExtension): - """Define stable abstract interface for l2 agent extensions. - - An agent extension extends the agent core functionality. - """ - - def initialize(self, connection, driver_type): - """Initialize agent extension. - - :param connection: RPC connection that can be reused by the extension - to define its RPC endpoints - :param driver_type: String that defines the agent type to the - extension. Can be used to choose the right backend - implementation. - """ - - @abc.abstractmethod - def handle_port(self, context, data): - """Handle a port add/update event. - - This can be called on either create or update, depending on the - code flow. Thus, it's this function's responsibility to check what - actually changed. - - :param context: RPC context. - :param data: Port data. - """ - - @abc.abstractmethod - def delete_port(self, context, data): - """Handle a port delete event. - - :param context: RPC context. - :param data: Port data. - """ diff --git a/neutron_lib/agent/l3_extension.py b/neutron_lib/agent/l3_extension.py deleted file mode 100644 index c787677..0000000 --- a/neutron_lib/agent/l3_extension.py +++ /dev/null @@ -1,53 +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. - -import abc - -import six - -from neutron_lib.agent import extension - - -@six.add_metaclass(abc.ABCMeta) -class L3AgentExtension(extension.AgentExtension): - """Define stable abstract interface for l3 agent extensions. - - An agent extension extends the agent core functionality. - """ - - @abc.abstractmethod - def add_router(self, context, data): - """Handle a router add event. - - Called on router create. - - :param context: RPC context. - :param data: Router data. - """ - - @abc.abstractmethod - def update_router(self, context, data): - """Handle a router update event. - - Called on router update. - - :param context: RPC context. - :param data: Router data. - """ - - @abc.abstractmethod - def delete_router(self, context, data): - """Handle a router delete event. - - :param context: RPC context. - :param data: Router data. - """ diff --git a/neutron_lib/api/__init__.py b/neutron_lib/api/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/api/attributes.py b/neutron_lib/api/attributes.py deleted file mode 100644 index 6d33fb1..0000000 --- a/neutron_lib/api/attributes.py +++ /dev/null @@ -1,214 +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 webob import exc - -from neutron_lib._i18n import _ -from neutron_lib.api.definitions import network -from neutron_lib.api.definitions import port -from neutron_lib.api.definitions import subnet -from neutron_lib.api.definitions import subnetpool -from neutron_lib.api import validators -from neutron_lib import constants -from neutron_lib import exceptions - - -def _validate_privileges(context, res_dict): - if ('project_id' in res_dict and - res_dict['project_id'] != context.project_id and - not context.is_admin): - msg = _("Specifying 'project_id' or 'tenant_id' other than the " - "authenticated project in request requires admin privileges") - raise exc.HTTPBadRequest(msg) - - -def populate_project_info(attributes): - """Ensure that both project_id and tenant_id attributes are present. - - If either project_id or tenant_id is present in attributes then ensure - that both are present. - - If neither are present then attributes is not updated. - - :param attributes: A dictionary of resource/API attributes - or API request/response dict. - :returns: attributes (updated with project_id if applicable). - :raises: HTTPBadRequest if the attributes project_id and tenant_id - don't match. - """ - if 'tenant_id' in attributes and 'project_id' not in attributes: - attributes['project_id'] = attributes['tenant_id'] - elif 'project_id' in attributes and 'tenant_id' not in attributes: - # Backward compatibility for code still using tenant_id - attributes['tenant_id'] = attributes['project_id'] - - if attributes.get('project_id') != attributes.get('tenant_id'): - msg = _("'project_id' and 'tenant_id' do not match") - raise exc.HTTPBadRequest(msg) - - return attributes - - -class AttributeInfo(object): - """Provides operations on a resource's attribute map. - - AttributeInfo wraps an API resource's attribute dict and provides methods - for filling defaults, validating, converting, etc. based on the - underlying attributes. - """ - - def __init__(self, resource_attrs): - """Create a new instance that wraps the given resource attributes. - - :param resource_attrs: The resource's attributes that can be any - of the following types: an instance of AttributeInfo, an API - definition that contains a RESOURCE_ATTRIBUTE_MAP attribute or - a dict of attributes for the resource. - """ - if isinstance(resource_attrs, AttributeInfo): - resource_attrs = resource_attrs.attributes - elif getattr(resource_attrs, - 'RESOURCE_ATTRIBUTE_MAP', None) is not None: - # handle neutron_lib API definitions - resource_attrs = resource_attrs.RESOURCE_ATTRIBUTE_MAP - - self.attributes = resource_attrs - - def fill_post_defaults( - self, res_dict, - exc_cls=lambda m: exceptions.InvalidInput(error_message=m), - check_allow_post=True): - """Fill in default values for attributes in a POST request. - - When a POST request is made, the attributes with default values do not - need to be specified by the user. This function fills in the values of - any unspecified attributes if they have a default value. - - If an attribute is not specified and it does not have a default value, - an exception is raised. - - If an attribute is specified and it is not allowed in POST requests, an - exception is raised. The caller can override this behavior by setting - check_allow_post=False (used by some internal admin operations). - - :param res_dict: The resource attributes from the request. - :param exc_cls: Exception to be raised on error that must take - a single error message as it's only constructor arg. - :param check_allow_post: Raises an exception if a non-POST-able - attribute is specified. - :raises: exc_cls If check_allow_post is True and this instance of - ResourceAttributes doesn't support POST. - """ - for attr, attr_vals in self.attributes.items(): - if attr_vals['allow_post']: - if 'default' not in attr_vals and attr not in res_dict: - msg = _("Failed to parse request. Required " - "attribute '%s' not specified") % attr - raise exc_cls(msg) - res_dict[attr] = res_dict.get(attr, - attr_vals.get('default')) - elif check_allow_post: - if attr in res_dict: - msg = _("Attribute '%s' not allowed in POST") % attr - raise exc_cls(msg) - - def convert_values( - self, res_dict, - exc_cls=lambda m: exceptions.InvalidInput(error_message=m)): - """Convert and validate attribute values for a request. - - :param res_dict: The resource attributes from the request. - :param exc_cls: Exception to be raised on error that must take - a single error message as it's only constructor arg. - :raises: exc_cls If any errors occur converting/validating the - res_dict. - """ - for attr, attr_vals in self.attributes.items(): - if (attr not in res_dict or - res_dict[attr] is constants.ATTR_NOT_SPECIFIED): - continue - # Convert values if necessary - if 'convert_to' in attr_vals: - res_dict[attr] = attr_vals['convert_to'](res_dict[attr]) - # Check that configured values are correct - if 'validate' not in attr_vals: - continue - for rule in attr_vals['validate']: - validator = validators.get_validator(rule) - res = validator(res_dict[attr], attr_vals['validate'][rule]) - - if res: - msg_dict = dict(attr=attr, reason=res) - msg = _("Invalid input for %(attr)s. " - "Reason: %(reason)s.") % msg_dict - raise exc_cls(msg) - - def populate_project_id(self, context, res_dict, is_create): - """Populate the owner information in a request body. - - Ensure both project_id and tenant_id attributes are present. - Validate that the requestor has the required privileges. - For a create request, copy owner info from context to request body - if needed and verify that owner is specified if required. - - :param context: The request context. - :param res_dict: The resource attributes from the request. - :param attr_info: The attribute map for the resource. - :param is_create: Is this a create request? - :raises: HTTPBadRequest If neither the project_id nor tenant_id - are specified in the res_dict. - - """ - populate_project_info(res_dict) - _validate_privileges(context, res_dict) - - if is_create and 'project_id' not in res_dict: - if context.project_id: - res_dict['project_id'] = context.project_id - - # For backward compatibility - res_dict['tenant_id'] = context.project_id - - elif 'tenant_id' in self.attributes: - msg = _("Running without keystone AuthN requires " - "that tenant_id is specified") - raise exc.HTTPBadRequest(msg) - - def verify_attributes(self, attrs_to_verify): - """Reject unknown attributes. - - Consumers should ensure the project info is populated in the - attrs_to_verify before calling this method. - - :param attrs_to_verify: The attributes to verify against this - resource attributes. - :raises: HTTPBadRequest: If attrs_to_verify contains any unrecognized - for this resource attributes instance. - """ - extra_keys = set(attrs_to_verify.keys()) - set(self.attributes.keys()) - if extra_keys: - msg = _("Unrecognized attribute(s) '%s'") % ', '.join(extra_keys) - raise exc.HTTPBadRequest(msg) - - -def _core_resource_attributes(): - resources = {} - for core_def in [network.RESOURCE_ATTRIBUTE_MAP, - port.RESOURCE_ATTRIBUTE_MAP, - subnet.RESOURCE_ATTRIBUTE_MAP, - subnetpool.RESOURCE_ATTRIBUTE_MAP]: - resources.update(core_def) - return resources - - -# populate core resources into singleton global -RESOURCES = _core_resource_attributes() diff --git a/neutron_lib/api/converters.py b/neutron_lib/api/converters.py deleted file mode 100644 index 7063bd3..0000000 --- a/neutron_lib/api/converters.py +++ /dev/null @@ -1,265 +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. - -import netaddr -from oslo_utils import strutils -import six - -from neutron_lib._i18n import _ -from neutron_lib.api import validators -from neutron_lib import constants -from neutron_lib import exceptions as n_exc - - -def convert_to_boolean(data): - """Convert a data value into a python bool. - - :param data: The data value to convert to a python bool. This function - supports string types, bools, and ints for conversion of representation - to python bool. - :returns: The bool value of 'data' if it can be coerced. - :raises InvalidInput: If the value can't be coerced to a python bool. - """ - try: - return strutils.bool_from_string(data, strict=True) - except ValueError: - msg = _("'%s' cannot be converted to boolean") % data - raise n_exc.InvalidInput(error_message=msg) - - -def convert_to_boolean_if_not_none(data): - """Uses convert_to_boolean() on the data if the data is not None. - - :param data: The data value to convert. - :returns: The 'data' returned from convert_to_boolean() if 'data' is not - None. None is returned if data is None. - """ - if data is not None: - return convert_to_boolean(data) - - -def convert_to_int(data): - """Convert a data value to a python int. - - :param data: The data value to convert to a python int via python's - built-in int() constructor. - :returns: The int value of the data. - :raises InvalidInput: If the value can't be converted to an int. - """ - try: - return int(data) - except (ValueError, TypeError): - msg = _("'%s' is not an integer") % data - raise n_exc.InvalidInput(error_message=msg) - - -def convert_to_int_if_not_none(data): - """Uses convert_to_int() on the data if the data is not None. - - :param data: The data value to convert. - :returns: The 'data' returned from convert_to_int() if 'data' is not None. - None is returned if data is None. - """ - if data is not None: - return convert_to_int(data) - return data - - -def convert_to_positive_float_or_none(val): - """Converts a value to a python float if the value is positive. - - :param val: The value to convert to a positive python float. - :returns: The value as a python float. If the val is None, None is - returned. - :raises ValueError, InvalidInput: A ValueError is raised if the 'val' - is a float, but is negative. InvalidInput is raised if 'val' can't be - converted to a python float. - """ - # NOTE(salv-orlando): This conversion function is currently used by - # a vendor specific extension only at the moment It is used for - # port's RXTX factor in neutron.plugins.vmware.extensions.qos. - # It is deemed however generic enough to be in this module as it - # might be used in future for other API attributes. - if val is None: - return - try: - val = float(val) - if val < 0: - raise ValueError() - except (ValueError, TypeError): - msg = _("'%s' must be a non negative decimal.") % val - raise n_exc.InvalidInput(error_message=msg) - return val - - -def convert_kvp_str_to_list(data): - """Convert a value of the form 'key=value' to ['key', 'value']. - - :param data: The string to parse for a key value pair. - :returns: A list where element 0 is the key and element 1 is the value. - :raises InvalidInput: If 'data' is not a key value string. - """ - kvp = [x.strip() for x in data.split('=', 1)] - if len(kvp) == 2 and kvp[0]: - return kvp - msg = _("'%s' is not of the form =[value]") % data - raise n_exc.InvalidInput(error_message=msg) - - -def convert_kvp_list_to_dict(kvp_list): - """Convert a list of 'key=value' strings to a dict. - - :param kvp_list: A list of key value pair strings. For more info on the - format see; convert_kvp_str_to_list(). - :returns: A dict who's key value pairs are populated by parsing 'kvp_list'. - :raises InvalidInput: If any of the key value strings are malformed. - """ - if kvp_list == ['True']: - # No values were provided (i.e. '--flag-name') - return {} - kvp_map = {} - for kvp_str in kvp_list: - key, value = convert_kvp_str_to_list(kvp_str) - kvp_map.setdefault(key, set()) - kvp_map[key].add(value) - return dict((x, list(y)) for x, y in kvp_map.items()) - - -def convert_none_to_empty_list(value): - """Convert value to an empty list if it's None. - - :param value: The value to convert. - :returns: An empty list of 'value' is None, otherwise 'value'. - """ - return [] if value is None else value - - -def convert_none_to_empty_dict(value): - """Convert the value to an empty dict if it's None. - - :param value: The value to convert. - :returns: An empty dict if 'value' is None, otherwise 'value'. - """ - return {} if value is None else value - - -def convert_to_list(data): - """Convert a value into a list. - - :param data: The value to convert. - :return: A new list wrapped around 'data' whereupon the list is empty - if 'data' is None. - """ - if data is None: - return [] - elif hasattr(data, '__iter__') and not isinstance(data, six.string_types): - return list(data) - else: - return [data] - - -def convert_ip_to_canonical_format(value): - """IP Address is validated and then converted to canonical format. - - :param value: The IP Address which needs to be checked. - :returns: - None if 'value' is None, - - 'value' if 'value' is IPv4 address, - - 'value' if 'value' is not an IP Address - - canonical IPv6 address if 'value' is IPv6 address. - - """ - try: - ip = netaddr.IPAddress(value) - if ip.version == constants.IP_VERSION_6: - return six.text_type(ip.format(dialect=netaddr.ipv6_compact)) - except netaddr.core.AddrFormatError: - pass - return value - - -def convert_cidr_to_canonical_format(value): - """CIDR is validated and converted to canonical format. - - :param value: The CIDR which needs to be checked. - :returns: - 'value' if 'value' is CIDR with IPv4 address, - - CIDR with canonical IPv6 address if 'value' is IPv6 CIDR. - :raises: InvalidInput if 'value' is None, not a valid CIDR or - invalid IP Format. - """ - error_message = _("%s is not in a CIDR format") % value - try: - cidr = netaddr.IPNetwork(value) - return str(convert_ip_to_canonical_format( - cidr.ip)) + "/" + str(cidr.prefixlen) - except netaddr.core.AddrFormatError: - raise n_exc.InvalidInput(error_message=error_message) - - -def convert_string_to_case_insensitive(data): - """Convert a string value into a lower case string. - - This effectively makes the string case-insensitive. - - :param data: The value to convert. - :return: The lower-cased string representation of the value, or None is - 'data' is None. - :raises InvalidInput: If the value is not a string. - """ - try: - return data.lower() - except AttributeError: - error_message = _("Input value %s must be string type") % data - raise n_exc.InvalidInput(error_message=error_message) - - -def convert_to_protocol(data): - """Validate that a specified IP protocol is valid. - - For the authoritative list mapping protocol names to numbers, see the IANA: - http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml - - :param data: The value to verify is an IP protocol. - :returns: If data is an int between 0 and 255 or None, return that; if - data is a string then return it lower-cased if it matches one of the - allowed protocol names. - :raises exceptions.InvalidInput: If data is an int < 0, an - int > 255, or a string that does not match one of the allowed protocol - names. - """ - - if data is None: - return - val = convert_string_to_case_insensitive(data) - if val in constants.IPTABLES_PROTOCOL_MAP: - return data - - error_message = _("IP protocol '%s' is not supported. Only protocol " - "names and their integer representation (0 to " - "255) are supported") % data - try: - if validators.validate_range(convert_to_int(data), [0, 255]) is None: - return data - else: - raise n_exc.InvalidInput(error_message=error_message) - except n_exc.InvalidInput: - raise n_exc.InvalidInput(error_message=error_message) - - -def convert_to_string(data): - """Convert a data value into a string. - - :param data: The data value to convert to a string. - :returns: The string value of 'data' if data is not None - """ - - if data is not None: - return str(data) diff --git a/neutron_lib/api/definitions/__init__.py b/neutron_lib/api/definitions/__init__.py deleted file mode 100644 index f732e5b..0000000 --- a/neutron_lib/api/definitions/__init__.py +++ /dev/null @@ -1,70 +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 neutron_lib.api.definitions import address_scope -from neutron_lib.api.definitions import agent -from neutron_lib.api.definitions import auto_allocated_topology -from neutron_lib.api.definitions import bgpvpn -from neutron_lib.api.definitions import bgpvpn_routes_control -from neutron_lib.api.definitions import data_plane_status -from neutron_lib.api.definitions import dns -from neutron_lib.api.definitions import dns_domain_ports -from neutron_lib.api.definitions import extra_dhcp_opt -from neutron_lib.api.definitions import fip64 -from neutron_lib.api.definitions import firewall -from neutron_lib.api.definitions import firewall_v2 -from neutron_lib.api.definitions import firewallrouterinsertion -from neutron_lib.api.definitions import l3 -from neutron_lib.api.definitions import logging -from neutron_lib.api.definitions import logging_resource -from neutron_lib.api.definitions import network -from neutron_lib.api.definitions import network_mtu -from neutron_lib.api.definitions import port -from neutron_lib.api.definitions import port_security -from neutron_lib.api.definitions import portbindings -from neutron_lib.api.definitions import provider_net -from neutron_lib.api.definitions import router_interface_fip -from neutron_lib.api.definitions import subnet -from neutron_lib.api.definitions import subnetpool -from neutron_lib.api.definitions import trunk -from neutron_lib.api.definitions import trunk_details - - -_ALL_API_DEFINITIONS = { - address_scope, - agent, - auto_allocated_topology, - bgpvpn, - bgpvpn_routes_control, - data_plane_status, - dns, - dns_domain_ports, - extra_dhcp_opt, - fip64, - firewall, - firewall_v2, - firewallrouterinsertion, - l3, - logging, - logging_resource, - network, - network_mtu, - port, - port_security, - portbindings, - provider_net, - router_interface_fip, - subnet, - subnetpool, - trunk, - trunk_details -} diff --git a/neutron_lib/api/definitions/_dummy.py b/neutron_lib/api/definitions/_dummy.py deleted file mode 100644 index e552dc9..0000000 --- a/neutron_lib/api/definitions/_dummy.py +++ /dev/null @@ -1,125 +0,0 @@ -# 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. - -# A declaration of a dummy neutron extension: this may have a number of -# constants being defined, and their aim is to document as much about -# the extension as possible. - -# The alias of the extension. -ALIAS = 'dummy' - -# The label to lookup the plugin in the plugin directory. It can match the -# alias, as required. -LABEL = 'DUMMY' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map (mandatory). -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension (mandatory). -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension (mandatory). -NAME = 'Foo Extension' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource (mandatory). -API_PREFIX = '' - -# The description of the extension (mandatory). -DESCRIPTION = "Provides support for foo" - -# A timestamp of when the extension was introduced (mandatory). -UPDATED_TIMESTAMP = "2000-00-01T00:00:00-00:00" - -# The specific resources and/or attributes for the extension (optional). -# In case of simple extensions, with single resource, the string constants -# RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals -# can be used instead. - -# The name of the resource introduced or being extended -# (in case it is defined by another extension, or it is -# a core resource). -RESOURCE_NAME = 'foo' - -# The plural for the resource introduced or being extended -# (in case it is defined by another extension, or it is a -# core resource). -COLLECTION_NAME = 'fooes' - -# The resource attribute map for the extension. It is effectively the -# bulk of the API contract alongside ACTION_MAP (mandatory). -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, 'primary_key': True}, - } -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). For example: -SUB_RESOURCE_ATTRIBUTE_MAP = { - 'subfoo': { - 'parent': { - 'collection_name': COLLECTION_NAME, - 'member_name': RESOURCE_NAME}, - 'parameters': { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - }, - }, -} - -# The action map: it associates verbs with methods to be performed on -# the API resource (mandatory). For example: -# -# ACTION_MAP = { -# RESOURCE_NAME: { -# 'add_my_foo_bars': 'PUT', -# 'remove_my_foo_bars': 'PUT', -# 'get_my_foo_bars': 'GET' -# } -# } -ACTION_MAP = { -} - -# The action status: it associates response statuses with methods to be -# performed on the API resource (mandatory). For example: -# -# ACTION_STATUS = { -# 'create': 201, -# 'delete': 204 -# } -ACTION_STATUS = { -} - -# The list of required extensions (mandatory). -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions (mandatory). -OPTIONAL_EXTENSIONS = [ -] - -# TODO(armax): add support for modeling custom queries diff --git a/neutron_lib/api/definitions/address_scope.py b/neutron_lib/api/definitions/address_scope.py deleted file mode 100644 index 6246a4f..0000000 --- a/neutron_lib/api/definitions/address_scope.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (c) 2015 Huawei Technologies Co.,LTD. -# -# 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 neutron_lib.api import converters -from neutron_lib import constants -from neutron_lib.db import constants as db_constants - - -ADDRESS_SCOPE = 'address_scope' -ADDRESS_SCOPE_ID = 'address_scope_id' -IPV4_ADDRESS_SCOPE = 'ipv4_%s' % ADDRESS_SCOPE -IPV6_ADDRESS_SCOPE = 'ipv6_%s' % ADDRESS_SCOPE - -ALIAS = 'address-scope' -LABEL = ALIAS -IS_SHIM_EXTENSION = False -IS_STANDARD_ATTR_EXTENSION = False -NAME = 'Address scope' -API_PREFIX = '' -DESCRIPTION = 'Address scopes extension.' -UPDATED_TIMESTAMP = '2015-07-26T10:00:00-00:00' -RESOURCE_NAME = ADDRESS_SCOPE -COLLECTION_NAME = RESOURCE_NAME + 's' -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, - 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, - 'allow_put': True, - 'default': '', - 'validate': {'type:string': db_constants.NAME_FIELD_SIZE}, - 'is_visible': True}, - 'tenant_id': {'allow_post': True, - 'allow_put': False, - 'validate': { - 'type:string': db_constants.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True}, - 'shared': {'allow_post': True, - 'allow_put': True, - 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, - 'required_by_policy': True, - 'enforce_policy': True}, - 'ip_version': {'allow_post': True, 'allow_put': False, - 'convert_to': converters.convert_to_int, - 'validate': {'type:values': [4, 6]}, - 'is_visible': True}, - }, - 'subnetpools': { - ADDRESS_SCOPE_ID: {'allow_post': True, - 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:uuid_or_none': None}, - 'is_visible': True} - }, - 'networks': { - IPV4_ADDRESS_SCOPE: {'allow_post': False, - 'allow_put': False, - 'is_visible': True}, - IPV6_ADDRESS_SCOPE: {'allow_post': False, - 'allow_put': False, - 'is_visible': True}, - } -} -SUB_RESOURCE_ATTRIBUTE_MAP = {} -ACTION_MAP = {} -REQUIRED_EXTENSIONS = [] -OPTIONAL_EXTENSIONS = [] -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/agent.py b/neutron_lib/api/definitions/agent.py deleted file mode 100644 index 404503e..0000000 --- a/neutron_lib/api/definitions/agent.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (c) 2013 OpenStack Foundation. -# -# 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 neutron_lib.api import converters -from neutron_lib.db import constants - -ALIAS = 'agent' -LABEL = ALIAS -IS_SHIM_EXTENSION = False -IS_STANDARD_ATTR_EXTENSION = False -NAME = ALIAS -API_PREFIX = '' -DESCRIPTION = 'The agent management extension.' -UPDATED_TIMESTAMP = '2013-02-03T10:00:00-00:00' -RESOURCE_NAME = ALIAS -COLLECTION_NAME = ALIAS + 's' -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True}, - 'agent_type': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'binary': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'topic': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'host': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'admin_state_up': {'allow_post': False, 'allow_put': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - 'created_at': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'started_at': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'heartbeat_timestamp': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'alive': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'configurations': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'description': { - 'allow_post': False, 'allow_put': True, - 'is_visible': True, - 'validate': { - 'type:string_or_none': constants.DESCRIPTION_FIELD_SIZE}}, - } -} -SUB_RESOURCE_ATTRIBUTE_MAP = {} -ACTION_MAP = {} -REQUIRED_EXTENSIONS = [] -OPTIONAL_EXTENSIONS = [] -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/auto_allocated_topology.py b/neutron_lib/api/definitions/auto_allocated_topology.py deleted file mode 100644 index f5b65cd..0000000 --- a/neutron_lib/api/definitions/auto_allocated_topology.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2015-2016 Hewlett Packard Enterprise Development Company, LP -# -# 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 neutron_lib.api import converters -from neutron_lib.api.definitions import constants -from neutron_lib.api.definitions import l3 -from neutron_lib.api.definitions import network - -ALIAS = 'auto-allocated-topology' -LABEL = ALIAS -IS_SHIM_EXTENSION = False -IS_STANDARD_ATTR_EXTENSION = False -NAME = 'Auto Allocated Topology Services' -API_PREFIX = '' -DESCRIPTION = 'Auto Allocated Topology Services.' -UPDATED_TIMESTAMP = '2016-01-01T00:00:00-00:00' -RESOURCE_NAME = 'auto_allocated_topology' -COLLECTION_NAME = 'auto_allocated_topologies' -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True}, - 'tenant_id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True}, - }, - network.COLLECTION_NAME: { - constants.IS_DEFAULT: { - 'allow_post': True, - 'allow_put': True, - 'default': False, - 'is_visible': True, - 'convert_to': converters.convert_to_boolean, - 'enforce_policy': True, - 'required_by_policy': True}}, -} -SUB_RESOURCE_ATTRIBUTE_MAP = {} -ACTION_MAP = {} -REQUIRED_EXTENSIONS = [l3.ALIAS, 'subnet_allocation', 'external-net'] -OPTIONAL_EXTENSIONS = [] -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/base.py b/neutron_lib/api/definitions/base.py deleted file mode 100644 index ca86e53..0000000 --- a/neutron_lib/api/definitions/base.py +++ /dev/null @@ -1,140 +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. - -KNOWN_ATTRIBUTES = ( - 'admin_state_up', - 'allocation_pools', - 'cidr', - 'default_prefixlen', - 'default_quota', - 'description', - 'device_id', - 'device_owner', - 'dns_nameservers', - 'enable_dhcp', - 'fixed_ips', - 'gateway_ip', - 'host_routes', - 'id', - 'ip_version', - 'ipv6_address_mode', - 'ipv6_ra_mode', - 'is_default', - 'mac_address', - 'max_prefixlen', - 'min_prefixlen', - 'name', - 'network_id', - 'port_id', - 'prefixes', - 'prefixlen', - 'project_id', - 'shared', - 'status', - 'subnets', - 'subnetpool_id', - 'tenant_id' -) - -KNOWN_RESOURCES = ( - 'networks', - 'ports', - 'routers', - 'subnets', - 'subnetpools' -) - -KNOWN_HTTP_ACTIONS = ( - 'DELETE', - 'GET', - 'POST', - 'PUT', -) - -KNOWN_ACTION_STATUSES = ( - 200, - 201, - 202, - 203, - 204, - 205, - 206, -) - -KNOWN_EXTENSIONS = ( - 'address-scope', - 'agent', - 'allowed-address-pairs', - 'auto-allocated-topology', - 'availability_zone', - 'binding', - 'data-plane-status', - 'default-subnetpools', - 'dhcp_agent_scheduler', - 'dns-domain-ports', - 'dns-integration', - 'dvr', - 'ext-gw-mode', - 'external-net', - 'extra_dhcp_opt', - 'extraroute', - 'flavors', - 'l3-ha', - 'l3_agent_scheduler', - 'logging', - 'metering', - 'multi-provider', - 'net-mtu', - 'network-ip-availability', - 'network_availability_zone', - 'pagination', - 'port-security', - 'project-id', - 'provider', - 'qos', - 'quotas', - 'rbac-policies', - 'router', - 'router_availability_zone', - 'security-group', - 'service-type', - 'sorting', - 'standard-attr-description', - 'standard-attr-revisions', - 'standard-attr-timestamp', - 'subnet_allocation', - 'tag', - 'trunk', - 'trunk-details', - # Add here list of extensions with pointers to the project repo, e.g. - # 'bgp', # http://git.openstack.org/cgit/openstack/neutron-dynamic-routing - - # http://git.openstack.org/cgit/openstack/neutron-fwaas - 'fwaas', - 'fwaasrouterinsertion', - 'fwaas_v2', - 'bgpvpn', # https://git.openstack.org/cgit/openstack/networking-bgpvpn - 'bgpvpn-routes-control', -) - -KNOWN_KEYWORDS = ( - 'allow_post', - 'allow_put', - 'convert_to', - 'convert_list_to', - 'default', - 'enforce_policy', - 'is_visible', - 'primary_key', - 'required_by_policy', - 'validate', -) diff --git a/neutron_lib/api/definitions/bgpvpn.py b/neutron_lib/api/definitions/bgpvpn.py deleted file mode 100644 index 12ff5de..0000000 --- a/neutron_lib/api/definitions/bgpvpn.py +++ /dev/null @@ -1,195 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.api.definitions import l3 -from neutron_lib.db import constants as db_const - -# Regular expression to validate an empty string -EMPTY_REGEX = (r'^$') -# Regular expression to validate 32 bits unsigned int -UINT32_REGEX = (r'(0|[1-9]\d{0,8}|[1-3]\d{9}|4[01]\d{8}|42[0-8]\d{7}' - r'|429[0-3]\d{6}|4294[0-8]\d{5}|42949[0-5]\d{4}' - r'|429496[0-6]\d{3}|4294967[0-1]\d{2}|42949672[0-8]\d' - r'|429496729[0-5])') -# Regular expression to validate 16 bits unsigned int -UINT16_REGEX = (r'(0|[1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}' - r'|655[0-2]\d|6553[0-5])') -# Regular expression to validate 8 bits unsigned int -UINT8_REGEX = (r'(0|[1-9]\d{0,1}|1\d{2}|2[0-4]\d|25[0-5])') -# Regular expression to validate IPv4 address -IP4_REGEX = (r'(%s\.%s\.%s\.%s)') % (UINT8_REGEX, UINT8_REGEX, UINT8_REGEX, - UINT8_REGEX) -# Regular expression to validate Route Target list format -# Support of the Type 0, Type 1 and Type 2, cf. chapter 4.2 in RFC 4364 -# Also validates Route Distinguisher list format -RTRD_REGEX = (r'%s|^(%s:%s|%s:%s|%s:%s)$') % (EMPTY_REGEX, UINT16_REGEX, - UINT32_REGEX, IP4_REGEX, - UINT16_REGEX, UINT32_REGEX, - UINT16_REGEX) - -# The alias of the extension. -ALIAS = 'bgpvpn' -LABEL = 'BGPVPN' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'BGPVPN Extension' - -# The description of the extension. -DESCRIPTION = "Provides support for BGP VPN interconnections" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2014-06-10T17:00:00-00:00" - -# The specific resources and/or attributes for the extension (optional). -RESOURCE_NAME = 'bgpvpn' -COLLECTION_NAME = 'bgpvpns' -BGPVPN_L2 = 'l2' -BGPVPN_L3 = 'l3' -BGPVPN_RES = "bgpvpns" -BGPVPN_TYPES = [BGPVPN_L3, BGPVPN_L2] -NETWORK_ASSOCIATION = 'network_association' -NETWORK_ASSOCIATIONS = 'network_associations' -ROUTER_ASSOCIATION = 'router_association' -ROUTER_ASSOCIATIONS = 'router_associations' - -# The resource attribute map for the extension. -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True, - 'enforce_policy': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True, - 'enforce_policy': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'default': '', - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True, - 'enforce_policy': True}, - 'type': {'allow_post': True, 'allow_put': False, - 'default': BGPVPN_L3, - 'validate': {'type:values': BGPVPN_TYPES}, - 'is_visible': True, - 'enforce_policy': True}, - 'route_targets': {'allow_post': True, 'allow_put': True, - 'default': [], - 'convert_to': converters.convert_to_list, - 'validate': {'type:list_of_regex_or_none': - RTRD_REGEX}, - 'is_visible': True, - 'enforce_policy': True}, - 'import_targets': {'allow_post': True, 'allow_put': True, - 'default': [], - 'convert_to': converters.convert_to_list, - 'validate': {'type:list_of_regex_or_none': - RTRD_REGEX}, - 'is_visible': True, - 'enforce_policy': True}, - 'export_targets': {'allow_post': True, 'allow_put': True, - 'default': [], - 'convert_to': converters.convert_to_list, - 'validate': {'type:list_of_regex_or_none': - RTRD_REGEX}, - 'is_visible': True, - 'enforce_policy': True}, - 'route_distinguishers': {'allow_post': True, 'allow_put': True, - 'default': [], - 'convert_to': converters.convert_to_list, - 'validate': {'type:list_of_regex_or_none': - RTRD_REGEX}, - 'is_visible': True, - 'enforce_policy': True}, - 'networks': {'allow_post': False, 'allow_put': False, - 'is_visible': True, - 'enforce_policy': True}, - 'routers': {'allow_post': False, 'allow_put': False, - 'is_visible': True, - 'enforce_policy': True} - }, -} - -SUB_RESOURCE_ATTRIBUTE_MAP = { - NETWORK_ASSOCIATIONS: { - 'parent': {'collection_name': COLLECTION_NAME, - 'member_name': RESOURCE_NAME}, - 'parameters': { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True, - 'enforce_policy': True}, - 'network_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'enforce_policy': True} - } - }, - ROUTER_ASSOCIATIONS: { - 'parent': {'collection_name': COLLECTION_NAME, - 'member_name': RESOURCE_NAME}, - 'parameters': { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True, - 'enforce_policy': True}, - 'router_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'enforce_policy': True} - } - } -} - -ACTION_MAP = { -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [l3.ALIAS] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/bgpvpn_routes_control.py b/neutron_lib/api/definitions/bgpvpn_routes_control.py deleted file mode 100644 index 8d67fbf..0000000 --- a/neutron_lib/api/definitions/bgpvpn_routes_control.py +++ /dev/null @@ -1,168 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.api.definitions import bgpvpn -from neutron_lib.db import constants as db_const - - -# The alias of the extension. -ALIAS = 'bgpvpn-routes-control' - -# The label to lookup the plugin in the plugin directory. It can match the -# alias, as required. -LABEL = ALIAS - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map (mandatory). -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension (mandatory). -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension (mandatory). -NAME = 'BGPVPN Routes Control Extension' - -# The description of the extension (mandatory). -DESCRIPTION = "Provides support for controlling routes advertised to a BGPVPN" - -# A timestamp of when the extension was introduced (mandatory). -UPDATED_TIMESTAMP = "2017-05-20T00:00:00-00:00" - -# The specific resources and/or attributes for the extension (optional). -# In case of simple extensions, with single resource, the string constants -# RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals -# can be used instead. - -# The name of the resource introduced or being extended (later case) -RESOURCE_NAME = bgpvpn.RESOURCE_NAME - -# The plural for the resource introduced or being extended (later case) -COLLECTION_NAME = bgpvpn.COLLECTION_NAME - -LOCAL_PREF_KEY = 'local_pref' -LOCAL_PREF_RANGE = [0, 2**32-1] # RFC 4271, section 4.3 (p.18) - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'ports': {'allow_post': False, 'allow_put': False, - 'is_visible': True, - 'enforce_policy': True}, - LOCAL_PREF_KEY: { - 'allow_post': True, 'allow_put': True, - 'is_visible': True, - 'default': None, - 'validate': {'type:range_or_none': LOCAL_PREF_RANGE}, - 'enforce_policy': True} - } -} - -PORT_ASSOCIATION = 'port_association' -PORT_ASSOCIATIONS = 'port_associations' - -ROUTES = 'routes' - -PREFIX_TYPE = 'prefix' -BGPVPN_TYPE = 'bgpvpn' -ROUTE_TYPES = [PREFIX_TYPE, BGPVPN_TYPE] - -ADV_FIXED_IPS = 'advertise_fixed_ips' - -TYPE = 'type' - -PREFIX = 'prefix' -BGPVPN_ID = 'bgpvpn_id' - -ADV_EXTRA_ROUTES = 'advertise_extra_routes' - -LOCAL_PREF_KEY_SPEC = {'type:range': LOCAL_PREF_RANGE, - 'required': False} - -ROUTE_SPECS = EXTRA_DHCP_OPT_KEY_SPECS = [ - {'type': {'type:values': [PREFIX_TYPE], - 'required': True}, - 'prefix': {'type:subnet': None, - 'required': True}, - LOCAL_PREF_KEY: LOCAL_PREF_KEY_SPEC, - }, - {'type': {'type:values': [BGPVPN_TYPE], - 'required': True}, - 'bgpvpn_id': {'type:uuid': None, - 'required': True}, - LOCAL_PREF_KEY: LOCAL_PREF_KEY_SPEC, - }, -] - -SUB_RESOURCE_ATTRIBUTE_MAP = { - PORT_ASSOCIATIONS: { - 'parent': { - 'collection_name': COLLECTION_NAME, - 'member_name': RESOURCE_NAME}, - 'parameters': { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'project_id': {'allow_post': True, 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True, - 'enforce_policy': True}, - 'port_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'enforce_policy': True}, - ROUTES: {'allow_post': True, 'allow_put': True, - 'default': [], - 'convert_list_to': converters.convert_kvp_list_to_dict, - 'validate': { - 'type:list_of_any_key_specs_or_none': ROUTE_SPECS - }, - 'enforce_policy': True, - 'is_visible': True}, - ADV_FIXED_IPS: {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - }, - }, - bgpvpn.ROUTER_ASSOCIATIONS: { - 'parent': {'collection_name': COLLECTION_NAME, - 'member_name': RESOURCE_NAME}, - 'parameters': { - ADV_EXTRA_ROUTES: {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - } - } -} - - -ACTION_MAP = { -} - -ACTION_STATUS = {} - -REQUIRED_EXTENSIONS = [ - bgpvpn.ALIAS -] - -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/definitions/constants.py b/neutron_lib/api/definitions/constants.py deleted file mode 100644 index 53258ec..0000000 --- a/neutron_lib/api/definitions/constants.py +++ /dev/null @@ -1,32 +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. - -# neutron-fwaas constants -from neutron_lib import constants - -FIREWALL_GROUPS = 'firewall_groups' -FIREWALL_POLICIES = 'firewall_policies' -FIREWALL_RULES = 'firewall_rules' -FIREWALLS = 'firewalls' - -FWAAS_ALLOW = "allow" -FWAAS_DENY = "deny" -FWAAS_REJECT = "reject" -FW_VALID_ACTION_VALUES = [FWAAS_ALLOW, FWAAS_DENY, FWAAS_REJECT] - -# Firewall Protocol List - -FW_PROTOCOL_VALUES = list(constants.IPTABLES_PROTOCOL_MAP.keys()) + [None] - -# a default resource, such as auto allocated topology is_default network -IS_DEFAULT = 'is_default' diff --git a/neutron_lib/api/definitions/data_plane_status.py b/neutron_lib/api/definitions/data_plane_status.py deleted file mode 100644 index 2c6a1ba..0000000 --- a/neutron_lib/api/definitions/data_plane_status.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2017 NEC Corporation. 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 neutron_lib.api.definitions import port -from neutron_lib import constants - - -VALID_VALUES = [None, constants.ACTIVE, constants.DOWN] - -# The alias of the extension. -ALIAS = 'data-plane-status' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Port data plane status extension' - -# The description of the extension. -DESCRIPTION = "Expose status of underlying data plane" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2017-01-24T10:00:00-00:00" - -# The name of the resource introduced or being extended. -RESOURCE_NAME = port.RESOURCE_NAME - -# The plural for the resource introduced or being extended. -COLLECTION_NAME = port.COLLECTION_NAME - -# The specific resources and/or attributes for the extension (optional). -DATA_PLANE_STATUS = 'data_plane_status' - -# The resource attribute map for the extension. -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - DATA_PLANE_STATUS: {'allow_post': False, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:values': VALID_VALUES}, - 'is_visible': True, - 'enforce_policy': True, } - }, -} - -# The subresource attribute map for the extension. -SUB_RESOURCE_ATTRIBUTE_MAP = { -} - -# The action map. -ACTION_MAP = { -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/dns.py b/neutron_lib/api/definitions/dns.py deleted file mode 100644 index 170e081..0000000 --- a/neutron_lib/api/definitions/dns.py +++ /dev/null @@ -1,116 +0,0 @@ -# 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 neutron_lib.api import converters as convert -from neutron_lib.api.definitions import l3 -from neutron_lib.api.definitions import network -from neutron_lib.api.definitions import port -from neutron_lib.api import validators -from neutron_lib.api.validators import dns as dns_validator -from neutron_lib.db import constants - -# The alias of the extension. -ALIAS = 'dns-integration' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map (mandatory). -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension (mandatory). -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension (mandatory). -NAME = 'DNS Integration' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource (mandatory). -API_PREFIX = '' - -# The description of the extension (mandatory). -DESCRIPTION = "Provides integration with DNS." - -# A timestamp of when the extension was introduced (mandatory). -UPDATED_TIMESTAMP = "2015-08-15T18:00:00-00:00" - -DNSNAME = 'dns_name' -DNSDOMAIN = 'dns_domain' -DNSASSIGNMENT = 'dns_assignment' - -validators.add_validator('dns_host_name', dns_validator.validate_dns_name) -validators.add_validator('fip_dns_host_name', - dns_validator.validate_fip_dns_name) -validators.add_validator('dns_domain_name', - dns_validator.validate_dns_domain) - -# The resource attribute map for the extension. It is effectively the -# bulk of the API contract alongside ACTION_MAP (mandatory). -RESOURCE_ATTRIBUTE_MAP = { - port.COLLECTION_NAME: { - DNSNAME: {'allow_post': True, 'allow_put': True, - 'default': '', - 'convert_to': convert.convert_string_to_case_insensitive, - 'validate': {'type:dns_host_name': - constants.FQDN_FIELD_SIZE}, - 'is_visible': True}, - DNSASSIGNMENT: {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - }, - l3.FLOATINGIPS: { - DNSNAME: {'allow_post': True, 'allow_put': False, - 'default': '', - 'convert_to': convert.convert_string_to_case_insensitive, - 'validate': {'type:fip_dns_host_name': - constants.FQDN_FIELD_SIZE}, - 'is_visible': True}, - DNSDOMAIN: {'allow_post': True, 'allow_put': False, - 'default': '', - 'convert_to': convert.convert_string_to_case_insensitive, - 'validate': {'type:dns_domain_name': - constants.FQDN_FIELD_SIZE}, - 'is_visible': True}, - }, - network.COLLECTION_NAME: { - DNSDOMAIN: {'allow_post': True, 'allow_put': True, - 'default': '', - 'convert_to': convert.convert_string_to_case_insensitive, - 'validate': {'type:dns_domain_name': - constants.FQDN_FIELD_SIZE}, - 'is_visible': True}, - }, -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). For example: -SUB_RESOURCE_ATTRIBUTE_MAP = {} - -# The action map: it associates verbs with methods to be performed on -# the API resource (mandatory). -ACTION_MAP = {} - -# The action status: it associates response statuses with methods to be -# performed on the API resource (mandatory). -ACTION_STATUS = {} - -# The list of required extensions (mandatory). -REQUIRED_EXTENSIONS = [l3.ALIAS] - -# The list of optional extensions (mandatory). -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/definitions/dns_domain_ports.py b/neutron_lib/api/definitions/dns_domain_ports.py deleted file mode 100644 index d27944d..0000000 --- a/neutron_lib/api/definitions/dns_domain_ports.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (c) 2017 IBM -# 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 neutron_lib.api import converters as convert -from neutron_lib.api.definitions import dns -from neutron_lib.api.definitions import port -from neutron_lib.db import constants - - -# The alias of the extension. -ALIAS = 'dns-domain-ports' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map (mandatory). -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension (mandatory). -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension (mandatory). -NAME = 'dns_domain for ports' - -# The description of the extension (mandatory). -DESCRIPTION = "Allows the DNS domain to be specified for a network port." - -# A timestamp of when the extension was introduced (mandatory). -UPDATED_TIMESTAMP = "2017-04-24T10:00:00-00:00" - -# The specific resources and/or attributes for the extension (optional). -# In case of simple extensions, with single resource, the string constants -# RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals -# can be used instead. - -# The name of the resource introduced or being extended -# (in case it is defined by another extension, or it is -# a core resource). -RESOURCE_NAME = port.RESOURCE_NAME - -# The plural for the resource introduced or being extended -# (in case it is defined by another extension, or it is a -# core resource). -COLLECTION_NAME = port.COLLECTION_NAME - -# The resource attribute map for the extension. It is effectively the -# bulk of the API contract alongside ACTION_MAP (mandatory). -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - dns.DNSDOMAIN: {'allow_post': True, 'allow_put': True, - 'default': '', - 'convert_to': - convert.convert_string_to_case_insensitive, - 'validate': {'type:dns_domain_name': - constants.FQDN_FIELD_SIZE}, - 'is_visible': True}, - }, -} - -# The subresource attribute map for the extension. -SUB_RESOURCE_ATTRIBUTE_MAP = { -} - -# The action map -ACTION_MAP = { -} - -# The action status -ACTION_STATUS = { -} - -# The list of required extensions (mandatory). -REQUIRED_EXTENSIONS = [dns.ALIAS] - -# The list of optional extensions (mandatory). -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/extra_dhcp_opt.py b/neutron_lib/api/definitions/extra_dhcp_opt.py deleted file mode 100644 index e08829b..0000000 --- a/neutron_lib/api/definitions/extra_dhcp_opt.py +++ /dev/null @@ -1,132 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.api.definitions import port - - -# Common definitions for maximum string field length -DHCP_OPT_NAME_MAX_LEN = 64 -VALID_BLANK_EXTRA_DHCP_OPTS = ('router', 'classless-static-route') -DHCP_OPT_VALUE_MAX_LEN = 255 - - -EXTRA_DHCP_OPT_KEY_SPECS = [ - # key spec for opt_name in _VALID_BLANK_EXTRA_DHCP_OPTS - {'opt_name': {'type:values': VALID_BLANK_EXTRA_DHCP_OPTS, - 'required': True}, - 'opt_value': {'type:string_or_none': - DHCP_OPT_VALUE_MAX_LEN, - 'required': True}, - 'ip_version': {'convert_to': converters.convert_to_int, - 'type:values': [4, 6], - 'required': False}}, - # key spec if opt_name not in _VALID_BLANK_EXTRA_DHCP_OPTS - {'opt_name': {'type:not_empty_string': DHCP_OPT_NAME_MAX_LEN, - 'required': True}, - 'opt_value': {'type:not_empty_string_or_none': - DHCP_OPT_VALUE_MAX_LEN, - 'required': True}, - 'ip_version': {'convert_to': converters.convert_to_int, - 'type:values': [4, 6], - 'required': False}} -] - -EXTRADHCPOPTS = 'extra_dhcp_opts' -DHCP_OPT_CLIENT_ID = "client-id" - - -# The alias of the extension. -ALIAS = 'extra_dhcp_opt' - -# The label to lookup the plugin in the plugin directory. It can match the -# alias, as required. -LABEL = 'extra_dhcp_opt' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map (mandatory). -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension (mandatory). -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension (mandatory). -NAME = 'Neutron Extra DHCP options' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource (mandatory). -API_PREFIX = '' - -# The description of the extension (mandatory). -DESCRIPTION = ("Extra options configuration for DHCP. " - "For example PXE boot options to DHCP clients can " - "be specified (e.g. tftp-server, server-ip-address, " - "bootfile-name)") - -# A timestamp of when the extension was introduced (mandatory). -UPDATED_TIMESTAMP = "2013-03-17T12:00:00-00:00" - -# The specific resources and/or attributes for the extension (optional). -# In case of simple extensions, with single resource, the string constants -# RESOURCE_NAME and COLLECTION_NAME can be used, otherwise string literals -# can be used instead. - -# The name of the resource introduced or being extended -# (in case it is defined by another extension, or it is -# a core resource). -RESOURCE_NAME = port.RESOURCE_NAME - -# The plural for the resource introduced or being extended -# (in case it is defined by another extension, or it is a -# core resource). -COLLECTION_NAME = port.COLLECTION_NAME - -# The resource attribute map for the extension. It is effectively the -# bulk of the API contract alongside ACTION_MAP (mandatory). -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - EXTRADHCPOPTS: { - 'allow_post': True, - 'allow_put': True, - 'is_visible': True, - 'default': None, - 'validate': { - 'type:list_of_any_key_specs_or_none': EXTRA_DHCP_OPT_KEY_SPECS - } - } - } -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). -SUB_RESOURCE_ATTRIBUTE_MAP = {} - -# The action map: it associates verbs with methods to be performed on -# the API resource (mandatory). -ACTION_MAP = {} - -# The list of required extensions (mandatory). -REQUIRED_EXTENSIONS = [] - -# The list of optional extensions (mandatory). -OPTIONAL_EXTENSIONS = [] - -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/fip64.py b/neutron_lib/api/definitions/fip64.py deleted file mode 100644 index e7ef276..0000000 --- a/neutron_lib/api/definitions/fip64.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 neutron_lib.api.definitions import l3 - -# The alias of the extension. -ALIAS = 'fip64' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = True - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'FIP64 Extension' - -# The description of the extension. -DESCRIPTION = "FIP64 Extension" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2016-12-14T10:00:00-00:00" - -# The resource attribute map for the extension. It is effectively the -# bulk of the API contract alongside ACTION_MAP -RESOURCE_ATTRIBUTE_MAP = {} - -# The subresource attribute map for the extension. -SUB_RESOURCE_ATTRIBUTE_MAP = None - -# The action map. -ACTION_MAP = {} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ - l3.ALIAS, -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/definitions/firewall.py b/neutron_lib/api/definitions/firewall.py deleted file mode 100644 index a296753..0000000 --- a/neutron_lib/api/definitions/firewall.py +++ /dev/null @@ -1,180 +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 neutron_lib.api import converters -from neutron_lib.api.definitions import constants as api_const -from neutron_lib.db import constants as db_const - -# The alias of the extension. -ALIAS = 'fwaas' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'FWaaS v1' - -# The description of the extension. -DESCRIPTION = "Provides support for firewall-as-a-service version 1" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" - -# Base for the API calls -API_PREFIX = '/fw' - -RESOURCE_ATTRIBUTE_MAP = { - api_const.FIREWALL_RULES: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'is_visible': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'description': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': - db_const.DESCRIPTION_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'firewall_policy_id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid_or_none': None}, - 'is_visible': True}, - 'shared': {'allow_post': True, 'allow_put': True, - 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, 'required_by_policy': True, - 'enforce_policy': True}, - 'protocol': { - 'allow_post': True, 'allow_put': True, - 'is_visible': True, 'default': None, - 'convert_to': converters.convert_to_protocol, - 'validate': {'type:values': api_const.FW_PROTOCOL_VALUES}}, - 'ip_version': {'allow_post': True, 'allow_put': True, - 'default': 4, 'convert_to': converters.convert_to_int, - 'validate': {'type:values': [4, 6]}, - 'is_visible': True}, - 'source_ip_address': {'allow_post': True, 'allow_put': True, - 'validate': {'type:ip_or_subnet_or_none': - None}, - 'is_visible': True, 'default': None}, - 'destination_ip_address': {'allow_post': True, 'allow_put': True, - 'validate': {'type:ip_or_subnet_or_none': - None}, - 'is_visible': True, 'default': None}, - 'source_port': {'allow_post': True, 'allow_put': True, - 'validate': {'type:port_range': None}, - 'convert_to': converters.convert_to_string, - 'default': None, 'is_visible': True}, - 'destination_port': {'allow_post': True, 'allow_put': True, - 'validate': {'type:port_range': None}, - 'convert_to': converters.convert_to_string, - 'default': None, 'is_visible': True}, - 'position': {'allow_post': False, 'allow_put': False, - 'default': None, 'is_visible': True}, - 'action': {'allow_post': True, 'allow_put': True, - 'convert_to': converters.convert_string_to_case_insensitive, - 'validate': {'type:values': - api_const.FW_VALID_ACTION_VALUES}, - 'is_visible': True, 'default': 'deny'}, - 'enabled': {'allow_post': True, 'allow_put': True, - 'default': True, 'is_visible': True, - 'convert_to': converters.convert_to_boolean}, - }, - api_const.FIREWALL_POLICIES: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'is_visible': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'description': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': - db_const.DESCRIPTION_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'shared': {'allow_post': True, 'allow_put': True, - 'default': False, 'enforce_policy': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, 'required_by_policy': True}, - 'firewall_rules': {'allow_post': True, 'allow_put': True, - 'validate': {'type:uuid_list': None}, - 'convert_to': converters.convert_none_to_empty_list, - 'default': None, 'is_visible': True}, - 'audited': {'allow_post': True, 'allow_put': True, - 'default': False, 'is_visible': True, - 'convert_to': converters.convert_to_boolean}, - }, - api_const.FIREWALLS: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'is_visible': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'description': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': - db_const.DESCRIPTION_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'admin_state_up': {'allow_post': True, 'allow_put': True, - 'default': True, 'is_visible': True, - 'convert_to': converters.convert_to_boolean}, - 'status': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'shared': {'allow_post': True, 'allow_put': True, - 'default': False, 'enforce_policy': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': False, 'required_by_policy': True}, - 'firewall_policy_id': {'allow_post': True, 'allow_put': True, - 'validate': {'type:uuid_or_none': None}, - 'is_visible': True}, - }, -} - -# The subresource attribute map for the extension. This extension has only -# top level resources, not child resources, so this is set to an empty dict. -SUB_RESOURCE_ATTRIBUTE_MAP = { -} - -# The action map. -ACTION_MAP = { - 'firewall_policy': {'insert_rule': 'PUT', 'remove_rule': 'PUT'}, -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/firewall_v2.py b/neutron_lib/api/definitions/firewall_v2.py deleted file mode 100644 index 5f5ac8f..0000000 --- a/neutron_lib/api/definitions/firewall_v2.py +++ /dev/null @@ -1,199 +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 neutron_lib.api import converters -from neutron_lib.api.definitions import constants as api_const -from neutron_lib.api.definitions import port -from neutron_lib.db import constants as db_const - -# The alias of the extension. -ALIAS = 'fwaas_v2' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'FWaaS v2' - -# The description of the extension. -DESCRIPTION = "Provides support for firewall-as-a-service version 2" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2016-10-06T10:00:00-00:00" - -# Base for the API calls -API_PREFIX = '/fwaas' - -RESOURCE_ATTRIBUTE_MAP = { - api_const.FIREWALL_RULES: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': {'type:string': - db_const.UUID_FIELD_SIZE}, - 'is_visible': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'description': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': - db_const.DESCRIPTION_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'firewall_policy_id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid_or_none': None}, - 'is_visible': True}, - 'shared': {'allow_post': True, 'allow_put': True, - 'default': False, 'is_visible': True, - 'convert_to': converters.convert_to_boolean, - 'required_by_policy': True, 'enforce_policy': True}, - 'protocol': { - 'allow_post': True, 'allow_put': True, - 'is_visible': True, 'default': None, - 'convert_to': converters.convert_to_protocol, - 'validate': {'type:values': api_const.FW_PROTOCOL_VALUES}}, - 'ip_version': {'allow_post': True, 'allow_put': True, - 'default': 4, 'convert_to': converters.convert_to_int, - 'validate': {'type:values': [4, 6]}, - 'is_visible': True}, - 'source_ip_address': {'allow_post': True, 'allow_put': True, - 'validate': {'type:ip_or_subnet_or_none': None}, - 'is_visible': True, 'default': None}, - 'destination_ip_address': {'allow_post': True, 'allow_put': True, - 'validate': {'type:ip_or_subnet_or_none': - None}, - 'is_visible': True, 'default': None}, - 'source_port': {'allow_post': True, 'allow_put': True, - 'validate': {'type:port_range': None}, - 'convert_to': converters.convert_to_string, - 'default': None, 'is_visible': True}, - 'destination_port': {'allow_post': True, 'allow_put': True, - 'validate': {'type:port_range': None}, - 'convert_to': converters.convert_to_string, - 'default': None, 'is_visible': True}, - 'position': {'allow_post': False, 'allow_put': False, - 'default': None, 'is_visible': True}, - 'action': {'allow_post': True, 'allow_put': True, - 'convert_to': converters.convert_string_to_case_insensitive, - 'validate': {'type:values': - api_const.FW_VALID_ACTION_VALUES}, - 'is_visible': True, 'default': 'deny'}, - 'enabled': {'allow_post': True, 'allow_put': True, - 'convert_to': converters.convert_to_boolean, - 'default': True, 'is_visible': True}, - }, - api_const.FIREWALL_GROUPS: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'description': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': - db_const.DESCRIPTION_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'admin_state_up': {'allow_post': True, 'allow_put': True, - 'default': True, 'is_visible': True, - 'convert_to': converters.convert_to_boolean}, - 'status': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'shared': {'allow_post': True, 'allow_put': True, 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, 'required_by_policy': True, - 'enforce_policy': True}, - port.COLLECTION_NAME: {'allow_post': True, 'allow_put': True, - 'validate': {'type:uuid_list': None}, - 'convert_to': - converters.convert_none_to_empty_list, - 'default': None, 'is_visible': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': {'type:string': - db_const.UUID_FIELD_SIZE}, - 'is_visible': True}, - 'ingress_firewall_policy_id': {'allow_post': True, - 'allow_put': True, - 'validate': {'type:uuid_or_none': - None}, - 'default': None, 'is_visible': True}, - 'egress_firewall_policy_id': {'allow_post': True, - 'allow_put': True, - 'validate': {'type:uuid_or_none': - None}, - 'default': None, 'is_visible': True}, - }, - api_const.FIREWALL_POLICIES: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': {'type:string': - db_const.UUID_FIELD_SIZE}, - 'is_visible': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'description': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': - db_const.DESCRIPTION_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'shared': {'allow_post': True, 'allow_put': True, 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, 'required_by_policy': True, - 'enforce_policy': True}, - api_const.FIREWALL_RULES: {'allow_post': True, 'allow_put': True, - 'validate': {'type:uuid_list': None}, - 'convert_to': - converters.convert_none_to_empty_list, - 'default': None, 'is_visible': True}, - 'audited': {'allow_post': True, 'allow_put': True, 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - - }, -} - -# The subresource attribute map for the extension. This extension has only -# top level resources, not child resources, so this is set to an empty dict. -SUB_RESOURCE_ATTRIBUTE_MAP = { -} - -# The action map. -ACTION_MAP = { - 'firewall_policy': {'insert_rule': 'PUT', 'remove_rule': 'PUT'}, -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/firewallrouterinsertion.py b/neutron_lib/api/definitions/firewallrouterinsertion.py deleted file mode 100644 index 2b1e9f4..0000000 --- a/neutron_lib/api/definitions/firewallrouterinsertion.py +++ /dev/null @@ -1,74 +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 neutron_lib.api.definitions import constants as api_const -from neutron_lib import constants - -# The alias of the extension. -ALIAS = 'fwaasrouterinsertion' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'FWaaS Router Insertion' - -# The description of the extension. -DESCRIPTION = "Provides router insertion support for FWaaS version 1" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" - -# The name of the resource -RESOURCE_NAME = "firewall" - -# The plural for the resource -COLLECTION_NAME = api_const.FIREWALLS - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'router_ids': {'allow_post': True, 'allow_put': True, - 'validate': {'type:uuid_list': None}, - 'is_visible': True, - 'default': constants.ATTR_NOT_SPECIFIED}, - } -} - -# The subresource attribute map for the extension. This extension has only -# top level resources, not child resources, so this is set to an empty dict. -SUB_RESOURCE_ATTRIBUTE_MAP = { -} - -# The action map. -ACTION_MAP = { -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/l3.py b/neutron_lib/api/definitions/l3.py deleted file mode 100644 index 79f92f1..0000000 --- a/neutron_lib/api/definitions/l3.py +++ /dev/null @@ -1,164 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.db import constants - -# The alias of the extension. -ALIAS = 'router' - -# The label to lookup the plugin in the plugin directory. It can match the -# alias, as required. -LABEL = 'router' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Neutron L3 Router' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource. -API_PREFIX = '' - -# The description of the extension. -DESCRIPTION = ("Router abstraction for basic L3 forwarding " - "between L2 Neutron networks and access to external " - "networks via a NAT gateway.") - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2012-07-20T10:00:00-00:00" - - -FLOATING_IP_ADDRESS = 'floating_ip_address' -FLOATING_NETWORK_ID = 'floating_network_id' -FLOATINGIP = 'floatingip' -FLOATINGIPS = 'floatingips' -ROUTERS = 'routers' -ROUTER = 'router' -SUBNET_ID = 'subnet_id' -ROUTER_ID = 'router_id' -PORT_ID = 'port_id' -FIXED_IP_ADDRESS = 'fixed_ip_address' -EXTERNAL_GW_INFO = 'external_gateway_info' - - -RESOURCE_ATTRIBUTE_MAP = { - ROUTERS: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': constants.NAME_FIELD_SIZE}, - 'is_visible': True, 'default': ''}, - 'admin_state_up': {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - 'status': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': { - 'type:string': constants.PROJECT_ID_FIELD_SIZE}, - 'is_visible': True}, - EXTERNAL_GW_INFO: {'allow_post': True, 'allow_put': True, - 'is_visible': True, 'default': None, - 'enforce_policy': True, - 'validate': { - 'type:dict_or_nodata': { - 'network_id': {'type:uuid': None, - 'required': True}, - 'external_fixed_ips': { - 'convert_list_to': - converters.convert_kvp_list_to_dict, - 'type:fixed_ips': None, - 'default': None, - 'required': False, - } - } - }} - }, - FLOATINGIPS: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'floating_ip_address': {'allow_post': True, 'allow_put': False, - 'validate': {'type:ip_address_or_none': None}, - 'is_visible': True, 'default': None, - 'enforce_policy': True}, - 'subnet_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:uuid_or_none': None}, - 'is_visible': False, # Use False for input only attr - 'default': None}, - 'floating_network_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True}, - 'router_id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid_or_none': None}, - 'is_visible': True, 'default': None}, - 'port_id': {'allow_post': True, 'allow_put': True, - 'validate': {'type:uuid_or_none': None}, - 'is_visible': True, 'default': None, - 'required_by_policy': True}, - 'fixed_ip_address': {'allow_post': True, 'allow_put': True, - 'validate': {'type:ip_address_or_none': None}, - 'is_visible': True, 'default': None}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': { - 'type:string': constants.PROJECT_ID_FIELD_SIZE}, - 'is_visible': True}, - 'status': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - }, -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). -SUB_RESOURCE_ATTRIBUTE_MAP = None - -# The action map: it associates verbs with methods to be performed on -# the API resource. -ACTION_MAP = { - ROUTER: { - 'add_router_interface': 'PUT', - 'remove_router_interface': 'PUT' - } -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/logging.py b/neutron_lib/api/definitions/logging.py deleted file mode 100644 index 0bcf882..0000000 --- a/neutron_lib/api/definitions/logging.py +++ /dev/null @@ -1,109 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.db import constants as db_const - -# The alias of the extension. -ALIAS = 'logging' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Logging API Extension' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource. -API_PREFIX = '/log' - -# The description of the extension. -DESCRIPTION = ("Provides a logging API for resources such as " - "security group and firewall.") - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2017-01-01T10:00:00-00:00" - -LOGS = 'logs' -LOG_TYPES = 'loggable_resources' - -ACCEPT_EVENT = 'ACCEPT' -DROP_EVENT = 'DROP' -ALL_EVENT = 'ALL' -LOG_EVENTS = [ACCEPT_EVENT, DROP_EVENT, ALL_EVENT] - -# Attribute Map -RESOURCE_ATTRIBUTE_MAP = { - LOGS: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'project_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': { - 'type:string': - db_const.PROJECT_ID_FIELD_SIZE}, - 'is_visible': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'default': '', 'is_visible': True}, - 'resource_type': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': { - 'type:string': - db_const.RESOURCE_TYPE_FIELD_SIZE}, - 'is_visible': True}, - 'resource_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:uuid_or_none': None}, - 'default': None, 'is_visible': True}, - 'event': {'allow_post': True, 'allow_put': False, - 'validate': {'type:values': LOG_EVENTS}, - 'default': ALL_EVENT, 'is_visible': True}, - 'target_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:uuid_or_none': None}, - 'default': None, 'is_visible': True}, - 'enabled': {'allow_post': True, 'allow_put': True, - 'is_visible': True, 'default': True, - 'convert_to': converters.convert_to_boolean}, - }, - LOG_TYPES: { - 'type': {'allow_post': False, 'allow_put': False, - 'is_visible': True}}, -} - -# The subresource attribute map for the extension. This extension has only -# top level resources, not child resources, so this is set to an empty dict. -SUB_RESOURCE_ATTRIBUTE_MAP = {} - -# The action map. -ACTION_MAP = {} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [] - -# The action status. -ACTION_STATUS = {} - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = ['security-group', 'fwaas_v2'] diff --git a/neutron_lib/api/definitions/logging_resource.py b/neutron_lib/api/definitions/logging_resource.py deleted file mode 100644 index c66089a..0000000 --- a/neutron_lib/api/definitions/logging_resource.py +++ /dev/null @@ -1,139 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.api.definitions import firewall -from neutron_lib.db import constants as db_const - - -# The alias of the extension. -ALIAS = 'logging-resource' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Logging Resource Extension' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource. -API_PREFIX = '/logging' - -# The description of the extension. -DESCRIPTION = "The logging resource extension." - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2016-06-06T10:00:00-00:00" - -# The name of the resource. -RESOURCE_NAME = 'logging_resource' - -# The plural for the resource. -COLLECTION_NAME = 'logging_resources' - -# Attributes -ENABLED = 'enabled' - -# Sub resource -FIREWALL_LOGS = 'firewall_logs' - - -LOGGING_RESOURCE_ID = 'logging_resource_id' -FW_EVENT = 'fw_event' -FIREWALL_ID = 'firewall_id' - - -FW_EVENT_ACCEPT = 'ACCEPT' -FW_EVENT_DROP = 'DROP' -FW_EVENT_ALL = 'ALL' -FW_EVENTS = [FW_EVENT_ACCEPT, FW_EVENT_DROP, FW_EVENT_ALL] -LOG_COMMON_FIELDS = { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, 'is_visible': True}, - LOGGING_RESOURCE_ID: {'allow_post': False, 'allow_put': False, - 'is_visible': True} -} - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, 'is_visible': True, - 'primary_key': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, 'is_visible': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'default': '', 'is_visible': True}, - 'description': { - 'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE}, - 'default': '', 'is_visible': True}, - ENABLED: {'allow_post': True, 'allow_put': True, - 'is_visible': True, 'default': False, - 'convert_to': converters.convert_to_boolean}, - FIREWALL_LOGS: {'allow_post': False, 'allow_put': False, - 'is_visible': True} - } -} - - -SUB_RESOURCE_ATTRIBUTE_MAP = { - FIREWALL_LOGS: { - 'parent': {'collection_name': COLLECTION_NAME, - 'member_name': RESOURCE_NAME}, - 'parameters': dict((LOG_COMMON_FIELDS), **{ - 'description': { - 'allow_post': True, 'allow_put': True, - 'validate': { - 'type:string': db_const.LONG_DESCRIPTION_FIELD_SIZE}, - 'default': '', 'is_visible': True}, - FIREWALL_ID: { - 'allow_post': True, 'allow_put': False, - 'is_visible': True, - 'validate': {'type:uuid': None}}, - FW_EVENT: { - 'allow_post': True, 'allow_put': True, - 'is_visible': True, - 'validate': {'type:values': FW_EVENTS}, - 'default': FW_EVENT_ALL} - }), - }, -} - -# The action map. -ACTION_MAP = {} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ - firewall.ALIAS, -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/definitions/network.py b/neutron_lib/api/definitions/network.py deleted file mode 100644 index 1f2949a..0000000 --- a/neutron_lib/api/definitions/network.py +++ /dev/null @@ -1,74 +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 neutron_lib.api import converters -from neutron_lib.api.definitions import subnet -from neutron_lib.db import constants as db_const - - -NAME = 'Neutron L2 Network' -ALIAS = 'network' -DESCRIPTION = "Layer 2 network abstraction" - -UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" - -RESOURCE_NAME = 'network' -COLLECTION_NAME = 'networks' - -# Identify the attribute used by a resource to reference another resource - -RESOURCE_FOREIGN_KEYS = { - COLLECTION_NAME: 'network_id' -} - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': { - 'type:string': db_const.NAME_FIELD_SIZE}, - 'default': '', 'is_visible': True}, - subnet.COLLECTION_NAME: {'allow_post': False, 'allow_put': False, - 'default': [], - 'is_visible': True}, - 'admin_state_up': {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - 'status': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True}, - 'shared': {'allow_post': True, - 'allow_put': True, - 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, - 'required_by_policy': True, - 'enforce_policy': True}, - } -} - -# This is a core resource so the following are not applicable. -IS_SHIM_EXTENSION = False -IS_STANDARD_ATTR_EXTENSION = False -SUB_RESOURCE_ATTRIBUTE_MAP = {} -ACTION_MAP = {} -REQUIRED_EXTENSIONS = [] -OPTIONAL_EXTENSIONS = [] -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/network_mtu.py b/neutron_lib/api/definitions/network_mtu.py deleted file mode 100644 index c3be3f9..0000000 --- a/neutron_lib/api/definitions/network_mtu.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 neutron_lib.api.definitions import network - - -MTU = 'mtu' - -# The alias of the extension. -ALIAS = 'net-mtu' - -# The label to lookup the plugin in the plugin directory. It can match the -# alias, as required. -LABEL = ALIAS - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Network MTU' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource. -API_PREFIX = '' - -# The description of the extension. -DESCRIPTION = "Provides MTU attribute for a network resource." - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2015-03-25T10:00:00-00:00" - - -RESOURCE_ATTRIBUTE_MAP = { - network.COLLECTION_NAME: { - MTU: {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - }, -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). -SUB_RESOURCE_ATTRIBUTE_MAP = {} - -# The action map: it associates verbs with methods to be performed on -# the API resource. -ACTION_MAP = {} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/definitions/port.py b/neutron_lib/api/definitions/port.py deleted file mode 100644 index db47c08..0000000 --- a/neutron_lib/api/definitions/port.py +++ /dev/null @@ -1,84 +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 neutron_lib.api import converters -from neutron_lib import constants -from neutron_lib.db import constants as db_const - - -NAME = 'Neutron Port' -ALIAS = 'port' -DESCRIPTION = "Network port abstraction" - -UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" - -RESOURCE_NAME = 'port' -COLLECTION_NAME = 'ports' - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, 'allow_put': True, 'default': '', - 'validate': { - 'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True}, - 'network_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': {'type:uuid': None}, - 'is_visible': True}, - 'admin_state_up': {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - 'mac_address': {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:mac_address': None}, - 'enforce_policy': True, - 'is_visible': True}, - 'fixed_ips': {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'convert_list_to': - converters.convert_kvp_list_to_dict, - 'validate': {'type:fixed_ips': None}, - 'enforce_policy': True, - 'is_visible': True}, - 'device_id': {'allow_post': True, 'allow_put': True, - 'validate': { - 'type:string': db_const.DEVICE_ID_FIELD_SIZE}, - 'default': '', - 'is_visible': True}, - 'device_owner': {'allow_post': True, 'allow_put': True, - 'validate': { - 'type:string': db_const.DEVICE_OWNER_FIELD_SIZE}, - 'default': '', 'enforce_policy': True, - 'is_visible': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True}, - 'status': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - } -} - -# This is a core resource so the following are not applicable. -IS_SHIM_EXTENSION = False -IS_STANDARD_ATTR_EXTENSION = False -SUB_RESOURCE_ATTRIBUTE_MAP = {} -ACTION_MAP = {} -REQUIRED_EXTENSIONS = [] -OPTIONAL_EXTENSIONS = [] -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/port_security.py b/neutron_lib/api/definitions/port_security.py deleted file mode 100644 index b58495b..0000000 --- a/neutron_lib/api/definitions/port_security.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.api.definitions import network -from neutron_lib.api.definitions import port -from neutron_lib import constants - - -DEFAULT_PORT_SECURITY = True - -PORTSECURITY = 'port_security_enabled' - -# The alias of the extension. -ALIAS = 'port-security' - -# The label to lookup the plugin in the plugin directory. It can match the -# alias, as required. -LABEL = 'port-security' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Port Security' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource. -API_PREFIX = '' - -# The description of the extension. -DESCRIPTION = "Provides port security" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2012-07-23T10:00:00-00:00" - - -RESOURCE_ATTRIBUTE_MAP = { - network.COLLECTION_NAME: { - PORTSECURITY: {'allow_post': True, 'allow_put': True, - 'convert_to': converters.convert_to_boolean, - 'enforce_policy': True, - 'default': DEFAULT_PORT_SECURITY, - 'is_visible': True}, - }, - port.COLLECTION_NAME: { - PORTSECURITY: {'allow_post': True, 'allow_put': True, - 'convert_to': converters.convert_to_boolean, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'is_visible': True}, - } -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). -SUB_RESOURCE_ATTRIBUTE_MAP = {} - -# The action map: it associates verbs with methods to be performed on -# the API resource. -ACTION_MAP = {} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/definitions/portbindings.py b/neutron_lib/api/definitions/portbindings.py deleted file mode 100644 index 77db22b..0000000 --- a/neutron_lib/api/definitions/portbindings.py +++ /dev/null @@ -1,214 +0,0 @@ -# Copyright (c) 2012 OpenStack Foundation. -# 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 neutron_lib.api.definitions import port -from neutron_lib import constants - - -# The type of vnic that this port should be attached to -VNIC_TYPE = 'binding:vnic_type' -# The service will return the vif type for the specific port. -VIF_TYPE = 'binding:vif_type' -# The service may return a dictionary containing additional -# information needed by the interface driver. The set of items -# returned may depend on the value of VIF_TYPE. -VIF_DETAILS = 'binding:vif_details' -# In some cases different implementations may be run on different hosts. -# The host on which the port will be allocated. -HOST_ID = 'binding:host_id' -# The profile will be a dictionary that enables the application running -# on the specific host to pass and receive vif port specific information to -# the plugin. -PROFILE = 'binding:profile' - -# The keys below are used in the VIF_DETAILS attribute to convey -# information to the VIF driver. - -# TODO(rkukura): Replace CAP_PORT_FILTER, which nova no longer -# understands, with the new set of VIF security details to be used in -# the VIF_DETAILS attribute. -# -# - port_filter : Boolean value indicating Neutron provides port filtering -# features such as security group and anti MAC/IP spoofing -# - ovs_hybrid_plug: Boolean used to inform Nova that the hybrid plugging -# strategy for OVS should be used -CAP_PORT_FILTER = 'port_filter' -OVS_HYBRID_PLUG = 'ovs_hybrid_plug' -VIF_DETAILS_VLAN = 'vlan' -VIF_DETAILS_MACVTAP_SOURCE = 'macvtap_source' -VIF_DETAILS_MACVTAP_MODE = 'macvtap_mode' -VIF_DETAILS_PHYSICAL_INTERFACE = 'physical_interface' -VIF_DETAILS_BRIDGE_NAME = 'bridge_name' - -# OVS bridge datapath type: String value used to define if the bridge uses -# kernel or userspace datapath. -OVS_DATAPATH_TYPE = 'datapath_type' - -# The keys below are used in the VIF_DETAILS attribute to convey -# information related to the configuration of the vhost-user VIF driver. - -# - vhost_user_mode: String value used to declare the mode of a -# vhost-user socket -VHOST_USER_MODE = 'vhostuser_mode' -# - server: socket created by hypervisor -VHOST_USER_MODE_SERVER = 'server' -# - client: socket created by vswitch -VHOST_USER_MODE_CLIENT = 'client' -# - vhostuser_socket String value used to declare the vhostuser socket name -VHOST_USER_SOCKET = 'vhostuser_socket' -# - vhost_user_ovs_plug: Boolean used to inform Nova that the ovs plug -# method should be used when binding the -# vhost-user vif. -VHOST_USER_OVS_PLUG = 'vhostuser_ovs_plug' - -# VIF_TYPE: vif_types are required by Nova to determine which vif_driver to -# use to attach a virtual server to the network - -# - vhost-user: The vhost-user interface type is a standard virtio interface -# provided by qemu 2.1+. This constant defines the neutron side -# of the vif binding type to provide a common definition -# to enable reuse in multiple agents and drivers. -VIF_TYPE_VHOST_USER = 'vhostuser' - -VIF_TYPE_UNBOUND = 'unbound' -VIF_TYPE_BINDING_FAILED = 'binding_failed' -VIF_TYPE_DISTRIBUTED = 'distributed' -VIF_TYPE_OVS = 'ovs' -VIF_TYPE_BRIDGE = 'bridge' -VIF_TYPE_OTHER = 'other' -VIF_TYPE_TAP = 'tap' -# vif_type_macvtap: Tells Nova that the macvtap vif_driver should be used to -# create a vif. It does not require the VNIC_TYPE_MACVTAP, -# which is defined further below. E.g. Macvtap agent uses -# vnic_type 'normal'. -VIF_TYPE_MACVTAP = 'macvtap' -# vif_type_agilio_ovs: Tells Nova that the Agilio OVS vif_driver should be -# used to create a vif. In addition to the normal OVS -# vif types exposed, VNIC_DIRECT and -# VNIC_VIRTIO_FORWARDER are supported. -VIF_TYPE_AGILIO_OVS = 'agilio_ovs' -# SR-IOV VIF types -VIF_TYPE_HW_VEB = 'hw_veb' -VIF_TYPE_HOSTDEV_PHY = 'hostdev_physical' - -# VNIC_TYPE: It's used to determine which mechanism driver to use to bind a -# port. It can be specified via the Neutron API. Default is normal, -# used by OVS and LinuxBridge agent. -VNIC_NORMAL = 'normal' -VNIC_DIRECT = 'direct' -VNIC_MACVTAP = 'macvtap' -VNIC_BAREMETAL = 'baremetal' -VNIC_DIRECT_PHYSICAL = 'direct-physical' -VNIC_VIRTIO_FORWARDER = 'virtio-forwarder' - -VNIC_TYPES = [VNIC_NORMAL, VNIC_DIRECT, VNIC_MACVTAP, VNIC_BAREMETAL, - VNIC_DIRECT_PHYSICAL, VNIC_VIRTIO_FORWARDER] - - -# The alias of the extension. -ALIAS = 'binding' - -# The label to lookup the plugin in the plugin directory. It can match the -# alias, as required. -LABEL = 'binding' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Port Binding' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource. -API_PREFIX = '' - -# The description of the extension. -DESCRIPTION = "Expose port bindings of a virtual port to external application" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2014-02-03T10:00:00-00:00" - -# The name of the resource. -RESOURCE_NAME = port.RESOURCE_NAME - -# The plural for the resource. -COLLECTION_NAME = port.COLLECTION_NAME - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - VIF_TYPE: {'allow_post': False, 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'is_visible': True}, - VIF_DETAILS: {'allow_post': False, 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'is_visible': True}, - VNIC_TYPE: {'allow_post': True, 'allow_put': True, - 'default': VNIC_NORMAL, - 'is_visible': True, - 'validate': {'type:values': VNIC_TYPES}, - 'enforce_policy': True}, - HOST_ID: {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'is_visible': True, - 'enforce_policy': True}, - PROFILE: {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'validate': {'type:dict_or_none': None}, - 'is_visible': True}, - } -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). -SUB_RESOURCE_ATTRIBUTE_MAP = None - -# The action map: it associates verbs with methods to be performed on -# the API resource. For example: -# -# ACTION_MAP = { -# RESOURCE_NAME: { -# 'add_my_foo_bars': 'PUT', -# 'remove_my_foo_bars': 'PUT', -# 'get_my_foo_bars': 'GET' -# } -# } -ACTION_MAP = { -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/provider_net.py b/neutron_lib/api/definitions/provider_net.py deleted file mode 100644 index 80112c4..0000000 --- a/neutron_lib/api/definitions/provider_net.py +++ /dev/null @@ -1,112 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.api.definitions import network -from neutron_lib import constants - -# The alias of the extension. -ALIAS = 'provider' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Provider Network' - -# A prefix for API resources. An empty prefix means that the API is going -# to be exposed at the v2/ level as any other core resource. -API_PREFIX = '' - -# The description of the extension. -DESCRIPTION = "Expose mapping of virtual networks to physical networks" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2012-09-07T10:00:00-00:00" - -# The name of the resource. -RESOURCE_NAME = network.RESOURCE_NAME - -# The plural for the resource. -COLLECTION_NAME = network.COLLECTION_NAME - -NETWORK_TYPE = 'provider:network_type' -PHYSICAL_NETWORK = 'provider:physical_network' -SEGMENTATION_ID = 'provider:segmentation_id' -ATTRIBUTES = (NETWORK_TYPE, PHYSICAL_NETWORK, SEGMENTATION_ID) - -# Common definitions for maximum string field length -NETWORK_TYPE_MAX_LEN = 32 -PHYSICAL_NETWORK_MAX_LEN = 64 - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - NETWORK_TYPE: {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': NETWORK_TYPE_MAX_LEN}, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'is_visible': True}, - PHYSICAL_NETWORK: {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': - PHYSICAL_NETWORK_MAX_LEN}, - 'default': constants.ATTR_NOT_SPECIFIED, - 'enforce_policy': True, - 'is_visible': True}, - SEGMENTATION_ID: {'allow_post': True, 'allow_put': True, - 'convert_to': converters.convert_to_int, - 'enforce_policy': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'is_visible': True}, - } -} - -# The subresource attribute map for the extension. It adds child resources -# to main extension's resource. The subresource map must have a parent and -# a parameters entry. If an extension does not need such a map, None can -# be specified (mandatory). -SUB_RESOURCE_ATTRIBUTE_MAP = None - -# The action map: it associates verbs with methods to be performed on -# the API resource. For example: -# -# ACTION_MAP = { -# RESOURCE_NAME: { -# 'add_my_foo_bars': 'PUT', -# 'remove_my_foo_bars': 'PUT', -# 'get_my_foo_bars': 'GET' -# } -# } -ACTION_MAP = { -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ -] diff --git a/neutron_lib/api/definitions/router_interface_fip.py b/neutron_lib/api/definitions/router_interface_fip.py deleted file mode 100644 index bc43e0f..0000000 --- a/neutron_lib/api/definitions/router_interface_fip.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 neutron_lib.api.definitions import l3 - -# The alias of the extension. -ALIAS = 'router-interface-fip' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = True - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Router interface FIP Extension' - -# The description of the extension. -DESCRIPTION = "Router interface FIP Extension" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2015-11-11T10:00:00-00:00" - -# The resource attribute map for the extension. It is effectively the -# bulk of the API contract alongside ACTION_MAP -RESOURCE_ATTRIBUTE_MAP = {} - -# The subresource attribute map for the extension. -SUB_RESOURCE_ATTRIBUTE_MAP = None - -# The action map. -ACTION_MAP = {} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ - l3.ALIAS, -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/definitions/subnet.py b/neutron_lib/api/definitions/subnet.py deleted file mode 100644 index 2cea0d4..0000000 --- a/neutron_lib/api/definitions/subnet.py +++ /dev/null @@ -1,120 +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 neutron_lib.api import converters -from neutron_lib import constants -from neutron_lib.db import constants as db_const - - -NAME = 'Neutron L3 Subnet' -ALIAS = 'subnet' -DESCRIPTION = "Layer 3 subnet abstraction" - -UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" - -RESOURCE_NAME = 'subnet' -COLLECTION_NAME = 'subnets' - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, 'allow_put': True, 'default': '', - 'validate': { - 'type:string': db_const.NAME_FIELD_SIZE}, - 'is_visible': True}, - 'ip_version': {'allow_post': True, 'allow_put': False, - 'convert_to': converters.convert_to_int, - 'validate': {'type:values': [4, 6]}, - 'is_visible': True}, - 'network_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': {'type:uuid': None}, - 'is_visible': True}, - 'subnetpool_id': {'allow_post': True, - 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'required_by_policy': False, - 'validate': {'type:subnetpool_id_or_none': None}, - 'is_visible': True}, - 'prefixlen': {'allow_post': True, - 'allow_put': False, - 'validate': {'type:non_negative': None}, - 'convert_to': converters.convert_to_int, - 'default': constants.ATTR_NOT_SPECIFIED, - 'required_by_policy': False, - 'is_visible': False}, - 'cidr': {'allow_post': True, - 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:subnet_or_none': None}, - 'required_by_policy': False, - 'is_visible': True}, - 'gateway_ip': {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:ip_address_or_none': None}, - 'is_visible': True}, - 'allocation_pools': {'allow_post': True, 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:ip_pools': None}, - 'is_visible': True}, - 'dns_nameservers': {'allow_post': True, 'allow_put': True, - 'convert_to': - converters.convert_none_to_empty_list, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:nameservers': None}, - 'is_visible': True}, - 'host_routes': {'allow_post': True, 'allow_put': True, - 'convert_to': - converters.convert_none_to_empty_list, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:hostroutes': None}, - 'is_visible': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True}, - 'enable_dhcp': {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - 'ipv6_ra_mode': {'allow_post': True, 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': { - 'type:values': constants.IPV6_MODES}, - 'is_visible': True}, - 'ipv6_address_mode': {'allow_post': True, 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': { - 'type:values': constants.IPV6_MODES}, - 'is_visible': True}, - 'shared': {'allow_post': False, - 'allow_put': False, - 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': False, - 'required_by_policy': True, - 'enforce_policy': True}, - } -} - -# This is a core resource so the following are not applicable. -IS_SHIM_EXTENSION = False -IS_STANDARD_ATTR_EXTENSION = False -SUB_RESOURCE_ATTRIBUTE_MAP = {} -ACTION_MAP = {} -REQUIRED_EXTENSIONS = [] -OPTIONAL_EXTENSIONS = [] -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/subnetpool.py b/neutron_lib/api/definitions/subnetpool.py deleted file mode 100644 index 1cd2076..0000000 --- a/neutron_lib/api/definitions/subnetpool.py +++ /dev/null @@ -1,99 +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 neutron_lib.api import converters -from neutron_lib import constants -from neutron_lib.db import constants as db_const - - -NAME = 'Neutron L3 Subnet Pool' -ALIAS = 'subnetpool' -DESCRIPTION = "Layer 3 subnet pool abstraction" - -UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00" - -RESOURCE_NAME = 'subnetpool' -COLLECTION_NAME = 'subnetpools' - -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: { - 'id': {'allow_post': False, - 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, - 'primary_key': True}, - 'name': {'allow_post': True, - 'allow_put': True, - 'validate': {'type:not_empty_string': None}, - 'is_visible': True}, - 'tenant_id': {'allow_post': True, - 'allow_put': False, - 'validate': { - 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'required_by_policy': True, - 'is_visible': True}, - 'prefixes': {'allow_post': True, - 'allow_put': True, - 'validate': {'type:subnet_list': None}, - 'is_visible': True}, - 'default_quota': {'allow_post': True, - 'allow_put': True, - 'validate': {'type:non_negative': None}, - 'convert_to': converters.convert_to_int, - 'default': constants.ATTR_NOT_SPECIFIED, - 'is_visible': True}, - 'ip_version': {'allow_post': False, - 'allow_put': False, - 'is_visible': True}, - 'default_prefixlen': {'allow_post': True, - 'allow_put': True, - 'validate': {'type:non_negative': None}, - 'convert_to': converters.convert_to_int, - 'default': constants.ATTR_NOT_SPECIFIED, - 'is_visible': True}, - 'min_prefixlen': {'allow_post': True, - 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:non_negative': None}, - 'convert_to': converters.convert_to_int, - 'is_visible': True}, - 'max_prefixlen': {'allow_post': True, - 'allow_put': True, - 'default': constants.ATTR_NOT_SPECIFIED, - 'validate': {'type:non_negative': None}, - 'convert_to': converters.convert_to_int, - 'is_visible': True}, - 'is_default': {'allow_post': True, - 'allow_put': True, - 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, - 'required_by_policy': True, - 'enforce_policy': True}, - 'shared': {'allow_post': True, - 'allow_put': False, - 'default': False, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True, - 'required_by_policy': True, - 'enforce_policy': True}, - } -} - -# This is a core resource so the following are not applicable. -IS_SHIM_EXTENSION = False -IS_STANDARD_ATTR_EXTENSION = False -SUB_RESOURCE_ATTRIBUTE_MAP = {} -ACTION_MAP = {} -REQUIRED_EXTENSIONS = [] -OPTIONAL_EXTENSIONS = [] -ACTION_STATUS = {} diff --git a/neutron_lib/api/definitions/trunk.py b/neutron_lib/api/definitions/trunk.py deleted file mode 100644 index 95a753d..0000000 --- a/neutron_lib/api/definitions/trunk.py +++ /dev/null @@ -1,107 +0,0 @@ -# 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 neutron_lib.api import converters -from neutron_lib.db import constants as db_const - - -# The alias of the extension. -ALIAS = 'trunk' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Trunk Extension' - -# The description of the extension. -DESCRIPTION = "Provides support for trunk ports" - -# A timestamp of when the extension was introduced. -UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" - -# The specific resources and/or attributes for the extension (optional). -TRUNK = 'trunk' -TRUNKS = 'trunks' -SUB_PORTS = 'sub_ports' - -# The resource attribute map for the extension. -RESOURCE_ATTRIBUTE_MAP = { - TRUNKS: { - 'admin_state_up': {'allow_post': True, 'allow_put': True, - 'default': True, - 'convert_to': converters.convert_to_boolean, - 'is_visible': True}, - 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:uuid': None}, - 'is_visible': True, 'primary_key': True}, - 'name': {'allow_post': True, 'allow_put': True, - 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, - 'default': '', 'is_visible': True}, - 'tenant_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': - {'type:string': db_const.PROJECT_ID_FIELD_SIZE}, - 'is_visible': True}, - 'port_id': {'allow_post': True, 'allow_put': False, - 'required_by_policy': True, - 'validate': {'type:uuid': None}, - 'is_visible': True}, - 'status': {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - SUB_PORTS: {'allow_post': True, 'allow_put': False, - 'default': [], - 'convert_list_to': converters.convert_kvp_list_to_dict, - 'validate': {'type:subports': None}, - 'enforce_policy': True, - 'is_visible': True} - }, -} - -# The subresource attribute map for the extension. -SUB_RESOURCE_ATTRIBUTE_MAP = None - -# The action map. -ACTION_MAP = { - TRUNK: { - 'add_subports': 'PUT', - 'remove_subports': 'PUT', - 'get_subports': 'GET' - } -} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [ - "binding", -] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [ - "provider", # needed to learn about network segmentation details. -] - -# TODO(armax): add support for modeling custom queries diff --git a/neutron_lib/api/definitions/trunk_details.py b/neutron_lib/api/definitions/trunk_details.py deleted file mode 100644 index 60cdfd1..0000000 --- a/neutron_lib/api/definitions/trunk_details.py +++ /dev/null @@ -1,79 +0,0 @@ -# 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 neutron_lib.api.definitions import port -from neutron_lib.api.definitions import trunk -from neutron_lib import constants - - -# The alias of the extension. -ALIAS = 'trunk-details' - -# Whether or not this extension is simply signaling behavior to the user -# or it actively modifies the attribute map. -IS_SHIM_EXTENSION = False - -# Whether the extension is marking the adoption of standardattr model for -# legacy resources, or introducing new standardattr attributes. False or -# None if the standardattr model is adopted since the introduction of -# resource extension. -# If this is True, the alias for the extension should be prefixed with -# 'standard-attr-'. -IS_STANDARD_ATTR_EXTENSION = False - -# The name of the extension. -NAME = 'Trunk port details' - -# The description of the extension. -DESCRIPTION = "Expose trunk port details" - -# A timestamp of when the extension was last updated. -UPDATED_TIMESTAMP = "2016-01-01T10:00:00-00:00" -# TODO(armax): to be removed when review -# https://review.openstack.org/#/c/484058/ merges -TIMESTAMP = UPDATED_TIMESTAMP - -# The name of the resource introduced or being extended. -RESOURCE_NAME = port.RESOURCE_NAME - -# The plural for the resource introduced or being extended. -COLLECTION_NAME = port.COLLECTION_NAME - -# The specific resources and/or attributes for the extension (optional). -TRUNK_DETAILS = 'trunk_details' - -# The resource attribute map for the extension. -RESOURCE_ATTRIBUTE_MAP = { - COLLECTION_NAME: {TRUNK_DETAILS: {'allow_post': False, 'allow_put': False, - 'default': constants.ATTR_NOT_SPECIFIED, - 'is_visible': True, - 'enforce_policy': True, - 'required_by_policy': True}}, -} - -# The subresource attribute map for the extension. -SUB_RESOURCE_ATTRIBUTE_MAP = None - -# The action map. -ACTION_MAP = {} - -# The action status. -ACTION_STATUS = { -} - -# The list of required extensions. -REQUIRED_EXTENSIONS = [trunk.ALIAS] - -# The list of optional extensions. -OPTIONAL_EXTENSIONS = [] diff --git a/neutron_lib/api/extensions.py b/neutron_lib/api/extensions.py deleted file mode 100644 index d7cd26f..0000000 --- a/neutron_lib/api/extensions.py +++ /dev/null @@ -1,251 +0,0 @@ -# Copyright 2011 OpenStack Foundation. -# 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. - -import abc - -import six - -from neutron_lib._i18n import _ -from neutron_lib import constants - - -_UNSET = constants.Sentinel() - - -def is_extension_supported(plugin, alias): - """Validate that the extension is supported. - - :param plugin: The plugin class. - :param alias: The alias to check. - :returns: True if the alias is supported else False. - """ - return alias in getattr(plugin, "supported_extension_aliases", []) - - -@six.add_metaclass(abc.ABCMeta) -class ExtensionDescriptor(object): - """Base class that defines the contract for extensions.""" - - @abc.abstractmethod - def get_name(self): - """The name of the extension. - - e.g. 'Fox In Socks' - """ - - @abc.abstractmethod - def get_alias(self): - """The alias for the extension. - - e.g. 'FOXNSOX' - """ - - @abc.abstractmethod - def get_description(self): - """Friendly description for the extension. - - e.g. 'The Fox In Socks Extension' - """ - - @abc.abstractmethod - def get_updated(self): - """The timestamp when the extension was last updated. - - e.g. '2011-01-22T13:25:27-06:00' - """ - # NOTE(justinsb): Not sure of the purpose of this is, vs the XML NS - - def get_resources(self): - """List of extensions.ResourceExtension extension objects. - - Resources define new nouns, and are accessible through URLs. - """ - return [] - - def get_actions(self): - """List of extensions.ActionExtension extension objects. - - Actions are verbs callable from the API. - """ - return [] - - def get_request_extensions(self): - """List of extensions.RequestExtension extension objects. - - Request extensions are used to handle custom request data. - """ - return [] - - def get_extended_resources(self, version): - """Retrieve extended resources or attributes for core resources. - - Extended attributes are implemented by a core plugin similarly - to the attributes defined in the core, and can appear in - request and response messages. Their names are scoped with the - extension's prefix. The core API version is passed to this - function, which must return a - map[][][] - specifying the extended resource attribute properties required - by that API version. - Extension can add resources and their attr definitions too. - The returned map can be integrated into RESOURCE_ATTRIBUTE_MAP. - """ - return {} - - def get_plugin_interface(self): - """Returns an abstract class which defines contract for the plugin. - - The abstract class should inherit from - neutron_lib.services.base.ServicePluginBase. - Methods in this abstract class should be decorated as abstractmethod - """ - - def get_required_extensions(self): - """Return list of extensions required for processing this descriptor. - - Without these extensions present in a neutron deployment, the - introduced extension cannot load or function properly. - """ - return [] - - def get_optional_extensions(self): - """Returns a list of optionally required extensions. - - Unlike get_required_extensions. This will not fail the loading of - the extension if one of these extensions is not present. This is - useful for an extension that extends multiple resources across - other extensions that should still work for the remaining extensions - when one is missing. - """ - return [] - - def update_attributes_map(self, extended_attributes, - extension_attrs_map=None): - """Update attributes map for this extension. - - This is default method for extending an extension's attributes map. - An extension can use this method and supplying its own resource - attribute map in extension_attrs_map argument to extend all its - attributes that needs to be extended. - If an extension does not implement update_attributes_map, the method - does nothing and just return. - """ - if not extension_attrs_map: - return - - for resource, attrs in extension_attrs_map.items(): - extended_attrs = extended_attributes.get(resource) - if extended_attrs: - attrs.update(extended_attrs) - - def get_pecan_resources(self): - """List of PecanResourceExtension extension objects. - - Resources define new nouns, and are accessible through URLs. - The controllers associated with each instance of - extensions.ResourceExtension should be a subclass of - neutron.pecan_wsgi.controllers.utils.NeutronPecanController. - If a resource is defined in both get_resources and get_pecan_resources, - the resource defined in get_pecan_resources will take precedence. - """ - return [] - - -class APIExtensionDescriptor(ExtensionDescriptor): - """Base class that defines the contract for extensions. - - Concrete implementations of API extensions should first provide - an API definition in neutron_lib.api.definitions. The API - definition module (object reference) can then be specified as a - class level attribute on the concrete extension. - - For example:: - - from neutron_lib.api.definitions import provider_net - from neutron_lib.api import extensions - - - class Providernet(extensions.APIExtensionDescriptor): - api_definition = provider_net - # nothing else needed if default behavior is acceptable - - - If extension implementations need to override the default behavior of - this class they can override the respective method directly. - """ - api_definition = _UNSET - - @classmethod - def _assert_api_definition(cls, attr=None): - if cls.api_definition == _UNSET: - raise NotImplementedError( - _("Extension module API definition not set.")) - if attr and getattr(cls.api_definition, attr, _UNSET) == _UNSET: - raise NotImplementedError(_("Extension module API definition " - "does not define '%s'") % attr) - - @classmethod - def get_name(cls): - """The name of the API definition.""" - cls._assert_api_definition('NAME') - return cls.api_definition.NAME - - @classmethod - def get_alias(cls): - """The alias for the API definition.""" - cls._assert_api_definition('ALIAS') - return cls.api_definition.ALIAS - - @classmethod - def get_description(cls): - """Friendly description for the API definition.""" - cls._assert_api_definition('DESCRIPTION') - return cls.api_definition.DESCRIPTION - - @classmethod - def get_updated(cls): - """The timestamp when the API definition was last updated.""" - cls._assert_api_definition('UPDATED_TIMESTAMP') - return cls.api_definition.UPDATED_TIMESTAMP - - def get_extended_resources(self, version): - """Retrieve the resource attribute map for the API definition.""" - if version == "2.0": - self._assert_api_definition('RESOURCE_ATTRIBUTE_MAP') - return self.api_definition.RESOURCE_ATTRIBUTE_MAP - else: - return {} - - def get_required_extensions(self): - """Returns the API definition's required extensions.""" - self._assert_api_definition('REQUIRED_EXTENSIONS') - return self.api_definition.REQUIRED_EXTENSIONS - - def get_optional_extensions(self): - """Returns the API definition's optional extensions.""" - self._assert_api_definition('OPTIONAL_EXTENSIONS') - return self.api_definition.OPTIONAL_EXTENSIONS - - def update_attributes_map(self, attributes, extension_attrs_map=None): - """Update attributes map for this extension. - - Behaves like ExtensionDescriptor.update_attributes_map(), but - if extension_attrs_map is not given the extension's API - definition RESOURCE_ATTRIBUTE_MAP is used. - """ - if extension_attrs_map is None: - extension_attrs_map = self.get_extended_resources('2.0') - super(APIExtensionDescriptor, self).update_attributes_map( - attributes, extension_attrs_map=extension_attrs_map) diff --git a/neutron_lib/api/faults.py b/neutron_lib/api/faults.py deleted file mode 100644 index e8feffc..0000000 --- a/neutron_lib/api/faults.py +++ /dev/null @@ -1,28 +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. - -import netaddr -from oslo_policy import policy -import webob.exc - -from neutron_lib import exceptions - -FAULT_MAP = { - exceptions.NotFound: webob.exc.HTTPNotFound, - exceptions.Conflict: webob.exc.HTTPConflict, - exceptions.InUse: webob.exc.HTTPConflict, - exceptions.BadRequest: webob.exc.HTTPBadRequest, - exceptions.ServiceUnavailable: webob.exc.HTTPServiceUnavailable, - exceptions.NotAuthorized: webob.exc.HTTPForbidden, - netaddr.AddrFormatError: webob.exc.HTTPBadRequest, - policy.PolicyNotAuthorized: webob.exc.HTTPForbidden, -} diff --git a/neutron_lib/api/utils.py b/neutron_lib/api/utils.py deleted file mode 100644 index 103b0a1..0000000 --- a/neutron_lib/api/utils.py +++ /dev/null @@ -1,23 +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. - -""" -NOTE: Do not use this module to add random utils. -We want to avoid having a generic utils.py dumping ground. -""" - -from debtcollector import moves - -from neutron_lib.api import attributes - -populate_project_info = moves.moved_function( - attributes.populate_project_info, 'populate_project_info', __name__) diff --git a/neutron_lib/api/validators/__init__.py b/neutron_lib/api/validators/__init__.py deleted file mode 100644 index 8ccfd69..0000000 --- a/neutron_lib/api/validators/__init__.py +++ /dev/null @@ -1,1093 +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. - -import collections -import functools -import inspect -import re - -import netaddr -from oslo_log import log as logging -from oslo_utils import netutils -from oslo_utils import strutils -from oslo_utils import uuidutils -import six - -from neutron_lib._i18n import _ -from neutron_lib import constants -from neutron_lib import exceptions as n_exc - -LOG = logging.getLogger(__name__) - -# Used by range check to indicate no limit for a bound. -UNLIMITED = None - -# Note: In order to ensure that the MAC address is unicast the first byte -# must be even. -MAC_PATTERN = "^%s[aceACE02468](:%s{2}){5}$" % (constants.HEX_ELEM, - constants.HEX_ELEM) - - -def _verify_dict_keys(expected_keys, target_dict, strict=True): - """Verify expected keys in a dictionary. - - :param expected_keys: A list of keys expected to be present. - :param target_dict: The dictionary which should be verified. - :param strict: Specifies whether additional keys are allowed to be present. - :returns: None if the expected keys are found. Otherwise a human readable - message indicating why the validation failed. - """ - if not isinstance(target_dict, dict): - msg = (_("Invalid input. '%(target_dict)s' must be a dictionary " - "with keys: %(expected_keys)s") % - {'target_dict': target_dict, 'expected_keys': expected_keys}) - LOG.debug(msg) - return msg - - expected_keys = set(expected_keys) - provided_keys = set(target_dict.keys()) - - predicate = expected_keys.__eq__ if strict else expected_keys.issubset - - if not predicate(provided_keys): - msg = (_("Validation of dictionary's keys failed. " - "Expected keys: %(expected_keys)s " - "Provided keys: %(provided_keys)s") % - {'expected_keys': expected_keys, - 'provided_keys': provided_keys}) - LOG.debug(msg) - return msg - - -def _collect_duplicates(data_list): - """Collects duplicate items from a list and returns them. - - :param data_list: A list of items to check for duplicates. The list may - include dict items. - :returns: A set of items that are duplicates in data_list. If no - duplicates are found, the returned set is empty. - """ - seen = [] - dups = set() - for datum in data_list: - if datum in seen: - dups.add(datum) - continue - seen.append(datum) - return dups - - -def is_attr_set(attribute): - """Determine if an attribute value is set. - - :param attribute: The attribute value to check. - :returns: False if the attribute value is None or ATTR_NOT_SPECIFIED, - otherwise True. - """ - return not (attribute is None or - attribute is constants.ATTR_NOT_SPECIFIED) - - -def _validate_list_of_items(item_validator, data, *args, **kwargs): - if not isinstance(data, list): - msg = _("'%s' is not a list") % data - return msg - - dups = _collect_duplicates(data) - - if dups: - msg = _("Duplicate items in the list: '%s'") % ', '.join( - [str(d) for d in dups]) - return msg - - for item in data: - msg = item_validator(item, *args, **kwargs) - if msg: - return msg - - -def validate_values(data, valid_values=None, valid_values_display=None): - """Validate that the provided 'data' is within 'valid_values'. - - :param data: The data to check within valid_values. - :param valid_values: A collection of values that 'data' must be in to be - valid. The collection can be any type that supports the 'in' operation. - :param valid_values_display: A string to display that describes the valid - values. This string is only displayed when an invalid value is - encountered. - If no string is provided, the string "valid_values" will be used. - :returns: The message to return if data not in valid_values. - :raises: TypeError if the values for 'data' or 'valid_values' are not - compatible for comparison or doesn't have __contains__. - If TypeError is raised this is considered a programming error and the - inputs (data) and (valid_values) must be checked so this is never - raised on validation. - """ - - # If valid_values is not specified we don't check against it. - if valid_values is None: - return - - # Check if we can use 'in' to find membership of data in valid_values - contains = getattr(valid_values, "__contains__", None) - if callable(contains): - try: - if data not in valid_values: - valid_values_display = valid_values_display or 'valid_values' - msg = (_("%(data)s is not in %(valid_values)s") % - {'data': data, 'valid_values': valid_values_display}) - LOG.debug(msg) - return msg - except TypeError: - # This is a programming error - msg = (_("'data' of type '%(typedata)s' and 'valid_values'" - "of type '%(typevalues)s' are not " - "compatible for comparison") % - {'typedata': type(data), - 'typevalues': type(valid_values)}) - raise TypeError(msg) - else: - # This is a programming error - msg = (_("'valid_values' does not support membership operations")) - raise TypeError(msg) - - -def validate_not_empty_string_or_none(data, max_len=None): - """Validate data is a non-empty string or None. - - :param data: The data to validate. - :param max_len: An optional cap on the str length to validate. - :returns: None if the data string is not None and is not an empty string, - otherwise a human readable message as to why the string data is - invalid. - """ - if data is not None: - return validate_not_empty_string(data, max_len=max_len) - - -def validate_not_empty_string(data, max_len=None): - """Validate data is a non-empty/non-blank string. - - :param data: The data to validate. - :param max_len: An optional cap on the length of the string data. - :returns: None if the data is non-empty/non-blank, otherwise a human - readable string message indicating why validation failed. - """ - msg = validate_string(data, max_len=max_len) - if msg: - return msg - if not data.strip(): - msg = _("'%s' Blank strings are not permitted") % data - LOG.debug(msg) - return msg - - -def validate_string_or_none(data, max_len=None): - """Validate data is a string or None. - - :param data: The data to validate. - :param max_len: An optional cap on the length of the string data. - :returns: None if the data is None or a valid string, otherwise a human - readable message indicating why validation failed. - """ - if data is not None: - return validate_string(data, max_len=max_len) - - -def validate_string(data, max_len=None): - """Validate data is a string object optionally capping it length. - - :param data: The data to validate. - :param max_len: An optional cap on the length of the string. - :returns: None if the data is a valid string type and (optionally) within - the given max_len. Otherwise a human readable message indicating why - the data is invalid. - """ - if not isinstance(data, six.string_types): - msg = _("'%s' is not a valid string") % data - LOG.debug(msg) - return msg - - if max_len is not None and len(data) > max_len: - msg = (_("'%(data)s' exceeds maximum length of %(max_len)s") % - {'data': data, 'max_len': max_len}) - LOG.debug(msg) - return msg - - -_validate_list_of_unique_strings = functools.partial(_validate_list_of_items, - validate_string) - - -# NOTE(boden): stubbed out for docstring comments. -def validate_list_of_unique_strings(data, max_len=None): - """Validate data is a list of unique strings. - - :param data: The data to validate. - :param max_len: An optional cap on the length of the string. - :returns: None if the data is a list of non-empty/non-blank strings, - otherwise a human readable message indicating why validation failed. - """ - return _validate_list_of_unique_strings(data, max_len=max_len) - - -def validate_boolean(data, valid_values=None): - """Validate data is a python bool compatible object. - - :param data: The data to validate. - :param valid_values: Not used! - :return: None if the value can be converted to a bool, otherwise a - human readable message indicating why data is invalid. - """ - try: - strutils.bool_from_string(data, strict=True) - except ValueError: - msg = _("'%s' is not a valid boolean value") % data - LOG.debug(msg) - return msg - - -def validate_integer(data, valid_values=None): - """This function validates if the data is an integer. - - It checks both number or string provided to validate it's an - integer and returns a message with the error if it's not - - :param data: The string or number to validate as integer. - :param valid_values: values to limit the 'data' to. - :returns: None if data is an integer, otherwise a human readable message - indicating why validation failed.. - """ - - if valid_values is not None: - msg = validate_values(data=data, valid_values=valid_values) - if msg: - return msg - - msg = _("'%s' is not an integer") % data - try: - fl_n = float(data) - int_n = int(data) - except (ValueError, TypeError, OverflowError): - LOG.debug(msg) - return msg - - # Fail test if non equal or boolean - if fl_n != int_n: - LOG.debug(msg) - return msg - elif isinstance(data, bool): - msg = _("'%s' is not an integer:boolean") % data - LOG.debug(msg) - return msg - - -def validate_range(data, valid_values=None): - """Check that integer value is within a range provided. - - Test is inclusive. Allows either limit to be ignored, to allow - checking ranges where only the lower or upper limit matter. - It is expected that the limits provided are valid integers or - the value None. - - :param data: The data to validate. - :param valid_values: A list of 2 elements where element 0 is the min - value the int data can have and element 1 is the max. - :returns: None if the data is a valid int in the given range, otherwise - a human readable message as to why validation failed. - """ - - min_value = valid_values[0] - max_value = valid_values[1] - try: - data = int(data) - except (ValueError, TypeError): - msg = _("'%s' is not an integer") % data - LOG.debug(msg) - return msg - if min_value is not UNLIMITED and data < min_value: - msg = _("'%(data)s' is too small - must be at least " - "'%(limit)d'") % {'data': data, 'limit': min_value} - LOG.debug(msg) - return msg - if max_value is not UNLIMITED and data > max_value: - msg = _("'%(data)s' is too large - must be no larger than " - "'%(limit)d'") % {'data': data, 'limit': max_value} - LOG.debug(msg) - return msg - - -def validate_range_or_none(data, valid_values=None): - """Check that the provided value is none or a ranged integer""" - - if data is not None: - return validate_range(data, valid_values) - - -def validate_no_whitespace(data): - """Validates that input has no whitespace. - - :param data: The data to validate. Must be a python string type suitable - for searching via regex. - :returns: The data itself. - :raises InvalidInput: If the data contains whitespace. - """ - if re.search(r'\s', data): - msg = _("'%s' contains whitespace") % data - LOG.debug(msg) - raise n_exc.InvalidInput(error_message=msg) - return data - - -def validate_mac_address(data, valid_values=None): - """Validate data is a MAC address. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if the data is a valid MAC address, otherwise a human - readable message as to why validation failed. - """ - try: - valid_mac = netaddr.valid_mac(validate_no_whitespace(data)) - except Exception: - valid_mac = False - - if valid_mac: - valid_mac = (not netaddr.EUI(data) in - map(netaddr.EUI, constants.INVALID_MAC_ADDRESSES)) - # TODO(arosen): The code in this file should be refactored - # so it catches the correct exceptions. validate_no_whitespace - # raises AttributeError if data is None. - if not valid_mac: - msg = _("'%s' is not a valid MAC address") % data - LOG.debug(msg) - return msg - - -def validate_mac_address_or_none(data, valid_values=None): - """Validate data is a MAC address if the data isn't None. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if the data is None or a valid MAC address, otherwise - a human readable message indicating why validation failed. - """ - if data is not None: - return validate_mac_address(data, valid_values) - - -def validate_ip_address(data, valid_values=None): - """Validate data is an IP address. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is an IP address, otherwise a human readable - message indicating why data isn't an IP address. - """ - msg = None - try: - # netaddr.core.ZEROFILL is only applicable to IPv4. - # it will remove leading zeros from IPv4 address octets. - ip = netaddr.IPAddress(validate_no_whitespace(data), - flags=netaddr.core.ZEROFILL) - # The followings are quick checks for IPv6 (has ':') and - # IPv4. (has 3 periods like 'xx.xx.xx.xx') - # NOTE(yamamoto): netaddr uses libraries provided by the underlying - # platform to convert addresses. For example, inet_aton(3). - # Some platforms, including NetBSD and OS X, have inet_aton - # implementation which accepts more varying forms of addresses than - # we want to accept here. The following check is to reject such - # addresses. For Example: - # >>> netaddr.IPAddress('1' * 59) - # IPAddress('199.28.113.199') - # >>> netaddr.IPAddress(str(int('1' * 59) & 0xffffffff)) - # IPAddress('199.28.113.199') - # >>> - if ':' not in data and data.count('.') != 3: - msg = _("'%s' is not a valid IP address") % data - # A leading '0' in IPv4 address may be interpreted as an octal number, - # e.g. 011 octal is 9 decimal. Since there is no standard saying - # whether IP address with leading '0's should be interpreted as octal - # or decimal, hence we reject leading '0's to avoid ambiguity. - elif ip.version == 4 and str(ip) != data: - msg = _("'%(data)s' is not an accepted IP address, " - "'%(ip)s' is recommended") % {"data": data, "ip": ip} - except Exception: - msg = _("'%s' is not a valid IP address") % data - if msg: - LOG.debug(msg) - return msg - - -def _validate_any_key_spec(data, key_specs=None): - """Validate a dict matches at least 1 key spec. - - :param data: The dict to validate. - :param key_specs: An iterable collection of key spec dicts used to validate - data. - :returns: None if at least 1 of the key_specs matches data, otherwise - a message is returned indicating data could not be matched with any - of the key_specs. - """ - for spec in key_specs: - if validate_dict(data, spec) is None: - return None - msg = _("No valid key specs matched for: %s") % data - LOG.debug(msg) - return msg - - -def validate_any_key_specs_or_none(data, key_specs=None): - """Validate each dict in a list matches at least 1 key_spec. - - :param data: The list of dicts to validate. - :param key_specs: An iterable collection of key spec dicts that is used - to check each dict in data. - :returns: None. - :raises InvalidInput: If any of the dicts in data do not match at least - 1 of the key_specs given. - """ - if data is None: - return - - def dict_validator(data_dict): - msg = _validate_any_key_spec(data_dict, key_specs=key_specs) - if msg: - raise n_exc.InvalidInput(error_message=msg) - - msg = _validate_list_of_items(dict_validator, data) - if msg: - raise n_exc.InvalidInput(error_message=msg) - - -def validate_ip_pools(data, valid_values=None): - """Validate that start and end IP addresses are present. - - In addition to this the IP addresses will also be validated. - - :param data: The data to validate. Must be a list-like structure of - IP pool dicts that each have a 'start' and 'end' key value. - :param valid_values: Not used! - :returns: None if data is a valid list of IP pools, otherwise a message - indicating why the data is invalid. - """ - if not isinstance(data, list): - msg = _("Invalid data format for IP pool: '%s'") % data - LOG.debug(msg) - return msg - - expected_keys = ['start', 'end'] - for ip_pool in data: - msg = _verify_dict_keys(expected_keys, ip_pool) - if msg: - return msg - for k in expected_keys: - msg = validate_ip_address(ip_pool[k]) - if msg: - return msg - - -def validate_fixed_ips(data, valid_values=None): - """Validate data is a list of fixed IP dicts. - - In addition this function validates the ip_address and subnet_id - if present in each fixed IP dict. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is a valid list of fixed IP dicts. Otherwise a - human readable message is returned indicating why validation failed. - """ - if not isinstance(data, list): - msg = _("Invalid data format for fixed IP: '%s'") % data - LOG.debug(msg) - return msg - - ips = [] - for fixed_ip in data: - if not isinstance(fixed_ip, dict): - msg = _("Invalid data format for fixed IP: '%s'") % fixed_ip - LOG.debug(msg) - return msg - if 'ip_address' in fixed_ip: - # Ensure that duplicate entries are not set - just checking IP - # suffices. Duplicate subnet_id's are legitimate. - fixed_ip_address = fixed_ip['ip_address'] - if fixed_ip_address in ips: - msg = _("Duplicate IP address '%s'") % fixed_ip_address - LOG.debug(msg) - else: - msg = validate_ip_address(fixed_ip_address) - if msg: - return msg - ips.append(fixed_ip_address) - if 'subnet_id' in fixed_ip: - msg = validate_uuid(fixed_ip['subnet_id']) - if msg: - return msg - - -def validate_nameservers(data, valid_values=None): - """Validate a list of unique IP addresses. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is a list of valid IP addresses, otherwise - a human readable message is returned indicating why validation failed. - """ - if not hasattr(data, '__iter__'): - msg = _("Invalid data format for nameserver: '%s'") % data - LOG.debug(msg) - return msg - - hosts = [] - for host in data: - # This must be an IP address only - msg = validate_ip_address(host) - if msg: - msg = _("'%(host)s' is not a valid nameserver. %(msg)s") % { - 'host': host, 'msg': msg} - LOG.debug(msg) - return msg - if host in hosts: - msg = _("Duplicate nameserver '%s'") % host - LOG.debug(msg) - return msg - hosts.append(host) - - -def validate_hostroutes(data, valid_values=None): - """Validate a list of unique host route dicts. - - :param data: The data to validate. To be valid it must be a list like - structure of host route dicts, each containing 'destination' and - 'nexthop' key values. - :param valid_values: Not used! - :returns: None if data is a valid list of unique host route dicts, - otherwise a human readable message indicating why validation failed. - """ - if not isinstance(data, list): - msg = _("Invalid data format for hostroute: '%s'") % data - LOG.debug(msg) - return msg - - expected_keys = ['destination', 'nexthop'] - hostroutes = [] - for hostroute in data: - msg = _verify_dict_keys(expected_keys, hostroute) - if msg: - return msg - msg = validate_subnet(hostroute['destination']) - if msg: - return msg - msg = validate_ip_address(hostroute['nexthop']) - if msg: - return msg - if hostroute in hostroutes: - msg = _("Duplicate hostroute '%s'") % hostroute - LOG.debug(msg) - return msg - hostroutes.append(hostroute) - - -def validate_ip_address_or_none(data, valid_values=None): - """Validate data is an IP address or None. - - :param data: The data to validate. - :param valid_values: An optional list of values data may take on. - :return: None if data is None or a valid IP address, otherwise a - human readable message indicating why the data is invalid. - """ - if data is not None: - return validate_ip_address(data, valid_values) - - -def validate_ip_or_subnet_or_none(data, valid_values=None): - """Validate data is an IP address, a valid IP subnet string, or None. - - :param data: The data to validate. - :param valid_values: Not used! - :return: None if data is None or a valid IP address or a valid IP subnet, - otherwise a human readable message indicating why the data is neither - an IP address nor IP subnet. - """ - msg_ip = validate_ip_address_or_none(data) - msg_subnet = validate_subnet_or_none(data) - if msg_ip is not None and msg_subnet is not None: - return _("'%(data)s' is neither a valid IP address, nor " - "is it a valid IP subnet") % {'data': data} - - -def validate_subnet(data, valid_values=None): - """Validate data is an IP network subnet string. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is valid IP network address. Otherwise a human - readable message as to why data is invalid. - """ - msg = None - try: - net = netaddr.IPNetwork(validate_no_whitespace(data)) - if '/' not in data or (net.version == 4 and str(net) != data): - msg = _("'%(data)s' isn't a recognized IP subnet cidr," - " '%(cidr)s' is recommended") % {"data": data, - "cidr": net.cidr} - else: - return - except Exception: - msg = _("'%s' is not a valid IP subnet") % data - if msg: - LOG.debug(msg) - return msg - - -def validate_subnet_or_none(data, valid_values=None): - """Validate data is a valid subnet address string or None. - - :param data: The data to validate. - :param valid_values: The optional list of values data may take on. - :returns: None if data is None or a valid subnet, otherwise a human - readable message as to why data is invalid. - """ - if data is not None: - return validate_subnet(data, valid_values) - - -_validate_subnet_list = functools.partial(_validate_list_of_items, - validate_subnet) - - -# NOTE(boden): subbed out for docstring comments. -def validate_subnet_list(data, valid_values=None): - """Validate data is a list of subnet dicts. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is a valid list of subnet dicts, otherwise a human - readable message as to why the data is invalid. - """ - return _validate_subnet_list(data, valid_values) - - -def validate_regex(data, valid_values=None): - """Validate data is matched against a regex. - - :param data: The data to validate. - :param valid_values: The regular expression to use with re.match on - the data. - :returns: None if data contains matches for valid_values, otherwise a - human readable message as to why data is invalid. - """ - try: - if re.match(valid_values, data): - return - except TypeError: - pass - - msg = _("'%s' is not a valid input") % data - LOG.debug(msg) - return msg - - -def validate_regex_or_none(data, valid_values=None): - """Validate data is None or matched against a regex. - - :param data: The data to validate. - :param valid_values: The regular expression to use with re.match on - the data. - :returns: None if data is None or contains matches for valid_values, - otherwise a human readable message as to why data is invalid. - """ - if data is not None: - return validate_regex(data, valid_values) - - -def validate_list_of_regex_or_none(data, valid_values=None): - """Validate data is None or a list of items matching regex. - - :param data: A list of data to validate. - :param valid_values: The regular expression to use with re.match on - each element of the data. - :returns: None if data is None or contains matches for valid_values, - otherwise a human readable message as to why data is invalid. - """ - if data is not None: - return _validate_list_of_items(validate_regex, data, valid_values) - - -def validate_subnetpool_id(data, valid_values=None): - """Validate data is valid subnet pool ID. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is a valid subnet pool ID, otherwise a - human readable message as to why it's invalid. - """ - if data != constants.IPV6_PD_POOL_ID: - return validate_uuid_or_none(data, valid_values) - - -def validate_subnetpool_id_or_none(data, valid_values=None): - """Validate data is valid subnet pool ID or None. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is a valid subnet pool ID or None, otherwise a - human readable message as to why it's invalid. - """ - if data is not None: - return validate_subnetpool_id(data, valid_values) - - -def validate_uuid(data, valid_values=None): - """Validate data is UUID like. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is UUID like in form, otherwise a human readable - message indicating why data is invalid. - """ - if not uuidutils.is_uuid_like(data): - msg = _("'%s' is not a valid UUID") % data - LOG.debug(msg) - return msg - - -def validate_uuid_or_none(data, valid_values=None): - """Validate data is UUID like or None. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is UUID like in form or None, otherwise a human - readable message indicating why data is invalid. - """ - if data is not None: - return validate_uuid(data) - - -_validate_uuid_list = functools.partial(_validate_list_of_items, - validate_uuid) - - -# NOTE(boden): subbed out for docstring comments. -def validate_uuid_list(data, valid_values=None): - """Validate data is a list of UUID like values. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is an iterable that contains valid UUID values, - otherwise a message is returned indicating why validation failed. - """ - return _validate_uuid_list(data, valid_values) - - -def _validate_dict_item(key, key_validator, data): - # Find conversion function, if any, and apply it - conv_func = key_validator.get('convert_to') - if conv_func: - data[key] = conv_func(data.get(key)) - # Find validator function - # TODO(salv-orlando): Structure of dict attributes should be improved - # to avoid iterating over items - val_func = val_params = None - for (k, v) in key_validator.items(): - if k.startswith('type:'): - # ask forgiveness, not permission - try: - val_func = validators[k] - except KeyError: - msg = _("Validator '%s' does not exist.") % k - LOG.debug(msg) - return msg - val_params = v - break - # Process validation - if val_func: - return val_func(data.get(key), val_params) - - -def validate_dict(data, key_specs=None): - """Validate data is a dict optionally containing a specific set of keys. - - :param data: The data to validate. - :param key_specs: The optional list of keys that must be contained in - data. - :returns: None if data is a dict and (optionally) contains only key_specs. - Otherwise a human readable message is returned indicating why data is - not valid. - """ - if not isinstance(data, dict): - msg = _("'%s' is not a dictionary") % data - LOG.debug(msg) - return msg - # Do not perform any further validation, if no constraints are supplied - if not key_specs: - return - - # Check whether all required keys are present - required_keys = [key for key, spec in key_specs.items() - if spec.get('required')] - - if required_keys: - msg = _verify_dict_keys(required_keys, data, False) - if msg: - return msg - - # Check whether unexpected keys are supplied in data - unexpected_keys = [key for key in data if key not in key_specs] - if unexpected_keys: - msg = _("Unexpected keys supplied: %s") % ', '.join(unexpected_keys) - LOG.debug(msg) - return msg - - # Perform validation and conversion of all values - # according to the specifications. - for key, key_validator in [(k, v) for k, v in key_specs.items() - if k in data]: - msg = _validate_dict_item(key, key_validator, data) - if msg: - return msg - - -def validate_dict_or_none(data, key_specs=None): - """Validate data is None or a dict containing a specific set of keys. - - :param data: The data to validate. - :param key_specs: The optional list of keys that must be contained in - data. - :returns: None if data is None or a dict that (optionally) contains - all key_specs. Otherwise a human readable message is returned - indicating why data is not valid. - """ - if data is not None: - return validate_dict(data, key_specs) - - -def validate_dict_or_empty(data, key_specs=None): - """Validate data is {} or a dict containing a specific set of keys. - - :param data: The data to validate. - :param key_specs: The optional list of keys that must be contained in - data. - :returns: None if data is {} or a dict (optionally) containing - only key_specs. Otherwise a human readable message is returned - indicating why data is not valid. - """ - if data != {}: - return validate_dict(data, key_specs) - - -def validate_dict_or_nodata(data, key_specs=None): - """Validate no data or a dict containing a specific set of keys. - - :param data: The data to validate. May be None. - :param key_specs: The optional list of keys that must be contained in - data. - :returns: None if no data/empty dict or a dict and (optionally) contains - all key_specs. Otherwise a human readable message is returned - indicating why data is not valid. - """ - if data: - return validate_dict(data, key_specs) - - -def validate_non_negative(data, valid_values=None): - """Validate data is a positive int. - - :param data: The data to validate - :param valid_values: Not used! - :returns: None if data is an int and is positive, otherwise a human - readable message as to why data is invalid. - """ - try: - data = int(data) - except (ValueError, TypeError): - msg = _("'%s' is not an integer") % data - LOG.debug(msg) - return msg - - if data < 0: - msg = _("'%s' should be non-negative") % data - LOG.debug(msg) - return msg - - -def validate_port_range_or_none(data, valid_values=None): - """Validate data is a range of TCP/UDP port numbers - - :param data: The data to validate - :param valid_values: Not used! - :returns: None if data is an int between 0 and 65535, or two ints between 0 - and 65535 with a colon between them, otherwise a human readable message - as to why data is invalid. - """ - if data is None: - return - data = str(data) - ports = data.split(':') - if len(ports) > 2: - msg = _("Port range must be two integers separated by a colon.") - LOG.debug(msg) - return msg - for p in ports: - if len(p) == 0: - msg = _("Port range must be two integers separated by a colon.") - LOG.debug(msg) - return msg - if not netutils.is_valid_port(p): - msg = _("Invalid port: %s.") % p - LOG.debug(msg) - return msg - if len(ports) > 1 and ports[0] > ports[1]: - msg = _("First port in a port range must be lower than the second " - "port.") - LOG.debug(msg) - return msg - - -def validate_subports(data, valid_values=None): - """Validate data is a list of subnet port dicts. - - :param data: The data to validate. - :param valid_values: Not used! - :returns: None if data is a list of subport dicts each with a unique valid - port_id, segmentation_id and segmentation_type. Otherwise a human - readable message is returned indicating why the data is invalid. - """ - if not isinstance(data, list): - msg = _("Invalid data format for subports: '%s' is not a list") % data - LOG.debug(msg) - return msg - - subport_ids = set() - segmentations = collections.defaultdict(set) - for subport in data: - if not isinstance(subport, dict): - msg = _("Invalid data format for subport: " - "'%s' is not a dict") % subport - LOG.debug(msg) - return msg - - # Expect a non duplicated and valid port_id for the subport - if 'port_id' not in subport: - msg = _("A valid port UUID must be specified") - LOG.debug(msg) - return msg - elif validate_uuid(subport["port_id"]): - msg = _("Invalid UUID for subport: '%s'") % subport["port_id"] - return msg - elif subport["port_id"] in subport_ids: - msg = _("Non unique UUID for subport: '%s'") % subport["port_id"] - return msg - subport_ids.add(subport["port_id"]) - - # Validate that both segmentation ID and segmentation type are - # specified, and that the client does not duplicate segmentation - # IDs (unless it is explicitly asked to inherit segmentation - # details from the underlying subport's network). - segmentation_type = subport.get("segmentation_type") - if segmentation_type == 'inherit': - return - segmentation_id = subport.get("segmentation_id") - if (not segmentation_type or not segmentation_id) and len(subport) > 1: - msg = _("Invalid subport details '%s': missing segmentation " - "information. Must specify both segmentation_id and " - "segmentation_type") % subport - LOG.debug(msg) - return msg - if segmentation_id in segmentations.get(segmentation_type, []): - msg = _("Segmentation ID '%(seg_id)s' for '%(subport)s' is not " - "unique") % {"seg_id": segmentation_id, - "subport": subport["port_id"]} - LOG.debug(msg) - return msg - if segmentation_id: - segmentations[segmentation_type].add(segmentation_id) - - -# Dictionary that maintains a list of validation functions -validators = {'type:dict': validate_dict, - 'type:dict_or_none': validate_dict_or_none, - 'type:dict_or_empty': validate_dict_or_empty, - 'type:dict_or_nodata': validate_dict_or_nodata, - 'type:fixed_ips': validate_fixed_ips, - 'type:hostroutes': validate_hostroutes, - 'type:ip_address': validate_ip_address, - 'type:ip_address_or_none': validate_ip_address_or_none, - 'type:ip_or_subnet_or_none': validate_ip_or_subnet_or_none, - 'type:ip_pools': validate_ip_pools, - 'type:list_of_regex_or_none': validate_list_of_regex_or_none, - 'type:mac_address': validate_mac_address, - 'type:mac_address_or_none': validate_mac_address_or_none, - 'type:nameservers': validate_nameservers, - 'type:non_negative': validate_non_negative, - 'type:port_range': validate_port_range_or_none, - 'type:range': validate_range, - 'type:range_or_none': validate_range_or_none, - 'type:regex': validate_regex, - 'type:regex_or_none': validate_regex_or_none, - 'type:string': validate_string, - 'type:string_or_none': validate_string_or_none, - 'type:not_empty_string': validate_not_empty_string, - 'type:not_empty_string_or_none': - validate_not_empty_string_or_none, - 'type:subnet': validate_subnet, - 'type:subnet_list': validate_subnet_list, - 'type:subnet_or_none': validate_subnet_or_none, - 'type:subnetpool_id': validate_subnetpool_id, - 'type:subnetpool_id_or_none': validate_subnetpool_id_or_none, - 'type:subports': validate_subports, - 'type:uuid': validate_uuid, - 'type:uuid_or_none': validate_uuid_or_none, - 'type:uuid_list': validate_uuid_list, - 'type:values': validate_values, - 'type:boolean': validate_boolean, - 'type:integer': validate_integer, - 'type:list_of_unique_strings': validate_list_of_unique_strings, - 'type:list_of_any_key_specs_or_none': - validate_any_key_specs_or_none} - - -def _to_validation_type(validation_type): - return (validation_type - if validation_type.startswith('type:') - else 'type:' + validation_type) - - -def get_validator(validation_type, default=None): - """Get a registered validator by type. - - :param validation_type: The type to retrieve the validator for. - :param default: A default value to return if the validator is - not registered. - :return: The validator if registered, otherwise the default value. - """ - return validators.get(_to_validation_type(validation_type), default) - - -def add_validator(validation_type, validator): - """Dynamically add a validator. - - This can be used by clients to add their own, private validators, rather - than directly modifying the data structure. The clients can NOT modify - existing validators. - """ - key = _to_validation_type(validation_type) - if key in validators: - # NOTE(boden): imp.load_source() forces module reinitialization that - # can lead to validator redefinition from the same call site - if inspect.getsource(validator) != inspect.getsource(validators[key]): - msg = _("Validator type %s is already defined") % validation_type - raise KeyError(msg) - return - validators[key] = validator diff --git a/neutron_lib/api/validators/dns.py b/neutron_lib/api/validators/dns.py deleted file mode 100644 index db22c0f..0000000 --- a/neutron_lib/api/validators/dns.py +++ /dev/null @@ -1,190 +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. - -import re - -from oslo_config import cfg - -from neutron_lib._i18n import _ -from neutron_lib.api import validators -from neutron_lib import constants -from neutron_lib.db import constants as db_constants - - -def _validate_dns_format(data, max_len=db_constants.FQDN_FIELD_SIZE): - # NOTE: An individual name regex instead of an entire FQDN was used - # because its easier to make correct. The logic should validate that the - # dns_name matches RFC 1123 (section 2.1) and RFC 952. - if not data: - return - try: - # A trailing period is allowed to indicate that a name is fully - # qualified per RFC 1034 (page 7). - trimmed = data[:-1] if data.endswith('.') else data - if len(trimmed) > max_len: - raise TypeError( - _("'%(trimmed)s' exceeds the %(maxlen)s character FQDN " - "limit") % {'trimmed': trimmed, 'maxlen': max_len}) - labels = trimmed.split('.') - for label in labels: - if not label: - raise TypeError(_("Encountered an empty component")) - if label.endswith('-') or label.startswith('-'): - raise TypeError( - _("Name '%s' must not start or end with a hyphen") % label) - if not re.match(constants.DNS_LABEL_REGEX, label): - raise TypeError( - _("Name '%s' must be 1-63 characters long, each of " - "which can only be alphanumeric or a hyphen") % label) - # RFC 1123 hints that a TLD can't be all numeric. last is a TLD if - # it's an FQDN. - if len(labels) > 1 and re.match("^[0-9]+$", labels[-1]): - raise TypeError( - _("TLD '%s' must not be all numeric") % labels[-1]) - except TypeError as e: - msg = _("'%(data)s' not a valid PQDN or FQDN. Reason: %(reason)s") % { - 'data': data, 'reason': e} - return msg - - -def _validate_dns_name_with_dns_domain(request_dns_name, dns_domain): - # If a PQDN was passed, make sure the FQDN that will be generated is of - # legal size - higher_labels = dns_domain - if dns_domain: - higher_labels = '.%s' % dns_domain - higher_labels_len = len(higher_labels) - dns_name_len = len(request_dns_name) - if not request_dns_name.endswith('.'): - if dns_name_len + higher_labels_len > db_constants.FQDN_FIELD_SIZE: - msg = _("The dns_name passed is a PQDN and its size is " - "'%(dns_name_len)s'. The dns_domain option in " - "neutron.conf is set to %(dns_domain)s, with a " - "length of '%(higher_labels_len)s'. When the two are " - "concatenated to form a FQDN (with a '.' at the end), " - "the resulting length exceeds the maximum size " - "of '%(fqdn_max_len)s'" - ) % {'dns_name_len': dns_name_len, - 'dns_domain': cfg.CONF.dns_domain, - 'higher_labels_len': higher_labels_len, - 'fqdn_max_len': db_constants.FQDN_FIELD_SIZE} - return msg - return - - # A FQDN was passed - if (dns_name_len <= higher_labels_len or not - request_dns_name.endswith(higher_labels)): - msg = _("The dns_name passed is a FQDN. Its higher level labels " - "must be equal to the dns_domain option in neutron.conf, " - "that has been set to '%(dns_domain)s'. It must also " - "include one or more valid DNS labels to the left " - "of '%(dns_domain)s'") % {'dns_domain': - cfg.CONF.dns_domain} - return msg - - -def _get_dns_domain_config(): - if not cfg.CONF.dns_domain: - return '' - if cfg.CONF.dns_domain.endswith('.'): - return cfg.CONF.dns_domain - return '%s.' % cfg.CONF.dns_domain - - -def _get_request_dns_name(dns_name): - dns_domain = _get_dns_domain_config() - if (dns_domain and dns_domain != constants.DNS_DOMAIN_DEFAULT): - # If CONF.dns_domain is the default value 'openstacklocal', - # neutron don't let the user to assign dns_name to ports - return dns_name - return '' - - -def validate_dns_name(data, max_len=db_constants.FQDN_FIELD_SIZE): - """Validate DNS name. - - This method validates dns name and also needs to have dns_domain in config - because this may call a method which uses the config. - - :param data: The data to validate. - :param max_len: An optional cap on the length of the string. - :returns: None if data is valid, otherwise a human readable message - indicating why validation failed. - """ - msg = _validate_dns_format(data, max_len) - if msg: - return msg - - request_dns_name = _get_request_dns_name(data) - if request_dns_name: - dns_domain = _get_dns_domain_config() - msg = _validate_dns_name_with_dns_domain(request_dns_name, dns_domain) - if msg: - return msg - - -def validate_fip_dns_name(data, max_len=db_constants.FQDN_FIELD_SIZE): - """Validate DNS name for floating IP. - - :param data: The data to validate. - :param max_len: An optional cap on the length of the string. - :returns: None if data is valid, otherwise a human readable message - indicating why validation failed. - """ - msg = validators.validate_string(data) - if msg: - return msg - if not data: - return - if data.endswith('.'): - msg = _("'%s' is a FQDN. It should be a relative domain name") % data - return msg - msg = _validate_dns_format(data, max_len) - if msg: - return msg - length = len(data) - if length > max_len - 3: - msg = _("'%(data)s' contains %(length)s characters. Adding a " - "domain name will cause it to exceed the maximum length " - "of a FQDN of '%(max_len)s'") % {"data": data, - "length": length, - "max_len": max_len} - return msg - - -def validate_dns_domain(data, max_len=db_constants.FQDN_FIELD_SIZE): - """Validate DNS domain. - - :param data: The data to validate. - :param max_len: An optional cap on the length of the string. - :returns: None if data is valid, otherwise a human readable message - indicating why validation failed. - """ - msg = validators.validate_string(data) - if msg: - return msg - if not data: - return - if not data.endswith('.'): - msg = _("'%s' is not a FQDN") % data - return msg - msg = _validate_dns_format(data, max_len) - if msg: - return msg - length = len(data) - if length > max_len - 2: - msg = _("'%(data)s' contains %(length)s characters. Adding a " - "sub-domain will cause it to exceed the maximum length of a " - "FQDN of '%(max_len)s'") % {"data": data, - "length": length, - "max_len": max_len} - return msg diff --git a/neutron_lib/callbacks/__init__.py b/neutron_lib/callbacks/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/callbacks/events.py b/neutron_lib/callbacks/events.py deleted file mode 100644 index 4185655..0000000 --- a/neutron_lib/callbacks/events.py +++ /dev/null @@ -1,156 +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. - -# String literals representing events associated to data store operations -BEFORE_CREATE = 'before_create' -BEFORE_READ = 'before_read' -BEFORE_UPDATE = 'before_update' -BEFORE_DELETE = 'before_delete' - -PRECOMMIT_CREATE = 'precommit_create' -PRECOMMIT_UPDATE = 'precommit_update' -PRECOMMIT_DELETE = 'precommit_delete' - -AFTER_CREATE = 'after_create' -AFTER_READ = 'after_read' -AFTER_UPDATE = 'after_update' -AFTER_DELETE = 'after_delete' - -# String literals representing events associated to API operations -BEFORE_RESPONSE = 'before_response' -AFTER_REQUEST = 'after_request' - -# String literals representing events associated to process operations -BEFORE_INIT = 'before_init' -BEFORE_SPAWN = 'before_spawn' # sent per process -AFTER_SPAWN = 'after_spawn' # sent per process -AFTER_INIT = 'after_init' # sent per worker - -# String literals representing events associated to error conditions -ABORT_CREATE = 'abort_create' -ABORT_READ = 'abort_read' -ABORT_UPDATE = 'abort_update' -ABORT_DELETE = 'abort_delete' - -ABORT = 'abort_' -BEFORE = 'before_' -PRECOMMIT = 'precommit_' - -OVS_RESTARTED = 'ovs_restarted' - - -class EventPayload(object): - """Base event payload object. - - This class is intended to be the super class for all event payloads. As - such, it defines common attributes many events are likely to use in their - payload. Note that event attributes are passed by reference; no copying - of states, metadata or request_body is performed and thus consumers should - not modify payload references. - - For more information, see the callbacks dev-ref documentation for this - project. - """ - - def __init__(self, context, metadata=None, request_body=None, - states=None, resource_id=None): - # the event context - self.context = context - - # NOTE(boden): longer term we should consider removing metadata - # optional 'unstructured' (key,value) pairs for special needs - self.metadata = metadata if metadata else {} - - # the request body associated to the resource - self.request_body = request_body - - # an iterable of states for the resource from the newest to the oldest - # for example db states or api request/response - # the actual object type for states will vary depending on event caller - self.states = states if states else [] - - # a unique ID for the event resource; may be None if the resource - # isn't created yet - self.resource_id = resource_id - - @property - def has_states(self): - """Determines if this event payload has any states. - - :returns: True if this event payload has states, otherwise False. - """ - return len(self.states) > 0 - - @property - def latest_state(self): - """Returns the latest state for the event payload. - - :returns: The last state of this event payload if has_state else None. - """ - return self.states[-1] if self.has_states else None - - -class DBEventPayload(EventPayload): - """The payload for data store events payloads.""" - - def __init__(self, context, metadata=None, request_body=None, - states=None, resource_id=None, desired_state=None): - - super(DBEventPayload, self).__init__( - context, metadata=metadata, request_body=request_body, - states=states, resource_id=resource_id) - - # the model object to be persisted in pre create/commit payloads - self.desired_state = desired_state - - @property - def is_persisted(self): - """Determine if the resource for this event payload is persisted. - - :returns: True if this payload's resource is persisted, otherwise - False. - """ - return self.resource_id is not None and self.has_states - - @property - def is_to_be_committed(self): - """"Determine if the event payload resource is to be committed. - - :returns: True if the desired state has been populated, else False. - """ - return self.desired_state is not None - - @property - def latest_state(self): - """Returns the latest state for the event payload resource. - - :returns: If this payload has a desired_state its returned, otherwise - latest_state is returned. - """ - return (self.desired_state or - super(DBEventPayload, self).latest_state) - - -class APIEventPayload(EventPayload): - """The payload for API events.""" - - def __init__(self, context, method_name, action, - metadata=None, request_body=None, states=None, - resource_id=None, collection_name=None): - - super(APIEventPayload, self).__init__( - context, metadata=metadata, request_body=request_body, - states=states, resource_id=resource_id) - - self.method_name = method_name - self.action = action - self.collection_name = collection_name diff --git a/neutron_lib/callbacks/exceptions.py b/neutron_lib/callbacks/exceptions.py deleted file mode 100644 index f2bea0d..0000000 --- a/neutron_lib/callbacks/exceptions.py +++ /dev/null @@ -1,58 +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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class Invalid(exceptions.NeutronException): - message = _("The value '%(value)s' for %(element)s is not valid.") - - -class CallbackFailure(exceptions.MultipleExceptions): - - def __init__(self, errors): - self.errors = errors - - def __str__(self): - if isinstance(self.errors, list): - return ','.join(str(error) for error in self.errors) - else: - return str(self.errors) - - @property - def inner_exceptions(self): - """The list of unpacked errors for this exception. - - :return: A list of unpacked errors for this exception. An unpacked - error is the Exception's 'error' attribute if it inherits from - NotificationError, otherwise it's the exception itself. - """ - if isinstance(self.errors, list): - return [self._unpack_if_notification_error(e) for e in self.errors] - return [self._unpack_if_notification_error(self.errors)] - - @staticmethod - def _unpack_if_notification_error(exc): - if isinstance(exc, NotificationError): - return exc.error - return exc - - -class NotificationError(object): - - def __init__(self, callback_id, error): - self.callback_id = callback_id - self.error = error - - def __str__(self): - return 'Callback %s failed with "%s"' % (self.callback_id, self.error) diff --git a/neutron_lib/callbacks/manager.py b/neutron_lib/callbacks/manager.py deleted file mode 100644 index 9f129d7..0000000 --- a/neutron_lib/callbacks/manager.py +++ /dev/null @@ -1,201 +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. - -import collections - -from oslo_log import log as logging -from oslo_utils import reflection - -from neutron_lib.callbacks import events -from neutron_lib.callbacks import exceptions -from neutron_lib.db import utils as db_utils - -LOG = logging.getLogger(__name__) - - -class CallbacksManager(object): - """A callback system that allows objects to cooperate in a loose manner.""" - - def __init__(self): - self.clear() - - def subscribe(self, callback, resource, event): - """Subscribe callback for a resource event. - - The same callback may register for more than one event. - - :param callback: the callback. It must raise or return a boolean. - :param resource: the resource. It must be a valid resource. - :param event: the event. It must be a valid event. - """ - LOG.debug("Subscribe: %(callback)s %(resource)s %(event)s", - {'callback': callback, 'resource': resource, 'event': event}) - - callback_id = _get_id(callback) - try: - self._callbacks[resource][event][callback_id] = callback - except KeyError: - # Initialize the registry for unknown resources and/or events - # prior to enlisting the callback. - self._callbacks[resource][event] = {} - self._callbacks[resource][event][callback_id] = callback - # We keep a copy of callbacks to speed the unsubscribe operation. - if callback_id not in self._index: - self._index[callback_id] = collections.defaultdict(set) - self._index[callback_id][resource].add(event) - - def unsubscribe(self, callback, resource, event): - """Unsubscribe callback from the registry. - - :param callback: the callback. - :param resource: the resource. - :param event: the event. - """ - LOG.debug("Unsubscribe: %(callback)s %(resource)s %(event)s", - {'callback': callback, 'resource': resource, 'event': event}) - - callback_id = self._find(callback) - if not callback_id: - LOG.debug("Callback %s not found", callback_id) - return - if resource and event: - del self._callbacks[resource][event][callback_id] - self._index[callback_id][resource].discard(event) - if not self._index[callback_id][resource]: - del self._index[callback_id][resource] - if not self._index[callback_id]: - del self._index[callback_id] - else: - value = '%s,%s' % (resource, event) - raise exceptions.Invalid(element='resource,event', value=value) - - def unsubscribe_by_resource(self, callback, resource): - """Unsubscribe callback for any event associated to the resource. - - :param callback: the callback. - :param resource: the resource. - """ - callback_id = self._find(callback) - if callback_id: - if resource in self._index[callback_id]: - for event in self._index[callback_id][resource]: - del self._callbacks[resource][event][callback_id] - del self._index[callback_id][resource] - if not self._index[callback_id]: - del self._index[callback_id] - - def unsubscribe_all(self, callback): - """Unsubscribe callback for all events and all resources. - - - :param callback: the callback. - """ - callback_id = self._find(callback) - if callback_id: - for resource, resource_events in self._index[callback_id].items(): - for event in resource_events: - del self._callbacks[resource][event][callback_id] - del self._index[callback_id] - - def publish(self, resource, event, trigger, payload=None): - """Notify all subscribed callback(s) with a payload. - - Dispatch the resource's event to the subscribed callbacks. - - :param resource: The resource for the event. - :param event: The event. - :param trigger: The trigger. A reference to the sender of the event. - :param payload: The optional event object to send to subscribers. If - passed this must be an instance of BaseEvent. - :raises neutron_lib.callbacks.exceptions.Invalid: if - the payload object is not an instance of BaseEvent. - :raises CallbackFailure: if the underlying callback has errors. - """ - if payload: - if not isinstance(payload, events.EventPayload): - raise exceptions.Invalid(element='event payload', - value=type(payload)) - return self.notify(resource, event, trigger, payload=payload) - - # NOTE(boden): We plan to deprecate the usage of this method and **kwargs - # as the payload in Queens, but no warning here to avoid log flooding - @db_utils.reraise_as_retryrequest - def notify(self, resource, event, trigger, **kwargs): - """Notify all subscribed callback(s). - - Dispatch the resource's event to the subscribed callbacks. - - :param resource: The resource for the event. - :param event: The event. - :param trigger: The trigger. A reference to the sender of the event. - :param kwargs: (deprecated) Unstructured key/value pairs to invoke - the callback with. Using event objects with publish() is preferred. - :raises CallbackFailure: CallbackFailure is raised if the underlying - callback has errors. - """ - errors = self._notify_loop(resource, event, trigger, **kwargs) - if errors: - if event.startswith(events.BEFORE): - abort_event = event.replace( - events.BEFORE, events.ABORT) - self._notify_loop(resource, abort_event, trigger, **kwargs) - - raise exceptions.CallbackFailure(errors=errors) - - if event.startswith(events.PRECOMMIT): - raise exceptions.CallbackFailure(errors=errors) - - def clear(self): - """Brings the manager to a clean slate.""" - self._callbacks = collections.defaultdict(dict) - self._index = collections.defaultdict(dict) - - def _notify_loop(self, resource, event, trigger, **kwargs): - """The notification loop.""" - errors = [] - callbacks = list(self._callbacks[resource].get(event, {}).items()) - LOG.debug("Notify callbacks %s for %s, %s", - [c[0] for c in callbacks], resource, event) - # TODO(armax): consider using a GreenPile - for callback_id, callback in callbacks: - try: - callback(resource, event, trigger, **kwargs) - except Exception as e: - abortable_event = ( - event.startswith(events.BEFORE) or - event.startswith(events.PRECOMMIT) - ) - if not abortable_event: - LOG.exception("Error during notification for " - "%(callback)s %(resource)s, %(event)s", - {'callback': callback_id, - 'resource': resource, 'event': event}) - else: - LOG.debug("Callback %(callback)s raised %(error)s", - {'callback': callback_id, 'error': e}) - errors.append(exceptions.NotificationError(callback_id, e)) - return errors - - def _find(self, callback): - """Return the callback_id if found, None otherwise.""" - callback_id = _get_id(callback) - return callback_id if callback_id in self._index else None - - -def _get_id(callback): - """Return a unique identifier for the callback.""" - # TODO(armax): consider using something other than names - # https://www.python.org/dev/peps/pep-3155/, but this - # might be okay for now. - parts = (reflection.get_callable_name(callback), - str(hash(callback))) - return '-'.join(parts) diff --git a/neutron_lib/callbacks/registry.py b/neutron_lib/callbacks/registry.py deleted file mode 100644 index 7ea0faa..0000000 --- a/neutron_lib/callbacks/registry.py +++ /dev/null @@ -1,121 +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. - -import collections -import inspect - -from neutron_lib.callbacks import manager - - -# TODO(armax): consider adding locking -_CALLBACK_MANAGER = None - -# stores a dictionary keyed on function pointers with a list of -# (resource, event) tuples to subscribe to on class initialization -_REGISTERED_CLASS_METHODS = collections.defaultdict(list) - - -def _get_callback_manager(): - global _CALLBACK_MANAGER - if _CALLBACK_MANAGER is None: - _CALLBACK_MANAGER = manager.CallbacksManager() - return _CALLBACK_MANAGER - - -def subscribe(callback, resource, event): - _get_callback_manager().subscribe(callback, resource, event) - - -def unsubscribe(callback, resource, event): - _get_callback_manager().unsubscribe(callback, resource, event) - - -def unsubscribe_by_resource(callback, resource): - _get_callback_manager().unsubscribe_by_resource(callback, resource) - - -def unsubscribe_all(callback): - _get_callback_manager().unsubscribe_all(callback) - - -# NOTE(boden): This method is deprecated in favor of publish() and will be -# removed in Queens, but not deprecation message to reduce log flooding -def notify(resource, event, trigger, **kwargs): - _get_callback_manager().notify(resource, event, trigger, **kwargs) - - -def publish(resource, event, trigger, payload=None): - _get_callback_manager().publish(resource, event, trigger, payload=payload) - - -def clear(): - _get_callback_manager().clear() - - -def receives(resource, events): - """Use to decorate methods on classes before initialization. - - Any classes that use this must themselves be decorated with the - @has_registry_receivers decorator to setup the __new__ method to - actually register the instance methods after initialization. - """ - assert isinstance(events, (list, tuple, set)), 'events must be collection' - - def decorator(f): - for e in events: - _REGISTERED_CLASS_METHODS[f].append((resource, e)) - return f - return decorator - - -def has_registry_receivers(klass): - """Decorator to setup __new__ method in classes to subscribe bound methods. - - Any method decorated with @receives above is an unbound method on a class. - This decorator sets up the class __new__ method to subscribe the bound - method in the callback registry after object instantiation. - """ - orig_new = klass.__new__ - new_inherited = '__new__' not in klass.__dict__ - - @staticmethod - def replacement_new(cls, *args, **kwargs): - if new_inherited: - # class didn't define __new__ so we need to call inherited __new__ - super_new = super(klass, cls).__new__ - if super_new is object.__new__: - # object.__new__ doesn't accept args nor kwargs - instance = super_new(cls) - else: - instance = super_new(cls, *args, **kwargs) - else: - instance = orig_new(cls, *args, **kwargs) - if getattr(instance, '_DECORATED_METHODS_SUBSCRIBED', False): - # Avoid running this logic twice for classes inheriting other - # classes with this same decorator. Only one needs to execute - # to subscribe all decorated methods. - return instance - for name, unbound_method in inspect.getmembers(cls): - if (not inspect.ismethod(unbound_method) and - not inspect.isfunction(unbound_method)): - continue - # handle py27/py34 difference - func = getattr(unbound_method, 'im_func', unbound_method) - if func not in _REGISTERED_CLASS_METHODS: - continue - for resource, event in _REGISTERED_CLASS_METHODS[func]: - # subscribe the bound method - subscribe(getattr(instance, name), resource, event) - setattr(instance, '_DECORATED_METHODS_SUBSCRIBED', True) - return instance - klass.__new__ = replacement_new - return klass diff --git a/neutron_lib/callbacks/resources.py b/neutron_lib/callbacks/resources.py deleted file mode 100644 index c91d9e3..0000000 --- a/neutron_lib/callbacks/resources.py +++ /dev/null @@ -1,31 +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. - -# String literals representing core resources. -AGENT = 'agent' -FLOATING_IP = 'floatingip' -NETWORK = 'network' -NETWORKS = 'networks' -PORT = 'port' -PORTS = 'ports' -PORT_DEVICE = 'port_device' -PROCESS = 'process' -ROUTER = 'router' -ROUTER_GATEWAY = 'router_gateway' -ROUTER_INTERFACE = 'router_interface' -SECURITY_GROUP = 'security_group' -SECURITY_GROUP_RULE = 'security_group_rule' -SEGMENT = 'segment' -SEGMENT_HOST_MAPPING = 'segment_host_mapping' -SUBNET = 'subnet' -SUBNETS = 'subnets' -SUBNETPOOL_ADDRESS_SCOPE = 'subnetpool_address_scope' diff --git a/neutron_lib/constants.py b/neutron_lib/constants.py deleted file mode 100644 index 79fe3fa..0000000 --- a/neutron_lib/constants.py +++ /dev/null @@ -1,366 +0,0 @@ -# Copyright (c) 2012 OpenStack Foundation. -# -# 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. - -# TODO(salv-orlando): Verify if a single set of operational -# status constants is achievable -NET_STATUS_ACTIVE = 'ACTIVE' -NET_STATUS_BUILD = 'BUILD' -NET_STATUS_DOWN = 'DOWN' -NET_STATUS_ERROR = 'ERROR' - -PORT_STATUS_ACTIVE = 'ACTIVE' -PORT_STATUS_BUILD = 'BUILD' -PORT_STATUS_DOWN = 'DOWN' -PORT_STATUS_ERROR = 'ERROR' -PORT_STATUS_NOTAPPLICABLE = 'N/A' - -FLOATINGIP_STATUS_ACTIVE = 'ACTIVE' -FLOATINGIP_STATUS_DOWN = 'DOWN' -FLOATINGIP_STATUS_ERROR = 'ERROR' - -# Service operation status constants -ACTIVE = "ACTIVE" -DOWN = "DOWN" -CREATED = "CREATED" -PENDING_CREATE = "PENDING_CREATE" -PENDING_UPDATE = "PENDING_UPDATE" -PENDING_DELETE = "PENDING_DELETE" -INACTIVE = "INACTIVE" -ERROR = "ERROR" - -DEVICE_OWNER_COMPUTE_PREFIX = "compute:" -DEVICE_OWNER_NETWORK_PREFIX = "network:" -DEVICE_OWNER_NEUTRON_PREFIX = "neutron:" -DEVICE_OWNER_BAREMETAL_PREFIX = "baremetal:" - -DEVICE_OWNER_ROUTER_HA_INTF = (DEVICE_OWNER_NETWORK_PREFIX + - "router_ha_interface") -DEVICE_OWNER_HA_REPLICATED_INT = (DEVICE_OWNER_NETWORK_PREFIX + - "ha_router_replicated_interface") -DEVICE_OWNER_ROUTER_INTF = DEVICE_OWNER_NETWORK_PREFIX + "router_interface" -DEVICE_OWNER_ROUTER_GW = DEVICE_OWNER_NETWORK_PREFIX + "router_gateway" -DEVICE_OWNER_FLOATINGIP = DEVICE_OWNER_NETWORK_PREFIX + "floatingip" -DEVICE_OWNER_DHCP = DEVICE_OWNER_NETWORK_PREFIX + "dhcp" -DEVICE_OWNER_DVR_INTERFACE = (DEVICE_OWNER_NETWORK_PREFIX + - "router_interface_distributed") -DEVICE_OWNER_AGENT_GW = (DEVICE_OWNER_NETWORK_PREFIX + - "floatingip_agent_gateway") -DEVICE_OWNER_ROUTER_SNAT = (DEVICE_OWNER_NETWORK_PREFIX + - "router_centralized_snat") -DEVICE_OWNER_LOADBALANCER = DEVICE_OWNER_NEUTRON_PREFIX + "LOADBALANCER" -DEVICE_OWNER_LOADBALANCERV2 = DEVICE_OWNER_NEUTRON_PREFIX + "LOADBALANCERV2" - -DEVICE_OWNER_PREFIXES = (DEVICE_OWNER_NETWORK_PREFIX, - DEVICE_OWNER_NEUTRON_PREFIX) - -# Collection used to identify devices owned by router interfaces. -# DEVICE_OWNER_ROUTER_HA_INTF is a special case and so is not included. -ROUTER_INTERFACE_OWNERS = (DEVICE_OWNER_ROUTER_INTF, - DEVICE_OWNER_HA_REPLICATED_INT, - DEVICE_OWNER_DVR_INTERFACE) -ROUTER_INTERFACE_OWNERS_SNAT = (DEVICE_OWNER_ROUTER_INTF, - DEVICE_OWNER_HA_REPLICATED_INT, - DEVICE_OWNER_DVR_INTERFACE, - DEVICE_OWNER_ROUTER_SNAT) - -DEVICE_ID_RESERVED_DHCP_PORT = 'reserved_dhcp_port' - -FLOATINGIP_KEY = '_floatingips' -INTERFACE_KEY = '_interfaces' -HA_INTERFACE_KEY = '_ha_interface' - -IPv4 = 'IPv4' -IPv6 = 'IPv6' -IP_VERSION_4 = 4 -IP_VERSION_6 = 6 -IPv4_BITS = 32 -IPv6_BITS = 128 - -INVALID_MAC_ADDRESSES = ['00:00:00:00:00:00', 'FF:FF:FF:FF:FF:FF'] - -IPv4_ANY = '0.0.0.0/0' -IPv6_ANY = '::/0' -IP_ANY = {IP_VERSION_4: IPv4_ANY, IP_VERSION_6: IPv6_ANY} - -IPv6_LLA_PREFIX = 'fe80::/64' - -DHCP_RESPONSE_PORT = 68 - -FLOODING_ENTRY = ('00:00:00:00:00:00', '0.0.0.0') - -AGENT_TYPE_DHCP = 'DHCP agent' -AGENT_TYPE_OVS = 'Open vSwitch agent' -AGENT_TYPE_LINUXBRIDGE = 'Linux bridge agent' -AGENT_TYPE_OFA = 'OFA driver agent' -AGENT_TYPE_L3 = 'L3 agent' -AGENT_TYPE_LOADBALANCER = 'Loadbalancer agent' -AGENT_TYPE_METERING = 'Metering agent' -AGENT_TYPE_METADATA = 'Metadata agent' -AGENT_TYPE_NIC_SWITCH = 'NIC Switch agent' -AGENT_TYPE_MACVTAP = 'Macvtap agent' -L2_AGENT_TOPIC = 'N/A' - -L3_AGENT_MODE_DVR = 'dvr' -L3_AGENT_MODE_DVR_SNAT = 'dvr_snat' -L3_AGENT_MODE_LEGACY = 'legacy' -L3_AGENT_MODE = 'agent_mode' - -PORT_BINDING_EXT_ALIAS = 'binding' -L3_AGENT_SCHEDULER_EXT_ALIAS = 'l3_agent_scheduler' -DHCP_AGENT_SCHEDULER_EXT_ALIAS = 'dhcp_agent_scheduler' -LBAAS_AGENT_SCHEDULER_EXT_ALIAS = 'lbaas_agent_scheduler' -L3_DISTRIBUTED_EXT_ALIAS = 'dvr' -L3_HA_MODE_EXT_ALIAS = 'l3-ha' -SUBNET_ALLOCATION_EXT_ALIAS = 'subnet_allocation' - -# Protocol names and numbers for Security Groups/Firewalls -PROTO_NAME_AH = 'ah' -PROTO_NAME_DCCP = 'dccp' -PROTO_NAME_EGP = 'egp' -PROTO_NAME_ESP = 'esp' -PROTO_NAME_GRE = 'gre' -PROTO_NAME_ICMP = 'icmp' -PROTO_NAME_IGMP = 'igmp' -PROTO_NAME_IPV6_ENCAP = 'ipv6-encap' -PROTO_NAME_IPV6_FRAG = 'ipv6-frag' -PROTO_NAME_IPV6_ICMP = 'ipv6-icmp' -# For backward-compatibility of security group rule API, we keep the old value -# for IPv6 ICMP. It should be clean up in the future. -PROTO_NAME_IPV6_ICMP_LEGACY = 'icmpv6' -PROTO_NAME_IPV6_NONXT = 'ipv6-nonxt' -PROTO_NAME_IPV6_OPTS = 'ipv6-opts' -PROTO_NAME_IPV6_ROUTE = 'ipv6-route' -PROTO_NAME_OSPF = 'ospf' -PROTO_NAME_PGM = 'pgm' -PROTO_NAME_RSVP = 'rsvp' -PROTO_NAME_SCTP = 'sctp' -PROTO_NAME_TCP = 'tcp' -PROTO_NAME_UDP = 'udp' -PROTO_NAME_UDPLITE = 'udplite' -PROTO_NAME_VRRP = 'vrrp' - -PROTO_NUM_AH = 51 -PROTO_NUM_DCCP = 33 -PROTO_NUM_EGP = 8 -PROTO_NUM_ESP = 50 -PROTO_NUM_GRE = 47 -PROTO_NUM_ICMP = 1 -PROTO_NUM_IGMP = 2 -PROTO_NUM_IPV6_ENCAP = 41 -PROTO_NUM_IPV6_FRAG = 44 -PROTO_NUM_IPV6_ICMP = 58 -PROTO_NUM_IPV6_NONXT = 59 -PROTO_NUM_IPV6_OPTS = 60 -PROTO_NUM_IPV6_ROUTE = 43 -PROTO_NUM_OSPF = 89 -PROTO_NUM_PGM = 113 -PROTO_NUM_RSVP = 46 -PROTO_NUM_SCTP = 132 -PROTO_NUM_TCP = 6 -PROTO_NUM_UDP = 17 -PROTO_NUM_UDPLITE = 136 -PROTO_NUM_VRRP = 112 - -IP_PROTOCOL_MAP = {PROTO_NAME_AH: PROTO_NUM_AH, - PROTO_NAME_DCCP: PROTO_NUM_DCCP, - PROTO_NAME_EGP: PROTO_NUM_EGP, - PROTO_NAME_ESP: PROTO_NUM_ESP, - PROTO_NAME_GRE: PROTO_NUM_GRE, - PROTO_NAME_ICMP: PROTO_NUM_ICMP, - PROTO_NAME_IGMP: PROTO_NUM_IGMP, - PROTO_NAME_IPV6_ENCAP: PROTO_NUM_IPV6_ENCAP, - PROTO_NAME_IPV6_FRAG: PROTO_NUM_IPV6_FRAG, - PROTO_NAME_IPV6_ICMP: PROTO_NUM_IPV6_ICMP, - # For backward-compatibility of security group rule API - PROTO_NAME_IPV6_ICMP_LEGACY: PROTO_NUM_IPV6_ICMP, - PROTO_NAME_IPV6_NONXT: PROTO_NUM_IPV6_NONXT, - PROTO_NAME_IPV6_OPTS: PROTO_NUM_IPV6_OPTS, - PROTO_NAME_IPV6_ROUTE: PROTO_NUM_IPV6_ROUTE, - PROTO_NAME_OSPF: PROTO_NUM_OSPF, - PROTO_NAME_PGM: PROTO_NUM_PGM, - PROTO_NAME_RSVP: PROTO_NUM_RSVP, - PROTO_NAME_SCTP: PROTO_NUM_SCTP, - PROTO_NAME_TCP: PROTO_NUM_TCP, - PROTO_NAME_UDP: PROTO_NUM_UDP, - PROTO_NAME_UDPLITE: PROTO_NUM_UDPLITE, - PROTO_NAME_VRRP: PROTO_NUM_VRRP} - -# Note that this differs from IP_PROTOCOL_MAP because iptables refers to IPv6 -# ICMP as 'icmp6' whereas it is 'ipv6-icmp' in IP_PROTOCOL_MAP. -IPTABLES_PROTOCOL_MAP = {PROTO_NAME_DCCP: 'dccp', - PROTO_NAME_ICMP: 'icmp', - PROTO_NAME_IPV6_ICMP: 'icmp6', - PROTO_NAME_SCTP: 'sctp', - PROTO_NAME_TCP: 'tcp', - PROTO_NAME_UDP: 'udp'} - -# IP header length -IP_HEADER_LENGTH = { - 4: 20, - 6: 40, -} - -# ICMPv6 types: -# Destination Unreachable (1) -ICMPV6_TYPE_DEST_UNREACH = 1 -# Packet Too Big (2) -ICMPV6_TYPE_PKT_TOOBIG = 2 -# Time Exceeded (3) -ICMPV6_TYPE_TIME_EXCEED = 3 -# Parameter Problem (4) -ICMPV6_TYPE_PARAMPROB = 4 -# Echo Request (128) -ICMPV6_TYPE_ECHO_REQUEST = 128 -# Echo Reply (129) -ICMPV6_TYPE_ECHO_REPLY = 129 -# Multicast Listener Query (130) -ICMPV6_TYPE_MLD_QUERY = 130 -# Multicast Listener Report (131) -ICMPV6_TYPE_MLD_REPORT = 131 -# Multicast Listener Done (132) -ICMPV6_TYPE_MLD_DONE = 132 -# Router Solicitation (133) -ICMPV6_TYPE_RS = 133 -# Router Advertisement (134) -ICMPV6_TYPE_RA = 134 -# Neighbor Solicitation (135) -ICMPV6_TYPE_NS = 135 -# Neighbor Advertisement (136) -ICMPV6_TYPE_NA = 136 -# Multicast Listener v2 Report (143) -ICMPV6_TYPE_MLD2_REPORT = 143 - -# List of ICMPv6 types that should be allowed from the unspecified address for -# Duplicate Address Detection: -ICMPV6_ALLOWED_UNSPEC_ADDR_TYPES = [ICMPV6_TYPE_MLD_REPORT, - ICMPV6_TYPE_NS, - ICMPV6_TYPE_MLD2_REPORT] - -# Human-readable ID to which the subnetpool ID should be set to -# indicate that IPv6 Prefix Delegation is enabled for a given subnetpool -IPV6_PD_POOL_ID = 'prefix_delegation' - -# Device names start with "tap" -TAP_DEVICE_PREFIX = 'tap' - -# Device names start with "macvtap" -MACVTAP_DEVICE_PREFIX = 'macvtap' - -# Linux interface max length -DEVICE_NAME_MAX_LEN = 15 - -# Time format -ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%f' - -DHCPV6_STATEFUL = 'dhcpv6-stateful' -DHCPV6_STATELESS = 'dhcpv6-stateless' -IPV6_SLAAC = 'slaac' -IPV6_MODES = [DHCPV6_STATEFUL, DHCPV6_STATELESS, IPV6_SLAAC] - -ACTIVE_PENDING_STATUSES = ( - ACTIVE, - PENDING_CREATE, - PENDING_UPDATE -) - -# Network Type constants -TYPE_FLAT = 'flat' -TYPE_GENEVE = 'geneve' -TYPE_GRE = 'gre' -TYPE_LOCAL = 'local' -TYPE_VXLAN = 'vxlan' -TYPE_VLAN = 'vlan' -TYPE_NONE = 'none' - -# Values for network_type - -# For VLAN Network -MIN_VLAN_TAG = 1 -MAX_VLAN_TAG = 4094 - -# For Geneve Tunnel -MIN_GENEVE_VNI = 1 -MAX_GENEVE_VNI = 2 ** 24 - 1 - -# For GRE Tunnel -MIN_GRE_ID = 1 -MAX_GRE_ID = 2 ** 32 - 1 - -# For VXLAN Tunnel -MIN_VXLAN_VNI = 1 -MAX_VXLAN_VNI = 2 ** 24 - 1 -VXLAN_UDP_PORT = 4789 - -# Overlay (tunnel) protocol overhead -GENEVE_ENCAP_MIN_OVERHEAD = 30 -GRE_ENCAP_OVERHEAD = 22 -VXLAN_ENCAP_OVERHEAD = 30 - -# For DNS extension -DNS_DOMAIN_DEFAULT = 'openstacklocal.' -DNS_LABEL_MAX_LEN = 63 -DNS_LABEL_REGEX = "^[a-z0-9-]{1,%d}$" % DNS_LABEL_MAX_LEN - -VALID_DSCP_MARKS = [0, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, - 36, 38, 40, 46, 48, 56] - -INGRESS_DIRECTION = 'ingress' -EGRESS_DIRECTION = 'egress' -VALID_DIRECTIONS = (INGRESS_DIRECTION, EGRESS_DIRECTION) - - -class Sentinel(object): - """A constant object that does not change even when copied.""" - def __deepcopy__(self, memo): - # Always return the same object because this is essentially a constant. - return self - - def __copy__(self): - # called via copy.copy(x) - return self - - -############################# -# Attribute related constants -############################# - -ATTR_NOT_SPECIFIED = Sentinel() - -HEX_ELEM = '[0-9A-Fa-f]' -UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}', - HEX_ELEM + '{4}', HEX_ELEM + '{4}', - HEX_ELEM + '{12}']) - - -########################## -# Device related constants -########################## -# vhost-user device names start with "vhu" -VHOST_USER_DEVICE_PREFIX = 'vhu' -# The vswitch side of a veth pair for a nova iptables filter setup -VETH_DEVICE_PREFIX = 'qvo' -# prefix for SNAT interface in DVR -SNAT_INT_DEV_PREFIX = 'sg-' - - -########################## -# Plugin related constants -########################## -# Plugin constants that are universally used across all neutron repos. -# The alias for the core plugin. -# TODO(boden): remove and replace consumer usage with plugins/constants.py -CORE = 'CORE' -# The alias for the L3 plugin. -L3 = 'L3_ROUTER_NAT' diff --git a/neutron_lib/context.py b/neutron_lib/context.py deleted file mode 100644 index b2891c0..0000000 --- a/neutron_lib/context.py +++ /dev/null @@ -1,197 +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. - -"""Context: context for security/db session.""" - -import collections -import copy -import datetime - -from oslo_context import context as oslo_context -from oslo_db.sqlalchemy import enginefacade - -from neutron_lib import _policy as policy -from neutron_lib.db import api as db_api - - -class ContextBase(oslo_context.RequestContext): - """Security context and request information. - - Represents the user taking a given action within the system. - - """ - - def __init__(self, user_id=None, tenant_id=None, is_admin=None, - timestamp=None, tenant_name=None, user_name=None, - is_advsvc=None, **kwargs): - # NOTE(jamielennox): We maintain these arguments in order for tests - # that pass arguments positionally. - kwargs.setdefault('user', user_id) - kwargs.setdefault('tenant', tenant_id) - # prefer project_name, as that's what's going to be set by - # keystone. Fall back to tenant_name if for some reason it's blank. - kwargs.setdefault('project_name', tenant_name) - super(ContextBase, self).__init__(is_admin=is_admin, **kwargs) - - self.user_name = user_name - - if not timestamp: - timestamp = datetime.datetime.utcnow() - self.timestamp = timestamp - self.is_advsvc = is_advsvc - if self.is_advsvc is None: - self.is_advsvc = self.is_admin or policy.check_is_advsvc(self) - if self.is_admin is None: - self.is_admin = policy.check_is_admin(self) - - @property - def project_id(self): - return self.tenant - - @property - def tenant_id(self): - return self.tenant - - @tenant_id.setter - def tenant_id(self, tenant_id): - self.tenant = tenant_id - - @property - def tenant_name(self): - return self.project_name - - @tenant_name.setter - def tenant_name(self, tenant_name): - self.project_name = tenant_name - - @property - def user_id(self): - return self.user - - @user_id.setter - def user_id(self, user_id): - self.user = user_id - - def to_dict(self): - context = super(ContextBase, self).to_dict() - context.update({ - 'user_id': self.user_id, - 'tenant_id': self.tenant_id, - 'project_id': self.project_id, - 'timestamp': str(self.timestamp), - 'tenant_name': self.project_name, - 'project_name': self.project_name, - 'user_name': self.user_name, - }) - return context - - def to_policy_values(self): - values = super(ContextBase, self).to_policy_values() - values['tenant_id'] = self.tenant_id - values['is_admin'] = self.is_admin - - # NOTE(jamielennox): These are almost certainly unused and non-standard - # but kept for backwards compatibility. Remove them in Pike - # (oslo.context from Ocata release already issues deprecation warnings - # for non-standard keys). - values['user'] = self.user - values['tenant'] = self.tenant - values['domain'] = self.domain - values['user_domain'] = self.user_domain - values['project_domain'] = self.project_domain - values['tenant_name'] = self.project_name - values['project_name'] = self.project_name - values['user_name'] = self.user_name - - return values - - @classmethod - def from_dict(cls, values): - return cls(user_id=values.get('user_id', values.get('user')), - tenant_id=values.get('tenant_id', values.get('project_id')), - is_admin=values.get('is_admin'), - roles=values.get('roles'), - timestamp=values.get('timestamp'), - request_id=values.get('request_id'), - tenant_name=values.get('tenant_name'), - user_name=values.get('user_name'), - auth_token=values.get('auth_token')) - - def elevated(self): - """Return a version of this context with admin flag set.""" - context = copy.copy(self) - context.is_admin = True - - if 'admin' not in [x.lower() for x in context.roles]: - context.roles = context.roles + ["admin"] - - return context - - -@enginefacade.transaction_context_provider -class ContextBaseWithSession(ContextBase): - pass - - -_TransactionConstraint = collections.namedtuple( - 'TransactionConstraint', ['if_revision_match', 'resource', 'resource_id']) - - -class Context(ContextBaseWithSession): - def __init__(self, *args, **kwargs): - super(Context, self).__init__(*args, **kwargs) - self._session = None - self._txn_constraint = None - - @property - def session(self): - # TODO(akamyshnikova): checking for session attribute won't be needed - # when reader and writer will be used - if hasattr(super(Context, self), 'session'): - return super(Context, self).session - if self._session is None: - self._session = db_api.get_writer_session() - - return self._session - - def set_transaction_constraint(self, resource, resource_id, rev_number): - """Set a revision constraint to enfore before resource_id is changed. - - :param resource: collection name of resource (e.g. ports or networks) - :param resource_id: the primary key ID of the individiual resource that - should have its revision number matched before - allowing the transaction to proceed. - :param rev_number: the revision_number that the resource should be at. - """ - - self._txn_constraint = _TransactionConstraint( - if_revision_match=rev_number, resource=resource, - resource_id=resource_id) - - def clear_transaction_constraint(self): - self._txn_constraint = None - - def get_transaction_constraint(self): - return self._txn_constraint - - -def get_admin_context(): - return Context(user_id=None, - tenant_id=None, - is_admin=True, - overwrite=False) - - -def get_admin_context_without_session(): - return ContextBase(user_id=None, - tenant_id=None, - is_admin=True) diff --git a/neutron_lib/db/__init__.py b/neutron_lib/db/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/db/api.py b/neutron_lib/db/api.py deleted file mode 100644 index 4ee1700..0000000 --- a/neutron_lib/db/api.py +++ /dev/null @@ -1,54 +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 oslo_concurrency import lockutils -from oslo_db.sqlalchemy import enginefacade - -_synchronized = lockutils.synchronized_with_prefix("neutron-") -_CTX_MANAGER = None - - -@_synchronized("context-manager") -def _create_context_manager(): - global _CTX_MANAGER - if _CTX_MANAGER is None: - _CTX_MANAGER = enginefacade.transaction_context() - _CTX_MANAGER.configure(sqlite_fk=True, flush_on_subtransaction=True) - - return _CTX_MANAGER - - -def get_context_manager(): - """Transaction Context Manager accessor. - - :returns: The transaction context manager. - """ - if _CTX_MANAGER is None: - return _create_context_manager() - - return _CTX_MANAGER - - -def get_reader_session(): - """Helper to get reader session. - - :returns: The reader session. - """ - return get_context_manager().reader.get_sessionmaker()() - - -def get_writer_session(): - """Helper to get writer session. - - :returns: The writer session. - """ - return get_context_manager().writer.get_sessionmaker()() diff --git a/neutron_lib/db/constants.py b/neutron_lib/db/constants.py deleted file mode 100644 index 2682834..0000000 --- a/neutron_lib/db/constants.py +++ /dev/null @@ -1,34 +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. - -# Database field sizes -NAME_FIELD_SIZE = 255 -LONG_DESCRIPTION_FIELD_SIZE = 1024 -DESCRIPTION_FIELD_SIZE = 255 -PROJECT_ID_FIELD_SIZE = 255 -DEVICE_ID_FIELD_SIZE = 255 -DEVICE_OWNER_FIELD_SIZE = 255 -UUID_FIELD_SIZE = 36 -STATUS_FIELD_SIZE = 16 -IP_ADDR_FIELD_SIZE = 64 # large enough to hold a v4 or v6 address -MAC_ADDR_FIELD_SIZE = 32 -RESOURCE_TYPE_FIELD_SIZE = 255 -FQDN_FIELD_SIZE = 255 - -# Alembic branches -EXPAND_BRANCH = 'expand' -CONTRACT_BRANCH = 'contract' - -# Maximum value integer can take in MySQL and PostgreSQL -# In SQLite integer can be stored in 1, 2, 3, 4, 6, or 8 bytes, -# but here it will be limited by this value for consistency. -DB_INTEGER_MAX_VALUE = 2 ** 31 - 1 diff --git a/neutron_lib/db/model_base.py b/neutron_lib/db/model_base.py deleted file mode 100644 index 699084a..0000000 --- a/neutron_lib/db/model_base.py +++ /dev/null @@ -1,113 +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 oslo_db.sqlalchemy import models -from oslo_utils import uuidutils -import sqlalchemy as sa -from sqlalchemy.ext import declarative -from sqlalchemy import orm - -from neutron_lib.db import constants as db_const - - -class HasProject(object): - """Project mixin, add to subclasses that have a user.""" - - # NOTE: project_id is just a free form string - project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE), - index=True) - - def get_tenant_id(self): - return self.project_id - - def set_tenant_id(self, value): - self.project_id = value - - @declarative.declared_attr - def tenant_id(cls): - return orm.synonym( - 'project_id', - descriptor=property(cls.get_tenant_id, cls.set_tenant_id)) - - -class HasProjectNoIndex(HasProject): - """Project mixin, add to subclasses that have a user.""" - - # NOTE: project_id is just a free form string - project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE)) - - -class HasProjectPrimaryKeyIndex(HasProject): - """Project mixin, add to subclasses that have a user.""" - - # NOTE: project_id is just a free form string - project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE), - nullable=False, primary_key=True, index=True) - - -class HasProjectPrimaryKey(HasProject): - """Project mixin, add to subclasses that have a user.""" - - # NOTE: project_id is just a free form string - project_id = sa.Column(sa.String(db_const.PROJECT_ID_FIELD_SIZE), - nullable=False, primary_key=True) - - -class HasId(object): - """id mixin, add to subclasses that have an id.""" - - id = sa.Column(sa.String(db_const.UUID_FIELD_SIZE), - primary_key=True, - default=uuidutils.generate_uuid) - - -class HasStatusDescription(object): - """Status with description mixin.""" - - status = sa.Column(sa.String(db_const.STATUS_FIELD_SIZE), - nullable=False) - status_description = sa.Column(sa.String(db_const.DESCRIPTION_FIELD_SIZE)) - - -class _NeutronBase(models.ModelBase): - """Base class for Neutron Models.""" - - __table_args__ = {'mysql_engine': 'InnoDB'} - - def __iter__(self): - self._i = iter(orm.object_mapper(self).columns) - return self - - def next(self): - n = next(self._i).name - return n, getattr(self, n) - - __next__ = next - - def __repr__(self): - """sqlalchemy based automatic __repr__ method.""" - items = ['%s=%r' % (col.name, getattr(self, col.name)) - for col in self.__table__.columns] - return "<%s.%s[object at %x] {%s}>" % (self.__class__.__module__, - self.__class__.__name__, - id(self), ', '.join(items)) - - -class NeutronBaseV2(_NeutronBase): - - @declarative.declared_attr - def __tablename__(cls): - # Use the pluralized name of the class as the table name. - return cls.__name__.lower() + 's' - - -BASEV2 = declarative.declarative_base(cls=NeutronBaseV2) diff --git a/neutron_lib/db/utils.py b/neutron_lib/db/utils.py deleted file mode 100644 index f9f8d84..0000000 --- a/neutron_lib/db/utils.py +++ /dev/null @@ -1,106 +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. - -import six - -from neutron_lib import exceptions as n_exc -from sqlalchemy.orm import properties - -from neutron_lib._i18n import _ -from oslo_db import exception as db_exc -from oslo_utils import excutils -from sqlalchemy.orm import exc - - -def get_and_validate_sort_keys(sorts, model): - """Extract sort keys from sorts and ensure they are valid for the model. - - :param sorts: A list of (key, direction) tuples. - :param model: A sqlalchemy ORM model class. - :returns: A list of the extracted sort keys. - :raises BadRequest: If a sort key attribute references another resource - and cannot be used in the sort. - """ - - sort_keys = [s[0] for s in sorts] - for sort_key in sort_keys: - try: - sort_key_attr = getattr(model, sort_key) - except AttributeError: - # Extension attributes don't support sorting. Because it - # existed in attr_info, it will be caught here. - msg = _("'%s' is an invalid attribute for sort key") % sort_key - raise n_exc.BadRequest(resource=model.__tablename__, msg=msg) - if isinstance(sort_key_attr.property, - properties.RelationshipProperty): - msg = _("Attribute '%(attr)s' references another resource and " - "cannot be used to sort '%(resource)s' resources" - ) % {'attr': sort_key, 'resource': model.__tablename__} - raise n_exc.BadRequest(resource=model.__tablename__, msg=msg) - - return sort_keys - - -def get_sort_dirs(sorts, page_reverse=False): - """Extract sort directions from sorts, possibly reversed. - - :param sorts: A list of (key, direction) tuples. - :param page_reverse: True if sort direction is reversed. - :returns: The list of extracted sort directions optionally reversed. - """ - if page_reverse: - return ['desc' if s[1] else 'asc' for s in sorts] - return ['asc' if s[1] else 'desc' for s in sorts] - - -def _is_nested_instance(exception, etypes): - """Check if exception or its inner excepts are an instance of etypes.""" - return (isinstance(exception, etypes) or - isinstance(exception, n_exc.MultipleExceptions) and - any(_is_nested_instance(i, etypes) - for i in exception.inner_exceptions)) - - -def is_retriable(exception): - """Determine if the said exception is retriable. - - :param exception: The exception to check. - :returns: True if 'exception' is retriable, otherwise False. - """ - if _is_nested_instance(exception, - (db_exc.DBDeadlock, exc.StaleDataError, - db_exc.DBConnectionError, - db_exc.DBDuplicateEntry, db_exc.RetryRequest)): - return True - # Look for savepoints mangled by deadlocks. See bug/1590298 for details. - return (_is_nested_instance(exception, db_exc.DBError) and - '1305' in str(exception)) - - -def reraise_as_retryrequest(function): - """Wrap the said function with a RetryRequest upon error. - - :param function: The function to wrap/decorate. - :returns: The 'function' wrapped in a try block that will reraise any - Exception's as a RetryRequest. - :raises RetryRequest: If the wrapped function raises retriable exception. - """ - @six.wraps(function) - def _wrapped(*args, **kwargs): - try: - return function(*args, **kwargs) - except Exception as e: - with excutils.save_and_reraise_exception() as ctx: - if is_retriable(e): - ctx.reraise = False - raise db_exc.RetryRequest(e) - return _wrapped diff --git a/neutron_lib/exceptions/__init__.py b/neutron_lib/exceptions/__init__.py deleted file mode 100644 index 7be8240..0000000 --- a/neutron_lib/exceptions/__init__.py +++ /dev/null @@ -1,517 +0,0 @@ -# Copyright 2011 VMware, Inc, 2015 A10 Networks, Inc -# 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. - -""" -Neutron base exception handling. -""" - -from oslo_utils import excutils -import six - -from neutron_lib._i18n import _ - - -class NeutronException(Exception): - """Base Neutron Exception. - - To correctly use this class, inherit from it and define - a 'message' property. That message will get printf'd - with the keyword arguments provided to the constructor. - """ - message = _("An unknown exception occurred.") - - def __init__(self, **kwargs): - try: - super(NeutronException, self).__init__(self.message % kwargs) - self.msg = self.message % kwargs - except Exception: - with excutils.save_and_reraise_exception() as ctxt: - if not self.use_fatal_exceptions(): - ctxt.reraise = False - # at least get the core message out if something happened - super(NeutronException, self).__init__(self.message) - - if six.PY2: - def __unicode__(self): - return unicode(self.msg) - - def __str__(self): - return self.msg - - def use_fatal_exceptions(self): - """Is the instance using fatal exceptions. - - :returns: Always returns False. - """ - return False - - -class BadRequest(NeutronException): - """An exception indicating a generic bad request for a said resource. - - A generic exception indicating a bad request for a specified resource. - - :param resource: The resource requested. - :param msg: A message indicating why the request is bad. - """ - message = _('Bad %(resource)s request: %(msg)s.') - - -class NotFound(NeutronException): - """A generic not found exception.""" - pass - - -class Conflict(NeutronException): - """A generic conflict exception.""" - pass - - -class NotAuthorized(NeutronException): - """A generic not authorized exception.""" - message = _("Not authorized.") - - -class ServiceUnavailable(NeutronException): - """A generic service unavailable exception.""" - message = _("The service is unavailable.") - - -class AdminRequired(NotAuthorized): - """A not authorized exception indicating an admin is required. - - A specialization of the NotAuthorized exception that indicates and admin - is required to carry out the operation or access a resource. - - :param reason: A message indicating additional details on why admin is - required for the operation access. - """ - message = _("User does not have admin privileges: %(reason)s.") - - -class ObjectNotFound(NotFound): - """A not found exception indicating an identifiable object isn't found. - - A specialization of the NotFound exception indicating an object with a said - ID doesn't exist. - - :param id: The ID of the (not found) object. - """ - message = _("Object %(id)s not found.") - - -class NetworkNotFound(NotFound): - """An exception indicating a network was not found. - - A specialization of the NotFound exception indicating a requested network - could not be found. - - :param net_id: The UUID of the (not found) network requested. - """ - message = _("Network %(net_id)s could not be found.") - - -class SubnetNotFound(NotFound): - """An exception for a requested subnet that's not found. - - A specialization of the NotFound exception indicating a requested subnet - could not be found. - - :param subnet_id: The UUID of the (not found) subnet that was requested. - """ - message = _("Subnet %(subnet_id)s could not be found.") - - -class PortNotFound(NotFound): - """An exception for a requested port that's not found. - - A specialization of the NotFound exception indicating a requested port - could not be found. - - :param port_id: The UUID of the (not found) port that was requested. - """ - message = _("Port %(port_id)s could not be found.") - - -class PortNotFoundOnNetwork(NotFound): - """An exception for a requested port on a network that's not found. - - A specialization of the NotFound exception that indicates a specified - port on a specified network doesn't exist. - - :param port_id: The UUID of the (not found) port that was requested. - :param net_id: The UUID of the network that was requested for the port. - """ - message = _("Port %(port_id)s could not be found " - "on network %(net_id)s.") - - -class DeviceNotFoundError(NotFound): - """An exception for a requested device that's not found. - - A specialization of the NotFound exception indicating a requested device - could not be found. - - :param device_name: The name of the (not found) device that was requested. - """ - message = _("Device '%(device_name)s' does not exist.") - - -class InUse(NeutronException): - """A generic exception indicating a resource is already in use.""" - message = _("The resource is in use.") - - -class NetworkInUse(InUse): - """An operational error indicating the network still has ports in use. - - A specialization of the InUse exception indicating a network operation was - requested, but failed because there are still ports in use on the said - network. - - :param net_id: The UUID of the network requested. - """ - message = _("Unable to complete operation on network %(net_id)s. " - "There are one or more ports still in use on the network.") - - -class SubnetInUse(InUse): - """An operational error indicating a subnet is still in use. - - A specialization of the InUse exception indicating an operation failed - on a subnet because the subnet is still in use. - - :param subnet_id: The UUID of the subnet requested. - :param reason: Details on why the operation failed. If None, a default - reason is used indicating one or more ports still have IP allocations - on the subnet. - """ - message = _("Unable to complete operation on subnet %(subnet_id)s: " - "%(reason)s.") - - def __init__(self, **kwargs): - if 'reason' not in kwargs: - kwargs['reason'] = _("One or more ports have an IP allocation " - "from this subnet") - super(SubnetInUse, self).__init__(**kwargs) - - -class SubnetPoolInUse(InUse): - """An operational error indicating a subnet pool is still in use. - - A specialization of the InUse exception indicating an operation failed - on a subnet pool because it's still in use. - - :param subnet_pool_id: The UUID of the subnet pool requested. - :param reason: Details on why the operation failed. If None a default - reason is used indicating two or more concurrent subnets are allocated. - """ - message = _("Unable to complete operation on subnet pool " - "%(subnet_pool_id)s. %(reason)s.") - - def __init__(self, **kwargs): - if 'reason' not in kwargs: - kwargs['reason'] = _("Two or more concurrent subnets allocated") - super(SubnetPoolInUse, self).__init__(**kwargs) - - -class PortInUse(InUse): - """An operational error indicating a requested port is already attached. - - A specialization of the InUse exception indicating an operation failed on - a port because it already has an attached device. - - :param port_id: The UUID of the port requested. - :param net_id: The UUID of the requested port's network. - :param device_id: The UUID of the device already attached to the port. - """ - message = _("Unable to complete operation on port %(port_id)s " - "for network %(net_id)s. Port already has an attached " - "device %(device_id)s.") - - -class ServicePortInUse(InUse): - """An error indicating a service port can't be deleted. - - A specialization of the InUse exception indicating a requested service - port can't be deleted via the APIs. - - :param port_id: The UUID of the port requested. - :param reason: Details on why the operation failed. - """ - message = _("Port %(port_id)s cannot be deleted directly via the " - "port API: %(reason)s.") - - -class PortBound(InUse): - """An operational error indicating a port is already bound. - - A specialization of the InUse exception indicating an operation can't - complete because the port is already bound. - - :param port_id: The UUID of the port requested. - :param vif_type: The VIF type associated with the bound port. - :param old_mac: The old MAC address of the port. - :param net_mac: The new MAC address of the port. - """ - message = _("Unable to complete operation on port %(port_id)s, " - "port is already bound, port type: %(vif_type)s, " - "old_mac %(old_mac)s, new_mac %(new_mac)s.") - - -class MacAddressInUse(InUse): - """An network operational error indicating a MAC address is already in use. - - A specialization of the InUse exception indicating an operation failed - on a network because a specified MAC address is already in use on that - network. - - :param net_id: The UUID of the network. - :param mac: The requested MAC address that's already in use. - """ - message = _("Unable to complete operation for network %(net_id)s. " - "The mac address %(mac)s is in use.") - - -class InvalidIpForNetwork(BadRequest): - """An exception indicating an invalid IP was specified for a network. - - A specialization of the BadRequest exception indicating a specified IP - address is invalid for a network. - - :param ip_address: The IP address that's invalid on the network. - """ - message = _("IP address %(ip_address)s is not a valid IP " - "for any of the subnets on the specified network.") - - -class InvalidIpForSubnet(BadRequest): - """An exception indicating an invalid IP was specified for a subnet. - - A specialization of the BadRequest exception indicating a specified IP - address is invalid for a subnet. - - :param ip_address: The IP address that's invalid on the subnet. - """ - message = _("IP address %(ip_address)s is not a valid IP " - "for the specified subnet.") - - -class IpAddressInUse(InUse): - """An network operational error indicating an IP address is already in use. - - A specialization of the InUse exception indicating an operation can't - complete because an IP address is in use. - - :param net_id: The UUID of the network. - :param ip_address: The IP address that's already in use on the network. - """ - message = _("Unable to complete operation for network %(net_id)s. " - "The IP address %(ip_address)s is in use.") - - -class VlanIdInUse(InUse): - """An exception indicating VLAN creation failed because it's already in use. - - A specialization of the InUse exception indicating network creation failed - because a specified VLAN is already in use on the physical network. - - :param vlan_id: The LVAN ID. - :param physical_network: The physical network. - """ - message = _("Unable to create the network. " - "The VLAN %(vlan_id)s on physical network " - "%(physical_network)s is in use.") - - -class TunnelIdInUse(InUse): - """A network creation failure due to tunnel ID already in use. - - A specialization of the InUse exception indicating network creation failed - because a said tunnel ID is already in use. - - :param tunnel_id: The ID of the tunnel that's already in use. - """ - message = _("Unable to create the network. " - "The tunnel ID %(tunnel_id)s is in use.") - - -class ResourceExhausted(ServiceUnavailable): - """A service unavailable error indicating a resource is exhausted.""" - pass - - -class NoNetworkAvailable(ResourceExhausted): - """A failure to create a network due to no tenant networks for allocation. - - A specialization of the ResourceExhausted exception indicating network - creation failed because no tenant network are available for allocation. - """ - message = _("Unable to create the network. " - "No tenant network is available for allocation.") - - -class SubnetMismatchForPort(BadRequest): - """A bad request error indicating a specified subnet isn't on a port. - - A specialization of the BadRequest exception indicating a subnet on a port - doesn't match a specified subnet. - - :param port_id: The UUID of the port. - :param subnet_id: The UUID of the requested subnet. - """ - message = _("Subnet on port %(port_id)s does not match " - "the requested subnet %(subnet_id)s.") - - -class Invalid(NeutronException): - """A generic base class for invalid errors.""" - def __init__(self, message=None): - self.message = message - super(Invalid, self).__init__() - - -class InvalidInput(BadRequest): - """A bad request due to invalid input. - - A specialization of the BadRequest error indicating bad input was - specified. - - :param error_message: Details on the operation that failed due to bad - input. - """ - message = _("Invalid input for operation: %(error_message)s.") - - -class IpAddressGenerationFailure(Conflict): - """A conflict error due to no more IP addresses on a said network. - - :param net_id: The UUID of the network that has no more IP addresses. - """ - message = _("No more IP addresses available on network %(net_id)s.") - - -class PreexistingDeviceFailure(NeutronException): - """A creation error due to an already existing device. - - An exception indication creation failed due to an already existing - device. - - :param dev_name: The device name that already exists. - """ - message = _("Creation failed. %(dev_name)s already exists.") - - -class OverQuota(Conflict): - """A error due to exceeding quota limits. - - A specialization of the Conflict exception indicating quota has been - exceeded. - - :param overs: The resources that have exceeded quota. - """ - message = _("Quota exceeded for resources: %(overs)s.") - - -class InvalidContentType(NeutronException): - """An error due to invalid content type. - - :param content_type: The invalid content type. - """ - message = _("Invalid content type %(content_type)s.") - - -class ExternalIpAddressExhausted(BadRequest): - """An error due to not finding IP addresses on an external network. - - A specialization of the BadRequest exception indicating no IP addresses - can be found on a network. - - :param net_id: The UUID of the network. - """ - message = _("Unable to find any IP address on external " - "network %(net_id)s.") - - -class TooManyExternalNetworks(NeutronException): - """An error due to more than one external networks existing.""" - message = _("More than one external network exists.") - - -class InvalidConfigurationOption(NeutronException): - """An error due to an invalid configuration option value. - - :param opt_name: The name of the configuration option that has an invalid - value. - :param opt_value: The value that's invalid for the configuration option. - """ - message = _("An invalid value was provided for %(opt_name)s: " - "%(opt_value)s.") - - -class NetworkTunnelRangeError(NeutronException): - """An error due to an invalid network tunnel range. - - An exception indicating an invalid network tunnel range was specified. - - :param tunnel_range: The invalid tunnel range. If specified in the - start:end' format, they will be converted automatically. - :param error: Additional details on why the range is invalid. - """ - message = _("Invalid network tunnel range: " - "'%(tunnel_range)s' - %(error)s.") - - def __init__(self, **kwargs): - # Convert tunnel_range tuple to 'start:end' format for display - if isinstance(kwargs['tunnel_range'], tuple): - kwargs['tunnel_range'] = "%d:%d" % kwargs['tunnel_range'] - super(NetworkTunnelRangeError, self).__init__(**kwargs) - - -class PolicyInitError(NeutronException): - """An error due to policy initialization failure. - - :param policy: The policy that failed to initialize. - :param reason: Details on why the policy failed to initialize. - """ - message = _("Failed to initialize policy %(policy)s because %(reason)s.") - - -class PolicyCheckError(NeutronException): - """An error due to a policy check failure. - - :param policy: The policy that failed to check. - :param reason: Additional details on the failure. - """ - message = _("Failed to check policy %(policy)s because %(reason)s.") - - -class MultipleExceptions(Exception): - """Container for multiple exceptions encountered. - - The API layer of Neutron will automatically unpack, translate, - filter, and combine the inner exceptions in any exception derived - from this class. - """ - - def __init__(self, exceptions, *args, **kwargs): - """Create a new instance wrapping the exceptions. - - :param exceptions: The inner exceptions this instance is composed of. - :param args: Passed onto parent constructor. - :param kwargs: Passed onto parent constructor. - """ - super(MultipleExceptions, self).__init__(*args, **kwargs) - self.inner_exceptions = exceptions diff --git a/neutron_lib/exceptions/address_scope.py b/neutron_lib/exceptions/address_scope.py deleted file mode 100644 index ecc2a62..0000000 --- a/neutron_lib/exceptions/address_scope.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class AddressScopeNotFound(exceptions.NotFound): - message = _("Address scope %(address_scope_id)s could not be found.") - - -class AddressScopeInUse(exceptions.InUse): - message = _("Unable to complete operation on " - "address scope %(address_scope_id)s. There are one or more " - "subnet pools in use on the address scope.") - - -class AddressScopeUpdateError(exceptions.BadRequest): - message = _("Unable to update address scope %(address_scope_id)s : " - "%(reason)s.") diff --git a/neutron_lib/exceptions/agent.py b/neutron_lib/exceptions/agent.py deleted file mode 100644 index f3d3cbb..0000000 --- a/neutron_lib/exceptions/agent.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class AgentNotFound(exceptions.NotFound): - message = _("Agent %(id)s could not be found.") - - -class AgentNotFoundByTypeHost(exceptions.NotFound): - message = _("Agent with agent_type=%(agent_type)s and host=%(host)s " - "could not be found.") - - -class MultipleAgentFoundByTypeHost(exceptions.Conflict): - message = _("Multiple agents with agent_type=%(agent_type)s and " - "host=%(host)s found.") diff --git a/neutron_lib/exceptions/dns.py b/neutron_lib/exceptions/dns.py deleted file mode 100644 index cdcfae4..0000000 --- a/neutron_lib/exceptions/dns.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class DNSDomainNotFound(exceptions.NotFound): - message = _("Domain %(dns_domain)s not found in the external DNS service") - - -class DuplicateRecordSet(exceptions.Conflict): - message = _("Name %(dns_name)s is duplicated in the external DNS service") - - -class ExternalDNSDriverNotFound(exceptions.NotFound): - message = _("External DNS driver %(driver)s could not be found.") - - -class InvalidPTRZoneConfiguration(exceptions.Conflict): - message = _("Value of %(parameter)s has to be multiple of %(number)s, " - "with maximum value of %(maximum)s and minimum value of " - "%(minimum)s") diff --git a/neutron_lib/exceptions/firewall_v1.py b/neutron_lib/exceptions/firewall_v1.py deleted file mode 100644 index d1e88f7..0000000 --- a/neutron_lib/exceptions/firewall_v1.py +++ /dev/null @@ -1,140 +0,0 @@ -# Copyright 2013 Big Switch Networks, Inc. -# 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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class FirewallNotFound(exceptions.NotFound): - message = _("Firewall %(firewall_id)s could not be found.") - - -class FirewallInUse(exceptions.InUse): - message = _("Firewall %(firewall_id)s is still active.") - - -class FirewallInPendingState(exceptions.Conflict): - message = _("Operation cannot be performed since associated firewall " - "%(firewall_id)s is in %(pending_state)s.") - - -class FirewallPolicyNotFound(exceptions.NotFound): - message = _("Firewall policy %(firewall_policy_id)s could not be found.") - - -class FirewallPolicyInUse(exceptions.InUse): - message = _("Firewall policy %(firewall_policy_id)s is being used.") - - -class FirewallPolicyConflict(exceptions.Conflict): - """FWaaS exception raised for firewall policy conflict - - Raised when user tries to use another project's unshared policy. - """ - message = _("Operation cannot be performed since firewall policy " - "%(firewall_policy_id)s is not shared and does not belong to " - "your project.") - - -class FirewallRuleSharingConflict(exceptions.Conflict): - """FWaaS exception raised for conflict with shared rules - - Raised if shared policy is created/updated with unshared rules. - """ - message = _("Operation cannot be performed since firewall policy " - "%(firewall_policy_id)s is shared but firewall rule " - "%(firewall_rule_id)s is not shared.") - - -class FirewallPolicySharingConflict(exceptions.Conflict): - """FWaaS exception raised for shared policies - - Raised if policy is shared without sharing its rules. - """ - message = _("Operation cannot be performed. Before sharing firewall " - "policy %(firewall_policy_id)s, share associated firewall " - "rule %(firewall_rule_id)s.") - - -class FirewallRuleNotFound(exceptions.NotFound): - message = _("Firewall rule %(firewall_rule_id)s could not be found.") - - -class FirewallRuleInUse(exceptions.InUse): - message = _("Firewall rule %(firewall_rule_id)s is being used.") - - -class FirewallRuleNotAssociatedWithPolicy(exceptions.InvalidInput): - message = _("Firewall rule %(firewall_rule_id)s is not associated " - "with firewall policy %(firewall_policy_id)s.") - - -class FirewallRuleInvalidProtocol(exceptions.InvalidInput): - message = _("Firewall rule protocol %(protocol)s is not supported. " - "Only protocol values %(values)s and their integer " - "representation (0 to 255) are supported.") - - -class FirewallRuleInvalidAction(exceptions.InvalidInput): - message = _("Firewall rule action %(action)s is not supported. " - "Only action values %(values)s are supported.") - - -class FirewallRuleInvalidICMPParameter(exceptions.InvalidInput): - message = _("%(param)s are not allowed when protocol " - "is set to ICMP.") - - -class FirewallRuleWithPortWithoutProtocolInvalid(exceptions.InvalidInput): - message = _("Source/destination port requires a protocol.") - - -class FirewallRuleInvalidPortValue(exceptions.InvalidInput): - message = _("Invalid value for port %(port)s.") - - -class FirewallRuleInfoMissing(exceptions.InvalidInput): - message = _("Missing rule info argument for insert/remove " - "rule operation.") - - -class FirewallIpAddressConflict(exceptions.InvalidInput): - message = _("Invalid input - IP addresses do not agree with IP Version.") - - -class FirewallInternalDriverError(exceptions.NeutronException): - """FWaaS exception for all driver errors - - On any failure or exception in the driver, driver should log it and - raise this exception to the agent. - """ - message = _("%(driver)s: Internal driver error.") - - -class FirewallRuleConflict(exceptions.Conflict): - """FWaaS rule conflict exception - - Occurs when admin policy tries to use another project's rule that is - not shared. - """ - message = _("Operation cannot be performed since firewall rule " - "%(firewall_rule_id)s is not shared and belongs to " - "another project %(project_id)s.") - - -class FirewallRouterInUse(exceptions.InUse): - message = _("Router(s) %(router_ids)s provided already associated with " - "other firewall(s).") diff --git a/neutron_lib/exceptions/firewall_v2.py b/neutron_lib/exceptions/firewall_v2.py deleted file mode 100644 index 4d77a98..0000000 --- a/neutron_lib/exceptions/firewall_v2.py +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright (c) 2016 Mirantis, Inc. -# -# 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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class FirewallGroupNotFound(exceptions.NotFound): - message = _("Firewall group %(firewall_id)s could not be found.") - - -class FirewallGroupInUse(exceptions.InUse): - message = _("Firewall group %(firewall_id)s is still active.") - - -class FirewallGroupInPendingState(exceptions.Conflict): - message = _("Operation cannot be performed since associated firewall " - "group %(firewall_id)s is in %(pending_state)s.") - - -class FirewallGroupPortInvalid(exceptions.Conflict): - message = _("Port %(port_id)s of firewall group is invalid.") - - -class FirewallGroupPortInvalidProject(exceptions.Conflict): - message = _("Operation cannot be performed as port %(port_id)s " - "is in an invalid project %(project_id)s.") - - -class FirewallGroupPortInUse(exceptions.InUse): - message = _("Port(s) %(port_ids)s provided already associated with " - "other firewall group(s).") - - -class FirewallPolicyNotFound(exceptions.NotFound): - message = _("Firewall policy %(firewall_policy_id)s could not be found.") - - -class FirewallPolicyInUse(exceptions.InUse): - message = _("Firewall policy %(firewall_policy_id)s is being used.") - - -class FirewallPolicyConflict(exceptions.NotFound): - """FWaaS exception raised for firewall policy conflict - - Raised when user tries to use another project's unshared policy. - """ - message = _("Operation cannot be performed since firewall policy " - "%(firewall_policy_id)s for your project could not be found. " - "Please confirm if the firewall policy exists and is shared.") - - -class FirewallRuleSharingConflict(exceptions.NotFound): - """FWaaS exception for sharing policies - - Raised when shared policy uses unshared rules. - """ - message = _("Operation cannot be performed since firewall policy " - "%(firewall_policy_id)s could not find the firewall rule " - "%(firewall_rule_id)s. Please confirm if the firewall rule" - "exists and is shared.") - - -class FirewallPolicySharingConflict(exceptions.Conflict): - """FWaaS exception raised for sharing policies - - Raised if policy is 'shared' but its associated rules are not. - """ - message = _("Operation cannot be performed. Before sharing firewall " - "policy %(firewall_policy_id)s, share associated firewall " - "rule %(firewall_rule_id)s.") - - -class FirewallRuleNotFound(exceptions.NotFound): - message = _("Firewall rule %(firewall_rule_id)s could not be found.") - - -class FirewallRuleInUse(exceptions.InUse): - message = _("Firewall rule %(firewall_rule_id)s is being used.") - - -class FirewallRuleNotAssociatedWithPolicy(exceptions.InvalidInput): - message = _("Firewall rule %(firewall_rule_id)s is not associated " - "with firewall policy %(firewall_policy_id)s.") - - -class FirewallRuleInvalidProtocol(exceptions.InvalidInput): - message = _("Protocol %(protocol)s is not supported. " - "Only protocol values %(values)s and their integer " - "representation (0 to 255) are supported.") - - -class FirewallRuleInvalidAction(exceptions.InvalidInput): - message = _("Action %(action)s is not supported. " - "Only action values %(values)s are supported.") - - -class FirewallRuleInvalidICMPParameter(exceptions.InvalidInput): - message = _("%(param)s are not allowed when protocol " - "is set to ICMP.") - - -class FirewallRuleWithPortWithoutProtocolInvalid(exceptions.InvalidInput): - message = _("Source/destination port requires a protocol.") - - -class FirewallRuleInvalidPortValue(exceptions.InvalidInput): - message = _("Invalid value for port %(port)s.") - - -class FirewallRuleInfoMissing(exceptions.InvalidInput): - message = _("Missing rule info argument for insert/remove " - "rule operation.") - - -class FirewallIpAddressConflict(exceptions.InvalidInput): - message = _("Invalid input - IP addresses do not agree with IP Version.") - - -class FirewallInternalDriverError(exceptions.NeutronException): - """FWaaS exception for all driver errors - - On any failure or exception in the driver, driver should log it and - raise this exception to the agent - """ - - message = _("%(driver)s: Internal driver error.") - - -class FirewallRuleConflict(exceptions.Conflict): - """FWaaS rule conflict exception - - Occurs when admin policy tries to use another project's rule that is - not shared. - """ - message = _("Operation cannot be performed since firewall rule " - "%(firewall_rule_id)s is not shared and belongs to " - "another project %(project_id)s.") - - -class FirewallRuleAlreadyAssociated(exceptions.Conflict): - """FWaaS exception for an already associated rule - - Occurs when there is an attempt to assign a rule to a policy that - the rule is already associated with. - """ - message = _("Operation cannot be performed since firewall rule " - "%(firewall_rule_id)s is already associated with firewall" - "policy %(firewall_policy_id)s.") - - -class FirewallGroupCannotRemoveDefault(exceptions.InUse): - message = _("Deleting default firewall group not allowed.") - - -class FirewallGroupCannotUpdateDefault(exceptions.InUse): - message = _("Updating default firewall group not allowed.") - - -class FirewallGroupDefaultAlreadyExists(exceptions.InUse): - """Default firewall group conflict exception - - Occurs when a user creates firewall group named 'default'. - """ - message = _("Default firewall group already exists. 'default' is the " - "reserved name for firewall group.") diff --git a/neutron_lib/exceptions/l3.py b/neutron_lib/exceptions/l3.py deleted file mode 100644 index 55f3a43..0000000 --- a/neutron_lib/exceptions/l3.py +++ /dev/null @@ -1,73 +0,0 @@ -# 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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -# L3 Exceptions -class RouterNotFound(exceptions.NotFound): - message = _("Router %(router_id)s could not be found") - - -class RouterInUse(exceptions.InUse): - message = _("Router %(router_id)s %(reason)s") - - def __init__(self, **kwargs): - if 'reason' not in kwargs: - kwargs['reason'] = "still has ports" - super(RouterInUse, self).__init__(**kwargs) - - -class RouterInterfaceNotFound(exceptions.NotFound): - message = _("Router %(router_id)s does not have " - "an interface with id %(port_id)s") - - -class RouterInterfaceNotFoundForSubnet(exceptions.NotFound): - message = _("Router %(router_id)s has no interface " - "on subnet %(subnet_id)s") - - -class RouterInterfaceInUseByFloatingIP(exceptions.InUse): - message = _("Router interface for subnet %(subnet_id)s on router " - "%(router_id)s cannot be deleted, as it is required " - "by one or more floating IPs.") - - -class FloatingIPNotFound(exceptions.NotFound): - message = _("Floating IP %(floatingip_id)s could not be found") - - -class ExternalGatewayForFloatingIPNotFound(exceptions.NotFound): - message = _("External network %(external_network_id)s is not reachable " - "from subnet %(subnet_id)s. Therefore, cannot associate " - "Port %(port_id)s with a Floating IP.") - - -class FloatingIPPortAlreadyAssociated(exceptions.InUse): - message = _("Cannot associate floating IP %(floating_ip_address)s " - "(%(fip_id)s) with port %(port_id)s " - "using fixed IP %(fixed_ip)s, as that fixed IP already " - "has a floating IP on external network %(net_id)s.") - - -class RouterExternalGatewayInUseByFloatingIp(exceptions.InUse): - message = _("Gateway cannot be updated for router %(router_id)s, since a " - "gateway to external network %(net_id)s is required by one or " - "more floating IPs.") - - -class RouterInterfaceAttachmentConflict(exceptions.Conflict): - message = _("Error %(reason)s while attempting the operation.") diff --git a/neutron_lib/exceptions/port_security.py b/neutron_lib/exceptions/port_security.py deleted file mode 100644 index 5ced5ae..0000000 --- a/neutron_lib/exceptions/port_security.py +++ /dev/null @@ -1,26 +0,0 @@ -# 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 neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class PortSecurityPortHasSecurityGroup(exceptions.InUse): - message = _("Port has security group associated. Cannot disable port " - "security or IP address until security group is removed.") - - -class PortSecurityAndIPRequiredForSecurityGroups(exceptions.InvalidInput): - message = _("Port security must be enabled and port must have an IP " - "address in order to use security groups.") diff --git a/neutron_lib/fixture.py b/neutron_lib/fixture.py deleted file mode 100644 index 5929643..0000000 --- a/neutron_lib/fixture.py +++ /dev/null @@ -1,156 +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. - -import copy - -import fixtures -import mock - -from neutron_lib.api import attributes -from neutron_lib.api import definitions -from neutron_lib.callbacks import manager -from neutron_lib.callbacks import registry -from neutron_lib.db import api as db_api -from neutron_lib.db import model_base -from neutron_lib.plugins import directory - - -class PluginDirectoryFixture(fixtures.Fixture): - - def __init__(self, plugin_directory=None): - super(PluginDirectoryFixture, self).__init__() - self.plugin_directory = ( - plugin_directory or directory._PluginDirectory()) - - def _setUp(self): - self._orig_directory = directory._PLUGIN_DIRECTORY - directory._PLUGIN_DIRECTORY = self.plugin_directory - self.addCleanup(self._restore) - - def _restore(self): - directory._PLUGIN_DIRECTORY = self._orig_directory - - -class CallbackRegistryFixture(fixtures.Fixture): - """Callback registry fixture. - - This class is intended to be used as a fixture within unit tests and - therefore consumers must register it using useFixture() within their - unit test class. The implementation optionally allows consumers to pass - in the CallbacksManager manager to use for your tests. - """ - - def __init__(self, callback_manager=None): - """Creates a new RegistryFixture. - - :param callback_manager: If specified, the return value to use for - _get_callback_manager(). Otherwise a new instance of CallbacksManager - is used. - """ - super(CallbackRegistryFixture, self).__init__() - self.callback_manager = callback_manager or manager.CallbacksManager() - self.patcher = None - - def _setUp(self): - self._orig_manager = registry._get_callback_manager() - self.patcher = mock.patch.object( - registry, '_get_callback_manager', - return_value=self.callback_manager) - self.patcher.start() - self.addCleanup(self._restore) - - def _restore(self): - registry._CALLBACK_MANAGER = self._orig_manager - self.patcher.stop() - - -class SqlFixture(fixtures.Fixture): - - # flag to indicate that the models have been loaded - _TABLES_ESTABLISHED = False - - def _setUp(self): - # Register all data models - engine = db_api.get_context_manager().writer.get_engine() - if not SqlFixture._TABLES_ESTABLISHED: - model_base.BASEV2.metadata.create_all(engine) - SqlFixture._TABLES_ESTABLISHED = True - - def clear_tables(): - with engine.begin() as conn: - for table in reversed( - model_base.BASEV2.metadata.sorted_tables): - conn.execute(table.delete()) - - self.addCleanup(clear_tables) - - -class APIDefinitionFixture(fixtures.Fixture): - """Test fixture for testing neutron-lib API definitions. - - Extension API definition RESOURCE_ATTRIBUTE_MAP dicts get updated as - part of standard extension processing/handling. While this behavior is - fine for service runtime, it can impact testing scenarios whereby test1 - updates the attribute map (globally) and test2 doesn't expect the - test1 updates. - - This fixture saves and restores 1 or more neutron-lib API definitions - attribute maps. It should be used anywhere multiple tests can be run - that might update an extension attribute map. - - In addition the fixture backs up and restores the global attribute - RESOURCES base on the boolean value of its backup_global_resources - attribute. - """ - - def __init__(self, *api_definitions): - """Create a new instance. - - Consumers can also control if the fixture should handle the global - attribute RESOURCE map using the backup_global_resources of the - fixture instance. If True the fixture will also handle - neutron_lib.api.attributes.RESOURCES. - - :param api_definitions: Zero or more API definitions the fixture - should handle. If no api_definitions are passed, the default is - to handle all neutron_lib API definitions as well as the global - RESOURCES attribute map. - """ - self.definitions = api_definitions or definitions._ALL_API_DEFINITIONS - self._orig_attr_maps = {} - self._orig_resources = {} - self.backup_global_resources = True - - def _setUp(self): - for api_def in self.definitions: - self._orig_attr_maps[api_def.ALIAS] = ( - api_def, {k: copy.deepcopy(v) - for k, v in api_def.RESOURCE_ATTRIBUTE_MAP.items()}) - if self.backup_global_resources: - for resource, attrs in attributes.RESOURCES.items(): - self._orig_resources[resource] = copy.deepcopy(attrs) - self.addCleanup(self._restore) - - def _restore(self): - # clear + repopulate so consumer refs don't change - for alias, def_and_map in self._orig_attr_maps.items(): - api_def, attr_map = def_and_map[0], def_and_map[1] - api_def.RESOURCE_ATTRIBUTE_MAP.clear() - api_def.RESOURCE_ATTRIBUTE_MAP.update(attr_map) - if self.backup_global_resources: - attributes.RESOURCES.clear() - attributes.RESOURCES.update(self._orig_resources) - - @classmethod - def all_api_definitions_fixture(cls): - """Return a fixture that handles all neutron-lib api-defs.""" - return APIDefinitionFixture(*tuple(definitions._ALL_API_DEFINITIONS)) diff --git a/neutron_lib/hacking/__init__.py b/neutron_lib/hacking/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/hacking/checks.py b/neutron_lib/hacking/checks.py deleted file mode 100644 index e5af5ce..0000000 --- a/neutron_lib/hacking/checks.py +++ /dev/null @@ -1,261 +0,0 @@ -# Copyright (c) 2014 OpenStack Foundation. -# -# 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. - -import re - -from neutron_lib.hacking import translation_checks - -# Guidelines for writing new hacking checks -# -# - Use only for Neutron specific tests. OpenStack general tests -# should be submitted to the common 'hacking' module. -# - Pick numbers in the range N5xx. Find the current test with -# the highest allocated number and then pick the next value. -# - Keep the test method code in the source file ordered based -# on the N5xx value. -# - List the new rule in the top level HACKING.rst file -# - Add test cases for each new rule to -# neutron_lib/tests/unit/hacking/test_checks.py - -mutable_default_args = re.compile(r"^\s*def .+\((.+=\{\}|.+=\[\])") - -namespace_imports_dot = re.compile(r"import[\s]+([\w]+)[.][^\s]+") -namespace_imports_from_dot = re.compile(r"from[\s]+([\w]+)[.]") -namespace_imports_from_root = re.compile(r"from[\s]+([\w]+)[\s]+import[\s]+") -contextlib_nested = re.compile(r"^\s*with (contextlib\.)?nested\(") - -assert_equal_none_re = re.compile( - r"assertEqual\(.*?,\s+None\)(( |\t)*#.*)?$|assertEqual\(None,") -assert_is_none_re = re.compile( - r"assertIs(Not)?\(.*,\s+None\)(( |\t)*#.*)?$|assertIs(Not)?\(None,") - - -def use_jsonutils(logical_line, filename): - """N521 - jsonutils must be used instead of json. - - :param logical_line: The logical line to check. - :param filename: The file name where the logical line exists. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - msg = "N521: jsonutils.%(fun)s must be used instead of json.%(fun)s" - - # Some files in the tree are not meant to be run from inside Neutron - # itself, so we should not complain about them not using jsonutils - json_check_skipped_patterns = [ - "neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/etc/xapi.d/" - "plugins/netwrap", - ] - - for pattern in json_check_skipped_patterns: - if pattern in filename: - return - - if "json." in logical_line: - json_funcs = ['dumps(', 'dump(', 'loads(', 'load('] - for f in json_funcs: - pos = logical_line.find('json.%s' % f) - if pos != -1: - yield (pos, msg % {'fun': f[:-1]}) - - -def _check_imports(regex, submatch, logical_line): - m = re.match(regex, logical_line) - if m and m.group(1) == submatch: - return True - - -def _check_namespace_imports(failure_code, namespace, new_ns, logical_line, - message_override=None): - if message_override is not None: - msg_o = "%s: %s" % (failure_code, message_override) - else: - msg_o = None - - if _check_imports(namespace_imports_from_dot, namespace, logical_line): - msg = ("%s: '%s' must be used instead of '%s'.") % ( - failure_code, - logical_line.replace('%s.' % namespace, new_ns), - logical_line) - return (0, msg_o or msg) - elif _check_imports(namespace_imports_from_root, namespace, logical_line): - msg = ("%s: '%s' must be used instead of '%s'.") % ( - failure_code, - logical_line.replace( - 'from %s import ' % namespace, 'import %s' % new_ns), - logical_line) - return (0, msg_o or msg) - elif _check_imports(namespace_imports_dot, namespace, logical_line): - msg = ("%s: '%s' must be used instead of '%s'.") % ( - failure_code, - logical_line.replace('import', 'from').replace('.', ' import '), - logical_line) - return (0, msg_o or msg) - - -def check_no_contextlib_nested(logical_line, filename): - """N524 - Use of contextlib.nested is deprecated. - - :param logical_line: The logical line to check. - :param filename: The file name where the logical line exists. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - msg = ("N524: contextlib.nested is deprecated. With Python 2.7 and later " - "the with-statement supports multiple nested objects. See https://" - "docs.python.org/2/library/contextlib.html#contextlib.nested for " - "more information.") - - if contextlib_nested.match(logical_line): - yield(0, msg) - - -def check_python3_xrange(logical_line): - """N525 - Do not use xrange. - - :param logical_line: The logical line to check. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - if re.search(r"\bxrange\s*\(", logical_line): - yield(0, "N525: Do not use xrange. Use range, or six.moves.range for " - "large loops.") - - -def check_no_basestring(logical_line): - """N526 - basestring is not Python3-compatible. - - :param logical_line: The logical line to check. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - if re.search(r"\bbasestring\b", logical_line): - msg = ("N526: basestring is not Python3-compatible, use " - "six.string_types instead.") - yield(0, msg) - - -def check_python3_no_iteritems(logical_line): - """N527 - Use dict.items() instead of dict.iteritems(). - - :param logical_line: The logical line to check. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - if re.search(r".*\.iteritems\(\)", logical_line): - msg = ("N527: Use dict.items() instead of dict.iteritems() to be " - "compatible with both Python 2 and Python 3. In Python 2, " - "dict.items() may be inefficient for very large dictionaries. " - "If you can prove that you need the optimization of an " - "iterator for Python 2, then you can use six.iteritems(dict).") - yield(0, msg) - - -def no_mutable_default_args(logical_line): - """N529 - Method's default argument shouldn't be mutable. - - :param logical_line: The logical line to check. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - msg = "N529: Method's default argument shouldn't be mutable!" - if mutable_default_args.match(logical_line): - yield (0, msg) - - -# Chances are that most projects will need to put an ignore on this rule -# until they can fully migrate to the lib. - -def check_neutron_namespace_imports(logical_line): - """N530 - Direct neutron imports not allowed. - - :param logical_line: The logical line to check. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - x = _check_namespace_imports( - 'N530', 'neutron', 'neutron_lib.', logical_line, - message_override="direct neutron imports not allowed") - if x is not None: - yield x - - -def check_no_eventlet_imports(logical_line): - """N535 - Usage of Python eventlet module not allowed. - - :param logical_line: The logical line to check. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - if re.match(r'(import|from)\s+[(]?eventlet', logical_line): - msg = 'N535: Usage of Python eventlet module not allowed' - yield logical_line.index('eventlet'), msg - - -def assert_equal_none(logical_line): - """N536 - Use assertIsNone.""" - if assert_equal_none_re.search(logical_line): - msg = ("N536: Use assertIsNone rather than assertEqual " - "to check for None values") - yield logical_line.index('assert'), msg - - if assert_is_none_re.search(logical_line): - msg = ("N536: Use assertIsNone or assertIsNotNone rather than " - "assertIs or assertIsNone to check for None values.") - yield logical_line.index('assert'), msg - - -def factory(register): - """Hacking check factory for neutron-lib adopter compliant checks. - - Hacking check factory for use with tox.ini. This factory registers all - neutron-lib adopter checks consumers should seek to comply with. - - :param register: The function to register the check functions with. - :returns: None. - """ - register(use_jsonutils) - register(check_no_contextlib_nested) - register(check_python3_xrange) - register(check_no_basestring) - register(check_python3_no_iteritems) - register(no_mutable_default_args) - register(check_neutron_namespace_imports) - register(translation_checks.no_translate_logs) - register(translation_checks.check_log_warn_deprecated) - register(translation_checks.check_raised_localized_exceptions) - register(assert_equal_none) - - -def _neutron_lib_factory(register): - """Hacking check factory for neutron-lib internal project checks. - - Hacking check factory for use with tox.ini. This factory registers all - checks that are run with the neutron-lib project itself. - - :param register: The function to register the check functions with. - :returns: None. - """ - factory(register) - - # neutron-lib project specific checks below - register(check_no_eventlet_imports) diff --git a/neutron_lib/hacking/translation_checks.py b/neutron_lib/hacking/translation_checks.py deleted file mode 100644 index b3d0330..0000000 --- a/neutron_lib/hacking/translation_checks.py +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright (c) 2014 OpenStack Foundation. -# -# 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. - -import re - - -_all_log_levels = {'critical', 'error', 'exception', 'info', - 'warning', 'debug'} -_all_hints = {'_LC', '_LE', '_LI', '_', '_LW'} - - -_log_warn = re.compile( - r"(.)*LOG\.(warn)\(\s*('|\")") - - -_log_translation_hint = re.compile( - r".*LOG\.(%(levels)s)\(\s*(%(hints)s)\(" % { - 'levels': '|'.join(_all_log_levels), - 'hints': '|'.join(_all_hints), - }) - - -def _translation_checks_not_enforced(filename): - # Do not do these validations on tests - return any(pat in filename for pat in ["/tests/", "rally-jobs/plugins/"]) - - -def check_log_warn_deprecated(logical_line, filename): - """N532 - Use LOG.warning due to compatibility with py3. - - :param logical_line: The logical line to check. - :param filename: The file name where the logical line exists. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - msg = "N532: Use LOG.warning due to compatibility with py3" - if _log_warn.match(logical_line): - yield (0, msg) - - -def check_raised_localized_exceptions(logical_line, filename): - """N534 - Untranslated exception message. - - :param logical_line: The logical line to check. - :param filename: The file name where the logical line exists. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - if _translation_checks_not_enforced(filename): - return - - logical_line = logical_line.strip() - raised_search = re.compile( - r"raise (?:\w*)\((.*)\)").match(logical_line) - if raised_search: - exception_msg = raised_search.groups()[0] - if exception_msg.startswith("\"") or exception_msg.startswith("\'"): - msg = "N534: Untranslated exception message." - yield (logical_line.index(exception_msg), msg) - - -def no_translate_logs(logical_line, filename): - """N537 - Don't translate logs. - - Check for 'LOG.*(_(' and 'LOG.*(_Lx(' - - Translators don't provide translations for log messages, and operators - asked not to translate them. - - * This check assumes that 'LOG' is a logger. - - :param logical_line: The logical line to check. - :param filename: The file name where the logical line exists. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - if _translation_checks_not_enforced(filename): - return - - msg = "N537: Log messages should not be translated!" - match = _log_translation_hint.match(logical_line) - if match: - yield (logical_line.index(match.group()), msg) diff --git a/neutron_lib/legacy/README.rst b/neutron_lib/legacy/README.rst deleted file mode 100644 index 90230b4..0000000 --- a/neutron_lib/legacy/README.rst +++ /dev/null @@ -1,7 +0,0 @@ -=========================== -neutron-lib legacy routines -=========================== - -This is a special namespace with lower deprecation policy standards, -and specific rules for its use. Please refer to the 'Legacy Modules' -section of this library's 'conventions' document for more information. diff --git a/neutron_lib/legacy/__init__.py b/neutron_lib/legacy/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/objects/__init__.py b/neutron_lib/objects/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/objects/exceptions.py b/neutron_lib/objects/exceptions.py deleted file mode 100644 index 5f17c3d..0000000 --- a/neutron_lib/objects/exceptions.py +++ /dev/null @@ -1,62 +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 oslo_utils import reflection - -from neutron_lib._i18n import _ -from neutron_lib import exceptions - - -class NeutronObjectUpdateForbidden(exceptions.NeutronException): - message = _("Unable to update the following object fields: %(fields)s") - - -class NeutronDbObjectDuplicateEntry(exceptions.Conflict): - message = _("Failed to create a duplicate %(object_type)s: " - "for attribute(s) %(attributes)s with value(s) %(values)s") - - def __init__(self, object_class, db_exception): - super(NeutronDbObjectDuplicateEntry, self).__init__( - object_type=reflection.get_class_name(object_class, - fully_qualified=False), - attributes=db_exception.columns, - values=db_exception.value) - - -class NeutronDbObjectNotFoundByModel(exceptions.NotFound): - message = _("NeutronDbObject not found by model %(model)s.") - - -class NeutronPrimaryKeyMissing(exceptions.BadRequest): - message = _("For class %(object_type)s missing primary keys: " - "%(missing_keys)s") - - def __init__(self, object_class, missing_keys): - super(NeutronPrimaryKeyMissing, self).__init__( - object_type=reflection.get_class_name(object_class, - fully_qualified=False), - missing_keys=missing_keys - ) - - -class NeutronRangeConstrainedIntegerInvalidLimit(exceptions.NeutronException): - message = _("Incorrect range limits specified: " - "start = %(start)s, end = %(end)s") - - -class NeutronSyntheticFieldMultipleForeignKeys(exceptions.NeutronException): - message = _("Synthetic field %(field)s shouldn't have more than one " - "foreign key") - - -class NeutronSyntheticFieldsForeignKeysNotFound(exceptions.NeutronException): - message = _("%(child)s does not define a foreign key for %(parent)s") diff --git a/neutron_lib/plugins/__init__.py b/neutron_lib/plugins/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/plugins/constants.py b/neutron_lib/plugins/constants.py deleted file mode 100644 index 264b5ce..0000000 --- a/neutron_lib/plugins/constants.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -# Well-known service type constants: -LOADBALANCER = "LOADBALANCER" -LOADBALANCERV2 = "LOADBALANCERV2" -FIREWALL = "FIREWALL" -VPN = "VPN" -METERING = "METERING" -FLAVORS = "FLAVORS" -QOS = "QOS" -CORE = 'CORE' -L3 = 'L3_ROUTER_NAT' diff --git a/neutron_lib/plugins/directory.py b/neutron_lib/plugins/directory.py deleted file mode 100644 index 498556c..0000000 --- a/neutron_lib/plugins/directory.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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. - -import weakref - -from oslo_concurrency import lockutils - -from neutron_lib import constants - - -_synchronized = lockutils.synchronized_with_prefix("neutron-") - - -class _PluginDirectory(object): - """A directory of activated plugins in a Neutron Deployment. - - The directory is bootstrapped by a Neutron Manager running in - the context of a Neutron Server process. - """ - - def __init__(self): - self._plugins = {} - - def add_plugin(self, alias, plugin): - """Add a plugin of type 'alias'.""" - self._plugins[alias] = plugin - - def get_plugin(self, alias): - """Get a plugin for a given alias or None if not present.""" - p = self._plugins.get(alias) - return weakref.proxy(p) if p else None - - @property - def plugins(self): - """The mapping alias -> weak reference to the plugin.""" - return dict((x, weakref.proxy(y)) - for x, y in self._plugins.items()) - - @property - def unique_plugins(self): - """A sequence of the unique plugins activated in the environments.""" - return tuple(weakref.proxy(x) for x in set(self._plugins.values())) - - @property - def is_loaded(self): - """True if the directory is non empty.""" - return len(self._plugins) > 0 - - -# Create a singleton plugins directory for the Neutron server instance. -# Accessing these methods before a Neutron Manager has had the chance -# to load the environment may result in callers handling an empty directory. -_PLUGIN_DIRECTORY = None - - -@_synchronized("plugin-directory") -def _create_plugin_directory(): - global _PLUGIN_DIRECTORY - if _PLUGIN_DIRECTORY is None: - _PLUGIN_DIRECTORY = _PluginDirectory() - return _PLUGIN_DIRECTORY - - -def _get_plugin_directory(): - if _PLUGIN_DIRECTORY is None: - return _create_plugin_directory() - return _PLUGIN_DIRECTORY - - -def add_plugin(alias, plugin): - _get_plugin_directory().add_plugin(alias, plugin) - - -def get_plugin(alias=constants.CORE): - return _get_plugin_directory().get_plugin(alias) - - -def get_plugins(): - return _get_plugin_directory().plugins - - -def get_unique_plugins(): - return _get_plugin_directory().unique_plugins - - -def is_loaded(): - return _get_plugin_directory().is_loaded diff --git a/neutron_lib/plugins/ml2/__init__.py b/neutron_lib/plugins/ml2/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/plugins/ml2/api.py b/neutron_lib/plugins/ml2/api.py deleted file mode 100644 index f9b40f2..0000000 --- a/neutron_lib/plugins/ml2/api.py +++ /dev/null @@ -1,1164 +0,0 @@ -# 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. - -import abc - -import six - - -# The following keys are used in the segment dictionaries passed via -# the driver API. -ID = 'id' -NETWORK_TYPE = 'network_type' -PHYSICAL_NETWORK = 'physical_network' -SEGMENTATION_ID = 'segmentation_id' -MTU = 'mtu' -NETWORK_ID = 'network_id' - -# The following keys are used in the binding level dictionaries -# available via the binding_levels and original_binding_levels -# PortContext properties. -BOUND_DRIVER = 'bound_driver' -BOUND_SEGMENT = 'bound_segment' - - -@six.add_metaclass(abc.ABCMeta) -class MechanismDriver(object): - """Define stable abstract interface for ML2 mechanism drivers. - - A mechanism driver is called on the creation, update, and deletion - of networks and ports. For every event, there are two methods that - get called - one within the database transaction (method suffix of - _precommit), one right afterwards (method suffix of _postcommit). - - Exceptions raised by methods called inside the transaction can - rollback, but should not make any blocking calls (for example, - REST requests to an outside controller). Methods called after - transaction commits can make blocking external calls, though these - will block the entire process. Exceptions raised in calls after - the transaction commits may cause the associated resource to be - deleted. - - Because rollback outside of the transaction is not done in the - update network/port case, all data validation must be done within - methods that are part of the database transaction. - """ - - @abc.abstractmethod - def initialize(self): - """Perform driver initialization. - - Called after all drivers have been loaded and the database has - been initialized. No abstract methods defined below will be - called prior to this method being called. - """ - pass - - def create_network_precommit(self, context): - """Allocate resources for a new network. - - :param context: NetworkContext instance describing the new - network. - - Create a new network, allocating resources as necessary in the - database. Called inside transaction context on session. Call - cannot block. Raising an exception will result in a rollback - of the current transaction. - """ - pass - - def create_network_postcommit(self, context): - """Create a network. - - :param context: NetworkContext instance describing the new - network. - - Called after the transaction commits. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Raising an exception will - cause the deletion of the resource. - """ - pass - - def update_network_precommit(self, context): - """Update resources of a network. - - :param context: NetworkContext instance describing the new - state of the network, as well as the original state prior - to the update_network call. - - Update values of a network, updating the associated resources - in the database. Called inside transaction context on session. - Raising an exception will result in rollback of the - transaction. - - update_network_precommit is called for all changes to the - network state. It is up to the mechanism driver to ignore - state or state changes that it does not know or care about. - """ - pass - - def update_network_postcommit(self, context): - """Update a network. - - :param context: NetworkContext instance describing the new - state of the network, as well as the original state prior - to the update_network call. - - Called after the transaction commits. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Raising an exception will - cause the deletion of the resource. - - update_network_postcommit is called for all changes to the - network state. It is up to the mechanism driver to ignore - state or state changes that it does not know or care about. - """ - pass - - def delete_network_precommit(self, context): - """Delete resources for a network. - - :param context: NetworkContext instance describing the current - state of the network, prior to the call to delete it. - - Delete network resources previously allocated by this - mechanism driver for a network. Called inside transaction - context on session. Runtime errors are not expected, but - raising an exception will result in rollback of the - transaction. - """ - pass - - def delete_network_postcommit(self, context): - """Delete a network. - - :param context: NetworkContext instance describing the current - state of the network, prior to the call to delete it. - - Called after the transaction commits. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Runtime errors are not - expected, and will not prevent the resource from being - deleted. - """ - pass - - def create_subnet_precommit(self, context): - """Allocate resources for a new subnet. - - :param context: SubnetContext instance describing the new - subnet. - - Create a new subnet, allocating resources as necessary in the - database. Called inside transaction context on session. Call - cannot block. Raising an exception will result in a rollback - of the current transaction. - """ - pass - - def create_subnet_postcommit(self, context): - """Create a subnet. - - :param context: SubnetContext instance describing the new - subnet. - - Called after the transaction commits. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Raising an exception will - cause the deletion of the resource. - """ - pass - - def update_subnet_precommit(self, context): - """Update resources of a subnet. - - :param context: SubnetContext instance describing the new - state of the subnet, as well as the original state prior - to the update_subnet call. - - Update values of a subnet, updating the associated resources - in the database. Called inside transaction context on session. - Raising an exception will result in rollback of the - transaction. - - update_subnet_precommit is called for all changes to the - subnet state. It is up to the mechanism driver to ignore - state or state changes that it does not know or care about. - """ - pass - - def update_subnet_postcommit(self, context): - """Update a subnet. - - :param context: SubnetContext instance describing the new - state of the subnet, as well as the original state prior - to the update_subnet call. - - Called after the transaction commits. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Raising an exception will - cause the deletion of the resource. - - update_subnet_postcommit is called for all changes to the - subnet state. It is up to the mechanism driver to ignore - state or state changes that it does not know or care about. - """ - pass - - def delete_subnet_precommit(self, context): - """Delete resources for a subnet. - - :param context: SubnetContext instance describing the current - state of the subnet, prior to the call to delete it. - - Delete subnet resources previously allocated by this - mechanism driver for a subnet. Called inside transaction - context on session. Runtime errors are not expected, but - raising an exception will result in rollback of the - transaction. - """ - pass - - def delete_subnet_postcommit(self, context): - """Delete a subnet. - - :param context: SubnetContext instance describing the current - state of the subnet, prior to the call to delete it. - - Called after the transaction commits. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Runtime errors are not - expected, and will not prevent the resource from being - deleted. - """ - pass - - def create_port_precommit(self, context): - """Allocate resources for a new port. - - :param context: PortContext instance describing the port. - - Create a new port, allocating resources as necessary in the - database. Called inside transaction context on session. Call - cannot block. Raising an exception will result in a rollback - of the current transaction. - """ - pass - - def create_port_postcommit(self, context): - """Create a port. - - :param context: PortContext instance describing the port. - - Called after the transaction completes. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Raising an exception will - result in the deletion of the resource. - """ - pass - - def update_port_precommit(self, context): - """Update resources of a port. - - :param context: PortContext instance describing the new - state of the port, as well as the original state prior - to the update_port call. - - Called inside transaction context on session to complete a - port update as defined by this mechanism driver. Raising an - exception will result in rollback of the transaction. - - update_port_precommit is called for all changes to the port - state. It is up to the mechanism driver to ignore state or - state changes that it does not know or care about. - """ - pass - - def update_port_postcommit(self, context): - """Update a port. - - :param context: PortContext instance describing the new - state of the port, as well as the original state prior - to the update_port call. - - Called after the transaction completes. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Raising an exception will - result in the deletion of the resource. - - update_port_postcommit is called for all changes to the port - state. It is up to the mechanism driver to ignore state or - state changes that it does not know or care about. - """ - pass - - def delete_port_precommit(self, context): - """Delete resources of a port. - - :param context: PortContext instance describing the current - state of the port, prior to the call to delete it. - - Called inside transaction context on session. Runtime errors - are not expected, but raising an exception will result in - rollback of the transaction. - """ - pass - - def delete_port_postcommit(self, context): - """Delete a port. - - :param context: PortContext instance describing the current - state of the port, prior to the call to delete it. - - Called after the transaction completes. Call can block, though - will block the entire process so care should be taken to not - drastically affect performance. Runtime errors are not - expected, and will not prevent the resource from being - deleted. - """ - pass - - def bind_port(self, context): - """Attempt to bind a port. - - :param context: PortContext instance describing the port - - This method is called outside any transaction to attempt to - establish a port binding using this mechanism driver. Bindings - may be created at each of multiple levels of a hierarchical - network, and are established from the top level downward. At - each level, the mechanism driver determines whether it can - bind to any of the network segments in the - context.segments_to_bind property, based on the value of the - context.host property, any relevant port or network - attributes, and its own knowledge of the network topology. At - the top level, context.segments_to_bind contains the static - segments of the port's network. At each lower level of - binding, it contains static or dynamic segments supplied by - the driver that bound at the level above. If the driver is - able to complete the binding of the port to any segment in - context.segments_to_bind, it must call context.set_binding - with the binding details. If it can partially bind the port, - it must call context.continue_binding with the network - segments to be used to bind at the next lower level. - - If the binding results are committed after bind_port returns, - they will be seen by all mechanism drivers as - update_port_precommit and update_port_postcommit calls. But if - some other thread or process concurrently binds or updates the - port, these binding results will not be committed, and - update_port_precommit and update_port_postcommit will not be - called on the mechanism drivers with these results. Because - binding results can be discarded rather than committed, - drivers should avoid making persistent state changes in - bind_port, or else must ensure that such state changes are - eventually cleaned up. - - Implementing this method explicitly declares the mechanism - driver as having the intention to bind ports. This is inspected - by the QoS service to identify the available QoS rules you - can use with ports. - """ - pass - - @property - def _supports_port_binding(self): - return self.__class__.bind_port != MechanismDriver.bind_port - - def check_vlan_transparency(self, context): - """Check if the network supports vlan transparency. - - :param context: NetworkContext instance describing the network. - - Check if the network supports vlan transparency or not. - """ - pass - - def get_workers(self): - """Get any NeutronWorker instances that should have their own process - - Any driver that needs to run processes separate from the API or RPC - workers, can return a sequence of NeutronWorker instances. - """ - return () - - @classmethod - def is_host_filtering_supported(cls): - return (cls.filter_hosts_with_segment_access != - MechanismDriver.filter_hosts_with_segment_access) - - def filter_hosts_with_segment_access( - self, context, segments, candidate_hosts, agent_getter): - """Filter hosts with access to at least one segment. - - :returns: a set with a subset of candidate_hosts. - - A driver can overload this method to return a subset of candidate_hosts - with the ones with access to at least one segment. - - Default implementation returns all hosts to disable filtering - (backward compatibility). - """ - return candidate_hosts - - -@six.add_metaclass(abc.ABCMeta) -class _TypeDriverBase(object): - - @abc.abstractmethod - def get_type(self): - """Get driver's network type. - - :returns: network_type value handled by this driver - """ - pass - - @abc.abstractmethod - def initialize(self): - """Perform driver initialization. - - Called after all drivers have been loaded and the database has - been initialized. No abstract methods defined below will be - called prior to this method being called. - """ - pass - - @abc.abstractmethod - def is_partial_segment(self, segment): - """Return True if segment is a partially specified segment. - - :param segment: segment dictionary - :returns: boolean - """ - - @abc.abstractmethod - def validate_provider_segment(self, segment): - """Validate attributes of a provider network segment. - - :param segment: segment dictionary using keys defined above - :raises: neutron_lib.exceptions.InvalidInput if invalid - - Called outside transaction context to validate the provider - attributes for a provider network segment. Raise InvalidInput - if: - - - any required attribute is missing - - any prohibited or unrecognized attribute is present - - any attribute value is not valid - - The network_type attribute is present in segment, but - need not be validated. - """ - pass - - @abc.abstractmethod - def get_mtu(self, physical): - """Get driver's network MTU. - - :returns: mtu maximum transmission unit - - Returns the mtu for the network based on the config values and - the network type. - """ - pass - - -@six.add_metaclass(abc.ABCMeta) -class TypeDriver(_TypeDriverBase): - """Define abstract interface for ML2 type drivers. - - ML2 type drivers each support a specific network_type for provider - and/or tenant network segments. Type drivers must implement this - abstract interface, which defines the API by which the plugin uses - the driver to manage the persistent type-specific resource - allocation state associated with network segments of that type. - - Network segments are represented by segment dictionaries using the - NETWORK_TYPE, PHYSICAL_NETWORK, and SEGMENTATION_ID keys defined - above, corresponding to the provider attributes. Future revisions - of the TypeDriver API may add additional segment dictionary - keys. Attributes not applicable for a particular network_type may - either be excluded or stored as None. - - TypeDriver passes session as argument for: - - reserve_provider_segment - - allocate_tenant_segment - - release_segment - - get_allocation - """ - - @abc.abstractmethod - def reserve_provider_segment(self, session, segment): - """Reserve resource associated with a provider network segment. - - :param session: database session - :param segment: segment dictionary - :returns: segment dictionary - - Called inside transaction context on session to reserve the - type-specific resource for a provider network segment. The - segment dictionary passed in was returned by a previous - validate_provider_segment() call. - """ - pass - - @abc.abstractmethod - def allocate_tenant_segment(self, session): - """Allocate resource for a new tenant network segment. - - :param session: database session - :returns: segment dictionary using keys defined above - - Called inside transaction context on session to allocate a new - tenant network, typically from a type-specific resource - pool. If successful, return a segment dictionary describing - the segment. If tenant network segment cannot be allocated - (i.e. tenant networks not supported or resource pool is - exhausted), return None. - """ - pass - - @abc.abstractmethod - def release_segment(self, session, segment): - """Release network segment. - - :param session: database session - :param segment: segment dictionary using keys defined above - - Called inside transaction context on session to release a - tenant or provider network's type-specific resource. Runtime - errors are not expected, but raising an exception will result - in rollback of the transaction. - """ - pass - - -@six.add_metaclass(abc.ABCMeta) -class ML2TypeDriver(_TypeDriverBase): - """Define abstract interface for ML2 type drivers. - - ML2 type drivers each support a specific network_type for provider - and/or tenant network segments. Type drivers must implement this - abstract interface, which defines the API by which the plugin uses - the driver to manage the persistent type-specific resource - allocation state associated with network segments of that type. - - Network segments are represented by segment dictionaries using the - NETWORK_TYPE, PHYSICAL_NETWORK, and SEGMENTATION_ID keys defined - above, corresponding to the provider attributes. Future revisions - of the TypeDriver API may add additional segment dictionary - keys. Attributes not applicable for a particular network_type may - either be excluded or stored as None. - - ML2TypeDriver passes context as argument for: - - reserve_provider_segment - - allocate_tenant_segment - - release_segment - - get_allocation - """ - - @abc.abstractmethod - def reserve_provider_segment(self, context, segment): - """Reserve resource associated with a provider network segment. - - :param context: instance of neutron context with DB session - :param segment: segment dictionary - :returns: segment dictionary - - Called inside transaction context on session to reserve the - type-specific resource for a provider network segment. The - segment dictionary passed in was returned by a previous - validate_provider_segment() call. - """ - pass - - @abc.abstractmethod - def allocate_tenant_segment(self, context): - """Allocate resource for a new tenant network segment. - - :param context: instance of neutron context with DB session - :returns: segment dictionary using keys defined above - - Called inside transaction context on session to allocate a new - tenant network, typically from a type-specific resource - pool. If successful, return a segment dictionary describing - the segment. If tenant network segment cannot be allocated - (i.e. tenant networks not supported or resource pool is - exhausted), return None. - """ - pass - - @abc.abstractmethod - def release_segment(self, context, segment): - """Release network segment. - - :param context: instance of neutron context with DB session - :param segment: segment dictionary using keys defined above - - Called inside transaction context on session to release a - tenant or provider network's type-specific resource. Runtime - errors are not expected, but raising an exception will result - in rollback of the transaction. - """ - pass - - -@six.add_metaclass(abc.ABCMeta) -class NetworkContext(object): - """Context passed to MechanismDrivers for changes to network resources. - - A NetworkContext instance wraps a network resource. It provides - helper methods for accessing other relevant information. Results - from expensive operations are cached so that other - MechanismDrivers can freely access the same information. - """ - - @abc.abstractproperty - def current(self): - """Return the network in its current configuration. - - Return the network, as defined by NeutronPluginBaseV2. - create_network and all extensions in the ml2 plugin, with - all its properties 'current' at the time the context was - established. - """ - pass - - @abc.abstractproperty - def original(self): - """Return the network in its original configuration. - - Return the network, with all its properties set to their - original values prior to a call to update_network. Method is - only valid within calls to update_network_precommit and - update_network_postcommit. - """ - pass - - @abc.abstractproperty - def network_segments(self): - """Return the segments associated with this network resource.""" - pass - - -@six.add_metaclass(abc.ABCMeta) -class SubnetContext(object): - """Context passed to MechanismDrivers for changes to subnet resources. - - A SubnetContext instance wraps a subnet resource. It provides - helper methods for accessing other relevant information. Results - from expensive operations are cached so that other - MechanismDrivers can freely access the same information. - """ - - @abc.abstractproperty - def current(self): - """Return the subnet in its current configuration. - - Return the subnet, as defined by NeutronPluginBaseV2. - create_subnet and all extensions in the ml2 plugin, with - all its properties 'current' at the time the context was - established. - """ - pass - - @abc.abstractproperty - def original(self): - """Return the subnet in its original configuration. - - Return the subnet, with all its properties set to their - original values prior to a call to update_subnet. Method is - only valid within calls to update_subnet_precommit and - update_subnet_postcommit. - """ - pass - - -@six.add_metaclass(abc.ABCMeta) -class PortContext(object): - """Context passed to MechanismDrivers for changes to port resources. - - A PortContext instance wraps a port resource. It provides helper - methods for accessing other relevant information. Results from - expensive operations are cached so that other MechanismDrivers can - freely access the same information. - """ - - @abc.abstractproperty - def current(self): - """Return the port in its current configuration. - - Return the port, as defined by NeutronPluginBaseV2. - create_port and all extensions in the ml2 plugin, with - all its properties 'current' at the time the context was - established. - """ - pass - - @abc.abstractproperty - def original(self): - """Return the port in its original configuration. - - Return the port, with all its properties set to their - original values prior to a call to update_port. Method is - only valid within calls to update_port_precommit and - update_port_postcommit. - """ - pass - - @abc.abstractproperty - def status(self): - """Return the status of the current port.""" - pass - - @abc.abstractproperty - def original_status(self): - """Return the status of the original port. - - The method is only valid within calls to update_port_precommit and - update_port_postcommit. - """ - pass - - @abc.abstractproperty - def network(self): - """Return the NetworkContext associated with this port.""" - pass - - @abc.abstractproperty - def binding_levels(self): - """Return dictionaries describing the current binding levels. - - This property returns a list of dictionaries describing each - binding level if the port is bound or partially bound, or None - if the port is unbound. Each returned dictionary contains the - name of the bound driver under the BOUND_DRIVER key, and the - bound segment dictionary under the BOUND_SEGMENT key. - - The first entry (index 0) describes the top-level binding, - which always involves one of the port's network's static - segments. In the case of a hierarchical binding, subsequent - entries describe the lower-level bindings in descending order, - which may involve dynamic segments. Adjacent levels where - different drivers bind the same static or dynamic segment are - possible. The last entry (index -1) describes the bottom-level - binding that supplied the port's binding:vif_type and - binding:vif_details attribute values. - - Within calls to MechanismDriver.bind_port, descriptions of the - levels above the level currently being bound are returned. - """ - pass - - @abc.abstractproperty - def original_binding_levels(self): - """Return dictionaries describing the original binding levels. - - This property returns a list of dictionaries describing each - original binding level if the port was previously bound, or - None if the port was unbound. The content is as described for - the binding_levels property. - - This property is only valid within calls to - update_port_precommit and update_port_postcommit. It returns - None otherwise. - """ - pass - - @abc.abstractproperty - def top_bound_segment(self): - """Return the current top-level bound segment dictionary. - - This property returns the current top-level bound segment - dictionary, or None if the port is unbound. For a bound port, - top_bound_segment is equivalent to - binding_levels[0][BOUND_SEGMENT], and returns one of the - port's network's static segments. - """ - pass - - @abc.abstractproperty - def original_top_bound_segment(self): - """Return the original top-level bound segment dictionary. - - This property returns the original top-level bound segment - dictionary, or None if the port was previously unbound. For a - previously bound port, original_top_bound_segment is - equivalent to original_binding_levels[0][BOUND_SEGMENT], and - returns one of the port's network's static segments. - - This property is only valid within calls to - update_port_precommit and update_port_postcommit. It returns - None otherwise. - """ - pass - - @abc.abstractproperty - def bottom_bound_segment(self): - """Return the current bottom-level bound segment dictionary. - - This property returns the current bottom-level bound segment - dictionary, or None if the port is unbound. For a bound port, - bottom_bound_segment is equivalent to - binding_levels[-1][BOUND_SEGMENT], and returns the segment - whose binding supplied the port's binding:vif_type and - binding:vif_details attribute values. - """ - pass - - @abc.abstractproperty - def original_bottom_bound_segment(self): - """Return the original bottom-level bound segment dictionary. - - This property returns the original bottom-level bound segment - dictionary, or None if the port was previously unbound. For a - previously bound port, original_bottom_bound_segment is - equivalent to original_binding_levels[-1][BOUND_SEGMENT], and - returns the segment whose binding supplied the port's previous - binding:vif_type and binding:vif_details attribute values. - - This property is only valid within calls to - update_port_precommit and update_port_postcommit. It returns - None otherwise. - """ - pass - - @abc.abstractproperty - def host(self): - """Return the host with which the port is associated. - - In the context of a host-specific operation on a distributed - port, the host property indicates the host for which the port - operation is being performed. Otherwise, it is the same value - as current['binding:host_id']. - """ - pass - - @abc.abstractproperty - def original_host(self): - """Return the original host with which the port was associated. - - In the context of a host-specific operation on a distributed - port, the original_host property indicates the host for which - the port operation is being performed. Otherwise, it is the - same value as original['binding:host_id']. - - This property is only valid within calls to - update_port_precommit and update_port_postcommit. It returns - None otherwise. - """ - pass - - @abc.abstractproperty - def vif_type(self): - """Return the vif_type indicating the binding state of the port. - - In the context of a host-specific operation on a distributed - port, the vif_type property indicates the binding state for - the host for which the port operation is being - performed. Otherwise, it is the same value as - current['binding:vif_type']. - """ - pass - - @abc.abstractproperty - def original_vif_type(self): - """Return the original vif_type of the port. - - In the context of a host-specific operation on a distributed - port, the original_vif_type property indicates original - binding state for the host for which the port operation is - being performed. Otherwise, it is the same value as - original['binding:vif_type']. - - This property is only valid within calls to - update_port_precommit and update_port_postcommit. It returns - None otherwise. - """ - pass - - @abc.abstractproperty - def vif_details(self): - """Return the vif_details describing the binding of the port. - - In the context of a host-specific operation on a distributed - port, the vif_details property describes the binding for the - host for which the port operation is being - performed. Otherwise, it is the same value as - current['binding:vif_details']. - """ - pass - - @abc.abstractproperty - def original_vif_details(self): - """Return the original vif_details of the port. - - In the context of a host-specific operation on a distributed - port, the original_vif_details property describes the original - binding for the host for which the port operation is being - performed. Otherwise, it is the same value as - original['binding:vif_details']. - - This property is only valid within calls to - update_port_precommit and update_port_postcommit. It returns - None otherwise. - """ - pass - - @abc.abstractproperty - def segments_to_bind(self): - """Return the list of segments with which to bind the port. - - This property returns the list of segment dictionaries with - which the mechanism driver may bind the port. When - establishing a top-level binding, these will be the port's - network's static segments. For each subsequent level, these - will be the segments passed to continue_binding by the - mechanism driver that bound the level above. - - This property is only valid within calls to - MechanismDriver.bind_port. It returns None otherwise. - """ - pass - - @abc.abstractmethod - def host_agents(self, agent_type): - """Get agents of the specified type on port's host. - - :param agent_type: Agent type identifier - :returns: List of neutron.db.models.agent.Agent records - """ - pass - - @abc.abstractmethod - def set_binding(self, segment_id, vif_type, vif_details, - status=None): - """Set the bottom-level binding for the port. - - :param segment_id: Network segment bound for the port. - :param vif_type: The VIF type for the bound port. - :param vif_details: Dictionary with details for VIF driver. - :param status: Port status to set if not None. - - This method is called by MechanismDriver.bind_port to indicate - success and specify binding details to use for port. The - segment_id must identify an item in the current value of the - segments_to_bind property. - """ - pass - - @abc.abstractmethod - def continue_binding(self, segment_id, next_segments_to_bind): - """Continue binding the port with different segments. - - :param segment_id: Network segment partially bound for the port. - :param next_segments_to_bind: Segments to continue binding with. - - This method is called by MechanismDriver.bind_port to indicate - it was able to partially bind the port, but that one or more - additional mechanism drivers are required to complete the - binding. The segment_id must identify an item in the current - value of the segments_to_bind property. The list of segments - IDs passed as next_segments_to_bind identify dynamic (or - static) segments of the port's network that will be used to - populate segments_to_bind for the next lower level of a - hierarchical binding. - """ - pass - - @abc.abstractmethod - def allocate_dynamic_segment(self, segment): - """Allocate a dynamic segment. - - :param segment: A partially or fully specified segment dictionary - - Called by the MechanismDriver.bind_port, create_port or update_port - to dynamically allocate a segment for the port using the partial - segment specified. The segment dictionary can be a fully or partially - specified segment. At a minimum it needs the network_type populated to - call on the appropriate type driver. - """ - pass - - @abc.abstractmethod - def release_dynamic_segment(self, segment_id): - """Release an allocated dynamic segment. - - :param segment_id: UUID of the dynamic network segment. - - Called by the MechanismDriver.delete_port or update_port to release - the dynamic segment allocated for this port. - """ - pass - - -@six.add_metaclass(abc.ABCMeta) -class ExtensionDriver(object): - """Define stable abstract interface for ML2 extension drivers. - - An extension driver extends the core resources implemented by the - ML2 plugin with additional attributes. Methods that process create - and update operations for these resources validate and persist - values for extended attributes supplied through the API. Other - methods extend the resource dictionaries returned from the API - operations with the values of the extended attributes. - """ - - @abc.abstractmethod - def initialize(self): - """Perform driver initialization. - - Called after all drivers have been loaded and the database has - been initialized. No abstract methods defined below will be - called prior to this method being called. - """ - pass - - @property - def extension_alias(self): - """Supported extension alias. - - Return the alias identifying the core API extension supported - by this driver. Do not declare if API extension handling will - be left to a service plugin, and we just need to provide - core resource extension and updates. - """ - pass - - def process_create_network(self, plugin_context, data, result): - """Process extended attributes for create network. - - :param plugin_context: plugin request context - :param data: dictionary of incoming network data - :param result: network dictionary to extend - - Called inside transaction context on plugin_context.session to - validate and persist any extended network attributes defined by this - driver. Extended attribute values must also be added to - result. - """ - pass - - def process_create_subnet(self, plugin_context, data, result): - """Process extended attributes for create subnet. - - :param plugin_context: plugin request context - :param data: dictionary of incoming subnet data - :param result: subnet dictionary to extend - - Called inside transaction context on plugin_context.session to - validate and persist any extended subnet attributes defined by this - driver. Extended attribute values must also be added to - result. - """ - pass - - def process_create_port(self, plugin_context, data, result): - """Process extended attributes for create port. - - :param plugin_context: plugin request context - :param data: dictionary of incoming port data - :param result: port dictionary to extend - - Called inside transaction context on plugin_context.session to - validate and persist any extended port attributes defined by this - driver. Extended attribute values must also be added to - result. - """ - pass - - def process_update_network(self, plugin_context, data, result): - """Process extended attributes for update network. - - :param plugin_context: plugin request context - :param data: dictionary of incoming network data - :param result: network dictionary to extend - - Called inside transaction context on plugin_context.session to - validate and update any extended network attributes defined by this - driver. Extended attribute values, whether updated or not, - must also be added to result. - """ - pass - - def process_update_subnet(self, plugin_context, data, result): - """Process extended attributes for update subnet. - - :param plugin_context: plugin request context - :param data: dictionary of incoming subnet data - :param result: subnet dictionary to extend - - Called inside transaction context on plugin_context.session to - validate and update any extended subnet attributes defined by this - driver. Extended attribute values, whether updated or not, - must also be added to result. - """ - pass - - def process_update_port(self, plugin_context, data, result): - """Process extended attributes for update port. - - :param plugin_context: plugin request context - :param data: dictionary of incoming port data - :param result: port dictionary to extend - - Called inside transaction context on plugin_context.session to - validate and update any extended port attributes defined by this - driver. Extended attribute values, whether updated or not, - must also be added to result. - """ - pass - - def extend_network_dict(self, session, base_model, result): - """Add extended attributes to network dictionary. - - :param session: database session - :param base_model: network model data - :param result: network dictionary to extend - - Called inside transaction context on session to add any - extended attributes defined by this driver to a network - dictionary to be used for mechanism driver calls and/or - returned as the result of a network operation. - """ - pass - - def extend_subnet_dict(self, session, base_model, result): - """Add extended attributes to subnet dictionary. - - :param session: database session - :param base_model: subnet model data - :param result: subnet dictionary to extend - - Called inside transaction context on session to add any - extended attributes defined by this driver to a subnet - dictionary to be used for mechanism driver calls and/or - returned as the result of a subnet operation. - """ - pass - - def extend_port_dict(self, session, base_model, result): - """Add extended attributes to port dictionary. - - :param session: database session - :param base_model: port model data - :param result: port dictionary to extend - - Called inside transaction context on session to add any - extended attributes defined by this driver to a port - dictionary to be used for mechanism driver calls - and/or returned as the result of a port operation. - """ - pass diff --git a/neutron_lib/services/__init__.py b/neutron_lib/services/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/services/base.py b/neutron_lib/services/base.py deleted file mode 100644 index 5c92cf8..0000000 --- a/neutron_lib/services/base.py +++ /dev/null @@ -1,87 +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. - -import abc - -import six - - -class WorkerBase(object): - - @property - def _workers(self): - try: - return self.__workers - except AttributeError: - self.__workers = [] - return self.__workers - - def get_workers(self): - """Returns a collection NeutronWorker instances needed by this service. - - """ - return list(self._workers) - - def add_worker(self, worker): - """Adds NeutronWorker needed for this service - - If a object needs to define workers thread/processes outside of API/RPC - workers then it will call this method to register worker. Should be - called on initialization stage before running services - """ - self._workers.append(worker) - - def add_workers(self, workers): - """Adds NeutronWorker list needed for this service - - The same as add_worker but adds a list of workers - """ - self._workers.extend(workers) - - -@six.add_metaclass(abc.ABCMeta) -class ServicePluginBase(WorkerBase): - """Define base interface for any Advanced Service plugin.""" - supported_extension_aliases = [] - - @classmethod - def __subclasshook__(cls, klass): - """Checking plugin class. - - The __subclasshook__ method is a class method - that will be called every time a class is tested - using issubclass(klass, ServicePluginBase). - In that case, it will check that every method - marked with the abstractmethod decorator is - provided by the plugin class. - """ - - if not cls.__abstractmethods__: - return NotImplemented - - for method in cls.__abstractmethods__: - if any(method in base.__dict__ for base in klass.__mro__): - continue - return NotImplemented - return True - - @abc.abstractmethod - def get_plugin_type(self): - """Return one of predefined service types. - - """ - pass - - @abc.abstractmethod - def get_plugin_description(self): - """Return string description of the plugin.""" - pass diff --git a/neutron_lib/services/qos/__init__.py b/neutron_lib/services/qos/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/services/qos/base.py b/neutron_lib/services/qos/base.py deleted file mode 100644 index 4534a82..0000000 --- a/neutron_lib/services/qos/base.py +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright 2016 Hewlett Packard Enterprise Development Company, LP -# Copyright 2016 Red Hat Inc. -# -# 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 oslo_log import log as logging - -from neutron_lib.api import validators as lib_validators -from neutron_lib.callbacks import events -from neutron_lib.callbacks import registry -from neutron_lib.services.qos import constants - -LOG = logging.getLogger(__name__) - - -@registry.has_registry_receivers -class DriverBase(object): - - def __init__(self, name, vif_types, vnic_types, - supported_rules, - requires_rpc_notifications=False): - """Instantiate a qos driver. - - :param name: driver name. - :param vif_types: list of interfaces (VIFs) supported. - :param vnic_types: list of vnic types supported. - :param supported_rules: dict of supported rules. - :param requires_rpc_notifications: indicates if this driver - expects rpc push notifications to be sent from the driver. - """ - - self.name = name - self.vif_types = vif_types - self.vnic_types = vnic_types - self.supported_rules = supported_rules - self.requires_rpc_notifications = requires_rpc_notifications - - @registry.receives(constants.QOS_PLUGIN, [events.AFTER_INIT]) - def _register(self, resource, event, trigger, **kwargs): - if self.is_loaded: - # trigger is the QosServiceDriverManager - trigger.register_driver(self) - - def is_loaded(self): - """True if the driver is active for the Neutron Server. - - Implement this property to determine if your driver is actively - configured for this Neutron Server deployment. - """ - return True - - def is_vif_type_compatible(self, vif_type): - """True if the driver is compatible with the VIF type.""" - return vif_type in self.vif_types - - def is_vnic_compatible(self, vnic_type): - """True if the driver is compatible with the specific VNIC type.""" - return vnic_type in self.vnic_types - - def is_rule_supported(self, rule): - supported_parameters = self.supported_rules.get(rule.rule_type) - if not supported_parameters: - LOG.debug("Rule type %(rule_type)s is not supported by " - "%(driver_name)s", - {'rule_type': rule.rule_type, - 'driver_name': self.name}) - return False - for parameter, validators in supported_parameters.items(): - parameter_value = rule.get(parameter) - for validator_type, validator_data in validators.items(): - validator_function = lib_validators.get_validator( - validator_type) - validate_result = validator_function(parameter_value, - validator_data) - # NOTE(slaweq): validator functions returns None if data is - # valid or string with reason why data is not valid - if validate_result: - LOG.debug("Parameter %(parameter)s=%(value)s in " - "rule type %(rule_type)s is not " - "supported by %(driver_name)s. " - "Validate result: %(validate_result)s", - {'parameter': parameter, - 'value': parameter_value, - 'rule_type': rule.rule_type, - 'driver_name': self.name, - 'validate_result': validate_result}) - return False - return True - - def create_policy(self, context, policy): - """Create policy invocation. - - This method can be implemented by the specific driver subclass - to update the backend where necessary with the specific policy - information. - - :param context: current running context information - :param policy: a QoSPolicy object being created, which will have no - rules. - """ - - def create_policy_precommit(self, context, policy): - """Create policy precommit. - - This method can be implemented by the specific driver subclass - to handle the precommit event of a policy that is being created. - - :param context: current running context information - :param policy: a QoSPolicy object being created, which will have no - rules. - """ - - def update_policy(self, context, policy): - """Update policy invocation. - - This method can be implemented by the specific driver subclass - to update the backend where necessary. - - :param context: current running context information - :param policy: a QoSPolicy object being updated. - """ - - def update_policy_precommit(self, context, policy): - """Update policy precommit. - - This method can be implemented by the specific driver subclass - to handle update precommit event of a policy that is being updated. - - :param context: current running context information - :param policy: a QoSPolicy object being updated. - """ - - def delete_policy(self, context, policy): - """Delete policy invocation. - - This method can be implemented by the specific driver subclass - to delete the backend policy where necessary. - - :param context: current running context information - :param policy: a QoSPolicy object being deleted - """ - - def delete_policy_precommit(self, context, policy): - """Delete policy precommit. - - This method can be implemented by the specific driver subclass - to handle delete precommit event of a policy that is being deleted. - - :param context: current running context information - :param policy: a QoSPolicy object being deleted - """ diff --git a/neutron_lib/services/qos/constants.py b/neutron_lib/services/qos/constants.py deleted file mode 100644 index e4a14cf..0000000 --- a/neutron_lib/services/qos/constants.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2015 Red Hat Inc. -# 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. - -RULE_TYPE_BANDWIDTH_LIMIT = 'bandwidth_limit' -RULE_TYPE_DSCP_MARKING = 'dscp_marking' -RULE_TYPE_MINIMUM_BANDWIDTH = 'minimum_bandwidth' -VALID_RULE_TYPES = [RULE_TYPE_BANDWIDTH_LIMIT, - RULE_TYPE_DSCP_MARKING, - RULE_TYPE_MINIMUM_BANDWIDTH, - ] - -# Names of rules' attributes -MAX_KBPS = "max_kbps" -MAX_BURST = "max_burst_kbps" -MIN_KBPS = "min_kbps" -DIRECTION = "direction" -DSCP_MARK = "dscp_mark" - -QOS_POLICY_ID = 'qos_policy_id' - -QOS_PLUGIN = 'qos_plugin' - -# NOTE(slaweq): Value used to calculate burst value for egress bandwidth limit -# if burst is not given by user. In such case burst value will be calculated -# as 80% of bw_limit to ensure that at least limits for TCP traffic will work -# fine. -DEFAULT_BURST_RATE = 0.8 - -# Method names for QoSDriver -PRECOMMIT_POSTFIX = '_precommit' -CREATE_POLICY = 'create_policy' -CREATE_POLICY_PRECOMMIT = CREATE_POLICY + PRECOMMIT_POSTFIX -UPDATE_POLICY = 'update_policy' -UPDATE_POLICY_PRECOMMIT = UPDATE_POLICY + PRECOMMIT_POSTFIX -DELETE_POLICY = 'delete_policy' -DELETE_POLICY_PRECOMMIT = DELETE_POLICY + PRECOMMIT_POSTFIX - -QOS_CALL_METHODS = ( - CREATE_POLICY, - CREATE_POLICY_PRECOMMIT, - UPDATE_POLICY, - UPDATE_POLICY_PRECOMMIT, - DELETE_POLICY, - DELETE_POLICY_PRECOMMIT, ) diff --git a/neutron_lib/tests/__init__.py b/neutron_lib/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/_base.py b/neutron_lib/tests/_base.py deleted file mode 100644 index 9756b27..0000000 --- a/neutron_lib/tests/_base.py +++ /dev/null @@ -1,247 +0,0 @@ -# Copyright 2010-2011 OpenStack Foundation -# 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. - -import logging as std_logging -import os -import os.path -import random - -import fixtures -import mock -from oslo_config import cfg -from oslo_db import options as db_options -from oslo_utils import strutils -import pbr.version -import testtools - -from neutron_lib._i18n import _ -from neutron_lib import constants -from neutron_lib import exceptions -from neutron_lib import fixture - -from neutron_lib.tests import _post_mortem_debug as post_mortem_debug -from neutron_lib.tests import _tools as tools - - -CONF = cfg.CONF -LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s" - -ROOTDIR = os.path.dirname(__file__) -ETCDIR = os.path.join(ROOTDIR, 'etc') - - -def etcdir(*p): - return os.path.join(ETCDIR, *p) - - -def fake_use_fatal_exceptions(*args): - return True - - -def get_rand_name(max_length=None, prefix='test'): - """Return a random string. - - The string will start with 'prefix' and will be exactly 'max_length'. - If 'max_length' is None, then exactly 8 random characters, each - hexadecimal, will be added. In case len(prefix) <= len(max_length), - ValueError will be raised to indicate the problem. - """ - - if max_length: - length = max_length - len(prefix) - if length <= 0: - raise ValueError("'max_length' must be bigger than 'len(prefix)'.") - - suffix = ''.join(str(random.randint(0, 9)) for i in range(length)) - else: - suffix = hex(random.randint(0x10000000, 0x7fffffff))[2:] - return prefix + suffix - - -def get_rand_device_name(prefix='test'): - return get_rand_name( - max_length=constants.DEVICE_NAME_MAX_LEN, prefix=prefix) - - -def bool_from_env(key, strict=False, default=False): - value = os.environ.get(key) - return strutils.bool_from_string(value, strict=strict, default=default) - - -def get_test_timeout(default=0): - return int(os.environ.get('OS_TEST_TIMEOUT', default)) - - -def sanitize_log_path(path): - # Sanitize the string so that its log path is shell friendly - return path.replace(' ', '-').replace('(', '_').replace(')', '_') - - -class AttributeDict(dict): - - """Provide attribute access (dict.key) to dictionary values.""" - - def __getattr__(self, name): - """Allow attribute access for all keys in the dict.""" - if name in self: - return self[name] - raise AttributeError(_("Unknown attribute '%s'.") % name) - - -class BaseTestCase(testtools.TestCase): - - @staticmethod - def config_parse(conf=None, args=None): - """Create the default configurations.""" - if args is None: - args = [] - args += ['--config-file', etcdir('neutron_lib.conf')] - if conf is None: - version_info = pbr.version.VersionInfo('neutron-lib') - cfg.CONF(args=args, project='neutron_lib', - version='%%(prog)s %s' % version_info.release_string()) - else: - conf(args) - - def setUp(self): - super(BaseTestCase, self).setUp() - self.useFixture(fixture.PluginDirectoryFixture()) - - # Enabling 'use_fatal_exceptions' allows us to catch string - # substitution format errors in exception messages. - mock.patch.object(exceptions.NeutronException, 'use_fatal_exceptions', - return_value=True).start() - - # Update the default QueuePool parameters. These can be tweaked by the - # conf variables - max_pool_size, max_overflow and pool_timeout - db_options.set_defaults( - cfg.CONF, - connection='sqlite://', - max_pool_size=10, - max_overflow=20, pool_timeout=10) - - self.useFixture(fixtures.MonkeyPatch( - 'oslo_config.cfg.find_config_files', - lambda project=None, prog=None, extension=None: [])) - - self.setup_config() - - # Configure this first to ensure pm debugging support for setUp() - debugger = os.environ.get('OS_POST_MORTEM_DEBUGGER') - if debugger: - self.addOnException(post_mortem_debug.get_exception_handler( - debugger)) - - # Make sure we see all relevant deprecation warnings when running tests - self.useFixture(tools.WarningsFixture()) - - if bool_from_env('OS_DEBUG'): - _level = std_logging.DEBUG - else: - _level = std_logging.INFO - capture_logs = bool_from_env('OS_LOG_CAPTURE') - if not capture_logs: - std_logging.basicConfig(format=LOG_FORMAT, level=_level) - self.log_fixture = self.useFixture( - fixtures.FakeLogger( - format=LOG_FORMAT, - level=_level, - nuke_handlers=capture_logs, - )) - - test_timeout = get_test_timeout() - if test_timeout == -1: - test_timeout = 0 - if test_timeout > 0: - self.useFixture(fixtures.Timeout(test_timeout, gentle=True)) - - # If someone does use tempfile directly, ensure that it's cleaned up - self.useFixture(fixtures.NestedTempfile()) - self.useFixture(fixtures.TempHomeDir()) - - self.addCleanup(mock.patch.stopall) - - if bool_from_env('OS_STDOUT_CAPTURE'): - stdout = self.useFixture(fixtures.StringStream('stdout')).stream - self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout)) - if bool_from_env('OS_STDERR_CAPTURE'): - stderr = self.useFixture(fixtures.StringStream('stderr')).stream - self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) - - self.addOnException(self.check_for_systemexit) - self.orig_pid = os.getpid() - - def get_new_temp_dir(self): - """Create a new temporary directory. - - :returns fixtures.TempDir - """ - return self.useFixture(fixtures.TempDir()) - - def get_default_temp_dir(self): - """Create a default temporary directory. - - Returns the same directory during the whole test case. - - :returns fixtures.TempDir - """ - if not hasattr(self, '_temp_dir'): - self._temp_dir = self.get_new_temp_dir() - return self._temp_dir - - def check_for_systemexit(self, exc_info): - if isinstance(exc_info[1], SystemExit): - if os.getpid() != self.orig_pid: - # Subprocess - let it just exit - raise - # This makes sys.exit(0) still a failure - self.force_failure = True - - def assertOrderedEqual(self, expected, actual): - expect_val = self.sort_dict_lists(expected) - actual_val = self.sort_dict_lists(actual) - self.assertEqual(expect_val, actual_val) - - def sort_dict_lists(self, dic): - for key, value in dic.items(): - if isinstance(value, list): - dic[key] = sorted(value) - elif isinstance(value, dict): - dic[key] = self.sort_dict_lists(value) - return dic - - def assertDictSupersetOf(self, expected_subset, actual_superset): - """Checks that actual dict contains the expected dict. - - After checking that the arguments are of the right type, this checks - that each item in expected_subset is in, and matches, what is in - actual_superset. Separate tests are done, so that detailed info can - be reported upon failure. - """ - if not isinstance(expected_subset, dict): - self.fail("expected_subset (%s) is not an instance of dict" % - type(expected_subset)) - if not isinstance(actual_superset, dict): - self.fail("actual_superset (%s) is not an instance of dict" % - type(actual_superset)) - for k, v in expected_subset.items(): - self.assertIn(k, actual_superset) - self.assertEqual(v, actual_superset[k], - "Key %(key)s expected: %(exp)r, actual %(act)r" % - {'key': k, 'exp': v, 'act': actual_superset[k]}) - - def setup_config(self, args=None): - """Tests that need a non-default config can override this method.""" - self.config_parse(args=args) diff --git a/neutron_lib/tests/_post_mortem_debug.py b/neutron_lib/tests/_post_mortem_debug.py deleted file mode 100644 index cecf44f..0000000 --- a/neutron_lib/tests/_post_mortem_debug.py +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright 2013 Red Hat, Inc. -# 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. - -import functools -import traceback - - -def get_exception_handler(debugger_name): - debugger = _get_debugger(debugger_name) - return functools.partial(_exception_handler, debugger) - - -def _get_debugger(debugger_name): - try: - debugger = __import__(debugger_name) - except ImportError: - raise ValueError("can't import %s module as a post mortem debugger" % - debugger_name) - if 'post_mortem' in dir(debugger): - return debugger - else: - raise ValueError("%s is not a supported post mortem debugger" % - debugger_name) - - -def _exception_handler(debugger, exc_info): - """Exception handler enabling post-mortem debugging. - - A class extending testtools.TestCase can add this handler in setUp(): - - self.addOnException(post_mortem_debug.exception_handler) - - When an exception occurs, the user will be dropped into a debugger - session in the execution environment of the failure. - - Frames associated with the testing framework are excluded so that - the post-mortem session for an assertion failure will start at the - assertion call (e.g. self.assertTrue) rather than the framework code - that raises the failure exception (e.g. the assertTrue method). - """ - tb = exc_info[2] - ignored_traceback = get_ignored_traceback(tb) - if ignored_traceback: - tb = FilteredTraceback(tb, ignored_traceback) - traceback.print_exception(exc_info[0], exc_info[1], tb) - debugger.post_mortem(tb) - - -def get_ignored_traceback(tb): - """Retrieve the first traceback of an ignored trailing chain. - - Given an initial traceback, find the first traceback of a trailing - chain of tracebacks that should be ignored. The criteria for - whether a traceback should be ignored is whether its frame's - globals include the __unittest marker variable. This criteria is - culled from: - - unittest.TestResult._is_relevant_tb_level - - For example: - - tb.tb_next => tb0.tb_next => tb1.tb_next - - - If no tracebacks were to be ignored, None would be returned. - - If only tb1 was to be ignored, tb1 would be returned. - - If tb0 and tb1 were to be ignored, tb0 would be returned. - - If either of only tb or only tb0 was to be ignored, None would - be returned because neither tb or tb0 would be part of a - trailing chain of ignored tracebacks. - """ - # Turn the traceback chain into a list - tb_list = [] - while tb: - tb_list.append(tb) - tb = tb.tb_next - - # Find all members of an ignored trailing chain - ignored_tracebacks = [] - for tb in reversed(tb_list): - if '__unittest' in tb.tb_frame.f_globals: - ignored_tracebacks.append(tb) - else: - break - - # Return the first member of the ignored trailing chain - if ignored_tracebacks: - return ignored_tracebacks[-1] - - -class FilteredTraceback(object): - """Wraps a traceback to filter unwanted frames.""" - - def __init__(self, tb, filtered_traceback): - """Constructor. - - :param tb: The start of the traceback chain to filter. - :param filtered_traceback: The first traceback of a trailing - chain that is to be filtered. - """ - self._tb = tb - self.tb_lasti = self._tb.tb_lasti - self.tb_lineno = self._tb.tb_lineno - self.tb_frame = self._tb.tb_frame - self._filtered_traceback = filtered_traceback - - @property - def tb_next(self): - tb_next = self._tb.tb_next - if tb_next and tb_next != self._filtered_traceback: - return FilteredTraceback(tb_next, self._filtered_traceback) diff --git a/neutron_lib/tests/_tools.py b/neutron_lib/tests/_tools.py deleted file mode 100644 index 0992c2c..0000000 --- a/neutron_lib/tests/_tools.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2013 NEC Corporation -# 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. - -import platform -import warnings - -import fixtures - -from neutron_lib.utils import helpers - - -class UnorderedList(list): - """A list that is equals to any permutation of itself.""" - - def __eq__(self, other): - if not isinstance(other, list): - return False - return (sorted(self, key=helpers.safe_sort_key) == - sorted(other, key=helpers.safe_sort_key)) - - def __neq__(self, other): - return not self == other - - -class WarningsFixture(fixtures.Fixture): - """Filters out warnings during test runs.""" - - warning_types = ( - DeprecationWarning, PendingDeprecationWarning, ImportWarning - ) - - def _setUp(self): - self.addCleanup(warnings.resetwarnings) - for wtype in self.warning_types: - warnings.filterwarnings( - "always", category=wtype, module='^neutron_lib\\.') - - -def is_bsd(): - """Return True on BSD-based systems.""" - - system = platform.system() - if system == 'Darwin': - return True - if 'bsd' in system.lower(): - return True - return False diff --git a/neutron_lib/tests/etc/neutron_lib.conf b/neutron_lib/tests/etc/neutron_lib.conf deleted file mode 100644 index df281ba..0000000 --- a/neutron_lib/tests/etc/neutron_lib.conf +++ /dev/null @@ -1,8 +0,0 @@ -[DEFAULT] -# Show debugging output in logs (sets DEBUG log level output) -debug = False - -lock_path = $state_path/lock - -[database] -connection = 'sqlite://' diff --git a/neutron_lib/tests/etc/no_policy.json b/neutron_lib/tests/etc/no_policy.json deleted file mode 100644 index 2c63c08..0000000 --- a/neutron_lib/tests/etc/no_policy.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/neutron_lib/tests/etc/policy.json b/neutron_lib/tests/etc/policy.json deleted file mode 100644 index f5fca03..0000000 --- a/neutron_lib/tests/etc/policy.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "context_is_admin": "role:admin", - "context_is_advsvc": "role:advsvc", - "default": "rule:admin_or_owner" -} diff --git a/neutron_lib/tests/unit/__init__.py b/neutron_lib/tests/unit/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/api/__init__.py b/neutron_lib/tests/unit/api/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/api/definitions/__init__.py b/neutron_lib/tests/unit/api/definitions/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/api/definitions/base.py b/neutron_lib/tests/unit/api/definitions/base.py deleted file mode 100644 index 8c643b6..0000000 --- a/neutron_lib/tests/unit/api/definitions/base.py +++ /dev/null @@ -1,203 +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. - -import imp -import os - -from neutron_lib.api import definitions -from neutron_lib.api.definitions import base -from neutron_lib.api import validators -from neutron_lib import constants -from neutron_lib.tests import _base as test_base - - -def assert_bool(tester, attribute, attribute_dict, keyword, value): - tester.assertIsInstance( - value, bool, - '%s must be a boolean for %s.' % (keyword, attribute)) - - -def assert_converter(tester, attribute, attribute_dict, keyword, value): - if ('default' not in attribute_dict or - attribute_dict['default'] is constants.ATTR_NOT_SPECIFIED): - return - try: - attribute_dict['convert_to'](attribute_dict['default']) - except KeyError: - try: - attribute_dict['convert_list_to'](attribute_dict['default']) - except KeyError: - if validators.is_attr_set(value) and not isinstance( - value, (str, list)): - tester.fail("Default value '%s' cannot be converted for " - "attribute %s." % (value, attribute)) - - -def assert_true(tester, attribute, attribute_dict, keyword, value): - tester.assertTrue( - value, '%s must be True for %s.' % (keyword, attribute)) - - -def assert_validator(tester, attribute, attribute_dict, keyword, value): - tester.assertIn(list(value)[0], validators.validators, - '%s is not a known validator for %s.' % (value, attribute)) - -ASSERT_FUNCTIONS = { - 'allow_post': assert_bool, - 'allow_put': assert_bool, - 'convert_to': assert_converter, - 'convert_list_to': assert_converter, - 'default': assert_converter, - 'enforce_policy': assert_bool, - 'is_visible': assert_bool, - 'primary_key': assert_true, - 'required_by_policy': assert_bool, - 'validate': assert_validator, -} - - -class DefinitionBaseTestCase(test_base.BaseTestCase): - - extension_module = None - extension_resources = () - extension_subresources = () - extension_attributes = () - - def setUp(self): - super(DefinitionBaseTestCase, self).setUp() - if not self.extension_module: - self.fail("Missing extension module definition.") - self.alias = self.extension_module.ALIAS - self.is_shim_extension = self.extension_module.IS_SHIM_EXTENSION - self.is_standard_attr_extension = ( - self.extension_module.IS_STANDARD_ATTR_EXTENSION) - self.name = self.extension_module.NAME - self.description = self.extension_module.DESCRIPTION - self.resource_map = self.extension_module.RESOURCE_ATTRIBUTE_MAP - self.subresource_map = self.extension_module.SUB_RESOURCE_ATTRIBUTE_MAP - self.action_map = self.extension_module.ACTION_MAP - self.action_status = self.extension_module.ACTION_STATUS - self.required_extensions = self.extension_module.REQUIRED_EXTENSIONS - self.optional_extensions = self.extension_module.OPTIONAL_EXTENSIONS - - def test_shim_extension(self): - if self.is_shim_extension is True: - self.assertFalse(self.extension_resources) - self.assertFalse(self.extension_attributes) - self.assertFalse(self.resource_map) - self.assertFalse(self.action_map) - self.assertFalse(self.action_status) - - def test_is_standard_attr_extension(self): - if self.is_standard_attr_extension: - self.assertIn('standard-attr-', self.alias) - else: - self.skipTest('API definition is not related to standardattr.') - - def test_resource_map(self): - if not self.resource_map and not self.is_shim_extension: - self.fail('Missing resource map, what is this extension doing?') - elif self.is_shim_extension: - self.skipTest('Shim extension with no API changes.') - - for resource in self.resource_map: - self.assertIn( - resource, base.KNOWN_RESOURCES + self.extension_resources, - 'Resource is unknown, check for typos.') - self.assertParams(self.resource_map[resource]) - - def assertParams(self, resource): - for attribute in resource.keys(): - self.assertIn( - attribute, - base.KNOWN_ATTRIBUTES + self.extension_attributes, - 'Attribute is unknown, check for typos.') - for keyword in resource[attribute]: - self.assertIn(keyword, base.KNOWN_KEYWORDS, - 'Keyword is unknown, check for typos.') - value = resource[attribute][keyword] - assert_f = ASSERT_FUNCTIONS[keyword] - assert_f(self, attribute, - resource[attribute], - keyword, value) - - def test_subresource_map(self): - if not self.subresource_map: - self.skipTest('API extension has no subresource map.') - for subresource in self.subresource_map: - self.assertIn( - subresource, self.extension_subresources, - 'Sub-resource is unknown, check for typos.') - for attribute in self.subresource_map[subresource]: - self.assertIn(attribute, ('parent', 'parameters')) - self.assertIn( - self.subresource_map[subresource]['parent']['collection_name'], - base.KNOWN_RESOURCES + self.extension_resources, - 'Sub-resource parent is unknown, check for typos.') - self.assertIn('member_name', - self.subresource_map[subresource]['parent'], - 'Incorrect parent definition, check for typos.') - self.assertParams(self.subresource_map[subresource]['parameters']) - - def test_action_map(self): - self.assertIsInstance(self.action_map, dict) - if not self.action_map: - self.skipTest('API definition has no action map.') - - for key in self.action_map: - for action in self.action_map[key].values(): - self.assertIn(action, base.KNOWN_HTTP_ACTIONS, - 'HTTP verb is unknown, check for typos.') - - def test_action_status(self): - if not self.action_status: - self.skipTest('API definition has no action status.') - - for status in self.action_status.values(): - self.assertIn(status, base.KNOWN_ACTION_STATUSES, - 'HTTP status is unknown, check for typos.') - - def test_required_extensions(self): - self.assertIsInstance(self.required_extensions, list) - if not self.required_extensions: - self.skipTest('API definition has no required extensions.') - - for ext in self.required_extensions: - self.assertIn(ext, base.KNOWN_EXTENSIONS, - 'Required extension is unknown, check for typos.') - - def test_optional_extensions(self): - self.assertIsInstance(self.optional_extensions, list) - if not self.optional_extensions: - self.skipTest('API definition has no optional extensions.') - - for ext in self.optional_extensions: - self.assertIn(ext, base.KNOWN_EXTENSIONS, - 'Optional extension is unknown, check for typos.') - - def test_all_api_definitions_list(self): - # ensure _ALL_API_DEFINITIONS contains all public api-defs - ext_aliases = [] - api_def_path = 'neutron_lib/api/definitions' - for f in sorted(os.listdir(api_def_path)): - mod_name, file_ext = os.path.splitext(os.path.split(f)[-1]) - ext_path = os.path.join(api_def_path, f) - if file_ext.lower() == '.py' and not mod_name.startswith('_'): - mod = imp.load_source(mod_name, ext_path) - ext_alias = getattr(mod, 'ALIAS', None) - if not ext_alias: - continue - ext_aliases.append(ext_alias) - - self.assertEqual(sorted(ext_aliases), - sorted([d.ALIAS for d in - definitions._ALL_API_DEFINITIONS])) diff --git a/neutron_lib/tests/unit/api/definitions/test__dummy.py b/neutron_lib/tests/unit/api/definitions/test__dummy.py deleted file mode 100644 index 24c0cb3..0000000 --- a/neutron_lib/tests/unit/api/definitions/test__dummy.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import _dummy -from neutron_lib.tests.unit.api.definitions import base - - -class _DummyDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = _dummy - extension_resources = (_dummy.COLLECTION_NAME,) - extension_subresources = ('subfoo',) diff --git a/neutron_lib/tests/unit/api/definitions/test_address_scope.py b/neutron_lib/tests/unit/api/definitions/test_address_scope.py deleted file mode 100644 index c3ac157..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_address_scope.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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 neutron_lib.api.definitions import address_scope -from neutron_lib.tests.unit.api.definitions import base - - -class AddressScopeDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = address_scope - extension_resources = (address_scope.COLLECTION_NAME,) - extension_attributes = ('ipv6_address_scope', - 'ipv4_address_scope', - 'address_scope_id',) diff --git a/neutron_lib/tests/unit/api/definitions/test_agent.py b/neutron_lib/tests/unit/api/definitions/test_agent.py deleted file mode 100644 index 15ca2ee..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_agent.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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 neutron_lib.api.definitions import agent -from neutron_lib.tests.unit.api.definitions import base - - -class AgentDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = agent - extension_resources = (agent.COLLECTION_NAME,) - extension_attributes = ('topic', 'agent_type', 'created_at', - 'configurations', 'heartbeat_timestamp', - 'binary', 'started_at', 'host', 'alive',) diff --git a/neutron_lib/tests/unit/api/definitions/test_auto_allocated_topology.py b/neutron_lib/tests/unit/api/definitions/test_auto_allocated_topology.py deleted file mode 100644 index de5c1c3..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_auto_allocated_topology.py +++ /dev/null @@ -1,22 +0,0 @@ -# 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 neutron_lib.api.definitions import auto_allocated_topology -from neutron_lib.tests.unit.api.definitions import base - - -class AutoTopologyDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = auto_allocated_topology - extension_resources = (auto_allocated_topology.COLLECTION_NAME,) - extension_attributes = () diff --git a/neutron_lib/tests/unit/api/definitions/test_bgpvpn.py b/neutron_lib/tests/unit/api/definitions/test_bgpvpn.py deleted file mode 100644 index 86ecd76..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_bgpvpn.py +++ /dev/null @@ -1,65 +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 neutron_lib.api.definitions import bgpvpn -from neutron_lib.api import validators -from neutron_lib.tests.unit.api.definitions import base - - -class BgpvpnDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = bgpvpn - extension_resources = (bgpvpn.COLLECTION_NAME,) - extension_attributes = ('type', 'route_targets', 'import_targets', - 'export_targets', 'route_distinguishers', - 'networks', 'routers', 'router_id', 'network_id') - extension_subresources = ('network_associations', 'router_associations') - - def _data_for_invalid_rtdt(self): - values = [[':1'], - ['1:'], - ['42'], - ['65536:123456'], - ['123.456.789.123:65535'], - ['4294967296:65535'], - ['1.1.1.1:655351'], - ['4294967295:65536'], - ] - for value in values: - yield value - - def _data_for_valid_rtdt(self): - values = [['1:1'], - ['1:4294967295'], - ['65535:0'], - ['65535:4294967295'], - ['1.1.1.1:1'], - ['1.1.1.1:65535'], - ['4294967295:0'], - ['65536:65535'], - ['4294967295:65535'], - ] - for value in values: - yield value - - def test_valid_rtrd(self): - for rtrd in self._data_for_valid_rtdt(): - msg = validators.validate_list_of_regex_or_none( - rtrd, - bgpvpn.RTRD_REGEX) - self.assertIsNone(msg) - - def test_invalid_rtrd(self): - for rtrd in self._data_for_invalid_rtdt(): - msg = validators.validate_list_of_regex_or_none( - rtrd, - bgpvpn.RTRD_REGEX) - self.assertIsNotNone(msg) diff --git a/neutron_lib/tests/unit/api/definitions/test_bgpvpn_routes_control.py b/neutron_lib/tests/unit/api/definitions/test_bgpvpn_routes_control.py deleted file mode 100644 index e44d1bb..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_bgpvpn_routes_control.py +++ /dev/null @@ -1,25 +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 neutron_lib.api.definitions import bgpvpn -from neutron_lib.api.definitions import bgpvpn_routes_control -from neutron_lib.tests.unit.api.definitions import base - - -class BgpvpnRoutesControlDefinitionTestCase(base.DefinitionBaseTestCase): - - extension_module = bgpvpn_routes_control - extension_resources = (bgpvpn.COLLECTION_NAME,) - extension_attributes = ('ports', 'routes', 'advertise_fixed_ips', - 'advertise_extra_routes', 'local_pref') - extension_subresources = ('port_associations', 'router_associations') diff --git a/neutron_lib/tests/unit/api/definitions/test_data_plane_status.py b/neutron_lib/tests/unit/api/definitions/test_data_plane_status.py deleted file mode 100644 index 6114d0f..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_data_plane_status.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2017 NEC Corporation. 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 neutron_lib.api.definitions import data_plane_status as dps -from neutron_lib.tests.unit.api.definitions import base - - -class DataPlaneStatusDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = dps - extension_resources = (dps.COLLECTION_NAME,) - extension_attributes = (dps.DATA_PLANE_STATUS,) diff --git a/neutron_lib/tests/unit/api/definitions/test_dns.py b/neutron_lib/tests/unit/api/definitions/test_dns.py deleted file mode 100644 index bb23635..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_dns.py +++ /dev/null @@ -1,21 +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 neutron_lib.api.definitions import dns -from neutron_lib.api.definitions import l3 -from neutron_lib.tests.unit.api.definitions import base - - -class DnsDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = dns - extension_resources = (l3.FLOATINGIPS,) - extension_attributes = (dns.DNSNAME, dns.DNSDOMAIN, dns.DNSASSIGNMENT,) diff --git a/neutron_lib/tests/unit/api/definitions/test_dns_domain_ports.py b/neutron_lib/tests/unit/api/definitions/test_dns_domain_ports.py deleted file mode 100644 index 65e4cbe..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_dns_domain_ports.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2017 IBM -# 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 neutron_lib.api.definitions import dns -from neutron_lib.api.definitions import dns_domain_ports -from neutron_lib.tests.unit.api.definitions import base - - -class DnsDomainPortsDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = dns_domain_ports - extension_attributes = (dns.DNSDOMAIN,) diff --git a/neutron_lib/tests/unit/api/definitions/test_extra_dhcp_opt.py b/neutron_lib/tests/unit/api/definitions/test_extra_dhcp_opt.py deleted file mode 100644 index 27a50b4..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_extra_dhcp_opt.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import extra_dhcp_opt -from neutron_lib.tests.unit.api.definitions import base - - -class ExtraDHCPOptDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = extra_dhcp_opt - extension_resources = (extra_dhcp_opt.COLLECTION_NAME,) - extension_attributes = (extra_dhcp_opt.EXTRADHCPOPTS,) diff --git a/neutron_lib/tests/unit/api/definitions/test_fip64.py b/neutron_lib/tests/unit/api/definitions/test_fip64.py deleted file mode 100644 index e967a4c..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_fip64.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import fip64 -from neutron_lib.tests.unit.api.definitions import base - - -class Fip64DefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = fip64 - extension_resources = () - extension_attributes = () diff --git a/neutron_lib/tests/unit/api/definitions/test_firewall.py b/neutron_lib/tests/unit/api/definitions/test_firewall.py deleted file mode 100644 index 7156d18..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_firewall.py +++ /dev/null @@ -1,24 +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 neutron_lib.api.definitions import firewall -from neutron_lib.tests.unit.api.definitions import base - - -class FirewallDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = firewall - extension_resources = ('firewalls', 'firewall_policies', 'firewall_rules') - extension_attributes = ('action', 'admin_state_up', 'audited', - 'destination_ip_address', 'destination_port', - 'enabled', 'firewall_policy_id', 'firewall_rules', - 'ip_version', 'position', 'protocol', - 'source_ip_address', 'source_port') diff --git a/neutron_lib/tests/unit/api/definitions/test_firewall_v2.py b/neutron_lib/tests/unit/api/definitions/test_firewall_v2.py deleted file mode 100644 index 3191fca..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_firewall_v2.py +++ /dev/null @@ -1,27 +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 neutron_lib.api.definitions import firewall_v2 -from neutron_lib.tests.unit.api.definitions import base - - -class FirewallDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = firewall_v2 - extension_resources = ('firewall_groups', 'firewall_policies', - 'firewall_rules') - extension_attributes = ('action', 'admin_state_up', 'audited', - 'destination_ip_address', 'destination_port', - 'egress_firewall_policy_id', 'enabled', - 'firewall_policy_id', 'firewall_rules', - 'ingress_firewall_policy_id', 'ip_version', - 'ports', 'position', 'protocol', 'shared', - 'source_ip_address', 'source_port') diff --git a/neutron_lib/tests/unit/api/definitions/test_firewallrouterinsertion.py b/neutron_lib/tests/unit/api/definitions/test_firewallrouterinsertion.py deleted file mode 100644 index 8d243a4..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_firewallrouterinsertion.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import firewallrouterinsertion -from neutron_lib.tests.unit.api.definitions import base - - -class FirewallDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = firewallrouterinsertion - extension_resources = ('firewalls',) - extension_attributes = ('router_ids',) diff --git a/neutron_lib/tests/unit/api/definitions/test_l3.py b/neutron_lib/tests/unit/api/definitions/test_l3.py deleted file mode 100644 index 8ccaec4..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_l3.py +++ /dev/null @@ -1,26 +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 neutron_lib.api.definitions import l3 -from neutron_lib.tests.unit.api.definitions import base - - -class L3DefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = l3 - extension_resources = (l3.ROUTERS, l3.FLOATINGIPS,) - extension_attributes = (l3.FLOATING_IP_ADDRESS, - l3.FLOATING_NETWORK_ID, - l3.ROUTER_ID, - l3.PORT_ID, - l3.FIXED_IP_ADDRESS, - l3.SUBNET_ID, - l3.EXTERNAL_GW_INFO) diff --git a/neutron_lib/tests/unit/api/definitions/test_logging.py b/neutron_lib/tests/unit/api/definitions/test_logging.py deleted file mode 100644 index 7ae5f51..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_logging.py +++ /dev/null @@ -1,30 +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 neutron_lib.api.definitions import logging as log_api -from neutron_lib.tests.unit.api.definitions import base - -EXTENSION_ATTRIBUTES = ( - 'event', - 'target_id', - 'resource_type', - 'enabled', - 'resource_id', - 'type', -) - - -class LoggingApiTestCase(base.DefinitionBaseTestCase): - extension_module = log_api - extension_attributes = EXTENSION_ATTRIBUTES - extension_resources = (log_api.LOGS, - log_api.LOG_TYPES,) diff --git a/neutron_lib/tests/unit/api/definitions/test_logging_resource.py b/neutron_lib/tests/unit/api/definitions/test_logging_resource.py deleted file mode 100644 index 17fe21d..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_logging_resource.py +++ /dev/null @@ -1,25 +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 neutron_lib.api.definitions import logging_resource -from neutron_lib.tests.unit.api.definitions import base - - -class LoggingResourceDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = logging_resource - extension_resources = (logging_resource.COLLECTION_NAME,) - extension_subresources = (logging_resource.FIREWALL_LOGS,) - extension_attributes = (logging_resource.ENABLED, - logging_resource.FIREWALL_LOGS, - logging_resource.LOGGING_RESOURCE_ID, - logging_resource.FW_EVENT, - logging_resource.FIREWALL_ID,) diff --git a/neutron_lib/tests/unit/api/definitions/test_network.py b/neutron_lib/tests/unit/api/definitions/test_network.py deleted file mode 100644 index 78558e6..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_network.py +++ /dev/null @@ -1,19 +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 neutron_lib.api.definitions import network -from neutron_lib.tests.unit.api.definitions import base - - -class NetworkDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = network - extension_attributes = () diff --git a/neutron_lib/tests/unit/api/definitions/test_network_mtu.py b/neutron_lib/tests/unit/api/definitions/test_network_mtu.py deleted file mode 100644 index 799852f..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_network_mtu.py +++ /dev/null @@ -1,19 +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 neutron_lib.api.definitions import network_mtu -from neutron_lib.tests.unit.api.definitions import base - - -class NetworkMtuDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = network_mtu - extension_attributes = ('mtu',) diff --git a/neutron_lib/tests/unit/api/definitions/test_port.py b/neutron_lib/tests/unit/api/definitions/test_port.py deleted file mode 100644 index d3b8824..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_port.py +++ /dev/null @@ -1,19 +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 neutron_lib.api.definitions import port -from neutron_lib.tests.unit.api.definitions import base - - -class PortDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = port - extension_attributes = () diff --git a/neutron_lib/tests/unit/api/definitions/test_port_security.py b/neutron_lib/tests/unit/api/definitions/test_port_security.py deleted file mode 100644 index 1a7a792..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_port_security.py +++ /dev/null @@ -1,19 +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 neutron_lib.api.definitions import port_security -from neutron_lib.tests.unit.api.definitions import base - - -class PortSecurityDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = port_security - extension_attributes = ('port_security_enabled',) diff --git a/neutron_lib/tests/unit/api/definitions/test_portbindings.py b/neutron_lib/tests/unit/api/definitions/test_portbindings.py deleted file mode 100644 index a5ea16a..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_portbindings.py +++ /dev/null @@ -1,24 +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 neutron_lib.api.definitions import portbindings -from neutron_lib.tests.unit.api.definitions import base - - -class PortbindingsDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = portbindings - extension_resources = (portbindings.COLLECTION_NAME,) - extension_attributes = (portbindings.VIF_TYPE, - portbindings.VIF_DETAILS, - portbindings.VNIC_TYPE, - portbindings.HOST_ID, - portbindings.PROFILE) diff --git a/neutron_lib/tests/unit/api/definitions/test_provider_net.py b/neutron_lib/tests/unit/api/definitions/test_provider_net.py deleted file mode 100644 index 22c0d47..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_provider_net.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import provider_net -from neutron_lib.tests.unit.api.definitions import base - - -class ProviderNetTestCase(base.DefinitionBaseTestCase): - extension_module = provider_net - extension_resources = (provider_net.COLLECTION_NAME,) - extension_attributes = provider_net.ATTRIBUTES diff --git a/neutron_lib/tests/unit/api/definitions/test_router_interface_fip.py b/neutron_lib/tests/unit/api/definitions/test_router_interface_fip.py deleted file mode 100644 index a757173..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_router_interface_fip.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import router_interface_fip -from neutron_lib.tests.unit.api.definitions import base - - -class RouterInterfaceFipDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = router_interface_fip - extension_resources = () - extension_attributes = () diff --git a/neutron_lib/tests/unit/api/definitions/test_subnet.py b/neutron_lib/tests/unit/api/definitions/test_subnet.py deleted file mode 100644 index 150e932..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_subnet.py +++ /dev/null @@ -1,19 +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 neutron_lib.api.definitions import subnet -from neutron_lib.tests.unit.api.definitions import base - - -class SubnetDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = subnet - extension_attributes = () diff --git a/neutron_lib/tests/unit/api/definitions/test_subnetpool.py b/neutron_lib/tests/unit/api/definitions/test_subnetpool.py deleted file mode 100644 index 073d2f2..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_subnetpool.py +++ /dev/null @@ -1,19 +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 neutron_lib.api.definitions import subnetpool -from neutron_lib.tests.unit.api.definitions import base - - -class SubnetPoolDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = subnetpool - extension_attributes = () diff --git a/neutron_lib/tests/unit/api/definitions/test_trunk.py b/neutron_lib/tests/unit/api/definitions/test_trunk.py deleted file mode 100644 index 9da186a..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_trunk.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import trunk -from neutron_lib.tests.unit.api.definitions import base - - -class TrunkDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = trunk - extension_resources = (trunk.TRUNKS,) - extension_attributes = (trunk.SUB_PORTS,) diff --git a/neutron_lib/tests/unit/api/definitions/test_trunk_details.py b/neutron_lib/tests/unit/api/definitions/test_trunk_details.py deleted file mode 100644 index f913c13..0000000 --- a/neutron_lib/tests/unit/api/definitions/test_trunk_details.py +++ /dev/null @@ -1,20 +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 neutron_lib.api.definitions import trunk_details -from neutron_lib.tests.unit.api.definitions import base - - -class TrunkDetailsDefinitionTestCase(base.DefinitionBaseTestCase): - extension_module = trunk_details - extension_resource = (trunk_details.COLLECTION_NAME,) - extension_attributes = (trunk_details.TRUNK_DETAILS,) diff --git a/neutron_lib/tests/unit/api/test_attributes.py b/neutron_lib/tests/unit/api/test_attributes.py deleted file mode 100644 index 226f953..0000000 --- a/neutron_lib/tests/unit/api/test_attributes.py +++ /dev/null @@ -1,271 +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 oslo_utils import uuidutils -import testtools -from webob import exc - -from neutron_lib.api import attributes -from neutron_lib.api import converters -from neutron_lib.api.definitions import network -from neutron_lib.api.definitions import port -from neutron_lib.api.definitions import subnet -from neutron_lib.api.definitions import subnetpool -from neutron_lib import constants -from neutron_lib import context -from neutron_lib import exceptions - -from neutron_lib.tests import _base as base - - -class TestPopulateProjectInfo(base.BaseTestCase): - - def test_populate_project_info_add_project(self): - attrs_in = {'tenant_id': uuidutils.generate_uuid()} - attrs_out = attributes.populate_project_info(attrs_in) - self.assertIn('project_id', attrs_out) - self.assertEqual(attrs_in['tenant_id'], attrs_out['project_id']) - self.assertEqual(2, len(attrs_out)) - - def test_populate_project_info_add_tenant(self): - attrs_in = {'project_id': uuidutils.generate_uuid()} - attrs_out = attributes.populate_project_info(attrs_in) - self.assertIn('tenant_id', attrs_out) - self.assertEqual(attrs_in['project_id'], attrs_out['tenant_id']) - self.assertEqual(2, len(attrs_out)) - - def test_populate_project_info_ids_match(self): - project_id = uuidutils.generate_uuid() - attrs_in = {'project_id': project_id, 'tenant_id': project_id} - attrs_out = attributes.populate_project_info(attrs_in) - self.assertEqual(attrs_in, attrs_out) - - def test_populate_project_info_id_mismatch(self): - attrs = { - 'project_id': uuidutils.generate_uuid(), - 'tenant_id': uuidutils.generate_uuid() - } - self.assertRaises(exc.HTTPBadRequest, - attributes.populate_project_info, attrs) - - -class TestAttributeInfo(base.BaseTestCase): - - class _MyException(Exception): - pass - - _EXC_CLS = _MyException - _RESOURCE_NAME = 'thing' - _RESOURCE_ATTRS = {'name': {}, 'type': {}} - _RESOURCE_MAP = {_RESOURCE_NAME: _RESOURCE_ATTRS} - _ATTRS_INSTANCE = attributes.AttributeInfo(_RESOURCE_MAP) - - def test_create_from_attribute_info_instance(self): - cloned_attrs = attributes.AttributeInfo( - TestAttributeInfo._ATTRS_INSTANCE) - - self.assertEqual(TestAttributeInfo._ATTRS_INSTANCE.attributes, - cloned_attrs.attributes) - - def test_create_from_api_def(self): - self.assertEqual( - port.RESOURCE_ATTRIBUTE_MAP, - attributes.AttributeInfo(port.RESOURCE_ATTRIBUTE_MAP).attributes) - - def _test_fill_default_value(self, attr_inst, expected, res_dict, - check_allow_post=True): - attr_inst.fill_post_defaults( - res_dict, check_allow_post=check_allow_post) - self.assertEqual(expected, res_dict) - - def test_fill_default_value_ok(self): - attr_info = { - 'key': { - 'allow_post': True, - 'default': constants.ATTR_NOT_SPECIFIED, - }, - } - attr_inst = attributes.AttributeInfo(attr_info) - self._test_fill_default_value(attr_inst, {'key': 'X'}, {'key': 'X'}) - self._test_fill_default_value( - attr_inst, {'key': constants.ATTR_NOT_SPECIFIED}, {}) - - def test_override_no_allow_post(self): - attr_info = { - 'key': { - 'allow_post': False, - 'default': constants.ATTR_NOT_SPECIFIED, - }, - } - attr_inst = attributes.AttributeInfo(attr_info) - self._test_fill_default_value(attr_inst, {'key': 'X'}, {'key': 'X'}, - check_allow_post=False) - - def test_fill_no_default_value_allow_post(self): - attr_info = { - 'key': { - 'allow_post': True, - }, - } - attr_inst = attributes.AttributeInfo(attr_info) - self._test_fill_default_value(attr_inst, {'key': 'X'}, {'key': 'X'}) - self.assertRaises(exceptions.InvalidInput, - self._test_fill_default_value, - attr_inst, {'key': 'X'}, {}) - self.assertRaises(self._EXC_CLS, attr_inst.fill_post_defaults, - {}, self._EXC_CLS) - - def test_fill_no_default_value_no_allow_post(self): - attr_info = { - 'key': { - 'allow_post': False, - }, - } - attr_inst = attributes.AttributeInfo(attr_info) - self.assertRaises(exceptions.InvalidInput, - self._test_fill_default_value, - attr_inst, {'key': 'X'}, {'key': 'X'}) - self._test_fill_default_value(attr_inst, {}, {}) - self.assertRaises(self._EXC_CLS, attr_inst.fill_post_defaults, - {'key': 'X'}, self._EXC_CLS) - - def _test_convert_value(self, attr_inst, expected, res_dict): - attr_inst.convert_values(res_dict) - self.assertEqual(expected, res_dict) - - def test_convert_value(self): - attr_info = { - 'key': { - }, - } - attr_inst = attributes.AttributeInfo(attr_info) - self._test_convert_value(attr_inst, - {'key': constants.ATTR_NOT_SPECIFIED}, - {'key': constants.ATTR_NOT_SPECIFIED}) - self._test_convert_value(attr_inst, {'key': 'X'}, {'key': 'X'}) - self._test_convert_value(attr_inst, - {'other_key': 'X'}, {'other_key': 'X'}) - - attr_info = { - 'key': { - 'convert_to': converters.convert_to_int, - }, - } - attr_inst = attributes.AttributeInfo(attr_info) - self._test_convert_value(attr_inst, - {'key': constants.ATTR_NOT_SPECIFIED}, - {'key': constants.ATTR_NOT_SPECIFIED}) - self._test_convert_value(attr_inst, {'key': 1}, {'key': '1'}) - self._test_convert_value(attr_inst, {'key': 1}, {'key': 1}) - self.assertRaises(exceptions.InvalidInput, self._test_convert_value, - attr_inst, {'key': 1}, {'key': 'a'}) - - attr_info = { - 'key': { - 'validate': {'type:uuid': None}, - }, - } - attr_inst = attributes.AttributeInfo(attr_info) - self._test_convert_value(attr_inst, - {'key': constants.ATTR_NOT_SPECIFIED}, - {'key': constants.ATTR_NOT_SPECIFIED}) - uuid_str = '01234567-1234-1234-1234-1234567890ab' - self._test_convert_value(attr_inst, - {'key': uuid_str}, {'key': uuid_str}) - self.assertRaises(exceptions.InvalidInput, self._test_convert_value, - attr_inst, {'key': 1}, {'key': 1}) - self.assertRaises(self._EXC_CLS, attr_inst.convert_values, - {'key': 1}, self._EXC_CLS) - - def test_populate_project_id_admin_req(self): - tenant_id_1 = uuidutils.generate_uuid() - tenant_id_2 = uuidutils.generate_uuid() - # non-admin users can't create a res on behalf of another project - ctx = context.Context(user_id=None, tenant_id=tenant_id_1) - res_dict = {'tenant_id': tenant_id_2} - attr_inst = attributes.AttributeInfo({}) - self.assertRaises(exc.HTTPBadRequest, - attr_inst.populate_project_id, - ctx, res_dict, None) - # but admin users can - ctx.is_admin = True - attr_inst.populate_project_id(ctx, res_dict, is_create=False) - - def test_populate_project_id_from_context(self): - tenant_id = uuidutils.generate_uuid() - ctx = context.Context(user_id=None, tenant_id=tenant_id) - # for each create request, the tenant_id should be added to the - # req body - res_dict = {} - attr_inst = attributes.AttributeInfo({}) - attr_inst.populate_project_id(ctx, res_dict, is_create=True) - self.assertEqual( - {'tenant_id': ctx.tenant_id, 'project_id': ctx.tenant_id}, - res_dict) - - def test_populate_project_id_mandatory_not_specified(self): - tenant_id = uuidutils.generate_uuid() - ctx = context.Context(user_id=None, tenant_id=tenant_id) - # if the tenant_id is mandatory for the resource and not specified - # in the request nor in the context, an exception should be raised - res_dict = {} - attr_info = {'tenant_id': {'allow_post': True}} - ctx.tenant_id = None - attr_inst = attributes.AttributeInfo(attr_info) - self.assertRaises(exc.HTTPBadRequest, - attr_inst.populate_project_id, - ctx, res_dict, True) - - def test_populate_project_id_not_mandatory(self): - ctx = context.Context(user_id=None) - # if the tenant_id is not mandatory for the resource it should be - # OK if it is not in the request. - res_dict = {'name': 'test_port'} - attr_inst = attributes.AttributeInfo({}) - ctx.tenant_id = None - attr_inst.populate_project_id(ctx, res_dict, True) - - def test_verify_attributes_null(self): - attributes.AttributeInfo({}).verify_attributes({}) - - def test_verify_attributes_ok_with_project_id(self): - attributes.AttributeInfo( - {'tenant_id': 'foo', 'project_id': 'foo'}).verify_attributes( - {'tenant_id': 'foo'}) - - def test_verify_attributes_ok_subset(self): - attributes.AttributeInfo( - {'attr1': 'foo', 'attr2': 'bar'}).verify_attributes( - {'attr1': 'foo'}) - - def test_verify_attributes_unrecognized(self): - with testtools.ExpectedException(exc.HTTPBadRequest) as bad_req: - attributes.AttributeInfo( - {'attr1': 'foo'}).verify_attributes( - {'attr1': 'foo', 'attr2': 'bar'}) - self.assertEqual(bad_req.message, - "Unrecognized attribute(s) 'attr2'") - - -class TestCoreResources(base.BaseTestCase): - - CORE_DEFS = [network, port, subnet, subnetpool] - - def test_core_resource_names(self): - self.assertEqual( - sorted([r.COLLECTION_NAME for r in TestCoreResources.CORE_DEFS]), - sorted(attributes.RESOURCES.keys())) - - def test_core_resource_attrs(self): - for r in TestCoreResources.CORE_DEFS: - self.assertIs(r.RESOURCE_ATTRIBUTE_MAP[r.COLLECTION_NAME], - attributes.RESOURCES[r.COLLECTION_NAME]) diff --git a/neutron_lib/tests/unit/api/test_conversions.py b/neutron_lib/tests/unit/api/test_conversions.py deleted file mode 100644 index 99db4db..0000000 --- a/neutron_lib/tests/unit/api/test_conversions.py +++ /dev/null @@ -1,300 +0,0 @@ -# Copyright 2012 OpenStack Foundation -# 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. - -import six -import testtools - -from neutron_lib.api import converters -from neutron_lib import constants -from neutron_lib import exceptions as n_exc -from neutron_lib.tests import _base as base -from neutron_lib.tests import _tools as tools - - -class TestConvertToBoolean(base.BaseTestCase): - - def test_convert_to_boolean_bool(self): - self.assertIs(converters.convert_to_boolean(True), True) - self.assertIs(converters.convert_to_boolean(False), False) - - def test_convert_to_boolean_int(self): - self.assertIs(converters.convert_to_boolean(0), False) - self.assertIs(converters.convert_to_boolean(1), True) - self.assertRaises(n_exc.InvalidInput, - converters.convert_to_boolean, - 7) - - def test_convert_to_boolean_str(self): - self.assertIs(converters.convert_to_boolean('True'), True) - self.assertIs(converters.convert_to_boolean('true'), True) - self.assertIs(converters.convert_to_boolean('False'), False) - self.assertIs(converters.convert_to_boolean('false'), False) - self.assertIs(converters.convert_to_boolean('0'), False) - self.assertIs(converters.convert_to_boolean('1'), True) - self.assertRaises(n_exc.InvalidInput, - converters.convert_to_boolean, - '7') - - def test_convert_to_boolean_if_not_none(self): - self.assertIsNone(converters.convert_to_boolean_if_not_none(None)) - self.assertIs(converters.convert_to_boolean_if_not_none(1), True) - - -class TestConvertToInt(base.BaseTestCase): - - def test_convert_to_int_int(self): - self.assertEqual(-1, converters.convert_to_int(-1)) - self.assertEqual(0, converters.convert_to_int(0)) - self.assertEqual(1, converters.convert_to_int(1)) - - def test_convert_to_int_if_not_none(self): - self.assertEqual(-1, converters.convert_to_int_if_not_none(-1)) - self.assertEqual(0, converters.convert_to_int_if_not_none(0)) - self.assertEqual(1, converters.convert_to_int_if_not_none(1)) - self.assertIsNone(converters.convert_to_int_if_not_none(None)) - - def test_convert_to_int_str(self): - self.assertEqual(4, converters.convert_to_int('4')) - self.assertEqual(6, converters.convert_to_int('6')) - self.assertRaises(n_exc.InvalidInput, - converters.convert_to_int, - 'garbage') - - def test_convert_to_int_none(self): - self.assertRaises(n_exc.InvalidInput, - converters.convert_to_int, - None) - - def test_convert_none_to_empty_list_none(self): - self.assertEqual([], converters.convert_none_to_empty_list(None)) - - def test_convert_none_to_empty_dict(self): - self.assertEqual({}, converters.convert_none_to_empty_dict(None)) - - def test_convert_none_to_empty_list_value(self): - values = ['1', 3, [], [1], {}, {'a': 3}] - for value in values: - self.assertEqual( - value, converters.convert_none_to_empty_list(value)) - - -class TestConvertToFloat(base.BaseTestCase): - # NOTE: the routine being tested here is a plugin-specific extension - # module. As the plugin split proceed towards its second phase this - # test should either be remove, or the validation routine moved into - # neutron.api.v2.attributes - - def test_convert_to_float_positve_value(self): - self.assertEqual( - 1.111, converters.convert_to_positive_float_or_none(1.111)) - self.assertEqual(1, converters.convert_to_positive_float_or_none(1)) - self.assertEqual(0, converters.convert_to_positive_float_or_none(0)) - - def test_convert_to_float_negative_value(self): - self.assertRaises(n_exc.InvalidInput, - converters.convert_to_positive_float_or_none, - -1.11) - - def test_convert_to_float_string(self): - self.assertEqual(4, converters.convert_to_positive_float_or_none('4')) - self.assertEqual( - 4.44, converters.convert_to_positive_float_or_none('4.44')) - self.assertRaises(n_exc.InvalidInput, - converters.convert_to_positive_float_or_none, - 'garbage') - - def test_convert_to_float_none_value(self): - self.assertIsNone(converters.convert_to_positive_float_or_none(None)) - - -class TestConvertKvp(base.BaseTestCase): - - def test_convert_kvp_list_to_dict_succeeds_for_missing_values(self): - result = converters.convert_kvp_list_to_dict(['True']) - self.assertEqual({}, result) - - def test_convert_kvp_list_to_dict_succeeds_for_multiple_values(self): - result = converters.convert_kvp_list_to_dict( - ['a=b', 'a=c', 'a=c', 'b=a']) - expected = {'a': tools.UnorderedList(['c', 'b']), 'b': ['a']} - self.assertEqual(expected, result) - - def test_convert_kvp_list_to_dict_succeeds_for_values(self): - result = converters.convert_kvp_list_to_dict(['a=b', 'c=d']) - self.assertEqual({'a': ['b'], 'c': ['d']}, result) - - def test_convert_kvp_str_to_list_fails_for_missing_key(self): - with testtools.ExpectedException(n_exc.InvalidInput): - converters.convert_kvp_str_to_list('=a') - - def test_convert_kvp_str_to_list_fails_for_missing_equals(self): - with testtools.ExpectedException(n_exc.InvalidInput): - converters.convert_kvp_str_to_list('a') - - def test_convert_kvp_str_to_list_succeeds_for_one_equals(self): - result = converters.convert_kvp_str_to_list('a=') - self.assertEqual(['a', ''], result) - - def test_convert_kvp_str_to_list_succeeds_for_two_equals(self): - result = converters.convert_kvp_str_to_list('a=a=a') - self.assertEqual(['a', 'a=a'], result) - - -class TestConvertToList(base.BaseTestCase): - - def test_convert_to_empty_list(self): - for item in (None, [], (), {}): - self.assertEqual([], converters.convert_to_list(item)) - - def test_convert_to_list_string(self): - for item in ('', 'foo'): - self.assertEqual([item], converters.convert_to_list(item)) - - def test_convert_to_list_iterable(self): - for item in ([None], [1, 2, 3], (1, 2, 3), set([1, 2, 3]), ['foo']): - self.assertEqual(list(item), converters.convert_to_list(item)) - - def test_convert_to_list_non_iterable(self): - for item in (True, False, 1, 1.2, object()): - self.assertEqual([item], converters.convert_to_list(item)) - - -class TestConvertIPv6AddrCanonicalFormat(base.BaseTestCase): - - def test_convert_ipv6_address_extended_add_with_zeroes(self): - result = converters.convert_ip_to_canonical_format( - u'2001:0db8:0:0:0:0:0:0001') - self.assertEqual(u'2001:db8::1', result) - - @testtools.skipIf(tools.is_bsd(), 'bug/1484837') - def test_convert_ipv6_compressed_address_OSX_skip(self): - result = converters.convert_ip_to_canonical_format( - u'2001:db8:0:1:1:1:1:1') - self.assertEqual(u'2001:db8:0:1:1:1:1:1', result) - - def test_convert_ipv6_extended_addr_to_compressed(self): - result = converters.convert_ip_to_canonical_format( - u"Fe80:0:0:0:0:0:0:1") - self.assertEqual(u'fe80::1', result) - - def test_convert_ipv4_address(self): - result = converters.convert_ip_to_canonical_format(u"192.168.1.1") - self.assertEqual(u'192.168.1.1', result) - - def test_convert_None_address(self): - result = converters.convert_ip_to_canonical_format(None) - self.assertIsNone(result) - - def test_convert_invalid_address(self): - result = converters.convert_ip_to_canonical_format("on") - self.assertEqual("on", result) - - -class TestConvertIPv6CIDRCanonicalFormat(base.BaseTestCase): - - def test_convert_ipv4_address_with_CIDR(self): - result = converters.convert_cidr_to_canonical_format(u'192.168.1.1/24') - self.assertEqual(u'192.168.1.1/24', result) - - def test_convert_ipv6_extended_addr_withcidr_to_compressed(self): - result = converters.convert_cidr_to_canonical_format( - u'Fe80:0:0:0:0:0:0:1/64') - self.assertEqual(u'fe80::1/64', result) - - def test_convert_non_ip_addr_with_slash(self): - with testtools.ExpectedException(n_exc.InvalidInput): - converters.convert_cidr_to_canonical_format( - u"Dormamu/DarkSeid/Vulture") - - -class TestConvertStringToCaseInsensitive(base.BaseTestCase): - - def test_convert_string_to_lower(self): - result = converters.convert_string_to_case_insensitive(u"THIS Is tEsT") - self.assertIsInstance(result, six.string_types) - - def test_assert_error_on_non_string(self): - for invalid in [[], 123]: - with testtools.ExpectedException(n_exc.InvalidInput): - converters.convert_string_to_case_insensitive(invalid) - - -class TestConvertProtocol(base.BaseTestCase): - - def test_tcp_is_valid(self): - result = converters.convert_to_protocol(constants.PROTO_NAME_TCP) - self.assertEqual(constants.PROTO_NAME_TCP, result) - proto_num_str = str(constants.PROTO_NUM_TCP) - result = converters.convert_to_protocol(proto_num_str) - self.assertEqual(proto_num_str, result) - - def test_udp_is_valid(self): - result = converters.convert_to_protocol(constants.PROTO_NAME_UDP) - self.assertEqual(constants.PROTO_NAME_UDP, result) - proto_num_str = str(constants.PROTO_NUM_UDP) - result = converters.convert_to_protocol(proto_num_str) - self.assertEqual(proto_num_str, result) - - def test_icmp_is_valid(self): - result = converters.convert_to_protocol(constants.PROTO_NAME_ICMP) - self.assertEqual(constants.PROTO_NAME_ICMP, result) - proto_num_str = str(constants.PROTO_NUM_ICMP) - result = converters.convert_to_protocol(proto_num_str) - self.assertEqual(proto_num_str, result) - - def test_numeric_is_valid(self): - proto_num_str = str(constants.PROTO_NUM_IGMP) - result = converters.convert_to_protocol(proto_num_str) - self.assertEqual(proto_num_str, result) - - def test_numeric_too_high(self): - with testtools.ExpectedException(n_exc.InvalidInput): - converters.convert_to_protocol("300") - - def test_numeric_too_low(self): - with testtools.ExpectedException(n_exc.InvalidInput): - converters.convert_to_protocol("-1") - - def test_unknown_string(self): - with testtools.ExpectedException(n_exc.InvalidInput): - converters.convert_to_protocol("Invalid") - - -class TestConvertToString(base.BaseTestCase): - - def test_data_is_string(self): - self.assertEqual('10000', converters.convert_to_string('10000')) - - def test_data_is_integer(self): - self.assertEqual('10000', converters.convert_to_string(10000)) - - def test_data_is_integer_zero(self): - self.assertEqual('0', converters.convert_to_string(0)) - - def test_data_is_none(self): - self.assertIsNone(converters.convert_to_string(None)) - - def test_data_is_empty_list(self): - self.assertEqual('[]', converters.convert_to_string([])) - - def test_data_is_list(self): - self.assertEqual("[1, 2, 3]", converters.convert_to_string([1, 2, 3])) - - def test_data_is_empty_dict(self): - self.assertEqual('{}', converters.convert_to_string({})) - - def test_data_is_dict(self): - self.assertEqual("{'foo': 'bar'}", - converters.convert_to_string({'foo': 'bar'})) diff --git a/neutron_lib/tests/unit/api/test_extensions.py b/neutron_lib/tests/unit/api/test_extensions.py deleted file mode 100644 index 5e4a7da..0000000 --- a/neutron_lib/tests/unit/api/test_extensions.py +++ /dev/null @@ -1,219 +0,0 @@ -# Copyright 2016 OpenStack Foundation -# 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 neutron_lib.api import extensions -from neutron_lib import fixture -from neutron_lib.services import base as service_base -from neutron_lib.tests import _base as base - - -class InheritFromExtensionDescriptor(extensions.ExtensionDescriptor): - """Class to inherit from ExtensionDescriptor to test its methods - - Because ExtensionDescriptor is an abstract class, in order to test methods - we need to create something to inherit from it so we have something - instantiatable. The only things defined here are those that are required - because in ExtensionDescriptor they are marked as @abc.abstractmethod. - """ - - def get_name(self): - pass - - def get_alias(self): - pass - - def get_description(self): - pass - - def get_updated(self): - pass - - def update_attributes_map_save(self, extended_attributes, - extension_attrs_map=None): - """Update attributes map for this extension. - - This is default method for extending an extension's attributes map. - An extension can use this method and supplying its own resource - attribute map in extension_attrs_map argument to extend all its - attributes that needs to be extended. - - If an extension does not implement update_attributes_map, the method - does nothing and just return. - """ - if not extension_attrs_map: - return - - for resource, attrs in extension_attrs_map.items(): - extended_attrs = extended_attributes.get(resource) - if extended_attrs: - attrs.update(extended_attrs) - - -class TestExtensionDescriptor(base.BaseTestCase): - - def _setup_attribute_maps(self): - self.extended_attributes = {'resource_one': {'one': 'first'}, - 'resource_two': {'two': 'second'}} - self.extension_attrs_map = {'resource_one': {'three': 'third'}} - - def test_update_attributes_map_works(self): - self._setup_attribute_maps() - extension_description = InheritFromExtensionDescriptor() - extension_description.update_attributes_map(self.extended_attributes, - self.extension_attrs_map) - self.assertEqual(self.extension_attrs_map, - {'resource_one': {'one': 'first', - 'three': 'third'}}) - - def test_update_attributes_map_short_circuit_exit(self): - self._setup_attribute_maps() - extension_description = InheritFromExtensionDescriptor() - extension_description.update_attributes_map(self.extended_attributes) - self.assertEqual(self.extension_attrs_map, - {'resource_one': {'three': 'third'}}) - - -class DummyPlugin(service_base.ServicePluginBase): - - supported_extension_aliases = ['flash'] - - def get_plugin_type(self): - return 'Flash Gordon' - - def get_plugin_description(self): - return 'Legend!' - - -class TestExtensionIsSupported(base.BaseTestCase): - - def setUp(self): - super(TestExtensionIsSupported, self).setUp() - self._plugin = DummyPlugin() - - def test_extension_exists(self): - self.assertTrue(extensions.is_extension_supported(self._plugin, - "flash")) - - def test_extension_does_not_exist(self): - self.assertFalse(extensions.is_extension_supported(self._plugin, - "gordon")) - - -class TestAPIExtensionDescriptor(base.BaseTestCase): - - # API definition attributes; acts as an API definition module - NAME = 'Test API' - ALIAS = 'test-api' - DESCRIPTION = 'A test API definition' - UPDATED_TIMESTAMP = '2017-02-01T10:00:00-00:00' - RESOURCE_ATTRIBUTE_MAP = {'ports': {}} - REQUIRED_EXTENSIONS = ['l3'] - OPTIONAL_EXTENSIONS = ['fw'] - - def setUp(self): - super(TestAPIExtensionDescriptor, self).setUp() - self.extn = _APIDefinition() - self.empty_extn = _EmptyAPIDefinition() - self.useFixture(fixture.APIDefinitionFixture(self)) - - def test__assert_api_definition_no_defn(self): - self.assertRaises(NotImplementedError, - _NoAPIDefinition._assert_api_definition) - - def test__assert_api_definition_no_attr(self): - self.assertRaises( - NotImplementedError, self.extn._assert_api_definition, attr='NOPE') - - def test_get_name(self): - self.assertEqual(self.NAME, self.extn.get_name()) - - def test_get_name_unset(self): - self.assertRaises(NotImplementedError, _EmptyAPIDefinition.get_name) - - def test_get_alias(self): - self.assertEqual(self.ALIAS, self.extn.get_alias()) - - def test_get_alias_unset(self): - self.assertRaises(NotImplementedError, _EmptyAPIDefinition.get_alias) - - def test_get_description(self): - self.assertEqual(self.DESCRIPTION, self.extn.get_description()) - - def test_get_description_unset(self): - self.assertRaises(NotImplementedError, - _EmptyAPIDefinition.get_description) - - def test_get_updated(self): - self.assertEqual(self.UPDATED_TIMESTAMP, self.extn.get_updated()) - - def test_get_updated_unset(self): - self.assertRaises(NotImplementedError, _EmptyAPIDefinition.get_updated) - - def test_get_extended_resources_v2(self): - self.assertEqual(self.RESOURCE_ATTRIBUTE_MAP, - self.extn.get_extended_resources('2.0')) - - def test_get_extended_resources_v2_unset(self): - self.assertRaises(NotImplementedError, - self.empty_extn.get_extended_resources, '2.0') - - def test_get_extended_resources_v1(self): - self.assertEqual({}, self.extn.get_extended_resources('1.0')) - - def test_get_extended_resources_v1_unset(self): - self.assertEqual({}, self.empty_extn.get_extended_resources('1.0')) - - def test_get_required_extensions(self): - self.assertEqual(self.REQUIRED_EXTENSIONS, - self.extn.get_required_extensions()) - - def test_get_required_extensions_unset(self): - self.assertRaises(NotImplementedError, - self.empty_extn.get_required_extensions) - - def test_get_optional_extensions(self): - self.assertEqual(self.OPTIONAL_EXTENSIONS, - self.extn.get_optional_extensions()) - - def test_get_optional_extensions_unset(self): - self.assertRaises(NotImplementedError, - self.empty_extn.get_optional_extensions) - - def test_update_attributes_map_extensions_unset(self): - self.assertRaises(NotImplementedError, - self.empty_extn.update_attributes_map, {}) - - def test_update_attributes_map_with_ext_attrs(self): - base_attrs = {'ports': {'a': 'A'}} - ext_attrs = {'ports': {'b': 'B'}} - self.extn.update_attributes_map(base_attrs, ext_attrs) - self.assertEqual({'ports': {'a': 'A', 'b': 'B'}}, ext_attrs) - - def test_update_attributes_map_without_ext_attrs(self): - base_attrs = {'ports': {'a': 'A'}} - self.extn.update_attributes_map(base_attrs) - self.assertIn('a', self.extn.get_extended_resources('2.0')['ports']) - - -class _APIDefinition(extensions.APIExtensionDescriptor): - api_definition = TestAPIExtensionDescriptor - - -class _NoAPIDefinition(extensions.APIExtensionDescriptor): - pass - - -class _EmptyAPIDefinition(extensions.APIExtensionDescriptor): - api_definition = {} diff --git a/neutron_lib/tests/unit/api/test_faults.py b/neutron_lib/tests/unit/api/test_faults.py deleted file mode 100644 index 602dae8..0000000 --- a/neutron_lib/tests/unit/api/test_faults.py +++ /dev/null @@ -1,24 +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. - -import webob.exc - -from neutron_lib.api import faults -from neutron_lib.tests import _base as base - - -class TestFaultMap(base.BaseTestCase): - - def test_extend_fault_map(self): - fault_map_dict = {NotImplemented: webob.exc.HTTPServiceUnavailable} - faults.FAULT_MAP.update(fault_map_dict) - self.assertIn(NotImplemented, faults.FAULT_MAP) diff --git a/neutron_lib/tests/unit/api/validators/__init__.py b/neutron_lib/tests/unit/api/validators/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/api/validators/test_dns.py b/neutron_lib/tests/unit/api/validators/test_dns.py deleted file mode 100644 index bd0cfb2..0000000 --- a/neutron_lib/tests/unit/api/validators/test_dns.py +++ /dev/null @@ -1,158 +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. - -import mock - -from neutron_lib.api.validators import dns -from neutron_lib.db import constants as db_constants -from neutron_lib.tests import _base as base - - -class TestDnsValidators(base.BaseTestCase): - - @mock.patch('oslo_config.cfg.CONF') - def test_validate_dns_name(self, CONF): - CONF.dns_domain = '' - msg = dns.validate_dns_name('') - self.assertIsNone(msg) - - CONF.dns_domain = 'example.org.' - dns_name = 'host' - msg = dns.validate_dns_name(dns_name) - self.assertIsNone(msg) - - invalid_data = 'A' * 256 - max_len = 255 - expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " - "'%(data)s' exceeds the %(maxlen)s character FQDN " - "limit") % {'data': invalid_data, 'maxlen': max_len} - msg = dns.validate_dns_name(invalid_data, max_len) - self.assertEqual(expected, msg) - - invalid_data = '.hostname' - expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " - "Encountered an empty component") % {'data': invalid_data} - msg = dns.validate_dns_name(invalid_data) - self.assertEqual(expected, msg) - - invalid_data = 'hostname-' - expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " - "Name '%(data)s' must not start or end with a " - "hyphen") % {'data': invalid_data} - msg = dns.validate_dns_name(invalid_data) - self.assertEqual(expected, msg) - - invalid_data = 'hostname@host' - expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " - "Name '%(data)s' must be 1-63 characters long, each of " - "which can only be alphanumeric or a " - "hyphen") % {'data': invalid_data} - msg = dns.validate_dns_name(invalid_data) - self.assertEqual(expected, msg) - invalid_suffix = '1234' - invalid_data = 'hostname.' + invalid_suffix - expected = ("'%(data)s' not a valid PQDN or FQDN. Reason: " - "TLD '%(suffix)s' must not be all " - "numeric") % {'data': invalid_data, - 'suffix': invalid_suffix} - msg = dns.validate_dns_name(invalid_data) - self.assertEqual(expected, msg) - - # len(dns_name + dns_domain) > 255 - invalid_domain = 'A' * 250 + '.org.' - CONF.dns_domain = invalid_domain - dns_name = 'hostname' - expected = ("The dns_name passed is a PQDN and its size is " - "'%(dns_name_len)s'. The dns_domain option in " - "neutron.conf is set to %(dns_domain)s, with a " - "length of '%(higher_labels_len)s'. When the two are " - "concatenated to form a FQDN (with a '.' at the end), " - "the resulting length exceeds the maximum size " - "of '%(fqdn_max_len)s'" - ) % {'dns_name_len': len(dns_name), - 'dns_domain': invalid_domain, - 'higher_labels_len': len(invalid_domain) + 1, - 'fqdn_max_len': db_constants.FQDN_FIELD_SIZE} - msg = dns.validate_dns_name(dns_name) - self.assertEqual(expected, msg) - - dns_name = 'host.' - dns_domain = 'example.com.' - CONF.dns_domain = dns_domain - expected = ("The dns_name passed is a FQDN. Its higher level labels " - "must be equal to the dns_domain option in neutron.conf, " - "that has been set to '%(dns_domain)s'. It must also " - "include one or more valid DNS labels to the left " - "of '%(dns_domain)s'") % {'dns_domain': dns_domain} - msg = dns.validate_dns_name(dns_name) - self.assertEqual(expected, msg) - - def test_validate_fip_dns_name(self): - # Don't run tests duplicated to validate_dns_name() - - msg = dns.validate_fip_dns_name('') - self.assertIsNone(msg) - - msg = dns.validate_fip_dns_name('host') - self.assertIsNone(msg) - - invalid_data = 1234 - expected = "'%s' is not a valid string" % invalid_data - msg = dns.validate_fip_dns_name(invalid_data) - self.assertEqual(expected, msg) - - invalid_data = 'host.' - expected = ("'%s' is a FQDN. It should be a relative domain " - "name") % invalid_data - msg = dns.validate_fip_dns_name(invalid_data) - self.assertEqual(expected, msg) - - length = 10 - invalid_data = 'a' * length - max_len = 12 - expected = ("'%(data)s' contains %(length)s characters. Adding a " - "domain name will cause it to exceed the maximum length " - "of a FQDN of '%(max_len)s'") % {"data": invalid_data, - "length": length, - "max_len": max_len} - msg = dns.validate_fip_dns_name(invalid_data, max_len) - self.assertEqual(expected, msg) - - def test_validate_dns_domain(self): - # Don't run tests duplicated to validate_dns_name() - - msg = dns.validate_dns_domain('') - self.assertIsNone(msg) - - msg = dns.validate_dns_domain('example.com.') - self.assertIsNone(msg) - - invalid_data = 1234 - expected = "'%s' is not a valid string" % invalid_data - msg = dns.validate_dns_domain(invalid_data) - self.assertEqual(expected, msg) - - invalid_data = 'example.com' - expected = "'%s' is not a FQDN" % invalid_data - msg = dns.validate_dns_domain(invalid_data) - self.assertEqual(expected, msg) - - length = 9 - invalid_data = 'a' * length + '.' - max_len = 11 - expected = ("'%(data)s' contains %(length)s characters. Adding a " - "sub-domain will cause it to exceed the maximum length " - "of a FQDN of '%(max_len)s'") % {"data": invalid_data, - "length": length + 1, - "max_len": max_len} - msg = dns.validate_dns_domain(invalid_data, max_len) - self.assertEqual(expected, msg) diff --git a/neutron_lib/tests/unit/api/validators/test_validators.py b/neutron_lib/tests/unit/api/validators/test_validators.py deleted file mode 100644 index a41f3e4..0000000 --- a/neutron_lib/tests/unit/api/validators/test_validators.py +++ /dev/null @@ -1,1204 +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. - -import string - -import mock -import netaddr - -from neutron_lib._i18n import _ -from neutron_lib.api import converters -from neutron_lib.api.definitions import extra_dhcp_opt -from neutron_lib.api import validators -from neutron_lib import constants -from neutron_lib import exceptions as n_exc -from neutron_lib.tests import _base as base - - -def dummy_validator(data, valid_values=None): - pass - - -class TestAttributeValidation(base.BaseTestCase): - - def _construct_dict_and_constraints(self): - """Constructs a test dictionary and a definition of constraints. - - :return: A (dictionary, constraint) tuple - """ - - constraints = {'key1': {'type:values': ['val1', 'val2'], - 'required': True}, - 'key2': {'type:string': None, - 'required': False}, - 'key3': {'type:dict': {'k4': {'type:string': None, - 'required': True}}, - 'required': True}} - - dictionary = {'key1': 'val1', - 'key2': 'a string value', - 'key3': {'k4': 'a string value'}} - - return dictionary, constraints - - def test_type_prefixing(self): - validators.add_validator('type:prefixed_type', dummy_validator) - validators.add_validator('unprefixed_type', dummy_validator) - self.assertEqual(dummy_validator, - validators.get_validator('type:prefixed_type')) - self.assertEqual(dummy_validator, - validators.get_validator('prefixed_type')) - self.assertEqual(dummy_validator, - validators.get_validator('type:unprefixed_type')) - self.assertEqual(dummy_validator, - validators.get_validator('unprefixed_type')) - - def test_adding_validator(self): - validators.add_validator('new_type', dummy_validator) - self.assertIn('type:new_type', validators.validators) - self.assertEqual(dummy_validator, - validators.validators['type:new_type']) - - def test_get_validator_default(self): - self.assertEqual(dummy_validator, - validators.get_validator('nope', - default=dummy_validator)) - - def test_fail_adding_duplicate_validator(self): - self.assertRaises(KeyError, - validators.add_validator, - 'dict', lambda x: x) - - def test_success_adding_duplicate_validator(self): - validators.add_validator('dummy', dummy_validator) - validators.add_validator('dummy', dummy_validator) - self.assertEqual(dummy_validator, validators.get_validator('dummy')) - - def test_is_attr_set(self): - data = constants.ATTR_NOT_SPECIFIED - self.assertIs(validators.is_attr_set(data), False) - - data = None - self.assertIs(validators.is_attr_set(data), False) - - data = "I'm set" - self.assertIs(validators.is_attr_set(data), True) - - def test_validate_values(self): - # Check that validation is not performed if valid_values is not set - msg = validators.validate_values(4) - self.assertIsNone(msg) - - # Check that value is within valid_values - msg = validators.validate_values(4, [4, 6]) - self.assertIsNone(msg) - - # Check that value is within valid_values - msg = validators.validate_values(4, (4, 6)) - self.assertIsNone(msg) - - # Check that value is within valid_values with strings - msg = validators.validate_values("1", ["2", "1", "4", "5"]) - self.assertIsNone(msg) - - # Check that value is not compatible for comparison - response = "'valid_values' does not support membership operations" - self.assertRaisesRegex(TypeError, response, - validators.validate_values, data=None, - valid_values=True) - - def test_validate_values_display(self): - # Check that value is NOT within valid_values and report values - msg = validators.validate_values(7, [4, 6], - valid_values_display="[4, 6]") - self.assertEqual("7 is not in [4, 6]", msg) - - # Check that value is NOT within valid_values and report values - msg = validators.validate_values(7, (4, 6), - valid_values_display="(4, 6)") - self.assertEqual("7 is not in (4, 6)", msg) - - # Check values with a range function showing a custom string - msg = validators.validate_values(8, range(8), - valid_values_display="[0..7]") - self.assertEqual("8 is not in [0..7]", msg) - - # Check that value is not within valid_values and custom string - msg = validators.validate_values(1, [2, 3, 4, 5], - valid_values_display="[2, 3, 4, 5]") - self.assertEqual("1 is not in [2, 3, 4, 5]", msg) - - # Check that value is not within valid_values and custom string - msg = validators.validate_values("1", ["2", "3", "4", "5"], - valid_values_display="'valid_values" - "_to_show'") - self.assertEqual("1 is not in 'valid_values_to_show'", msg) - - # Check that value is not comparable to valid_values and got Exception - data = 1 - valid_values = '[2, 3, 4, 5]' - response = "'data' of type '%s' and 'valid_values'of type" \ - " '%s' are not compatible for comparison" % ( - type(data), type(valid_values)) - self.assertRaisesRegex(TypeError, response, - validators.validate_values, data, - valid_values, - valid_values_display="[2, 3, 4, 5]") - - def test_validate_not_empty_string(self): - msg = validators.validate_not_empty_string(' ', None) - self.assertEqual(u"' ' Blank strings are not permitted", msg) - msg = validators.validate_not_empty_string(123, None) - self.assertEqual(u"'123' is not a valid string", msg) - - def test_validate_not_empty_string_or_none(self): - msg = validators.validate_not_empty_string_or_none(' ', None) - self.assertEqual(u"' ' Blank strings are not permitted", msg) - - msg = validators.validate_not_empty_string_or_none(None, None) - self.assertIsNone(msg) - - def test_validate_string_or_none(self): - msg = validators.validate_string_or_none('test', None) - self.assertIsNone(msg) - - msg = validators.validate_string_or_none(None, None) - self.assertIsNone(msg) - - def test_validate_string(self): - msg = validators.validate_string(None, None) - self.assertEqual("'None' is not a valid string", msg) - - # 0 == len(data) == max_len - msg = validators.validate_string("", 0) - self.assertIsNone(msg) - - # 0 == len(data) < max_len - msg = validators.validate_string("", 9) - self.assertIsNone(msg) - - # 0 < len(data) < max_len - msg = validators.validate_string("123456789", 10) - self.assertIsNone(msg) - - # 0 < len(data) == max_len - msg = validators.validate_string("123456789", 9) - self.assertIsNone(msg) - - # 0 < max_len < len(data) - msg = validators.validate_string("1234567890", 9) - self.assertEqual("'1234567890' exceeds maximum length of 9", msg) - - msg = validators.validate_string("123456789", None) - self.assertIsNone(msg) - - def test_validate_list_of_unique_strings(self): - data = "TEST" - msg = validators.validate_list_of_unique_strings(data, None) - self.assertEqual("'TEST' is not a list", msg) - - data = ["TEST01", "TEST02", "TEST01"] - msg = validators.validate_list_of_unique_strings(data, None) - self.assertEqual( - "Duplicate items in the list: 'TEST01'", msg) - - data = ["12345678", "123456789"] - msg = validators.validate_list_of_unique_strings(data, 8) - self.assertEqual("'123456789' exceeds maximum length of 8", msg) - - data = ["TEST01", "TEST02", "TEST03"] - msg = validators.validate_list_of_unique_strings(data, None) - self.assertIsNone(msg) - - def test_validate_boolean(self): - msg = validators.validate_boolean(True) - self.assertIsNone(msg) - msg = validators.validate_boolean(0) - self.assertIsNone(msg) - msg = validators.validate_boolean("false") - self.assertIsNone(msg) - msg = validators.validate_boolean("fasle") - self.assertEqual("'fasle' is not a valid boolean value", msg) - - def test_validate_integer(self): - msg = validators.validate_integer(1) - self.assertIsNone(msg) - msg = validators.validate_integer(0.1) - self.assertEqual("'0.1' is not an integer", msg) - msg = validators.validate_integer("1") - self.assertIsNone(msg) - msg = validators.validate_integer("0.1") - self.assertEqual("'0.1' is not an integer", msg) - msg = validators.validate_integer(True) - self.assertEqual("'True' is not an integer:boolean", msg) - msg = validators.validate_integer(False) - self.assertEqual("'False' is not an integer:boolean", msg) - msg = validators.validate_integer(float('Inf')) - self.assertEqual("'inf' is not an integer", msg) - msg = validators.validate_integer(None) - self.assertEqual("'None' is not an integer", msg) - - def test_validate_integer_values(self): - msg = validators.validate_integer(2, [2, 3, 4, 5]) - self.assertIsNone(msg) - msg = validators.validate_integer(1, [2, 3, 4, 5]) - self.assertEqual("1 is not in valid_values", msg) - - def test_validate_no_whitespace(self): - data = 'no_white_space' - result = validators.validate_no_whitespace(data) - self.assertEqual(data, result) - - self.assertRaises(n_exc.InvalidInput, - validators.validate_no_whitespace, - 'i have whitespace') - - self.assertRaises(n_exc.InvalidInput, - validators.validate_no_whitespace, - 'i\thave\twhitespace') - - for ws in string.whitespace: - self.assertRaises(n_exc.InvalidInput, - validators.validate_no_whitespace, - '%swhitespace-at-head' % ws) - self.assertRaises(n_exc.InvalidInput, - validators.validate_no_whitespace, - 'whitespace-at-tail%s' % ws) - - def test_validate_range(self): - msg = validators.validate_range(1, [1, 9]) - self.assertIsNone(msg) - - msg = validators.validate_range(5, [1, 9]) - self.assertIsNone(msg) - - msg = validators.validate_range(9, [1, 9]) - self.assertIsNone(msg) - - msg = validators.validate_range(1, (1, 9)) - self.assertIsNone(msg) - - msg = validators.validate_range(5, (1, 9)) - self.assertIsNone(msg) - - msg = validators.validate_range(9, (1, 9)) - self.assertIsNone(msg) - - msg = validators.validate_range(0, [1, 9]) - self.assertEqual("'0' is too small - must be at least '1'", msg) - - msg = validators.validate_range(10, (1, 9)) - self.assertEqual("'10' is too large - must be no larger than '9'", msg) - - msg = validators.validate_range("bogus", (1, 9)) - self.assertEqual("'bogus' is not an integer", msg) - - msg = validators.validate_range(10, (validators.UNLIMITED, - validators.UNLIMITED)) - self.assertIsNone(msg) - - msg = validators.validate_range(10, (1, validators.UNLIMITED)) - self.assertIsNone(msg) - - msg = validators.validate_range(1, (validators.UNLIMITED, 9)) - self.assertIsNone(msg) - - msg = validators.validate_range(-1, (0, validators.UNLIMITED)) - self.assertEqual("'-1' is too small - must be at least '0'", msg) - - msg = validators.validate_range(10, (validators.UNLIMITED, 9)) - self.assertEqual("'10' is too large - must be no larger than '9'", msg) - - @mock.patch("neutron_lib.api.validators.validate_range") - def test_validate_range_or_none(self, mock_validate_range): - msg = validators.validate_range_or_none(None, [1, 9]) - self.assertFalse(mock_validate_range.called) - self.assertIsNone(msg) - - validators.validate_range_or_none(1, [1, 9]) - mock_validate_range.assert_called_once_with(1, [1, 9]) - - def _test_validate_mac_address(self, validator, allow_none=False): - mac_addr = "ff:16:3e:4f:00:00" - msg = validator(mac_addr) - self.assertIsNone(msg) - - mac_addr = "ffa:16:3e:4f:00:00" - msg = validator(mac_addr) - err_msg = "'%s' is not a valid MAC address" - self.assertEqual(err_msg % mac_addr, msg) - - for invalid_mac_addr in constants.INVALID_MAC_ADDRESSES: - msg = validator(invalid_mac_addr) - self.assertEqual(err_msg % invalid_mac_addr, msg) - - mac_addr = "123" - msg = validator(mac_addr) - self.assertEqual(err_msg % mac_addr, msg) - - mac_addr = None - msg = validator(mac_addr) - if allow_none: - self.assertIsNone(msg) - else: - self.assertEqual(err_msg % mac_addr, msg) - - mac_addr = "ff:16:3e:4f:00:00\r" - msg = validator(mac_addr) - self.assertEqual(err_msg % mac_addr, msg) - - def test_validate_mac_address(self): - self._test_validate_mac_address(validators.validate_mac_address) - - def test_validate_mac_address_or_none(self): - self._test_validate_mac_address( - validators.validate_mac_address_or_none, allow_none=True) - - def test_validate_ip_address(self): - ip_addr = '1.1.1.1' - msg = validators.validate_ip_address(ip_addr) - self.assertIsNone(msg) - - ip_addr = '1111.1.1.1' - msg = validators.validate_ip_address(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - # Depending on platform to run UTs, this case might or might not be - # an equivalent to test_validate_ip_address_bsd. - ip_addr = '1' * 59 - msg = validators.validate_ip_address(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - ip_addr = '1.1.1.1 has whitespace' - msg = validators.validate_ip_address(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - ip_addr = '111.1.1.1\twhitespace' - msg = validators.validate_ip_address(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - ip_addr = '111.1.1.1\nwhitespace' - msg = validators.validate_ip_address(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - for ws in string.whitespace: - ip_addr = '%s111.1.1.1' % ws - msg = validators.validate_ip_address(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - for ws in string.whitespace: - ip_addr = '111.1.1.1%s' % ws - msg = validators.validate_ip_address(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - def test_validate_ip_address_with_leading_zero(self): - ip_addr = '1.1.1.01' - expected_msg = ("'%(data)s' is not an accepted IP address, " - "'%(ip)s' is recommended") - msg = validators.validate_ip_address(ip_addr) - self.assertEqual(expected_msg % {"data": ip_addr, "ip": '1.1.1.1'}, - msg) - - ip_addr = '1.1.1.011' - msg = validators.validate_ip_address(ip_addr) - self.assertEqual(expected_msg % {"data": ip_addr, "ip": '1.1.1.11'}, - msg) - - ip_addr = '1.1.1.09' - msg = validators.validate_ip_address(ip_addr) - self.assertEqual(expected_msg % {"data": ip_addr, "ip": '1.1.1.9'}, - msg) - - ip_addr = "fe80:0:0:0:0:0:0:0001" - msg = validators.validate_ip_address(ip_addr) - self.assertIsNone(msg) - - def test_validate_ip_address_bsd(self): - # NOTE(yamamoto): On NetBSD and OS X, netaddr.IPAddress() accepts - # '1' * 59 as a valid address. The behaviour is inherited from - # libc behaviour there. This test ensures that our validator reject - # such addresses on such platforms by mocking netaddr to emulate - # the behaviour. - ip_addr = '1' * 59 - with mock.patch('netaddr.IPAddress') as ip_address_cls: - msg = validators.validate_ip_address(ip_addr) - ip_address_cls.assert_called_once_with(ip_addr, - flags=netaddr.core.ZEROFILL) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - def test_validate_ip_pools(self): - pools = [[{'end': '10.0.0.254'}], - [{'start': '10.0.0.254'}], - [{'start': '1000.0.0.254', - 'end': '1.1.1.1'}], - [{'start': '10.0.0.2', 'end': '10.0.0.254', - 'forza': 'juve'}], - [{'start': '10.0.0.2', 'end': '10.0.0.254'}, - {'end': '10.0.0.254'}], - [None], - None] - for pool in pools: - msg = validators.validate_ip_pools(pool) - self.assertIsNotNone(msg) - - pools = [[{'end': '10.0.0.254', 'start': '10.0.0.2'}, - {'start': '11.0.0.2', 'end': '11.1.1.1'}], - [{'start': '11.0.0.2', 'end': '11.0.0.100'}]] - for pool in pools: - msg = validators.validate_ip_pools(pool) - self.assertIsNone(msg) - - invalid_ip = '10.0.0.2\r' - pools = [[{'end': '10.0.0.254', 'start': invalid_ip}]] - for pool in pools: - msg = validators.validate_ip_pools(pool) - self.assertEqual("'%s' is not a valid IP address" % invalid_ip, - msg) - - def test_validate_fixed_ips(self): - fixed_ips = [ - {'data': [{'subnet_id': '00000000-ffff-ffff-ffff-000000000000', - 'ip_address': '1111.1.1.1'}], - 'error_msg': "'1111.1.1.1' is not a valid IP address"}, - {'data': [{'subnet_id': 'invalid', - 'ip_address': '1.1.1.1'}], - 'error_msg': "'invalid' is not a valid UUID"}, - {'data': None, - 'error_msg': "Invalid data format for fixed IP: 'None'"}, - {'data': "1.1.1.1", - 'error_msg': "Invalid data format for fixed IP: '1.1.1.1'"}, - {'data': ['00000000-ffff-ffff-ffff-000000000000', '1.1.1.1'], - 'error_msg': "Invalid data format for fixed IP: " - "'00000000-ffff-ffff-ffff-000000000000'"}, - {'data': [['00000000-ffff-ffff-ffff-000000000000', '1.1.1.1']], - 'error_msg': "Invalid data format for fixed IP: " - "'['00000000-ffff-ffff-ffff-000000000000', " - "'1.1.1.1']'"}, - {'data': [{'subnet_id': '00000000-0fff-ffff-ffff-000000000000', - 'ip_address': '1.1.1.1'}, - {'subnet_id': '00000000-ffff-ffff-ffff-000000000000', - 'ip_address': '1.1.1.1'}], - 'error_msg': "Duplicate IP address '1.1.1.1'"}] - for fixed in fixed_ips: - msg = validators.validate_fixed_ips(fixed['data']) - self.assertEqual(fixed['error_msg'], msg) - - fixed_ips = [[{'subnet_id': '00000000-ffff-ffff-ffff-000000000000', - 'ip_address': '1.1.1.1'}], - [{'subnet_id': '00000000-0fff-ffff-ffff-000000000000', - 'ip_address': '1.1.1.1'}, - {'subnet_id': '00000000-ffff-ffff-ffff-000000000000', - 'ip_address': '1.1.1.2'}]] - for fixed in fixed_ips: - msg = validators.validate_fixed_ips(fixed) - self.assertIsNone(msg) - - def test_validate_nameservers(self): - ns_pools = [['1.1.1.2', '1.1.1.2'], - ['www.hostname.com', 'www.hostname.com'], - ['1000.0.0.1'], - ['www.hostname.com'], - ['www.great.marathons.to.travel'], - ['valid'], - ['77.hostname.com'], - ['1' * 59], - ['www.internal.hostname.com'], - None] - - for ns in ns_pools: - msg = validators.validate_nameservers(ns, None) - self.assertIsNotNone(msg) - - ns_pools = [['100.0.0.2'], - ['1.1.1.1', '1.1.1.2']] - - for ns in ns_pools: - msg = validators.validate_nameservers(ns, None) - self.assertIsNone(msg) - - def test_validate_hostroutes(self): - hostroute_pools = [[{'destination': '100.0.0.0/24'}], - [{'nexthop': '10.0.2.20'}], - [{'nexthop': '10.0.2.20', - 'forza': 'juve', - 'destination': '100.0.0.0/8'}], - [{'nexthop': '1110.0.2.20', - 'destination': '100.0.0.0/8'}], - [{'nexthop': '10.0.2.20', - 'destination': '100.0.0.0'}], - [{'nexthop': '10.0.2.20', - 'destination': '100.0.0.0/8'}, - {'nexthop': '10.0.2.20', - 'destination': '100.0.0.0/8'}], - [None], - None] - for host_routes in hostroute_pools: - msg = validators.validate_hostroutes(host_routes, None) - self.assertIsNotNone(msg) - - hostroute_pools = [[{'destination': '100.0.0.0/24', - 'nexthop': '10.0.2.20'}], - [{'nexthop': '10.0.2.20', - 'destination': '100.0.0.0/8'}, - {'nexthop': '10.0.2.20', - 'destination': '101.0.0.0/8'}]] - for host_routes in hostroute_pools: - msg = validators.validate_hostroutes(host_routes, None) - self.assertIsNone(msg) - - def test_validate_ip_address_or_none(self): - ip_addr = None - msg = validators.validate_ip_address_or_none(ip_addr) - self.assertIsNone(msg) - - ip_addr = '1.1.1.1' - msg = validators.validate_ip_address_or_none(ip_addr) - self.assertIsNone(msg) - - ip_addr = '1111.1.1.1' - msg = validators.validate_ip_address_or_none(ip_addr) - self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg) - - def test_uuid_pattern(self): - data = 'garbage' - msg = validators.validate_regex(data, constants.UUID_PATTERN) - self.assertIsNotNone(msg) - - data = '00000000-ffff-ffff-ffff-000000000000' - msg = validators.validate_regex(data, constants.UUID_PATTERN) - self.assertIsNone(msg) - - def test_mac_pattern(self): - # Valid - 3 octets - base_mac = "fa:16:3e:00:00:00" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNone(msg) - - # Valid - 4 octets - base_mac = "fa:16:3e:4f:00:00" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNone(msg) - - # Invalid - not unicast - base_mac = "01:16:3e:4f:00:00" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNotNone(msg) - - # Invalid - invalid format - base_mac = "a:16:3e:4f:00:00" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNotNone(msg) - - # Invalid - invalid format - base_mac = "ffa:16:3e:4f:00:00" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNotNone(msg) - - # Invalid - invalid format - base_mac = "01163e4f0000" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNotNone(msg) - - # Invalid - invalid format - base_mac = "01-16-3e-4f-00-00" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNotNone(msg) - - # Invalid - invalid format - base_mac = "00:16:3:f:00:00" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNotNone(msg) - - # Invalid - invalid format - base_mac = "12:3:4:5:67:89ab" - msg = validators.validate_regex(base_mac, validators.MAC_PATTERN) - self.assertIsNotNone(msg) - - def _test_validate_subnet(self, validator, allow_none=False): - # Valid - IPv4 - cidr = "10.0.2.0/24" - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Valid - IPv6 without final octets - cidr = "fe80::/24" - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Valid - IPv6 with final octets - cidr = "fe80::/24" - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Valid - uncompressed ipv6 address - cidr = "fe80:0:0:0:0:0:0:0/128" - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Valid - ipv6 address with multiple consecutive zero - cidr = "2001:0db8:0:0:1::1/128" - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Valid - ipv6 address with multiple consecutive zero - cidr = "2001:0db8::1:0:0:1/128" - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Valid - ipv6 address with multiple consecutive zero - cidr = "2001::0:1:0:0:1100/120" - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Invalid - abbreviated ipv4 address - cidr = "10/24" - msg = validator(cidr, None) - error = _("'%(data)s' isn't a recognized IP subnet cidr," - " '%(cidr)s' is recommended") % {"data": cidr, - "cidr": "10.0.0.0/24"} - self.assertEqual(error, msg) - - # Invalid - IPv4 missing mask - cidr = "10.0.2.0" - msg = validator(cidr, None) - error = _("'%(data)s' isn't a recognized IP subnet cidr," - " '%(cidr)s' is recommended") % {"data": cidr, - "cidr": "10.0.2.0/32"} - self.assertEqual(error, msg) - - # Valid - IPv4 with non-zero masked bits is ok - for i in range(1, 255): - cidr = "192.168.1.%s/24" % i - msg = validator(cidr, None) - self.assertIsNone(msg) - - # Invalid - IPv6 without final octets, missing mask - cidr = "fe80::" - msg = validator(cidr, None) - error = _("'%(data)s' isn't a recognized IP subnet cidr," - " '%(cidr)s' is recommended") % {"data": cidr, - "cidr": "fe80::/128"} - self.assertEqual(error, msg) - - # Invalid - IPv6 with final octets, missing mask - cidr = "fe80::0" - msg = validator(cidr, None) - error = _("'%(data)s' isn't a recognized IP subnet cidr," - " '%(cidr)s' is recommended") % {"data": cidr, - "cidr": "fe80::/128"} - self.assertEqual(error, msg) - - # Invalid - Address format error - cidr = 'invalid' - msg = validator(cidr, None) - error = "'%s' is not a valid IP subnet" % cidr - self.assertEqual(error, msg) - - cidr = None - msg = validator(cidr, None) - if allow_none: - self.assertIsNone(msg) - else: - error = "'%s' is not a valid IP subnet" % cidr - self.assertEqual(error, msg) - - # Invalid - IPv4 with trailing CR - cidr = "10.0.2.0/24\r" - msg = validator(cidr, None) - error = "'%s' is not a valid IP subnet" % cidr - self.assertEqual(error, msg) - - def test_validate_subnet(self): - self._test_validate_subnet(validators.validate_subnet) - - def test_validate_subnet_or_none(self): - self._test_validate_subnet(validators.validate_subnet_or_none, - allow_none=True) - - def test_validate_subnet_list(self): - msg = validators.validate_subnet_list('abc') - self.assertEqual(u"'abc' is not a list", msg) - msg = validators.validate_subnet_list(['10.1.0.0/24', - '10.2.0.0/24', - '10.1.0.0/24']) - self.assertEqual(u"Duplicate items in the list: '10.1.0.0/24'", msg) - msg = validators.validate_subnet_list(['10.1.0.0/24', '10.2.0.0']) - self.assertEqual(u"'10.2.0.0' isn't a recognized IP subnet cidr, " - u"'10.2.0.0/32' is recommended", msg) - - def _test_validate_regex(self, validator, allow_none=False): - pattern = '[hc]at' - - data = None - msg = validator(data, pattern) - if allow_none: - self.assertIsNone(msg) - else: - self.assertEqual("'None' is not a valid input", msg) - - data = 'bat' - msg = validator(data, pattern) - self.assertEqual("'%s' is not a valid input" % data, msg) - - data = 'hat' - msg = validator(data, pattern) - self.assertIsNone(msg) - - data = 'cat' - msg = validator(data, pattern) - self.assertIsNone(msg) - - def test_validate_regex(self): - self._test_validate_regex(validators.validate_regex) - - def test_validate_regex_or_none(self): - self._test_validate_regex(validators.validate_regex_or_none, - allow_none=True) - - def test_validate_list_of_regex_or_none(self): - pattern = '[hc]at|^$' - - list_of_regex = ['hat', 'cat', ''] - msg = validators.validate_list_of_regex_or_none(list_of_regex, pattern) - self.assertIsNone(msg) - - list_of_regex = ['bat', 'hat', 'cat', ''] - msg = validators.validate_list_of_regex_or_none(list_of_regex, pattern) - self.assertEqual("'bat' is not a valid input", msg) - - empty_list = [] - msg = validators.validate_list_of_regex_or_none(empty_list, pattern) - - def test_validate_subnetpool_id(self): - msg = validators.validate_subnetpool_id(constants.IPV6_PD_POOL_ID) - self.assertIsNone(msg) - - msg = validators.validate_subnetpool_id( - '00000000-ffff-ffff-ffff-000000000000') - self.assertIsNone(msg) - - def test_validate_subnetpool_id_or_none(self): - msg = validators.validate_subnetpool_id_or_none(None) - self.assertIsNone(msg) - - msg = validators.validate_subnetpool_id_or_none( - '00000000-ffff-ffff-ffff-000000000000') - self.assertIsNone(msg) - - def test_validate_uuid(self): - invalid_uuids = [None, - 123, - '123', - 't5069610-744b-42a7-8bd8-ceac1a229cd4', - 'e5069610-744bb-42a7-8bd8-ceac1a229cd4'] - for uuid in invalid_uuids: - msg = validators.validate_uuid(uuid) - error = "'%s' is not a valid UUID" % uuid - self.assertEqual(error, msg) - - msg = validators.validate_uuid('00000000-ffff-ffff-ffff-000000000000') - self.assertIsNone(msg) - - def test_validate_uuid_list(self): - bad_uuid_list = ['00000000-ffff-ffff-ffff-000000000000', - '00000000-ffff-ffff-ffff-000000000001', - '123'] - msg = validators.validate_uuid_list(bad_uuid_list, - valid_values='parameter not used') - error = "'%s' is not a valid UUID" % bad_uuid_list[2] - self.assertEqual(error, msg) - - good_uuid_list = ['00000000-ffff-ffff-ffff-000000000000', - '00000000-ffff-ffff-ffff-000000000001'] - msg = validators.validate_uuid_list(good_uuid_list, - valid_values='parameter not used') - self.assertIsNone(msg) - - def test__validate_list_of_items(self): - # check not a list - items = [None, - 123, - 'e5069610-744b-42a7-8bd8-ceac1a229cd4', - '12345678123456781234567812345678', - {'uuid': 'e5069610-744b-42a7-8bd8-ceac1a229cd4'}] - for item in items: - msg = validators._validate_list_of_items(mock.Mock(), item) - error = "'%s' is not a list" % item - self.assertEqual(error, msg) - - # check duplicate items in a list - duplicate_items = ['e5069610-744b-42a7-8bd8-ceac1a229cd4', - 'f3eeab00-8367-4524-b662-55e64d4cacb5', - 'e5069610-744b-42a7-8bd8-ceac1a229cd4'] - msg = validators._validate_list_of_items(mock.Mock(), duplicate_items) - error = ("Duplicate items in the list: " - "'e5069610-744b-42a7-8bd8-ceac1a229cd4'") - self.assertEqual(error, msg) - - # check valid lists - valid_lists = [[], - [1, 2, 3], - ['a', 'b', 'c']] - for list_obj in valid_lists: - msg = validators._validate_list_of_items( - mock.Mock(return_value=None), list_obj) - self.assertIsNone(msg) - - def test_validate_dict_type(self): - for value in (None, True, '1', []): - self.assertEqual("'%s' is not a dictionary" % value, - validators.validate_dict(value)) - - def test_validate_dict_without_constraints(self): - msg = validators.validate_dict({}) - self.assertIsNone(msg) - - # Validate a dictionary without constraints. - msg = validators.validate_dict({'key': 'value'}) - self.assertIsNone(msg) - - def test_validate_a_valid_dict_with_constraints(self): - dictionary, constraints = self._construct_dict_and_constraints() - - msg = validators.validate_dict(dictionary, constraints) - self.assertIsNone(msg, 'Validation of a valid dictionary failed.') - - def test_validate_dict_with_invalid_validator(self): - dictionary, constraints = self._construct_dict_and_constraints() - - constraints['key1'] = {'type:unsupported': None, 'required': True} - msg = validators.validate_dict(dictionary, constraints) - self.assertEqual("Validator 'type:unsupported' does not exist.", msg) - - def test_validate_dict_not_required_keys(self): - dictionary, constraints = self._construct_dict_and_constraints() - - del dictionary['key2'] - msg = validators.validate_dict(dictionary, constraints) - self.assertIsNone(msg, 'Field that was not required by the specs was' - 'required by the validator.') - - def test_validate_dict_required_keys(self): - dictionary, constraints = self._construct_dict_and_constraints() - - del dictionary['key1'] - msg = validators.validate_dict(dictionary, constraints) - self.assertIn('Expected keys:', msg) - - def test_validate_dict_wrong_values(self): - dictionary, constraints = self._construct_dict_and_constraints() - - dictionary['key1'] = 'UNSUPPORTED' - msg = validators.validate_dict(dictionary, constraints) - self.assertIsNotNone(msg) - - def test_validate_dict_unexpected_keys(self): - dictionary, constraints = self._construct_dict_and_constraints() - - dictionary['unexpected_key'] = 'val' - msg = validators.validate_dict(dictionary, constraints) - self.assertIn('Unexpected keys supplied:', msg) - - def test_validate_dict_convert_boolean(self): - dictionary, constraints = self._construct_dict_and_constraints() - - constraints['key_bool'] = { - 'type:boolean': None, - 'required': False, - 'convert_to': converters.convert_to_boolean} - dictionary['key_bool'] = 'true' - msg = validators.validate_dict(dictionary, constraints) - self.assertIsNone(msg) - # Explicitly comparing with literal 'True' as assertTrue - # succeeds also for 'true' - self.assertIs(True, dictionary['key_bool']) - - def test_subdictionary(self): - dictionary, constraints = self._construct_dict_and_constraints() - - del dictionary['key3']['k4'] - dictionary['key3']['k5'] = 'a string value' - msg = validators.validate_dict(dictionary, constraints) - self.assertIn('Expected keys:', msg) - - def test_validate_dict_or_none(self): - dictionary, constraints = self._construct_dict_and_constraints() - - # Check whether None is a valid value. - msg = validators.validate_dict_or_none(None, constraints) - self.assertIsNone(msg, 'Validation of a None dictionary failed.') - - # Check validation of a regular dictionary. - msg = validators.validate_dict_or_none(dictionary, constraints) - self.assertIsNone(msg, 'Validation of a valid dictionary failed.') - - def test_validate_dict_or_empty(self): - dictionary, constraints = self._construct_dict_and_constraints() - - # Check whether an empty dictionary is valid. - msg = validators.validate_dict_or_empty({}, constraints) - self.assertIsNone(msg, 'Validation of a None dictionary failed.') - - # Check validation of a regular dictionary. - msg = validators.validate_dict_or_empty(dictionary, constraints) - self.assertIsNone(msg, 'Validation of a valid dictionary failed.') - - def test_validate_dict_or_nodata(self): - dictionary, constraints = self._construct_dict_and_constraints() - - # Check whether no data is a valid value. - msg = validators.validate_dict_or_nodata(None, constraints) - self.assertIsNone(msg, 'Validation of None for no-data failed.') - msg = validators.validate_dict_or_nodata({}, constraints) - self.assertIsNone(msg, 'Validation of empty dict for no-data failed.') - - # Check validation of a regular dictionary. - msg = validators.validate_dict_or_nodata(dictionary, constraints) - self.assertIsNone(msg, 'Validation of a valid dictionary failed.') - - def test_validate_non_negative(self): - msg = validators.validate_non_negative('abc') - self.assertEqual("'abc' is not an integer", msg) - - for value in (-1, '-2'): - self.assertEqual("'%s' should be non-negative" % value, - validators.validate_non_negative(value)) - - for value in (0, 1, '2', True, False): - msg = validators.validate_non_negative(value) - self.assertIsNone(msg) - - def test_validate_subports_invalid_body(self): - self.assertIsNotNone(validators.validate_subports(None)) - - def test_validate_subports_invalid_subport_object(self): - self.assertIsNotNone(validators.validate_subports(['foo_port'])) - - def test_validate_subports_invalid_port_uuid(self): - body = [{'port_id': 'foo_port'}] - self.assertIsNotNone(validators.validate_subports(body)) - - def test_validate_subports_invalid_missing_port_id(self): - body = [{'poort_id': 'foo_port'}] - self.assertIsNotNone(validators.validate_subports(body)) - - def test_validate_subports_invalid_duplicate_port_ids(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000'}, - {'port_id': '00000000-ffff-ffff-ffff-000000000000'} - ] - self.assertIsNotNone(validators.validate_subports(body)) - - def test_validate_subports_invalid_incomplete_segmentation_details(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000', - 'segmentation_id': '3'} - ] - self.assertIsNotNone(validators.validate_subports(body)) - - def test_validate_subports_invalid_unknown_paramenter(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000', - 'segmentation_id': '3', 'segmeNAtion_type': 'vlan'} - ] - self.assertIsNotNone(validators.validate_subports(body)) - - def test_validate_subports_invalid_duplicate_segmentation_id(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000', - 'segmentation_id': '3', 'segmentation_type': 'vlan'}, - {'port_id': '11111111-ffff-ffff-ffff-000000000000', - 'segmentation_id': '3', 'segmentation_type': 'vlan'} - ] - self.assertIsNotNone(validators.validate_subports(body)) - - def test_validate_subports_inherit_segmentation_details(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000', - 'segmentation_type': 'inherit'} - ] - self.assertIsNone(validators.validate_subports(body)) - - def test_validate_subports_valid_unique_segmentation_id(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000', - 'segmentation_id': '3', 'segmentation_type': 'vlan'}, - {'port_id': '11111111-ffff-ffff-ffff-000000000000', - 'segmentation_id': '3', 'segmentation_type': 'vxlan'} - ] - self.assertIsNone(validators.validate_subports(body)) - - def test_validate_subports_valid_empty_body(self): - self.assertIsNone(validators.validate_subports([])) - - def test_validate_subports_valid_suports_with_segmentation_details(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000', - 'segmentation_id': '3', 'segmentation_type': 'vlan'}, - {'port_id': '11111111-ffff-ffff-ffff-000000000000', - 'segmentation_id': '5', 'segmentation_type': 'vlan'} - ] - self.assertIsNone(validators.validate_subports(body)) - - def test_validate_subports_valid_subports(self): - body = [ - {'port_id': '00000000-ffff-ffff-ffff-000000000000'}, - {'port_id': '11111111-ffff-ffff-ffff-000000000000'}, - ] - self.assertIsNone(validators.validate_subports(body)) - - -class TestValidateIPSubnetNone(base.BaseTestCase): - - def test_validate_none(self): - self.assertIsNone(validators.validate_ip_or_subnet_or_none(None)) - - def test_validate_ipv4(self): - testdata = "172.0.0.1" - self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) - - def test_validate_ipv4_subnet(self): - testdata = "172.0.0.1/24" - self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) - - def test_validate_ipv6(self): - testdata = "2001:0db8:0a0b:12f0:0000:0000:0000:0001" - self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) - - def test_validate_ipv6_subnet(self): - testdata = "::1/128" - self.assertIsNone(validators.validate_ip_or_subnet_or_none(testdata)) - - def test_validate_ipv4_invalid(self): - testdata = "300.0.0.1" - self.assertEqual(("'300.0.0.1' is neither a valid IP address, nor is " - "it a valid IP subnet"), - validators.validate_ip_or_subnet_or_none(testdata)) - - def test_validate_ipv4_subnet_invalid(self): - testdata = "172.0.0.1/45" - self.assertEqual(("'172.0.0.1/45' is neither a valid IP address, nor " - "is it a valid IP subnet"), - validators.validate_ip_or_subnet_or_none(testdata)) - - def test_validate_ipv6_invalid(self): - testdata = "xxxx:0db8:0a0b:12f0:0000:0000:0000:0001" - self.assertEqual(("'xxxx:0db8:0a0b:12f0:0000:0000:0000:0001' is " - "neither a valid IP address, nor is it a valid IP " - "subnet"), - validators.validate_ip_or_subnet_or_none(testdata)) - - def test_validate_ipv6_subnet_invalid(self): - testdata = "::1/2048" - self.assertEqual(("'::1/2048' is neither a valid IP address, nor is " - "it a valid IP subnet"), - validators.validate_ip_or_subnet_or_none(testdata)) - - -class TestPortRangeValidation(base.BaseTestCase): - - def test_valid_port(self): - result = validators.validate_port_range_or_none("80") - self.assertIsNone(result) - - def test_valid_port_integer(self): - result = validators.validate_port_range_or_none(80) - self.assertIsNone(result) - - def test_valid_range(self): - result = validators.validate_port_range_or_none("80:8888") - self.assertIsNone(result) - - def test_port_too_high(self): - result = validators.validate_port_range_or_none("99999") - self.assertEqual(u"Invalid port: 99999.", result) - - def test_port_too_low(self): - result = validators.validate_port_range_or_none("-1") - self.assertEqual(u"Invalid port: -1.", result) - - def test_range_too_high(self): - result = validators.validate_port_range_or_none("80:99999") - self.assertEqual(u"Invalid port: 99999.", result) - - def test_range_too_low(self): - result = validators.validate_port_range_or_none("-1:8888") - self.assertEqual(u"Invalid port: -1.", result) - - def test_range_wrong_way(self): - result = validators.validate_port_range_or_none("8888:80") - self.assertEqual(u"First port in a port range must be lower than the " - "second port.", result) - - def test_range_invalid(self): - result = validators.validate_port_range_or_none("DEAD:BEEF") - self.assertEqual(u"Invalid port: DEAD.", result) - - def test_range_bad_input(self): - result = validators.validate_port_range_or_none(['a', 'b', 'c']) - self.assertEqual(u"Invalid port: ['a', 'b', 'c'].", result) - - def test_range_colon(self): - result = validators.validate_port_range_or_none(":") - self.assertEqual(u"Port range must be two integers separated by a " - "colon.", result) - - def test_too_many_colons(self): - result = validators.validate_port_range_or_none("80:888:8888") - self.assertEqual(u"Port range must be two integers separated by a " - "colon.", result) - - -class TestAnyKeySpecs(base.BaseTestCase): - - def test_data_is_none(self): - self.assertIsNone( - validators.validate_any_key_specs_or_none(None, key_specs={})) - - def test_data_is_not_list(self): - for t in [dict(), set(), 'abc', 1, True]: - self.assertRaises( - n_exc.InvalidInput, - validators.validate_any_key_specs_or_none, t, key_specs={}) - - def test_data_invalid_keys(self): - data = [{'opt_name': 'a', 'opt_value': 'A'}, - {'opt_name': 'b', 'opt_valuee': 'B'}] - self.assertRaisesRegex( - n_exc.InvalidInput, - "No valid key specs", - validators.validate_any_key_specs_or_none, - data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS) - - def test_data_optional_key(self): - data = [{'opt_name': 'a', 'opt_value': 'A'}, - {'opt_name': 'b', 'opt_value': 'B', 'ip_version': '4'}] - self.assertIsNone( - validators.validate_any_key_specs_or_none( - data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS)) - - def test_data_optional_key_invalid(self): - data = [{'opt_name': 'a', 'opt_value': 'A'}, - {'opt_name': 'b', 'opt_value': 'B', 'ip_version': '3'}] - self.assertRaisesRegex( - n_exc.InvalidInput, - "No valid key specs", - validators.validate_any_key_specs_or_none, - data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS) - - def test_data_conditional_spec(self): - data = [{'opt_name': 'router', 'opt_value': None}, - {'opt_name': 'b', 'opt_value': 'B', 'ip_version': '4'}] - self.assertIsNone( - validators.validate_any_key_specs_or_none( - data, key_specs=extra_dhcp_opt.EXTRA_DHCP_OPT_KEY_SPECS)) diff --git a/neutron_lib/tests/unit/callbacks/__init__.py b/neutron_lib/tests/unit/callbacks/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/callbacks/test_callback_exceptions.py b/neutron_lib/tests/unit/callbacks/test_callback_exceptions.py deleted file mode 100644 index 8fa37b9..0000000 --- a/neutron_lib/tests/unit/callbacks/test_callback_exceptions.py +++ /dev/null @@ -1,60 +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. - -""" -test_callback_exceptions ----------------------------------- - -Tests for `neutron_lib.callback.exceptions` module. -""" - -import functools - -import neutron_lib.callbacks.exceptions as ex -from neutron_lib.tests.unit.exceptions import test_exceptions - - -class TestCallbackExceptions(test_exceptions.TestExceptions): - - def _check_exception(self, exc_class, expected_msg, **kwargs): - raise_exc_class = functools.partial(test_exceptions._raise, exc_class) - e = self.assertRaises(exc_class, raise_exc_class, **kwargs) - self.assertEqual(expected_msg, str(e)) - - def test_invalid(self): - self._check_exception( - ex.Invalid, - "The value 'foo' for bar is not valid.", - value='foo', element='bar') - - def test_callback_failure(self): - self._check_exception( - ex.CallbackFailure, - 'one', - errors='one') - - def test_callback_failure_with_list(self): - self._check_exception( - ex.CallbackFailure, - '1,2,3', - errors=[1, 2, 3]) - - def test_notification_error(self): - '''Test that correct message is created for this error class.''' - error = ex.NotificationError('abc', 'boom') - self.assertEqual('Callback abc failed with "boom"', str(error)) - - def test_inner_exceptions(self): - key_err = KeyError() - n_key_err = ex.NotificationError('cb1', key_err) - err = ex.CallbackFailure([key_err, n_key_err]) - self.assertEqual([key_err, n_key_err.error], err.inner_exceptions) diff --git a/neutron_lib/tests/unit/callbacks/test_events.py b/neutron_lib/tests/unit/callbacks/test_events.py deleted file mode 100644 index 4e50e1b..0000000 --- a/neutron_lib/tests/unit/callbacks/test_events.py +++ /dev/null @@ -1,116 +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. - -import mock - -from neutron_lib.callbacks import events -from oslotest import base - - -class EventPayloadTestCase(base.BaseTestCase): - - def test_context(self): - e = events.EventPayload(mock.ANY) - self.assertEqual(mock.ANY, e.context) - - def test_metadata(self): - meta = {'k1': 'v1', 'k2': mock.ANY} - e = events.EventPayload(mock.ANY, metadata=meta) - self.assertEqual(meta, e.metadata) - event_meta = e.metadata - event_meta['k3'] = 'v3' - self.assertTrue('k3' in e.metadata) - - def test_request_body(self): - e = events.EventPayload(mock.ANY, request_body={'k', 'v'}) - self.assertEqual({'k', 'v'}, e.request_body) - - def test_states(self): - e = events.EventPayload(mock.ANY, states=['s1', 's2']) - self.assertEqual(['s1', 's2'], e.states) - e.states.append('state') - self.assertIn('state', e.states) - - def test_resource_id(self): - e = events.EventPayload(mock.ANY, resource_id='id1') - self.assertEqual('id1', e.resource_id) - - def test_has_no_states(self): - e = events.EventPayload(mock.ANY) - self.assertFalse(e.has_states) - - def test_has_states(self): - e = events.EventPayload(mock.ANY, states=['s1']) - self.assertTrue(e.has_states) - - def test_latest_state_with_states(self): - body = object() - states = [object(), object()] - e = events.EventPayload(mock.ANY, request_body=body, states=states) - self.assertEqual(states[-1], e.latest_state) - - def test_latest_state_without_states(self): - body = object() - e = events.EventPayload(mock.ANY, request_body=body) - self.assertIsNone(e.latest_state) - - -class DataStoreEventPayloadTestCase(base.BaseTestCase): - - def test_states(self): - e = events.DBEventPayload(mock.ANY, states=['s1']) - self.assertEqual(['s1'], e.states) - - def test_desired_state(self): - desired_state = {'k': object()} - e = events.DBEventPayload(mock.ANY, desired_state=desired_state) - self.assertEqual(desired_state, e.desired_state) - desired_state['a'] = 'A' - self.assertEqual(desired_state, e.desired_state) - - def test_is_not_persisted(self): - e = events.DBEventPayload(mock.ANY, states=['s1']) - self.assertFalse(e.is_persisted) - e = events.DBEventPayload(mock.ANY, resource_id='1a') - self.assertFalse(e.is_persisted) - - def test_is_persisted(self): - e = events.DBEventPayload(mock.ANY, states=['s1'], - resource_id='1a') - self.assertTrue(e.is_persisted) - - def test_is_not_to_be_committed(self): - e = events.DBEventPayload(mock.ANY, states=['s1'], - resource_id='1a') - self.assertFalse(e.is_to_be_committed) - - def test_is_to_be_committed(self): - e = events.DBEventPayload(mock.ANY, states=[mock.ANY], - resource_id='1a', desired_state=object()) - self.assertTrue(e.is_to_be_committed) - - def test_latest_state_with_desired_state(self): - desired_state = object() - e = events.DBEventPayload(mock.ANY, states=[object()], - desired_state=desired_state) - self.assertEqual(desired_state, e.latest_state) - - -class APIEventPayloadTestCase(base.BaseTestCase): - - def test_action(self): - e = events.APIEventPayload(mock.ANY, 'post.end', 'POST') - self.assertEqual('POST', e.action) - - def test_method_name(self): - e = events.APIEventPayload(mock.ANY, 'post.end', 'POST') - self.assertEqual('post.end', e.method_name) diff --git a/neutron_lib/tests/unit/callbacks/test_manager.py b/neutron_lib/tests/unit/callbacks/test_manager.py deleted file mode 100644 index ac8400b..0000000 --- a/neutron_lib/tests/unit/callbacks/test_manager.py +++ /dev/null @@ -1,322 +0,0 @@ -# Copyright 2015 OpenStack Foundation -# -# 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. - -import mock - -from oslo_db import exception as db_exc -from oslotest import base - -from neutron_lib.callbacks import events -from neutron_lib.callbacks import exceptions -from neutron_lib.callbacks import manager -from neutron_lib.callbacks import resources - - -class ObjectWithCallback(object): - - def __init__(self): - self.counter = 0 - - def callback(self, *args, **kwargs): - self.counter += 1 - - -class GloriousObjectWithCallback(ObjectWithCallback): - pass - - -def callback_1(*args, **kwargs): - callback_1.counter += 1 -callback_id_1 = manager._get_id(callback_1) - - -def callback_2(*args, **kwargs): - callback_2.counter += 1 -callback_id_2 = manager._get_id(callback_2) - - -def callback_raise(*args, **kwargs): - raise Exception() - - -def callback_raise_retriable(*args, **kwargs): - raise db_exc.DBDeadlock() - - -def callback_3(resource, event, trigger, payload): - callback_3.counter += 1 - - -class CallBacksManagerTestCase(base.BaseTestCase): - - def setUp(self): - super(CallBacksManagerTestCase, self).setUp() - self.manager = manager.CallbacksManager() - callback_1.counter = 0 - callback_2.counter = 0 - callback_3.counter = 0 - - def test_subscribe(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.assertIsNotNone( - self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) - self.assertIn(callback_id_1, self.manager._index) - self.assertEqual(self.__module__ + '.callback_1-%s' % - hash(callback_1), callback_id_1) - - def test_subscribe_unknown(self): - self.manager.subscribe( - callback_1, 'my_resource', 'my-event') - self.assertIsNotNone( - self.manager._callbacks['my_resource']['my-event']) - self.assertIn(callback_id_1, self.manager._index) - - def test_subscribe_is_idempotent(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.assertEqual( - 1, - len(self.manager._callbacks[resources.PORT][events.BEFORE_CREATE])) - callbacks = self.manager._index[callback_id_1][resources.PORT] - self.assertEqual(1, len(callbacks)) - - def test_subscribe_multiple_callbacks(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_2, resources.PORT, events.BEFORE_CREATE) - self.assertEqual(2, len(self.manager._index)) - self.assertEqual( - 2, - len(self.manager._callbacks[resources.PORT][events.BEFORE_CREATE])) - - def test_unsubscribe_during_iteration(self): - unsub = lambda r, e, *a, **k: self.manager.unsubscribe(unsub, r, e) - self.manager.subscribe(unsub, resources.PORT, - events.BEFORE_CREATE) - self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) - self.assertNotIn(unsub, self.manager._index) - - def test_unsubscribe(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.unsubscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.assertNotIn( - callback_id_1, - self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) - self.assertNotIn(callback_id_1, self.manager._index) - - def test_unsubscribe_unknown_callback(self): - self.manager.subscribe( - callback_2, resources.PORT, events.BEFORE_CREATE) - self.manager.unsubscribe(callback_1, mock.ANY, mock.ANY) - self.assertEqual(1, len(self.manager._index)) - - def test_fail_to_unsubscribe(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.assertRaises(exceptions.Invalid, - self.manager.unsubscribe, - callback_1, resources.PORT, None) - self.assertRaises(exceptions.Invalid, - self.manager.unsubscribe, - callback_1, None, events.BEFORE_CREATE) - - def test_unsubscribe_is_idempotent(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.unsubscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.unsubscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.assertNotIn(callback_id_1, self.manager._index) - self.assertNotIn(callback_id_1, - self.manager._callbacks[resources.PORT] - [events.BEFORE_CREATE]) - - def test_unsubscribe_by_resource(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_DELETE) - self.manager.subscribe( - callback_2, resources.PORT, events.BEFORE_DELETE) - self.manager.unsubscribe_by_resource(callback_1, resources.PORT) - self.assertNotIn( - callback_id_1, - self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) - self.assertIn( - callback_id_2, - self.manager._callbacks[resources.PORT][events.BEFORE_DELETE]) - self.assertNotIn(callback_id_1, self.manager._index) - - def test_unsubscribe_all(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_DELETE) - self.manager.subscribe( - callback_1, resources.ROUTER, events.BEFORE_CREATE) - self.manager.unsubscribe_all(callback_1) - self.assertNotIn( - callback_id_1, - self.manager._callbacks[resources.PORT][events.BEFORE_CREATE]) - self.assertNotIn(callback_id_1, self.manager._index) - - def test_notify_none(self): - self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) - self.assertEqual(0, callback_1.counter) - self.assertEqual(0, callback_2.counter) - - def test_feebly_referenced_callback(self): - self.manager.subscribe(lambda *x, **y: None, resources.PORT, - events.BEFORE_CREATE) - self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) - - def test_notify_with_exception(self): - with mock.patch.object(self.manager, '_notify_loop') as n: - n.return_value = ['error'] - self.assertRaises(exceptions.CallbackFailure, - self.manager.notify, - mock.ANY, events.BEFORE_CREATE, mock.ANY) - expected_calls = [ - mock.call(mock.ANY, 'before_create', mock.ANY), - mock.call(mock.ANY, 'abort_create', mock.ANY) - ] - n.assert_has_calls(expected_calls) - - def test_notify_with_precommit_exception(self): - with mock.patch.object(self.manager, '_notify_loop') as n: - n.return_value = ['error'] - self.assertRaises(exceptions.CallbackFailure, - self.manager.notify, - mock.ANY, events.PRECOMMIT_UPDATE, mock.ANY) - expected_calls = [ - mock.call(mock.ANY, 'precommit_update', mock.ANY), - ] - n.assert_has_calls(expected_calls) - - def test_notify_handle_exception(self): - self.manager.subscribe( - callback_raise, resources.PORT, events.BEFORE_CREATE) - e = self.assertRaises(exceptions.CallbackFailure, self.manager.notify, - resources.PORT, events.BEFORE_CREATE, self) - self.assertIsInstance(e.errors[0], exceptions.NotificationError) - - def test_notify_handle_retriable_exception(self): - self.manager.subscribe( - callback_raise_retriable, resources.PORT, events.BEFORE_CREATE) - self.assertRaises(db_exc.RetryRequest, self.manager.notify, - resources.PORT, events.BEFORE_CREATE, self) - - def test_notify_called_once_with_no_failures(self): - with mock.patch.object(self.manager, '_notify_loop') as n: - n.return_value = False - self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) - n.assert_called_once_with( - resources.PORT, events.BEFORE_CREATE, mock.ANY) - - def test__notify_loop_single_event(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_2, resources.PORT, events.BEFORE_CREATE) - self.manager._notify_loop( - resources.PORT, events.BEFORE_CREATE, mock.ANY) - self.assertEqual(1, callback_1.counter) - self.assertEqual(1, callback_2.counter) - - def test__notify_loop_multiple_events(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_1, resources.ROUTER, events.BEFORE_DELETE) - self.manager.subscribe( - callback_2, resources.PORT, events.BEFORE_CREATE) - self.manager._notify_loop( - resources.PORT, events.BEFORE_CREATE, mock.ANY) - self.manager._notify_loop( - resources.ROUTER, events.BEFORE_DELETE, mock.ANY) - self.assertEqual(2, callback_1.counter) - self.assertEqual(1, callback_2.counter) - - def test_clearing_subscribers(self): - self.manager.subscribe( - callback_1, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_2, resources.PORT, events.AFTER_CREATE) - self.assertEqual(2, len(self.manager._callbacks[resources.PORT])) - self.assertEqual(2, len(self.manager._index)) - self.manager.clear() - self.assertEqual(0, len(self.manager._callbacks)) - self.assertEqual(0, len(self.manager._index)) - - @mock.patch("neutron_lib.callbacks.manager.LOG") - def test__notify_loop_skip_log_errors(self, _logger): - self.manager.subscribe( - callback_raise, resources.PORT, events.BEFORE_CREATE) - self.manager.subscribe( - callback_raise, resources.PORT, events.PRECOMMIT_CREATE) - self.manager._notify_loop( - resources.PORT, events.BEFORE_CREATE, mock.ANY) - self.manager._notify_loop( - resources.PORT, events.PRECOMMIT_CREATE, mock.ANY) - self.assertFalse(_logger.exception.call_count) - self.assertTrue(_logger.debug.call_count) - - def test_object_instances_as_subscribers(self): - """Ensures that the manager doesn't think these are equivalent.""" - a = GloriousObjectWithCallback() - b = ObjectWithCallback() - c = ObjectWithCallback() - for o in (a, b, c): - self.manager.subscribe( - o.callback, resources.PORT, events.BEFORE_CREATE) - # ensure idempotency remains for a single object - self.manager.subscribe( - o.callback, resources.PORT, events.BEFORE_CREATE) - self.manager.notify(resources.PORT, events.BEFORE_CREATE, mock.ANY) - self.assertEqual(1, a.counter) - self.assertEqual(1, b.counter) - self.assertEqual(1, c.counter) - - def test_publish_invalid_payload(self): - self.assertRaises(exceptions.Invalid, self.manager.publish, - resources.PORT, events.AFTER_DELETE, self, - payload=object()) - - def test_publish_empty_payload(self): - notify_payload = [] - - def _memo(resource, event, trigger, payload=None): - notify_payload.append(payload) - - self.manager.subscribe(_memo, 'x', 'y') - self.manager.publish('x', 'y', self) - self.assertIsNone(notify_payload[0]) - - def test_publish_payload(self): - notify_payload = [] - - def _memo(resource, event, trigger, payload=None): - notify_payload.append(payload) - - self.manager.subscribe(_memo, 'x', 'y') - payload = events.EventPayload(object()) - self.manager.publish('x', 'y', self, payload=payload) - self.assertEqual(payload, notify_payload[0]) diff --git a/neutron_lib/tests/unit/callbacks/test_registry.py b/neutron_lib/tests/unit/callbacks/test_registry.py deleted file mode 100644 index e7668f0..0000000 --- a/neutron_lib/tests/unit/callbacks/test_registry.py +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright 2015 Cisco Systems Inc -# -# 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. - -import mock -import testtools - -from oslotest import base - -from neutron_lib.callbacks import events -from neutron_lib.callbacks import registry -from neutron_lib.callbacks import resources -from neutron_lib import fixture - - -@registry.has_registry_receivers -class ObjectWithDecoratedCallback(object): - - def __init__(self): - self.counter = 0 - - @registry.receives(resources.PORT, [events.AFTER_CREATE, - events.AFTER_UPDATE]) - @registry.receives(resources.NETWORK, [events.AFTER_DELETE]) - def callback(self, *args, **kwargs): - self.counter += 1 - - -class MixinWithNew(object): - def __new__(cls): - i = super(MixinWithNew, cls).__new__(cls) - i.new_called = True - return i - - -@registry.has_registry_receivers -class AnotherObjectWithDecoratedCallback(ObjectWithDecoratedCallback, - MixinWithNew): - - def __init__(self): - super(AnotherObjectWithDecoratedCallback, self).__init__() - self.counter2 = 0 - - @registry.receives(resources.NETWORK, [events.AFTER_DELETE]) - def callback2(self, *args, **kwargs): - self.counter2 += 1 - - -@registry.has_registry_receivers -class CallbackClassWithParameters(object): - - def __init__(self, dummy): - pass - - -def my_callback(): - pass - - -class CallBacksManagerTestCase(base.BaseTestCase): - - def test_decorated_inst_method_receives(self): - i1 = ObjectWithDecoratedCallback() - registry.notify(resources.PORT, events.BEFORE_CREATE, self) - self.assertEqual(0, i1.counter) - registry.notify(resources.PORT, events.AFTER_CREATE, self) - self.assertEqual(1, i1.counter) - registry.notify(resources.PORT, events.AFTER_UPDATE, self) - self.assertEqual(2, i1.counter) - registry.notify(resources.NETWORK, events.AFTER_UPDATE, self) - self.assertEqual(2, i1.counter) - registry.notify(resources.NETWORK, events.AFTER_DELETE, self) - self.assertEqual(3, i1.counter) - i2 = ObjectWithDecoratedCallback() - self.assertEqual(0, i2.counter) - registry.notify(resources.NETWORK, events.AFTER_DELETE, self) - self.assertEqual(4, i1.counter) - self.assertEqual(1, i2.counter) - - def test_object_inheriting_others_no_double_subscribe(self): - with mock.patch.object(registry, 'subscribe') as sub: - AnotherObjectWithDecoratedCallback() - # there are 3 methods (2 in parent and one in child) and 1 - # subscribes to 2 events, so we expect 4 subscribes - self.assertEqual(4, len(sub.mock_calls)) - - def test_new_inheritance_not_broken(self): - self.assertTrue(AnotherObjectWithDecoratedCallback().new_called) - - def test_object_new_not_broken(self): - CallbackClassWithParameters('dummy') - - def test_no_strings_in_events_arg(self): - with testtools.ExpectedException(AssertionError): - registry.receives(resources.PORT, events.AFTER_CREATE) - - -class TestCallbackRegistryDispatching(base.BaseTestCase): - - def setUp(self): - super(TestCallbackRegistryDispatching, self).setUp() - self.callback_manager = mock.Mock() - self.registry_fixture = fixture.CallbackRegistryFixture( - callback_manager=self.callback_manager) - self.useFixture(self.registry_fixture) - - def test_subscribe(self): - registry.subscribe(my_callback, 'my-resource', 'my-event') - self.callback_manager.subscribe.assert_called_with( - my_callback, 'my-resource', 'my-event') - - def test_unsubscribe(self): - registry.unsubscribe(my_callback, 'my-resource', 'my-event') - self.callback_manager.unsubscribe.assert_called_with( - my_callback, 'my-resource', 'my-event') - - def test_unsubscribe_by_resource(self): - registry.unsubscribe_by_resource(my_callback, 'my-resource') - self.callback_manager.unsubscribe_by_resource.assert_called_with( - my_callback, 'my-resource') - - def test_unsubscribe_all(self): - registry.unsubscribe_all(my_callback) - self.callback_manager.unsubscribe_all.assert_called_with( - my_callback) - - def test_notify(self): - registry.notify('my-resource', 'my-event', mock.ANY) - self.callback_manager.notify.assert_called_with( - 'my-resource', 'my-event', mock.ANY) - - def test_clear(self): - registry.clear() - self.callback_manager.clear.assert_called_with() - - def test_publish_payload(self): - event_payload = events.EventPayload(mock.ANY) - registry.publish('x', 'y', self, payload=event_payload) - self.callback_manager.publish.assert_called_with( - 'x', 'y', self, payload=event_payload) diff --git a/neutron_lib/tests/unit/db/__init__.py b/neutron_lib/tests/unit/db/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/db/_base.py b/neutron_lib/tests/unit/db/_base.py deleted file mode 100644 index 058f9c7..0000000 --- a/neutron_lib/tests/unit/db/_base.py +++ /dev/null @@ -1,26 +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. - -""" -Base classes for unit tests needing DB backend. -Only sqlite is supported in neutron-lib. -""" - -from neutron_lib import fixture -from neutron_lib.tests import _base as base - - -class SqlTestCase(base.BaseTestCase): - - def setUp(self): - super(SqlTestCase, self).setUp() - self.useFixture(fixture.SqlFixture()) diff --git a/neutron_lib/tests/unit/db/test_model_base.py b/neutron_lib/tests/unit/db/test_model_base.py deleted file mode 100644 index f4039a2..0000000 --- a/neutron_lib/tests/unit/db/test_model_base.py +++ /dev/null @@ -1,61 +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. - -import sqlalchemy as sa - -from neutron_lib import context -from neutron_lib.db import model_base - -from neutron_lib.tests.unit.db import _base as db_base - - -class TestTable(model_base.BASEV2, model_base.HasProject, - model_base.HasId, model_base.HasStatusDescription): - - name = sa.Column(sa.String(8), primary_key=True) - - -class TestModelBase(db_base.SqlTestCase): - - def setUp(self): - super(TestModelBase, self).setUp() - self.ctx = context.Context('user', 'project') - self.session = self.ctx.session - - def test_model_base(self): - foo = TestTable(name='meh') - self.assertEqual('meh', foo.name) - self.assertIn('meh', str(foo)) # test foo.__repr__ - cols = [k for k, _v in foo] # test foo.__iter__ and foo.next - self.assertIn('name', cols) - - def test_get_set_tenant_id_tenant(self): - foo = TestTable(tenant_id='tenant') - self.assertEqual('tenant', foo.get_tenant_id()) - foo.set_tenant_id('project') - self.assertEqual('project', foo.get_tenant_id()) - - def test_get_set_tenant_id_project(self): - foo = TestTable(project_id='project') - self.assertEqual('project', foo.get_tenant_id()) - foo.set_tenant_id('tenant') - self.assertEqual('tenant', foo.get_tenant_id()) - - def test_project_id_attribute(self): - foo = TestTable(project_id='project') - self.assertEqual('project', foo.project_id) - self.assertEqual('project', foo.tenant_id) - - def test_tenant_id_attribute(self): - foo = TestTable(tenant_id='tenant') - self.assertEqual('tenant', foo.project_id) - self.assertEqual('tenant', foo.tenant_id) diff --git a/neutron_lib/tests/unit/db/test_utils.py b/neutron_lib/tests/unit/db/test_utils.py deleted file mode 100644 index 83a4c47..0000000 --- a/neutron_lib/tests/unit/db/test_utils.py +++ /dev/null @@ -1,63 +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 oslo_db.sqlalchemy import models -import sqlalchemy as sa -from sqlalchemy.ext import declarative -from sqlalchemy import orm - -from neutron_lib.db import utils -from neutron_lib import exceptions as n_exc - -from neutron_lib.tests import _base as base - - -class FakePort(declarative.declarative_base(cls=models.ModelBase)): - __tablename__ = 'fakeports' - port_id = sa.Column(sa.String(36), primary_key=True) - name = sa.Column(sa.String(64)) - status = sa.Column(sa.String(16), nullable=False) - - -class FakeRouter(declarative.declarative_base(cls=models.ModelBase)): - __tablename__ = 'fakerouters' - router_id = sa.Column(sa.String(36), primary_key=True) - gw_port_id = sa.Column(sa.String(36), sa.ForeignKey(FakePort.port_id)) - gw_port = orm.relationship(FakePort, lazy='joined') - - -class TestUtils(base.BaseTestCase): - - def test_get_sort_dirs(self): - sorts = [(1, True), (2, False), (3, True)] - self.assertEqual(['asc', 'desc', 'asc'], - utils.get_sort_dirs(sorts)) - - def test_get_sort_dirs_reversed(self): - sorts = [(1, True), (2, False), (3, True)] - self.assertEqual(['desc', 'asc', 'desc'], - utils.get_sort_dirs(sorts, page_reverse=True)) - - def test_get_and_validate_sort_keys(self): - sorts = [('name', False), ('status', True)] - self.assertEqual(['name', 'status'], - utils.get_and_validate_sort_keys(sorts, FakePort)) - - def test_get_and_validate_sort_keys_bad_key_fails(self): - sorts = [('master', True)] - self.assertRaises(n_exc.BadRequest, - utils.get_and_validate_sort_keys, sorts, FakePort) - - def test_get_and_validate_sort_keys_by_relationship_fails(self): - sorts = [('gw_port', True)] - self.assertRaises(n_exc.BadRequest, - utils.get_and_validate_sort_keys, sorts, FakeRouter) diff --git a/neutron_lib/tests/unit/exceptions/__init__.py b/neutron_lib/tests/unit/exceptions/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/exceptions/test_exceptions.py b/neutron_lib/tests/unit/exceptions/test_exceptions.py deleted file mode 100644 index 263bdea..0000000 --- a/neutron_lib/tests/unit/exceptions/test_exceptions.py +++ /dev/null @@ -1,315 +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. - -""" -test_exceptions ----------------------------------- - -Tests for `neutron_lib.exception` module. -""" - -import functools - -from neutron_lib._i18n import _ -import neutron_lib.exceptions as ne -from neutron_lib.tests import _base as base - - -def _raise(exc_class, **kwargs): - raise exc_class(**kwargs) - - -class TestExceptions(base.BaseTestCase): - - def _check_nexc(self, exc_class, expected_msg, **kwargs): - raise_exc_class = functools.partial(_raise, exc_class) - e = self.assertRaises(exc_class, raise_exc_class, **kwargs) - self.assertEqual(expected_msg, str(e)) - - def test_base(self): - self._check_nexc( - ne.NeutronException, - _('An unknown exception occurred.')) - - def test_not_found(self): - self._check_nexc( - ne.NotFound, - _('An unknown exception occurred.')) - - def test_conflict(self): - self._check_nexc( - ne.Conflict, - _('An unknown exception occurred.')) - - def test_bad_request(self): - self._check_nexc( - ne.BadRequest, - _('Bad A request: B.'), - resource='A', msg='B') - - def test_bad_request_misused(self): - try: - self._check_nexc( - ne.BadRequest, - _('Bad A request: B.'), - resource='A', msg='B') - except AttributeError: - pass - - def test_not_authorized(self): - self._check_nexc( - ne.NotAuthorized, - _("Not authorized.")) - - def test_service_unavailable(self): - self._check_nexc( - ne.ServiceUnavailable, - _("The service is unavailable.")) - - def test_admin_required(self): - self._check_nexc( - ne.AdminRequired, - _("User does not have admin privileges: hoser."), - reason="hoser") - - def test_object_not_found(self): - self._check_nexc( - ne.ObjectNotFound, - _("Object fallout tato not found."), - id="fallout tato") - - def test_network_not_found(self): - self._check_nexc( - ne.NetworkNotFound, - _("Network spam could not be found."), - net_id="spam") - - def test_subnet_not_found(self): - self._check_nexc( - ne.SubnetNotFound, - _("Subnet root could not be found."), - subnet_id="root") - - def test_port_not_found(self): - self._check_nexc( - ne.PortNotFound, - _("Port harbor could not be found."), - port_id="harbor") - - def test_port_not_found_on_network(self): - self._check_nexc( - ne.PortNotFoundOnNetwork, - _("Port serial could not be found on network USB."), - port_id="serial", net_id="USB") - - def test_device_not_found_error(self): - self._check_nexc( - ne.DeviceNotFoundError, - _("Device 'device' does not exist."), - device_name="device") - - def test_in_use(self): - self._check_nexc( - ne.InUse, - _("The resource is in use.")) - - def test_network_in_use(self): - self._check_nexc( - ne.NetworkInUse, - _("Unable to complete operation on network foo. " - "There are one or more ports still in use on the network."), - net_id="foo") - - def test_subnet_in_use(self): - self._check_nexc( - ne.SubnetInUse, - _("Unable to complete operation on subnet garbage: not full."), - subnet_id="garbage", reason="not full") - - def test_subnet_in_use_no_reason(self): - self._check_nexc( - ne.SubnetInUse, - _("Unable to complete operation on subnet garbage: " - "One or more ports have an IP allocation from this subnet."), - subnet_id="garbage") - - def test_subnet_pool_in_use(self): - self._check_nexc( - ne.SubnetPoolInUse, - _("Unable to complete operation on subnet pool ymca. because."), - subnet_pool_id="ymca", reason="because") - - def test_subnet_pool_in_use_no_reason(self): - self._check_nexc( - ne.SubnetPoolInUse, - _("Unable to complete operation on subnet pool ymca. " - "Two or more concurrent subnets allocated."), - subnet_pool_id="ymca") - - def test_port_in_use(self): - self._check_nexc( - ne.PortInUse, - _("Unable to complete operation on port a for network c. " - "Port already has an attached device b."), - port_id='a', device_id='b', net_id='c') - - def test_service_port_in_use(self): - self._check_nexc( - ne.ServicePortInUse, - _("Port harbor cannot be deleted directly via the " - "port API: docking."), - port_id='harbor', reason='docking') - - def test_port_bound(self): - self._check_nexc( - ne.PortBound, - _("Unable to complete operation on port bigmac, " - "port is already bound, port type: ketchup, " - "old_mac onions, new_mac salt."), - port_id='bigmac', vif_type='ketchup', old_mac='onions', - new_mac='salt') - - def test_mac_address_in_use(self): - self._check_nexc( - ne.MacAddressInUse, - _("Unable to complete operation for network nutters. " - "The mac address grill is in use."), - net_id='nutters', mac='grill') - - def test_invalid_ip_for_network(self): - self._check_nexc( - ne.InvalidIpForNetwork, - _("IP address shazam! is not a valid IP " - "for any of the subnets on the specified network."), - ip_address='shazam!') - - def test_invalid_ip_for_subnet(self): - self._check_nexc( - ne.InvalidIpForSubnet, - _("IP address 300.400.500.600 is not a valid IP " - "for the specified subnet."), - ip_address='300.400.500.600') - - def test_ip_address_in_use(self): - self._check_nexc( - ne.IpAddressInUse, - _("Unable to complete operation for network boredom. " - "The IP address crazytown is in use."), - net_id='boredom', ip_address='crazytown') - - def test_vlan_id_in_use(self): - self._check_nexc( - ne.VlanIdInUse, - _("Unable to create the network. The VLAN virtual on physical " - "network phys is in use."), - vlan_id='virtual', physical_network='phys') - - def test_tunnel_id_in_use(self): - self._check_nexc( - ne.TunnelIdInUse, - _("Unable to create the network. The tunnel ID sewer is in use."), - tunnel_id='sewer') - - def test_resource_exhausted(self): - self._check_nexc( - ne.ResourceExhausted, - _("The service is unavailable.")) - - def test_no_network_available(self): - self._check_nexc( - ne.NoNetworkAvailable, - _("Unable to create the network. " - "No tenant network is available for allocation.")) - - def test_subnet_mismatch_for_port(self): - self._check_nexc( - ne.SubnetMismatchForPort, - _("Subnet on port porter does not match " - "the requested subnet submit."), - port_id='porter', subnet_id='submit') - - def test_invalid(self): - try: - raise ne.Invalid("hello world") - except ne.Invalid as e: - self.assertEqual(e.msg, "hello world") - - def test_invalid_input(self): - self._check_nexc( - ne.InvalidInput, - _("Invalid input for operation: warp core breach."), - error_message='warp core breach') - - def test_ip_address_generation_failure(self): - self._check_nexc( - ne.IpAddressGenerationFailure, - _("No more IP addresses available on network nuke."), - net_id='nuke') - - def test_preexisting_device_failure(self): - self._check_nexc( - ne.PreexistingDeviceFailure, - _("Creation failed. hal9000 already exists."), - dev_name='hal9000') - - def test_over_quota(self): - self._check_nexc( - ne.OverQuota, - _("Quota exceeded for resources: tube socks."), - overs='tube socks') - - def test_invalid_content_type(self): - self._check_nexc( - ne.InvalidContentType, - _("Invalid content type porn."), - content_type='porn') - - def test_external_ip_address_exhausted(self): - self._check_nexc( - ne.ExternalIpAddressExhausted, - _("Unable to find any IP address on external network darpanet."), - net_id='darpanet') - - def test_too_many_external_networks(self): - self._check_nexc( - ne.TooManyExternalNetworks, - _("More than one external network exists.")) - - def test_invalid_configuration_option(self): - self._check_nexc( - ne.InvalidConfigurationOption, - _("An invalid value was provided for which muppet: big bird."), - opt_name='which muppet', opt_value='big bird') - - def test_network_tunnel_range_error(self): - self._check_nexc( - ne.NetworkTunnelRangeError, - _("Invalid network tunnel range: 'rats' - present."), - tunnel_range='rats', error='present') - - def test_network_tunnel_range_error_tuple(self): - self._check_nexc( - ne.NetworkTunnelRangeError, - _("Invalid network tunnel range: '3:4' - present."), - tunnel_range=(3, 4), error='present') - - def test_policy_init_error(self): - self._check_nexc( - ne.PolicyInitError, - _("Failed to initialize policy policy because reason."), - policy='policy', reason='reason') - - def test_policy_check_error(self): - self._check_nexc( - ne.PolicyCheckError, - _("Failed to check policy policy because reason."), - policy='policy', reason='reason') diff --git a/neutron_lib/tests/unit/hacking/__init__.py b/neutron_lib/tests/unit/hacking/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/hacking/test_checks.py b/neutron_lib/tests/unit/hacking/test_checks.py deleted file mode 100644 index 31fe36e..0000000 --- a/neutron_lib/tests/unit/hacking/test_checks.py +++ /dev/null @@ -1,218 +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. - -import testtools - -from neutron_lib.hacking import checks -from neutron_lib.hacking import translation_checks as tc -from neutron_lib.tests import _base as base - - -class HackingTestCase(base.BaseTestCase): - - def assertLinePasses(self, func, *args): - with testtools.ExpectedException(StopIteration): - next(func(*args)) - - def assertLineFails(self, func, *args): - self.assertIsInstance(next(func(*args)), tuple) - - def _get_factory_checks(self, factory): - check_fns = [] - - def _reg(check_fn): - self.assertTrue(hasattr(check_fn, '__call__')) - self.assertFalse(check_fn in check_fns) - check_fns.append(check_fn) - - factory(_reg) - return check_fns - - def test_factory(self): - self.assertTrue(len(self._get_factory_checks(checks.factory)) > 0) - - def test_neutron_lib_factory(self): - lib_checks = self._get_factory_checks(checks._neutron_lib_factory) - other_checks = self._get_factory_checks(checks.factory) - - self.assertTrue(len(lib_checks) > 0) - - if other_checks: - for other_check in other_checks: - # lib checks are superset of all checks - self.assertTrue(other_check in lib_checks) - - def test_use_jsonutils(self): - def __get_msg(fun): - msg = ("N521: jsonutils.%(fun)s must be used instead of " - "json.%(fun)s" % {'fun': fun}) - return [(0, msg)] - - for method in ('dump', 'dumps', 'load', 'loads'): - self.assertEqual( - __get_msg(method), - list(checks.use_jsonutils("json.%s(" % method, - "./neutron/common/rpc.py"))) - - self.assertEqual( - 0, - len(list(checks.use_jsonutils("jsonx.%s(" % method, - "./neutron/common/rpc.py")))) - - self.assertEqual( - 0, - len(list(checks.use_jsonutils("json.%sx(" % method, - "./neutron/common/rpc.py")))) - - self.assertEqual( - 0, - len(list(checks.use_jsonutils( - "json.%s" % method, - "./neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/" - "etc/xapi.d/plugins/netwrap")))) - - def test_check_contextlib_nested(self): - f = checks.check_no_contextlib_nested - self.assertLineFails(f, 'with contextlib.nested():', '') - self.assertLineFails(f, ' with contextlib.nested():', '') - self.assertLinePasses(f, '# with contextlib.nested():', '') - self.assertLinePasses(f, 'print("with contextlib.nested():")', '') - - def test_check_python3_xrange(self): - f = checks.check_python3_xrange - self.assertLineFails(f, 'a = xrange(1000)') - self.assertLineFails(f, 'b =xrange ( 42 )') - self.assertLineFails(f, 'c = xrange(1, 10, 2)') - self.assertLinePasses(f, 'd = range(1000)') - self.assertLinePasses(f, 'e = six.moves.range(1337)') - - def test_no_basestring(self): - f = checks.check_no_basestring - self.assertLineFails(f, 'isinstance(x, basestring)') - self.assertLinePasses(f, 'isinstance(x, BaseString)') - - def test_check_python3_iteritems(self): - f = checks.check_python3_no_iteritems - self.assertLineFails(f, "d.iteritems()") - self.assertLinePasses(f, "six.iteritems(d)") - - def test_no_mutable_default_args(self): - self.assertEqual(1, len(list(checks.no_mutable_default_args( - " def fake_suds_context(calls={}):")))) - - self.assertEqual(1, len(list(checks.no_mutable_default_args( - "def get_info_from_bdm(virt_type, bdm, mapping=[])")))) - - self.assertEqual(0, len(list(checks.no_mutable_default_args( - "defined = []")))) - - self.assertEqual(0, len(list(checks.no_mutable_default_args( - "defined, undefined = [], {}")))) - - def test_check_neutron_namespace_imports(self): - f = checks.check_neutron_namespace_imports - self.assertLinePasses(f, 'from neutron_lib import constants') - self.assertLinePasses(f, 'import neutron_lib.constants') - self.assertLineFails(f, 'from neutron.common import rpc') - self.assertLineFails(f, 'from neutron import context') - self.assertLineFails(f, 'import neutron.common.config') - - def test_no_log_translations(self): - for log in tc._all_log_levels: - for hint in tc._all_hints: - bad = 'LOG.%s(%s("Bad"))' % (log, hint) - self.assertEqual( - 1, len(list(tc.no_translate_logs(bad, 'f')))) - # Catch abuses when used with a variable and not a literal - bad = 'LOG.%s(%s(msg))' % (log, hint) - self.assertEqual( - 1, len(list(tc.no_translate_logs(bad, 'f')))) - # Do not do validations in tests - ok = 'LOG.%s(_("OK - unit tests"))' % log - self.assertEqual( - 0, len(list(tc.no_translate_logs(ok, 'f/tests/f')))) - - def test_check_log_warn_deprecated(self): - bad = "LOG.warn('i am deprecated!')" - good = "LOG.warning('zlatan is the best')" - f = tc.check_log_warn_deprecated - self.assertLineFails(f, bad, '') - self.assertLinePasses(f, good, '') - - def test_check_localized_exception_messages(self): - f = tc.check_raised_localized_exceptions - self.assertLineFails(f, " raise KeyError('Error text')", '') - self.assertLineFails(f, ' raise KeyError("Error text")', '') - self.assertLinePasses(f, ' raise KeyError(_("Error text"))', '') - self.assertLinePasses(f, ' raise KeyError(_ERR("Error text"))', '') - self.assertLinePasses(f, " raise KeyError(translated_msg)", '') - self.assertLinePasses(f, '# raise KeyError("Not translated")', '') - self.assertLinePasses(f, 'print("raise KeyError("Not ' - 'translated")")', '') - - def test_check_localized_exception_message_skip_tests(self): - f = tc.check_raised_localized_exceptions - self.assertLinePasses(f, "raise KeyError('Error text')", - 'neutron_lib/tests/unit/mytest.py') - - def test_check_eventlet_imports(self): - f = checks.check_no_eventlet_imports - self.assertLineFails(f, "import eventlet") - self.assertLineFails(f, "import eventlet.timeout") - self.assertLineFails(f, "from eventlet import timeout") - self.assertLineFails(f, "from eventlet.timeout import Timeout") - self.assertLineFails(f, "from eventlet.timeout import (Timeout, X)") - self.assertLinePasses(f, "import is.not.eventlet") - self.assertLinePasses(f, "from is.not.eventlet") - self.assertLinePasses(f, "from mymod import eventlet") - self.assertLinePasses(f, "from mymod.eventlet import amod") - self.assertLinePasses(f, 'print("eventlet not here")') - self.assertLinePasses(f, 'print("eventlet.timeout")') - self.assertLinePasses(f, "from mymod.timeout import (eventlet, X)") - - def test_assert_equal_none(self): - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual(A, None)"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual(A, None) # Comment"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual(None, A)"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual(None, A) # Comment"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual((None, None), A)"))), 0) - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual((None, None), A) # Comment"))), 0) - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual(A, (None, None))"))), 0) - self.assertEqual(len(list(checks.assert_equal_none( - "self.assertEqual(A, (None, None)) # Comment"))), 0) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot(A, None)"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot(A, None) # Comment"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot(None, A)"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot(None, A) # Comment"))), 1) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot((None, None), A)"))), 0) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot((None, None), A) # Comment"))), 0) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot(A, (None, None))"))), 0) - self.assertEqual(len(list(checks.assert_equal_none( - "assertIsNot(A, (None, None)) # Comment"))), 0) - self.assertEqual( - len(list(checks.assert_equal_none("self.assertIsNone(A)"))), 0) - self.assertEqual( - len(list(checks.assert_equal_none("self.assertIsNotNone(A)"))), 0) diff --git a/neutron_lib/tests/unit/legacy/__init__.py b/neutron_lib/tests/unit/legacy/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/plugins/__init__.py b/neutron_lib/tests/unit/plugins/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/plugins/ml2/__init__.py b/neutron_lib/tests/unit/plugins/ml2/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/plugins/ml2/test_api.py b/neutron_lib/tests/unit/plugins/ml2/test_api.py deleted file mode 100644 index f4c4d7e..0000000 --- a/neutron_lib/tests/unit/plugins/ml2/test_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 neutron_lib.plugins.ml2 import api -from neutron_lib.tests import _base as base - - -class _MechanismDriver(api.MechanismDriver): - bind_port = lambda s, c: c - - def initialize(self): - pass - - -class TestMechanismDriver(base.BaseTestCase): - - def test__supports_port_binding(self): - self.assertTrue(_MechanismDriver()._supports_port_binding) - - def test_get_workers(self): - self.assertEqual((), _MechanismDriver().get_workers()) - - def test_filter_hosts_with_segment_access(self): - dummy_token = ["X"] - self.assertEqual( - dummy_token, - _MechanismDriver().filter_hosts_with_segment_access( - dummy_token, dummy_token, dummy_token, dummy_token)) diff --git a/neutron_lib/tests/unit/plugins/test_directory.py b/neutron_lib/tests/unit/plugins/test_directory.py deleted file mode 100644 index ec79bba..0000000 --- a/neutron_lib/tests/unit/plugins/test_directory.py +++ /dev/null @@ -1,100 +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 neutron_lib.plugins import directory -from neutron_lib.tests import _base as base - - -def fake_plugin(): - pass - - -class DirectoryTestCase(base.BaseTestCase): - - def test__create_plugin_directory(self): - self.assertIsNotNone(directory._create_plugin_directory()) - - def test__get_plugin_directory(self): - self.assertIsNotNone(directory._get_plugin_directory()) - - def test_add_plugin(self): - directory.add_plugin('foo', fake_plugin) - self.assertIn('foo', directory.get_plugins()) - - def test_get_plugin_core_none(self): - self.assertIsNone(directory.get_plugin()) - - def test_get_plugin_alias_none(self): - self.assertIsNone(directory.get_plugin('foo')) - - def test_get_plugin_core(self): - directory.add_plugin('CORE', fake_plugin) - self.assertIsNotNone(directory.get_plugin()) - - def test_get_plugin_alias(self): - directory.add_plugin('foo', fake_plugin) - self.assertIsNotNone(directory.get_plugin('foo')) - - def test_get_plugins_none(self): - self.assertFalse(directory.get_plugins()) - - def test_get_unique_plugins_none(self): - self.assertFalse(directory.get_unique_plugins()) - - def test_get_plugins(self): - directory.add_plugin('CORE', fake_plugin) - self.assertIsNotNone(directory.get_plugins()) - - def test_get_unique_plugins(self): - directory.add_plugin('foo1', fake_plugin) - directory.add_plugin('foo2', fake_plugin) - self.assertEqual(1, len(directory.get_unique_plugins())) - - def test_is_loaded(self): - self.assertFalse(directory.is_loaded()) - directory.add_plugin('foo1', fake_plugin) - self.assertTrue(directory.is_loaded()) - - -class PluginDirectoryTestCase(base.BaseTestCase): - - def setUp(self): - super(PluginDirectoryTestCase, self).setUp() - self.plugin_directory = directory._PluginDirectory() - - def test_add_plugin(self): - self.plugin_directory.add_plugin('foo', 'bar') - self.assertEqual(1, len(self.plugin_directory._plugins)) - - def test_get_plugin_not_found(self): - self.assertIsNone(self.plugin_directory.get_plugin('foo')) - - def test_get_plugin_found(self): - self.plugin_directory._plugins = {'foo': lambda *x, **y: 'bar'} - plugin = self.plugin_directory.get_plugin('foo') - self.assertEqual('bar', plugin()) - - def test_plugins(self): - self.plugin_directory._plugins = {'foo': lambda *x, **y: 'bar'} - self.assertIsNotNone(self.plugin_directory.plugins) - - def test_unique_plugins(self): - self.plugin_directory._plugins = { - 'foo1': fake_plugin, - 'foo2': fake_plugin, - } - self.assertEqual(1, len(self.plugin_directory.unique_plugins)) - - def test_is_loaded(self): - self.assertFalse(self.plugin_directory.is_loaded) - self.plugin_directory._plugins = {'foo': lambda *x, **y: 'bar'} - self.assertTrue(self.plugin_directory.is_loaded) diff --git a/neutron_lib/tests/unit/services/__init__.py b/neutron_lib/tests/unit/services/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/services/qos/__init__.py b/neutron_lib/tests/unit/services/qos/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/services/qos/test_base.py b/neutron_lib/tests/unit/services/qos/test_base.py deleted file mode 100644 index 82e9e5c..0000000 --- a/neutron_lib/tests/unit/services/qos/test_base.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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. - -import mock - -from neutron_lib.api.definitions import portbindings -from neutron_lib.services.qos import base as qos_base -from neutron_lib.services.qos import constants as qos_consts -from neutron_lib.tests import _base - - -SUPPORTED_RULES = { - qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH: { - "min_kbps": {'type:values': None}, - 'direction': {'type:values': ['egress']} - } -} - - -def _make_rule(rule_type='fake-rule-type', params=None): - mock_rule = mock.MagicMock() - mock_rule.rule_type = rule_type - params = params or {} - mock_rule.get = params.get - return mock_rule - - -def _make_driver(name='fake-driver', - vif_types=[portbindings.VIF_TYPE_OVS], - vnic_types=[portbindings.VNIC_NORMAL], - supported_rules=SUPPORTED_RULES, - requires_rpc_notifications=False): - return qos_base.DriverBase( - name, vif_types, vnic_types, supported_rules, - requires_rpc_notifications=requires_rpc_notifications) - - -class TestDriverBase(_base.BaseTestCase): - - def test_is_loaded(self): - self.assertTrue(_make_driver().is_loaded()) - - def test_is_vif_type_compatible(self): - self.assertTrue( - _make_driver().is_vif_type_compatible( - portbindings.VIF_TYPE_OVS)) - self.assertFalse( - _make_driver().is_vif_type_compatible( - portbindings.VIF_TYPE_BRIDGE)) - - def test_is_vnic_compatible(self): - self.assertTrue( - _make_driver().is_vnic_compatible(portbindings.VNIC_NORMAL)) - self.assertFalse( - _make_driver().is_vnic_compatible(portbindings.VNIC_BAREMETAL)) - - def test_is_rule_supported_with_unsupported_rule(self): - self.assertFalse(_make_driver().is_rule_supported(_make_rule())) - - def test_is_rule_supported(self): - self.assertTrue( - _make_driver().is_rule_supported( - _make_rule( - rule_type=qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH, - params={'min_kbps': None, 'direction': 'egress'}))) - self.assertFalse( - _make_driver().is_rule_supported( - _make_rule( - rule_type=qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH, - params={'min_kbps': None, 'direction': 'ingress'}))) diff --git a/neutron_lib/tests/unit/services/test_base.py b/neutron_lib/tests/unit/services/test_base.py deleted file mode 100644 index 97d3dc8..0000000 --- a/neutron_lib/tests/unit/services/test_base.py +++ /dev/null @@ -1,92 +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. - -import abc - -from neutron_lib.services import base -from neutron_lib.tests import _base as test_base - - -class _Worker(base.WorkerBase): - pass - - -class Test_WorkerSupportServiceMixin(test_base.BaseTestCase): - - def setUp(self): - super(Test_WorkerSupportServiceMixin, self).setUp() - self.worker = _Worker() - - def test_allocate_workers(self): - self.assertEqual([], self.worker.get_workers()) - - def test_add_worker(self): - workers = [object(), object()] - for w in workers: - self.worker.add_worker(w) - - self.assertSequenceEqual(workers, self.worker.get_workers()) - - def test_add_workers(self): - workers = [object(), object(), object()] - self.worker.add_workers(workers) - - self.assertSequenceEqual(workers, self.worker.get_workers()) - - -class TestPluginInterface(test_base.BaseTestCase): - - class ServicePluginStub(base.ServicePluginBase): - def get_plugin_type(self): - pass - - def get_plugin_description(self): - pass - - def test_issubclass_hook(self): - class A(TestPluginInterface.ServicePluginStub): - def f(self): - pass - - class B(base.ServicePluginBase): - @abc.abstractmethod - def f(self): - pass - - self.assertTrue(issubclass(A, B)) - - def test_issubclass_hook_class_without_abstract_methods(self): - class A(object): - def f(self): - pass - - class B(base.ServicePluginBase): - def f(self): - pass - - self.assertFalse(issubclass(A, B)) - - def test_issubclass_hook_not_all_methods_implemented(self): - class A(TestPluginInterface.ServicePluginStub): - def f(self): - pass - - class B(base.ServicePluginBase): - @abc.abstractmethod - def f(self): - pass - - @abc.abstractmethod - def g(self): - pass - - self.assertFalse(issubclass(A, B)) diff --git a/neutron_lib/tests/unit/test__policy.py b/neutron_lib/tests/unit/test__policy.py deleted file mode 100644 index 4c49f91..0000000 --- a/neutron_lib/tests/unit/test__policy.py +++ /dev/null @@ -1,64 +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. - -import mock - -from neutron_lib import _policy as policy -from neutron_lib import context - -from neutron_lib.tests import _base as base - - -class TestPolicyEnforcer(base.BaseTestCase): - def setUp(self): - super(TestPolicyEnforcer, self).setUp() - # Isolate one _ROLE_ENFORCER per test case - mock.patch.object(policy, '_ROLE_ENFORCER', None).start() - - def test_init_reset(self): - self.assertIsNone(policy._ROLE_ENFORCER) - policy.init() - self.assertIsNotNone(policy._ROLE_ENFORCER) - - def test_check_user_is_not_admin(self): - ctx = context.Context('me', 'my_project') - self.assertFalse(policy.check_is_admin(ctx)) - - def test_check_user_elevated_is_admin(self): - ctx = context.Context('me', 'my_project', roles=['user']).elevated() - self.assertTrue(policy.check_is_admin(ctx)) - - def test_check_is_admin_no_roles_no_admin(self): - policy.init(policy_file='no_policy.json') - ctx = context.Context('me', 'my_project', roles=['user']).elevated() - # With no admin role, elevated() should not work. - self.assertFalse(policy.check_is_admin(ctx)) - - def test_check_is_advsvc_role(self): - ctx = context.Context('me', 'my_project', roles=['advsvc']) - self.assertTrue(policy.check_is_advsvc(ctx)) - - def test_check_is_not_advsvc_user(self): - ctx = context.Context('me', 'my_project', roles=['user']) - self.assertFalse(policy.check_is_advsvc(ctx)) - - def test_check_is_not_advsvc_admin(self): - ctx = context.Context('me', 'my_project').elevated() - self.assertTrue(policy.check_is_admin(ctx)) - self.assertFalse(policy.check_is_advsvc(ctx)) - - def test_check_is_advsvc_no_roles_no_advsvc(self): - policy.init(policy_file='no_policy.json') - ctx = context.Context('me', 'my_project', roles=['advsvc']) - # No advsvc role in the policy file, so cannot assume the role. - self.assertFalse(policy.check_is_advsvc(ctx)) diff --git a/neutron_lib/tests/unit/test_context.py b/neutron_lib/tests/unit/test_context.py deleted file mode 100644 index 4bbb3b6..0000000 --- a/neutron_lib/tests/unit/test_context.py +++ /dev/null @@ -1,226 +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. - -import mock -from oslo_context import context as oslo_context -from testtools import matchers - -from neutron_lib import context -from neutron_lib.tests import _base - - -class TestNeutronContext(_base.BaseTestCase): - - def setUp(self): - super(TestNeutronContext, self).setUp() - db_api = 'neutron_lib.db.api.get_writer_session' - self._db_api_session_patcher = mock.patch(db_api) - self.db_api_session = self._db_api_session_patcher.start() - - def test_neutron_context_create(self): - ctx = context.Context('user_id', 'tenant_id') - self.assertEqual('user_id', ctx.user_id) - self.assertEqual('tenant_id', ctx.project_id) - self.assertEqual('tenant_id', ctx.tenant_id) - request_id = ctx.request_id - if isinstance(request_id, bytes): - request_id = request_id.decode('utf-8') - self.assertThat(request_id, matchers.StartsWith('req-')) - self.assertEqual('user_id', ctx.user) - self.assertEqual('tenant_id', ctx.tenant) - self.assertIsNone(ctx.user_name) - self.assertIsNone(ctx.tenant_name) - self.assertIsNone(ctx.project_name) - self.assertIsNone(ctx.auth_token) - - def test_neutron_context_getter_setter(self): - ctx = context.Context('Anakin', 'Skywalker') - self.assertEqual('Anakin', ctx.user_id) - self.assertEqual('Skywalker', ctx.tenant_id) - ctx.user_id = 'Darth' - ctx.tenant_id = 'Vader' - self.assertEqual('Darth', ctx.user_id) - self.assertEqual('Vader', ctx.tenant_id) - - def test_neutron_context_create_with_name(self): - ctx = context.Context('user_id', 'tenant_id', - tenant_name='tenant_name', user_name='user_name') - # Check name is set - self.assertEqual('user_name', ctx.user_name) - self.assertEqual('tenant_name', ctx.tenant_name) - self.assertEqual('tenant_name', ctx.project_name) - # Check user/tenant contains its ID even if user/tenant_name is passed - self.assertEqual('user_id', ctx.user) - self.assertEqual('tenant_id', ctx.tenant) - - def test_neutron_context_create_with_request_id(self): - ctx = context.Context('user_id', 'tenant_id', request_id='req_id_xxx') - self.assertEqual('req_id_xxx', ctx.request_id) - - def test_neutron_context_create_with_timestamp(self): - now = "Right Now!" - ctx = context.Context('user_id', 'tenant_id', timestamp=now) - self.assertEqual(now, ctx.timestamp) - - def test_neutron_context_create_is_advsvc(self): - ctx = context.Context('user_id', 'tenant_id', is_advsvc=True) - self.assertFalse(ctx.is_admin) - self.assertTrue(ctx.is_advsvc) - - def test_neutron_context_create_with_auth_token(self): - ctx = context.Context('user_id', 'tenant_id', - auth_token='auth_token_xxx') - self.assertEqual('auth_token_xxx', ctx.auth_token) - - def test_neutron_context_from_dict(self): - owner = {'user_id': 'Luke', 'tenant_id': 'Skywalker'} - ctx = context.Context.from_dict(owner) - self.assertEqual(owner['user_id'], ctx.user_id) - self.assertEqual(owner['tenant_id'], ctx.tenant_id) - - def test_neutron_context_to_dict(self): - ctx = context.Context('user_id', 'tenant_id') - ctx_dict = ctx.to_dict() - self.assertEqual('user_id', ctx_dict['user_id']) - self.assertEqual('tenant_id', ctx_dict['project_id']) - self.assertEqual(ctx.request_id, ctx_dict['request_id']) - self.assertEqual('user_id', ctx_dict['user']) - self.assertEqual('tenant_id', ctx_dict['tenant']) - self.assertIsNone(ctx_dict['user_name']) - self.assertIsNone(ctx_dict['tenant_name']) - self.assertIsNone(ctx_dict['project_name']) - self.assertIsNone(ctx_dict['auth_token']) - - def test_neutron_context_to_dict_with_name(self): - ctx = context.Context('user_id', 'tenant_id', - tenant_name='tenant_name', - user_name='user_name') - ctx_dict = ctx.to_dict() - self.assertEqual('user_name', ctx_dict['user_name']) - self.assertEqual('tenant_name', ctx_dict['tenant_name']) - self.assertEqual('tenant_name', ctx_dict['project_name']) - - def test_neutron_context_to_dict_with_auth_token(self): - ctx = context.Context('user_id', 'tenant_id', - auth_token='auth_token_xxx') - ctx_dict = ctx.to_dict() - self.assertEqual('auth_token_xxx', ctx_dict['auth_token']) - - def test_neutron_context_admin_to_dict(self): - self.db_api_session.return_value = 'fakesession' - ctx = context.get_admin_context() - ctx_dict = ctx.to_dict() - self.assertIsNone(ctx_dict['user_id']) - self.assertIsNone(ctx_dict['tenant_id']) - self.assertIsNone(ctx_dict['auth_token']) - self.assertTrue(ctx_dict['is_admin']) - self.assertIsNotNone(ctx.session) - self.assertNotIn('session', ctx_dict) - - def test_neutron_context_admin_without_session_to_dict(self): - ctx = context.get_admin_context_without_session() - ctx_dict = ctx.to_dict() - self.assertIsNone(ctx_dict['user_id']) - self.assertIsNone(ctx_dict['tenant_id']) - self.assertIsNone(ctx_dict['auth_token']) - self.assertFalse(hasattr(ctx, 'session')) - - def test_neutron_context_elevated_retains_request_id(self): - ctx = context.Context('user_id', 'tenant_id') - self.assertFalse(ctx.is_admin) - req_id_before = ctx.request_id - - elevated_ctx = ctx.elevated() - self.assertTrue(elevated_ctx.is_admin) - self.assertEqual(req_id_before, elevated_ctx.request_id) - - def test_neutron_context_elevated_idempotent(self): - ctx = context.Context('user_id', 'tenant_id') - self.assertFalse(ctx.is_admin) - elevated_ctx = ctx.elevated() - self.assertTrue(elevated_ctx.is_admin) - elevated2_ctx = elevated_ctx.elevated() - self.assertTrue(elevated2_ctx.is_admin) - - def test_neutron_context_overwrite(self): - ctx1 = context.Context('user_id', 'tenant_id') - self.assertEqual(ctx1.request_id, - oslo_context.get_current().request_id) - - # If overwrite is not specified, request_id should be updated. - ctx2 = context.Context('user_id', 'tenant_id') - self.assertNotEqual(ctx2.request_id, ctx1.request_id) - self.assertEqual(ctx2.request_id, - oslo_context.get_current().request_id) - - # If overwrite is specified, request_id should be kept. - ctx3 = context.Context('user_id', 'tenant_id', overwrite=False) - self.assertNotEqual(ctx3.request_id, ctx2.request_id) - self.assertEqual(ctx2.request_id, - oslo_context.get_current().request_id) - - def test_neutron_context_get_admin_context_not_update_local_store(self): - ctx = context.Context('user_id', 'tenant_id') - req_id_before = oslo_context.get_current().request_id - self.assertEqual(ctx.request_id, req_id_before) - - ctx_admin = context.get_admin_context() - self.assertEqual(req_id_before, oslo_context.get_current().request_id) - self.assertNotEqual(req_id_before, ctx_admin.request_id) - - def test_to_policy_values(self): - values = { - 'user_id': 'user_id', - 'tenant_id': 'tenant_id', - 'is_admin': 'is_admin', - 'tenant_name': 'tenant_name', - 'user_name': 'user_name', - 'domain': 'domain', - 'user_domain': 'user_domain', - 'project_domain': 'project_domain', - 'user_name': 'user_name', - } - additional_values = { - 'user': 'user_id', - 'tenant': 'tenant_id', - 'project_id': 'tenant_id', - 'project_name': 'tenant_name', - } - ctx = context.Context(**values) - # apply dict() to get a real dictionary, needed for newer oslo.context - # that returns _DeprecatedPolicyValues object instead - policy_values = dict(ctx.to_policy_values()) - self.assertDictSupersetOf(values, policy_values) - self.assertDictSupersetOf(additional_values, policy_values) - - @mock.patch.object(context.ContextBaseWithSession, 'session') - def test_superclass_session(self, mocked_session): - ctx = context.Context('user_id', 'tenant_id') - # make sure context uses parent class session that is mocked - self.assertEqual(mocked_session, ctx.session) - - def test_session_cached(self): - ctx = context.Context('user_id', 'tenant_id') - session1 = ctx.session - session2 = ctx.session - self.assertIs(session1, session2) - - def test_add_get_remove_constraint(self): - ctx = context.Context('user_id', 'tenant_id') - self.assertIsNone(ctx.get_transaction_constraint()) - ctx.set_transaction_constraint('networks', 'net_id', 44) - constraint = ctx.get_transaction_constraint() - self.assertEqual(44, constraint.if_revision_match) - self.assertEqual('networks', constraint.resource) - self.assertEqual('net_id', constraint.resource_id) - ctx.clear_transaction_constraint() - self.assertIsNone(ctx.get_transaction_constraint()) diff --git a/neutron_lib/tests/unit/test_fixture.py b/neutron_lib/tests/unit/test_fixture.py deleted file mode 100644 index ab0e35b..0000000 --- a/neutron_lib/tests/unit/test_fixture.py +++ /dev/null @@ -1,124 +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. - -import mock - -from oslo_config import cfg -from oslo_db import options -from oslotest import base - -from neutron_lib.api import attributes -from neutron_lib.api.definitions import port -from neutron_lib.callbacks import registry -from neutron_lib.db import model_base -from neutron_lib import fixture -from neutron_lib.plugins import directory -from neutron_lib.tests.unit.api import test_attributes - - -class PluginDirectoryFixtureTestCase(base.BaseTestCase): - - def setUp(self): - super(PluginDirectoryFixtureTestCase, self).setUp() - self.directory = mock.Mock() - self.useFixture(fixture.PluginDirectoryFixture( - plugin_directory=self.directory)) - - def test_fixture(self): - directory.add_plugin('foo', 'foo') - self.assertTrue(self.directory.add_plugin.called) - - -class CallbackRegistryFixtureTestCase(base.BaseTestCase): - - def setUp(self): - super(CallbackRegistryFixtureTestCase, self).setUp() - self.manager = mock.Mock() - self.useFixture(fixture.CallbackRegistryFixture( - callback_manager=self.manager)) - - def test_fixture(self): - registry.notify('a', 'b', self) - self.assertTrue(self.manager.notify.called) - - -class SqlFixtureTestCase(base.BaseTestCase): - - def setUp(self): - super(SqlFixtureTestCase, self).setUp() - options.set_defaults( - cfg.CONF, - connection='sqlite://') - self.useFixture(fixture.SqlFixture()) - - def test_fixture(self): - self.assertIsNotNone(model_base.BASEV2.metadata.sorted_tables) - - -class APIDefinitionFixtureTestCase(base.BaseTestCase): - - def _test_all_api_definitions_fixture(self, global_cleanup=True): - apis = fixture.APIDefinitionFixture.all_api_definitions_fixture() - apis.backup_global_resources = global_cleanup - apis.setUp() - - asserteq = self.assertNotEqual if global_cleanup else self.assertEqual - asserteq({}, apis._orig_resources) - - for r in test_attributes.TestCoreResources.CORE_DEFS: - attributes.RESOURCES[r.COLLECTION_NAME]['_test_'] = {} - r.RESOURCE_ATTRIBUTE_MAP['_test_'] = {} - - apis.cleanUp() - for r in test_attributes.TestCoreResources.CORE_DEFS: - self.assertNotIn('_test_', r.RESOURCE_ATTRIBUTE_MAP) - global_assert = (self.assertNotIn - if global_cleanup else self.assertIn) - global_assert('_test_', attributes.RESOURCES[r.COLLECTION_NAME]) - # cleanup - if not global_cleanup: - del attributes.RESOURCES[r.COLLECTION_NAME]['_test_'] - - def test_all_api_definitions_fixture_no_global_backup(self): - self._test_all_api_definitions_fixture(global_cleanup=False) - - def test_all_api_definitions_fixture_with_global_backup(self): - self._test_all_api_definitions_fixture(global_cleanup=True) - - def test_global_resources_reference_updated(self): - resources_ref = attributes.RESOURCES - apis = fixture.APIDefinitionFixture() - - apis.setUp() - attributes.RESOURCES['test_resource'] = {} - self.assertIn('test_resource', resources_ref) - attributes.RESOURCES[port.COLLECTION_NAME]['test_port_attr'] = {} - self.assertIn('test_port_attr', - attributes.RESOURCES[port.COLLECTION_NAME]) - apis.cleanUp() - - self.assertNotIn('test_port_attr', - attributes.RESOURCES[port.COLLECTION_NAME]) - self.assertNotIn('test_resource', resources_ref) - - def test_api_def_reference_updated(self): - api_def_ref = port.RESOURCE_ATTRIBUTE_MAP - apis = fixture.APIDefinitionFixture() - - apis.setUp() - port.RESOURCE_ATTRIBUTE_MAP[port.COLLECTION_NAME]['test_attr'] = {} - self.assertIn('test_attr', api_def_ref[port.COLLECTION_NAME]) - apis.cleanUp() - - self.assertNotIn('test_attr', - port.RESOURCE_ATTRIBUTE_MAP[port.COLLECTION_NAME]) - self.assertNotIn('test_attr', api_def_ref[port.COLLECTION_NAME]) diff --git a/neutron_lib/tests/unit/test_neutron_lib.py b/neutron_lib/tests/unit/test_neutron_lib.py deleted file mode 100644 index 918b715..0000000 --- a/neutron_lib/tests/unit/test_neutron_lib.py +++ /dev/null @@ -1,29 +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. - -import copy - -from neutron_lib import constants - -from neutron_lib.tests import _base as base - - -class TestNeutronLib(base.BaseTestCase): - - def test_sentinel_constant(self): - foo = constants.Sentinel() - bar = copy.deepcopy(foo) - self.assertEqual(id(foo), id(bar)) - - def test_sentinel_copy(self): - singleton = constants.Sentinel() - self.assertEqual(copy.deepcopy(singleton), copy.copy(singleton)) diff --git a/neutron_lib/tests/unit/test_worker.py b/neutron_lib/tests/unit/test_worker.py deleted file mode 100644 index 94af5fb..0000000 --- a/neutron_lib/tests/unit/test_worker.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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. - -import mock - -from neutron_lib.callbacks import events -from neutron_lib.callbacks import resources -from neutron_lib import fixture -from neutron_lib import worker - -from neutron_lib.tests import _base as base - - -class _BaseWorker(worker.BaseWorker): - - def reset(self): - pass - - def stop(self): - pass - - def wait(self): - pass - - -class TestBaseWorker(base.BaseTestCase): - - def setUp(self): - super(TestBaseWorker, self).setUp() - self._reg = mock.Mock() - self.useFixture(fixture.CallbackRegistryFixture( - callback_manager=self._reg)) - - def test_worker_process_count(self): - self.assertEqual(9, _BaseWorker( - worker_process_count=9).worker_process_count) - - def test_start_callback_event(self): - base_worker = _BaseWorker() - base_worker.start() - self._reg.notify.assert_called_once_with( - resources.PROCESS, events.AFTER_INIT, base_worker.start) diff --git a/neutron_lib/tests/unit/utils/__init__.py b/neutron_lib/tests/unit/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/tests/unit/utils/test_file.py b/neutron_lib/tests/unit/utils/test_file.py deleted file mode 100644 index e4d6e1f..0000000 --- a/neutron_lib/tests/unit/utils/test_file.py +++ /dev/null @@ -1,81 +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. - -import errno -import os.path -import stat - -import mock - -from neutron_lib.tests import _base as base -from neutron_lib.utils import file - - -class TestEnsureDir(base.BaseTestCase): - - @mock.patch('os.makedirs') - def test_ensure_dir_no_fail_if_exists(self, makedirs): - error = OSError() - error.errno = errno.EEXIST - makedirs.side_effect = error - file.ensure_dir("/etc/create/concurrently") - - @mock.patch('os.makedirs') - def test_ensure_dir_oserr(self, makedirs): - error = OSError() - error.errno = errno.EPERM - makedirs.side_effect = error - self.assertRaises(OSError, - file.ensure_dir, - "/etc/create/directory") - makedirs.assert_called_once_with("/etc/create/directory", 0o755) - - @mock.patch('os.makedirs') - def test_ensure_dir_calls_makedirs(self, makedirs): - file.ensure_dir("/etc/create/directory") - makedirs.assert_called_once_with("/etc/create/directory", 0o755) - - -class TestReplaceFile(base.BaseTestCase): - - def setUp(self): - super(TestReplaceFile, self).setUp() - temp_dir = self.get_default_temp_dir().path - self.file_name = os.path.join(temp_dir, "new_file") - self.data = "data to copy" - - def _verify_result(self, file_mode): - self.assertTrue(os.path.exists(self.file_name)) - with open(self.file_name) as f: - content = f.read() - self.assertEqual(self.data, content) - mode = os.stat(self.file_name).st_mode - self.assertEqual(file_mode, stat.S_IMODE(mode)) - - def test_replace_file_default_mode(self): - file_mode = 0o644 - file.replace_file(self.file_name, self.data) - self._verify_result(file_mode) - - def test_replace_file_custom_mode(self): - file_mode = 0o722 - file.replace_file(self.file_name, self.data, file_mode) - self._verify_result(file_mode) - - def test_replace_file_custom_mode_twice(self): - file_mode = 0o722 - file.replace_file(self.file_name, self.data, file_mode) - self.data = "new data to copy" - file_mode = 0o777 - file.replace_file(self.file_name, self.data, file_mode) - self._verify_result(file_mode) diff --git a/neutron_lib/tests/unit/utils/test_helpers.py b/neutron_lib/tests/unit/utils/test_helpers.py deleted file mode 100644 index 4e7b050..0000000 --- a/neutron_lib/tests/unit/utils/test_helpers.py +++ /dev/null @@ -1,224 +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. - -import collections -import re - -import six -import testtools - -from neutron_lib.tests import _base as base -from neutron_lib.utils import helpers - - -class TestParseMappings(base.BaseTestCase): - - def parse(self, mapping_list, unique_values=True, unique_keys=True): - return helpers.parse_mappings(mapping_list, unique_values, unique_keys) - - def test_parse_mappings_fails_for_missing_separator(self): - with testtools.ExpectedException(ValueError): - self.parse(['key']) - - def test_parse_mappings_fails_for_missing_key(self): - with testtools.ExpectedException(ValueError): - self.parse([':val']) - - def test_parse_mappings_fails_for_missing_value(self): - with testtools.ExpectedException(ValueError): - self.parse(['key:']) - - def test_parse_mappings_fails_for_extra_separator(self): - with testtools.ExpectedException(ValueError): - self.parse(['key:val:junk']) - - def test_parse_mappings_fails_for_duplicate_key(self): - with testtools.ExpectedException(ValueError): - self.parse(['key:val1', 'key:val2']) - - def test_parse_mappings_fails_for_duplicate_value(self): - with testtools.ExpectedException(ValueError): - self.parse(['key1:val', 'key2:val']) - - def test_parse_mappings_succeeds_for_one_mapping(self): - self.assertEqual({'key': 'val'}, self.parse(['key:val'])) - - def test_parse_mappings_succeeds_for_n_mappings(self): - self.assertEqual({'key1': 'val1', 'key2': 'val2'}, - self.parse(['key1:val1', 'key2:val2'])) - - def test_parse_mappings_succeeds_for_duplicate_value(self): - self.assertEqual({'key1': 'val', 'key2': 'val'}, - self.parse(['key1:val', 'key2:val'], False)) - - def test_parse_mappings_succeeds_for_no_mappings(self): - self.assertEqual({}, self.parse([''])) - - def test_parse_mappings_succeeds_for_nonuniq_key(self): - self.assertEqual({'key': ['val1', 'val2']}, - self.parse(['key:val1', 'key:val2', 'key:val2'], - unique_keys=False)) - - def test_parse_mappings_succeeds_for_nonuniq_key_duplicate_value(self): - self.assertEqual({'key': ['val']}, - self.parse(['key:val', 'key:val', 'key:val'], - unique_keys=False)) - - -class TestCompareElements(base.BaseTestCase): - - def test_compare_elements(self): - self.assertFalse(helpers.compare_elements([], ['napoli'])) - self.assertFalse(helpers.compare_elements(None, ['napoli'])) - self.assertFalse(helpers.compare_elements(['napoli'], [])) - self.assertFalse(helpers.compare_elements(['napoli'], None)) - self.assertFalse(helpers.compare_elements(['napoli', 'juve'], - ['juve'])) - self.assertTrue(helpers.compare_elements(['napoli', 'juve'], - ['napoli', 'juve'])) - self.assertTrue(helpers.compare_elements(['napoli', 'juve'], - ['juve', 'napoli'])) - - -class TestDictUtils(base.BaseTestCase): - - def test_dict2str(self): - dic = {"key1": "value1", "key2": "value2", "key3": "value3"} - expected = "key1=value1,key2=value2,key3=value3" - self.assertEqual(expected, helpers.dict2str(dic)) - - def test_str2dict(self): - string = "key1=value1,key2=value2,key3=value3" - expected = {"key1": "value1", "key2": "value2", "key3": "value3"} - self.assertEqual(expected, helpers.str2dict(string)) - - def test_dict_str_conversion(self): - dic = {"key1": "value1", "key2": "value2"} - self.assertEqual(dic, helpers.str2dict(helpers.dict2str(dic))) - - def test_diff_list_of_dict(self): - old_list = [{"key1": "value1"}, - {"key2": "value2"}, - {"key3": "value3"}] - new_list = [{"key1": "value1"}, - {"key2": "value2"}, - {"key4": "value4"}] - added, removed = helpers.diff_list_of_dict(old_list, new_list) - self.assertEqual(added, [dict(key4="value4")]) - self.assertEqual(removed, [dict(key3="value3")]) - - -class TestDict2Tuples(base.BaseTestCase): - - def test_dict(self): - input_dict = {'foo': 'bar', '42': 'baz', 'aaa': 'zzz'} - expected = (('42', 'baz'), ('aaa', 'zzz'), ('foo', 'bar')) - output_tuple = helpers.dict2tuple(input_dict) - self.assertEqual(expected, output_tuple) - - -class TestCamelize(base.BaseTestCase): - - def test_camelize(self): - data = {'bandwidth_limit': 'BandwidthLimit', - 'test': 'Test', - 'some__more__dashes': 'SomeMoreDashes', - 'a_penguin_walks_into_a_bar': 'APenguinWalksIntoABar'} - - for s, expected in data.items(): - self.assertEqual(expected, helpers.camelize(s)) - - -class TestRoundVal(base.BaseTestCase): - - def test_round_val_ok(self): - for expected, value in ((0, 0), - (0, 0.1), - (1, 0.5), - (1, 1.49), - (2, 1.5)): - self.assertEqual(expected, helpers.round_val(value)) - - -class TestGetRandomString(base.BaseTestCase): - - def test_get_random_string(self): - length = 127 - random_string = helpers.get_random_string(length) - self.assertEqual(length, len(random_string)) - regex = re.compile('^[0-9a-fA-F]+$') - self.assertIsNotNone(regex.match(random_string)) - - -def requires_py2(testcase): - return testtools.skipUnless(six.PY2, "requires python 2.x")(testcase) - - -def requires_py3(testcase): - return testtools.skipUnless(six.PY3, "requires python 3.x")(testcase) - - -class TestSafeDecodeUtf8(base.BaseTestCase): - - @requires_py2 - def test_py2_does_nothing(self): - s = 'test-py2' - self.assertIs(s, helpers.safe_decode_utf8(s)) - - @requires_py3 - def test_py3_decoded_valid_bytes(self): - s = bytes('test-py2', 'utf-8') - decoded_str = helpers.safe_decode_utf8(s) - self.assertIsInstance(decoded_str, six.text_type) - self.assertEqual(s, decoded_str.encode('utf-8')) - - @requires_py3 - def test_py3_decoded_invalid_bytes(self): - s = bytes('test-py2', 'utf_16') - decoded_str = helpers.safe_decode_utf8(s) - self.assertIsInstance(decoded_str, six.text_type) - - -class TestSafeSortKey(base.BaseTestCase): - - def test_safe_sort_key(self): - data1 = {'k1': 'v1', - 'k2': 'v2'} - data2 = {'k2': 'v2', - 'k1': 'v1'} - self.assertEqual(helpers.safe_sort_key(data1), - helpers.safe_sort_key(data2)) - - def _create_dict_from_list(self, list_data): - d = collections.defaultdict(list) - for k, v in list_data: - d[k].append(v) - return d - - def test_safe_sort_key_mapping_ne(self): - list1 = [('yellow', 1), ('blue', 2), ('yellow', 3), - ('blue', 4), ('red', 1)] - data1 = self._create_dict_from_list(list1) - list2 = [('yellow', 3), ('blue', 4), ('yellow', 1), - ('blue', 2), ('red', 1)] - data2 = self._create_dict_from_list(list2) - self.assertNotEqual(helpers.safe_sort_key(data1), - helpers.safe_sort_key(data2)) - - def test_safe_sort_key_mapping(self): - list1 = [('yellow', 1), ('blue', 2), ('red', 1)] - data1 = self._create_dict_from_list(list1) - list2 = [('blue', 2), ('red', 1), ('yellow', 1)] - data2 = self._create_dict_from_list(list2) - self.assertEqual(helpers.safe_sort_key(data1), - helpers.safe_sort_key(data2)) diff --git a/neutron_lib/tests/unit/utils/test_host.py b/neutron_lib/tests/unit/utils/test_host.py deleted file mode 100644 index df19d7f..0000000 --- a/neutron_lib/tests/unit/utils/test_host.py +++ /dev/null @@ -1,34 +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. - -import multiprocessing - -import mock - -from neutron_lib.tests import _base as base -from neutron_lib.utils import host - - -class TestCpuCount(base.BaseTestCase): - - @mock.patch.object(multiprocessing, 'cpu_count', - return_value=7) - def test_cpu_count(self, mock_cpu_count): - self.assertEqual(7, host.cpu_count()) - mock_cpu_count.assert_called_once_with() - - @mock.patch.object(multiprocessing, 'cpu_count', - side_effect=NotImplementedError()) - def test_cpu_count_not_implemented(self, mock_cpu_count): - self.assertEqual(1, host.cpu_count()) - mock_cpu_count.assert_called_once_with() diff --git a/neutron_lib/tests/unit/utils/test_net.py b/neutron_lib/tests/unit/utils/test_net.py deleted file mode 100644 index a61304b..0000000 --- a/neutron_lib/tests/unit/utils/test_net.py +++ /dev/null @@ -1,76 +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. - -import random -import socket - -import mock - -from neutron_lib import constants -from neutron_lib.tests import _base as base -from neutron_lib.utils import net - - -class TestGetHostname(base.BaseTestCase): - - @mock.patch.object(socket, 'gethostname', - return_value='fake-host-name') - def test_get_hostname(self, mock_gethostname): - self.assertEqual('fake-host-name', - net.get_hostname()) - mock_gethostname.assert_called_once_with() - - -class TestGetRandomMac(base.BaseTestCase): - - def test_full_prefix_does_nothing(self): - mac = net.get_random_mac(['aa', 'bb', 'cc', 'dd', 'ee', 'ff']) - - self.assertEqual('aa:bb:cc:dd:ee:ff', mac) - - @mock.patch.object(random, 'randint', side_effect=[0x11]) - def test_5_octets_prefix_replaces_1_part(self, mock_rnd): - mac = net.get_random_mac(['aa', 'bb', 'cc', 'dd', 'ee', '00']) - - self.assertEqual('aa:bb:cc:dd:ee:11', mac) - - mock_rnd.assert_called_with(0x00, 0xff) - - @mock.patch.object(random, 'randint', - side_effect=[0x01, 0x02, 0x03, 0x04, 0x05]) - def test_1_octets_prefix_replaces_5_parts(self, mock_rnd): - mac = net.get_random_mac(['aa', '00', '00', '00', '00', '00']) - - self.assertEqual('aa:01:02:03:04:05', mac) - - mock_rnd.assert_called_with(0x00, 0xff) - - @mock.patch.object(random, 'randint', return_value=0xa2) - def test_no_prefix_replaces_all_parts(self, mock_rnd): - mac = net.get_random_mac(['00', '00', '00', '00', '00', '00']) - - self.assertEqual('a2:a2:a2:a2:a2:a2', mac) - - mock_rnd.assert_called_with(0x00, 0xff) - - -class TestPortDeviceOwner(base.BaseTestCase): - - def test_is_port_trusted(self): - self.assertTrue(net.is_port_trusted( - {'device_owner': - constants.DEVICE_OWNER_NETWORK_PREFIX + 'dev'})) - - def test_is_port_not_trusted(self): - self.assertFalse(net.is_port_trusted( - {'device_owner': constants.DEVICE_OWNER_COMPUTE_PREFIX + 'dev'})) diff --git a/neutron_lib/tests/unit/utils/test_runtime.py b/neutron_lib/tests/unit/utils/test_runtime.py deleted file mode 100644 index f8b71aa..0000000 --- a/neutron_lib/tests/unit/utils/test_runtime.py +++ /dev/null @@ -1,53 +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. - -import mock - -from neutron_lib.tests import _base as base -from neutron_lib.utils import runtime - - -class _DummyDriver(object): - driver = mock.sentinel.dummy_driver - - -class TestRunTime(base.BaseTestCase): - - @mock.patch.object(runtime, 'LOG') - def test_load_class_by_alias_or_classname_no_name(self, mock_log): - self.assertRaises( - ImportError, - runtime.load_class_by_alias_or_classname, 'ns', None) - - @mock.patch.object(runtime.driver, 'DriverManager', - return_value=_DummyDriver) - @mock.patch.object(runtime, 'LOG') - def test_load_class_by_alias_or_classname_dummy_driver( - self, mock_log, mock_driver): - self.assertEqual(_DummyDriver.driver, - runtime.load_class_by_alias_or_classname('ns', 'n')) - - @mock.patch.object(runtime, 'LOG') - def test_load_class_by_alias_or_classname_bad_classname(self, mock_log): - self.assertRaises( - ImportError, - runtime.load_class_by_alias_or_classname, 'ns', '_NoClass') - - @mock.patch.object(runtime.importutils, 'import_class', - return_value=mock.sentinel.dummy_class) - @mock.patch.object(runtime, 'LOG') - def test_load_class_by_alias_or_classname_with_classname( - self, mock_log, mock_import): - self.assertEqual( - mock.sentinel.dummy_class, - runtime.load_class_by_alias_or_classname('ns', 'n')) diff --git a/neutron_lib/utils/__init__.py b/neutron_lib/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/neutron_lib/utils/file.py b/neutron_lib/utils/file.py deleted file mode 100644 index 5f056eb..0000000 --- a/neutron_lib/utils/file.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2011, VMware, Inc. -# -# 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. - -import errno -import os -import tempfile - -from debtcollector import removals - - -@removals.remove( - message="use ensure_tree(path, 0o755) from oslo_utils.fileutils", - version="Ocata", - removal_version="Queens") -def ensure_dir(dir_path): - """Ensure a directory with 755 permissions mode. - - :param dir_path: The directory path to ensure. - :returns: None. - :raises OSError: If the underlying call to makedirs raises an OSError - other than EEXIST. - """ - try: - os.makedirs(dir_path, 0o755) - except OSError as e: - # If the directory already existed, don't raise the error. - if e.errno != errno.EEXIST: - raise - - -def replace_file(file_name, data, file_mode=0o644): - """Replaces the contents of file_name with data in a safe manner. - - First write to a temp file and then rename. Since POSIX renames are - atomic, the file is unlikely to be corrupted by competing writes. - - We create the tempfile on the same device to ensure that it can be renamed. - - :param file_name: Path to the file to replace. - :param data: The data to write to the file. - :param file_mode: The mode to use for the replaced file. - :returns: None. - """ - - base_dir = os.path.dirname(os.path.abspath(file_name)) - with tempfile.NamedTemporaryFile('w+', - dir=base_dir, - delete=False) as tmp_file: - tmp_file.write(data) - os.chmod(tmp_file.name, file_mode) - os.rename(tmp_file.name, file_name) diff --git a/neutron_lib/utils/helpers.py b/neutron_lib/utils/helpers.py deleted file mode 100644 index 65ccb2b..0000000 --- a/neutron_lib/utils/helpers.py +++ /dev/null @@ -1,178 +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. - -import collections -import decimal -import random - -import six - -from neutron_lib._i18n import _ - - -def parse_mappings(mapping_list, unique_values=True, unique_keys=True): - """Parse a list of mapping strings into a dictionary. - - :param mapping_list: A list of strings of the form ':'. - :param unique_values: Values must be unique if True. - :param unique_keys: Keys must be unique if True, else implies that keys - and values are not unique. - :returns: A dict mapping keys to values or to list of values. - :raises ValueError: Upon malformed data or duplicate keys. - """ - mappings = {} - for mapping in mapping_list: - mapping = mapping.strip() - if not mapping: - continue - split_result = mapping.split(':') - if len(split_result) != 2: - raise ValueError(_("Invalid mapping: '%s'") % mapping) - key = split_result[0].strip() - if not key: - raise ValueError(_("Missing key in mapping: '%s'") % mapping) - value = split_result[1].strip() - if not value: - raise ValueError(_("Missing value in mapping: '%s'") % mapping) - if unique_keys: - if key in mappings: - raise ValueError(_("Key %(key)s in mapping: '%(mapping)s' not " - "unique") % {'key': key, - 'mapping': mapping}) - if unique_values and value in mappings.values(): - raise ValueError(_("Value %(value)s in mapping: '%(mapping)s' " - "not unique") % {'value': value, - 'mapping': mapping}) - mappings[key] = value - else: - mappings.setdefault(key, []) - if value not in mappings[key]: - mappings[key].append(value) - return mappings - - -def compare_elements(a, b): - """Compare elements if a and b have same elements. - - This method doesn't consider ordering. - - :param a: The first item to compare. - :param b: The second item to compare. - :returns: True if a and b have the same elements, False otherwise. - """ - return set(a or []) == set(b or []) - - -def safe_sort_key(value): - """Return value hash or build one for dictionaries. - - :param value: The value to build a hash for. - :returns: The value sorted. - """ - if isinstance(value, collections.Mapping): - return sorted(value.items()) - return value - - -def dict2str(dic): - """Build a str representation of a dict. - - :param dic: The dict to build a str representation for. - :returns: The dict in str representation that is a k=v command list for - each item in dic. - """ - return ','.join("%s=%s" % (key, val) - for key, val in sorted(dic.items())) - - -def str2dict(string): - """Parse a str representation of a dict into its dict form. - - This is the inverse of dict2str() - - :param string: The string to parse. - :returns: A dict constructed from the str representation in string. - """ - res_dict = {} - for keyvalue in string.split(','): - (key, value) = keyvalue.split('=', 1) - res_dict[key] = value - return res_dict - - -def dict2tuple(d): - """Build a tuple from a dict. - - :param d: The dict to coherence into a tuple. - :returns: The dict d in tuple form. - """ - items = list(d.items()) - items.sort() - return tuple(items) - - -def diff_list_of_dict(old_list, new_list): - """Given 2 lists of dicts, return a tuple containing the diff. - - :param old_list: The old list of dicts to diff. - :param new_list: The new list of dicts to diff. - :returns: A tuple where the first item is a list of the added dicts in - the diff and the second item is the removed dicts. - """ - new_set = set([dict2str(l) for l in new_list]) - old_set = set([dict2str(l) for l in old_list]) - added = new_set - old_set - removed = old_set - new_set - return [str2dict(a) for a in added], [str2dict(r) for r in removed] - - -def get_random_string(length): - """Get a random hex string of the specified length. - - :param length: The length for the hex string. - :returns: A random hex string of the said length. - """ - return "{0:0{1}x}".format(random.getrandbits(length * 4), length) - - -def camelize(s): - """Camelize a str that uses _ as a camelize token. - - :param s: The str to camelize that contains a _ at each index where a new - camelized word starts. - :returns: The camelized str. - """ - return ''.join(s.replace('_', ' ').title().split()) - - -def round_val(val): - """Round the value. - - :param val: The value to round. - :returns: The value rounded using the half round up scheme. - """ - # we rely on decimal module since it behaves consistently across Python - # versions (2.x vs. 3.x) - return int(decimal.Decimal(val).quantize(decimal.Decimal('1'), - rounding=decimal.ROUND_HALF_UP)) - - -def safe_decode_utf8(s): - """Safe decode a str from UTF. - - :param s: The str to decode. - :returns: The decoded str. - """ - if six.PY3 and isinstance(s, bytes): - return s.decode('utf-8', 'surrogateescape') - return s diff --git a/neutron_lib/utils/host.py b/neutron_lib/utils/host.py deleted file mode 100644 index 07e4004..0000000 --- a/neutron_lib/utils/host.py +++ /dev/null @@ -1,26 +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. - -import multiprocessing - - -def cpu_count(): - """Get the system CPU count. - - :returns: The number of CPUs on the system as an int. If there's an issue - fetching the CPU count on the system, a default value of 1 is returned. - """ - try: - return multiprocessing.cpu_count() - except NotImplementedError: - return 1 diff --git a/neutron_lib/utils/net.py b/neutron_lib/utils/net.py deleted file mode 100644 index b30ae28..0000000 --- a/neutron_lib/utils/net.py +++ /dev/null @@ -1,54 +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. - -import random -import socket - -from neutron_lib import constants - - -def get_hostname(): - """Get the hostname of the system. - - :returns: The hostname of the system. - """ - return socket.gethostname() - - -def get_random_mac(base_mac): - """Get a random MAC address string of the specified base format. - - Any part that is '00' will be randomized - - :param base_mac: Base MAC address represented by an array of 6 strings/int - :returns: The MAC address string. - """ - - return ':'.join( - "{:02x}".format(random.randint(0x00, 0xff))if p == '00' else p - for p in base_mac - ) - - -def is_port_trusted(port): - """Used to determine if port can be trusted not to attack network. - - Trust is currently based on the device_owner field starting with 'network:' - since we restrict who can use that in the default policy.json file. - - :param port: The port dict to inspect the 'device_owner' for. - :returns: True if the port dict's 'device_owner' value starts with the - networking prefix. False otherwise. - """ - return port['device_owner'].startswith( - constants.DEVICE_OWNER_NETWORK_PREFIX) diff --git a/neutron_lib/utils/runtime.py b/neutron_lib/utils/runtime.py deleted file mode 100644 index 98ffaf8..0000000 --- a/neutron_lib/utils/runtime.py +++ /dev/null @@ -1,59 +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. - -import sys - -from oslo_concurrency import lockutils -from oslo_log import log as logging -from oslo_utils import importutils -from stevedore import driver - -from neutron_lib._i18n import _ - -LOG = logging.getLogger(__name__) -SYNCHRONIZED_PREFIX = 'neutron-' - - -# common synchronization decorator -synchronized = lockutils.synchronized_with_prefix(SYNCHRONIZED_PREFIX) - - -def load_class_by_alias_or_classname(namespace, name): - """Load a class using stevedore alias or the class name. - - :param namespace: The namespace where the alias is defined. - :param name: The alias or class name of the class to be loaded. - :returns: Class if it can be loaded. - :raises ImportError: if class cannot be loaded. - """ - - if not name: - LOG.error("Alias or class name is not set") - raise ImportError(_("Class not found.")) - try: - # Try to resolve class by alias - mgr = driver.DriverManager( - namespace, name, warn_on_missing_entrypoint=False) - class_to_load = mgr.driver - except RuntimeError: - e1_info = sys.exc_info() - # Fallback to class name - try: - class_to_load = importutils.import_class(name) - except (ImportError, ValueError): - LOG.error("Error loading class by alias", - exc_info=e1_info) - LOG.error("Error loading class by class name", - exc_info=True) - raise ImportError(_("Class not found.")) - return class_to_load diff --git a/neutron_lib/version.py b/neutron_lib/version.py deleted file mode 100644 index 0bd7dfc..0000000 --- a/neutron_lib/version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2011 OpenStack Foundation -# -# 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. - -import pbr.version - -version_info = pbr.version.VersionInfo('neutron-lib') diff --git a/neutron_lib/worker.py b/neutron_lib/worker.py deleted file mode 100644 index 1f4975f..0000000 --- a/neutron_lib/worker.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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 oslo_service import service - -from neutron_lib.callbacks import events -from neutron_lib.callbacks import registry -from neutron_lib.callbacks import resources - - -class BaseWorker(service.ServiceBase): - """Partial implementation of the ServiceBase ABC. - - Subclasses will still need to add the other abstract methods defined in - service.ServiceBase. See oslo_service for more details. - - If a plugin needs to handle synchronization with the Neutron database and - do this only once instead of in every API worker, for instance, it would - define a BaseWorker class and the plugin would have get_workers return - an array of BaseWorker instances. For example: - - .. code-block:: python - - class MyPlugin(...): - def get_workers(self): - return [MyPluginWorker()] - - class MyPluginWorker(BaseWorker): - def start(self): - super(MyPluginWorker, self).start() - do_sync() - """ - - # default class value for case when super().__init__ is not called - _default_process_count = 1 - - def __init__(self, worker_process_count=_default_process_count): - """Initialize a worker instance. - - :param worker_process_count: Defines how many processes to spawn for - worker: - 0 - spawn 1 new worker thread, - 1..N - spawn N new worker processes - """ - self._worker_process_count = worker_process_count - - @property - def worker_process_count(self): - """The worker's process count. - - :returns: The number of processes to spawn for this worker. - """ - return self._worker_process_count - - def start(self): - """Start the worker. - - If worker_process_count is greater than 0, a callback notification - is sent. Subclasses should call this method before doing their - own start() work. - :returns: None - """ - if self.worker_process_count > 0: - registry.notify(resources.PROCESS, events.AFTER_INIT, self.start) diff --git a/releasenotes/notes/.placeholder b/releasenotes/notes/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/releasenotes/notes/add-action-status-3dbfe2490a0d231a.yaml b/releasenotes/notes/add-action-status-3dbfe2490a0d231a.yaml deleted file mode 100644 index c20050e..0000000 --- a/releasenotes/notes/add-action-status-3dbfe2490a0d231a.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``ACTION_STATUS`` is added to API definitions for neutron extension has - specific ``action_status``. \ No newline at end of file diff --git a/releasenotes/notes/add-convert-to-string-524541aa6224f66f.yaml b/releasenotes/notes/add-convert-to-string-524541aa6224f66f.yaml deleted file mode 100644 index f63fee2..0000000 --- a/releasenotes/notes/add-convert-to-string-524541aa6224f66f.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - | - A new converter ``convert_to_string`` into ``neutron_lib.api.converters``. - This method can convert an argument which is not None into string value. diff --git a/releasenotes/notes/add-directory-is-loaded-e9da5b65824dddad.yaml b/releasenotes/notes/add-directory-is-loaded-e9da5b65824dddad.yaml deleted file mode 100644 index 0758660..0000000 --- a/releasenotes/notes/add-directory-is-loaded-e9da5b65824dddad.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - | - Introduced neutron_lib.plugins.directory.is_loaded(). This can be used - in lieu of len(plugins()) or bool(plugins()) or plugins() alone. diff --git a/releasenotes/notes/add-exception-pkg-5a14389891abf358.yaml b/releasenotes/notes/add-exception-pkg-5a14389891abf358.yaml deleted file mode 100644 index 34f1976..0000000 --- a/releasenotes/notes/add-exception-pkg-5a14389891abf358.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - A new ``neutron_lib.exceptions`` package is now available where the - existing definitions from the ``exceptions`` module are now in - ``neutron_lib.exceptions.__init__`` and subsequent per-component - exceptions can be created in their own exceptions sub-module. diff --git a/releasenotes/notes/add-extension-supported-be6f7069856d2891.yaml b/releasenotes/notes/add-extension-supported-be6f7069856d2891.yaml deleted file mode 100644 index 29a04a7..0000000 --- a/releasenotes/notes/add-extension-supported-be6f7069856d2891.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - | - Rehome the validation for checking if an extension is supported by the - plugin. The method ``is_extension_supported`` will now be part of - ``neutron_lib.api.extensions``. diff --git a/releasenotes/notes/add-validator-pkg-a6565a2d4fbfa1d8.yaml b/releasenotes/notes/add-validator-pkg-a6565a2d4fbfa1d8.yaml deleted file mode 100644 index 190543d..0000000 --- a/releasenotes/notes/add-validator-pkg-a6565a2d4fbfa1d8.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - A new ``neutron_lib.validators`` package is now available where the - existing definitions from the ``validators`` module are now in - ``neutron_lib.validators.__init__`` and subsequent per-component - validators can be created in their own validators sub-module. \ No newline at end of file diff --git a/releasenotes/notes/add-vif-type-agilio-ovs-6bee5b2557aca10e.yaml b/releasenotes/notes/add-vif-type-agilio-ovs-6bee5b2557aca10e.yaml deleted file mode 100644 index 07f80ec..0000000 --- a/releasenotes/notes/add-vif-type-agilio-ovs-6bee5b2557aca10e.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - A VIF type for Agilio OVS (``VIF_TYPE_AGILIO_OVS``) has been added to - portbindings. This links the external Neutron plugin to the external - OS-VIF plugin in Nova. diff --git a/releasenotes/notes/add-vnic-virtio-forwarder-portbinding-f7f87dfbef456ed1.yaml b/releasenotes/notes/add-vnic-virtio-forwarder-portbinding-f7f87dfbef456ed1.yaml deleted file mode 100644 index dea40aa..0000000 --- a/releasenotes/notes/add-vnic-virtio-forwarder-portbinding-f7f87dfbef456ed1.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -features: - - The ``VNIC_VIRTIO_FORWARDER`` VNIC type has been added to portbindings. - This VNIC type is intended to request a low-latency virtio port inside the - instance, likely backed by hardware acceleration. Currently the Agilio OVS - external plugin provides support for this, with support from other vendors - following soon. diff --git a/releasenotes/notes/agent_extensions-2b497ff33c6dc3e8.yaml b/releasenotes/notes/agent_extensions-2b497ff33c6dc3e8.yaml deleted file mode 100644 index 6180d6f..0000000 --- a/releasenotes/notes/agent_extensions-2b497ff33c6dc3e8.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - Neutron agent extension abstract classes are moved from ``neutron.agent`` to ``neutron_lib.agent`` diff --git a/releasenotes/notes/alembic-branches-6d5947d141efd26e.yaml b/releasenotes/notes/alembic-branches-6d5947d141efd26e.yaml deleted file mode 100644 index 2589dbd..0000000 --- a/releasenotes/notes/alembic-branches-6d5947d141efd26e.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - The constants ``EXPAND_BRANCH`` and ``CONTRACT_BRANCH`` are now available in - ``neutron_lib.db.constants``. They should be used instead of the ones in - ``neutron.db.migration.cli``. diff --git a/releasenotes/notes/api-definition-base-d2e9514c5ee2ef5b.yaml b/releasenotes/notes/api-definition-base-d2e9514c5ee2ef5b.yaml deleted file mode 100644 index ab6df51..0000000 --- a/releasenotes/notes/api-definition-base-d2e9514c5ee2ef5b.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -other: - - Provide API definition framework for Neutron Stadium APIs to - be consolidated into neutron-lib. For more details see review - https://review.openstack.org/#/c/353131/. diff --git a/releasenotes/notes/bgpvpn-api-def-22c7072575316ddd.yaml b/releasenotes/notes/bgpvpn-api-def-22c7072575316ddd.yaml deleted file mode 100644 index f8e9b68..0000000 --- a/releasenotes/notes/bgpvpn-api-def-22c7072575316ddd.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - API definition for the ``networking-bgpvpn`` extension. - - Adds new validator ``validate_list_of_regex_or_none``. diff --git a/releasenotes/notes/bgpvpn-api-ref-f0294d9ddec726a0.yaml b/releasenotes/notes/bgpvpn-api-ref-f0294d9ddec726a0.yaml deleted file mode 100644 index 3eefb6b..0000000 --- a/releasenotes/notes/bgpvpn-api-ref-f0294d9ddec726a0.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - API reference for the ``networking-bgpvpn`` extension. diff --git a/releasenotes/notes/bgpvpn-routes-control-51cd95d6ab265cb1.yaml b/releasenotes/notes/bgpvpn-routes-control-51cd95d6ab265cb1.yaml deleted file mode 100644 index b2b407c..0000000 --- a/releasenotes/notes/bgpvpn-routes-control-51cd95d6ab265cb1.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -features: - - | - The ``bgpvpn-routes-control`` API extension is introduced to enrich the - base ``bgpvpn`` extension. It allows to control BGPVPN connectivity at - the granularity of a port and the advertisement into a BGPVPN of routes - corresponding to destination reachable via a given port (static routes, - BGPVPN route leaking). diff --git a/releasenotes/notes/boilerplate-ext-descriptor-a5cec8b9b900cbfd.yaml b/releasenotes/notes/boilerplate-ext-descriptor-a5cec8b9b900cbfd.yaml deleted file mode 100644 index 2000c9f..0000000 --- a/releasenotes/notes/boilerplate-ext-descriptor-a5cec8b9b900cbfd.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - The ``APIExtensionDescriptor`` was added to ``neutron_lib.api.extensions`` - and can be used with extensions that have an API definition in neutron-lib - to minimize the boilplate code needed in the extension definition class. - For more details, see the dev-ref. diff --git a/releasenotes/notes/cidr_for_canonical_format-4e7925d76a27a19d.yaml b/releasenotes/notes/cidr_for_canonical_format-4e7925d76a27a19d.yaml deleted file mode 100644 index 69a46f5..0000000 --- a/releasenotes/notes/cidr_for_canonical_format-4e7925d76a27a19d.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - | - A new converter is added to facilitate converting IPv6 CIDRs to canonical format. This way - IPv6 CIDRs can be specified in multiple formats but would be handled in their canonical format. diff --git a/releasenotes/notes/context-manager-23538670cd9c701f.yaml b/releasenotes/notes/context-manager-23538670cd9c701f.yaml deleted file mode 100644 index 23eb143..0000000 --- a/releasenotes/notes/context-manager-23538670cd9c701f.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -features: - - | - ``neutron_lib.db`` has a public module ``api`` that provides - accessor functions for transactional context manager services. - - | - ``neutron_lib.fixture`` has a new ``SqlFixture`` available. diff --git a/releasenotes/notes/context-public-6df198b77027c224.yaml b/releasenotes/notes/context-public-6df198b77027c224.yaml deleted file mode 100644 index d13df73..0000000 --- a/releasenotes/notes/context-public-6df198b77027c224.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -features: - - | - The ``context`` module has been made public. For example: - - .. code-block:: python - - from neutron_lib import context - - ctx = context.get_admin_context() - - For more examples, see: https://review.openstack.org/#/c/388157/ diff --git a/releasenotes/notes/core-attributes-43e6969f1b187e5c.yaml b/releasenotes/notes/core-attributes-43e6969f1b187e5c.yaml deleted file mode 100644 index 63d9aeb..0000000 --- a/releasenotes/notes/core-attributes-43e6969f1b187e5c.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -features: - - A bulk of the ``neutron.api.v2.attributes`` functionality is now available - in ``neutron_lib.api.attributes``. A new ``AttributeInfo`` class is - available in that acts as a wrapper for an API resource's attribute dict - and allows consumers to perform operations with the underlying attribute - dict. The ``populate_project_info`` function is now available. The global - attribute map ``RESOURCES`` is now available and will take the place of - neutron's global ``RESOURCE_ATTRIBUTE_MAP``. - - The ``neutron_lib.fixture.APIDefinitionFixture`` has been updated to handle - backing-up and restoring the global ``RESOURCES`` dict. By default the - constructor now also uses all API definitions if none are passed to it's - constructor. This is the default behavior almost all consumers need and is - thus a convenience change. diff --git a/releasenotes/notes/data-plane-status-ext-c3452a01ef5007ce.yaml b/releasenotes/notes/data-plane-status-ext-c3452a01ef5007ce.yaml deleted file mode 100644 index 60a0beb..0000000 --- a/releasenotes/notes/data-plane-status-ext-c3452a01ef5007ce.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - API definition and reference documentation for the port data plane status - extension. diff --git a/releasenotes/notes/deprecate-api-utils-4f86288591c95679.yaml b/releasenotes/notes/deprecate-api-utils-4f86288591c95679.yaml deleted file mode 100644 index e67cbc9..0000000 --- a/releasenotes/notes/deprecate-api-utils-4f86288591c95679.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -deprecations: - - The function ``neutron_lib.api.utils.populate_project_info`` has moved - to ``neutron_lib.api.attributes.populate_project_info``. It will be removed - from the old location in the future. diff --git a/releasenotes/notes/directory-fixture-083c5c5f365670d6.yaml b/releasenotes/notes/directory-fixture-083c5c5f365670d6.yaml deleted file mode 100644 index 36971f8..0000000 --- a/releasenotes/notes/directory-fixture-083c5c5f365670d6.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -features: - - | - Introduced neutron_lib.fixture, and added fixture for plugin - directory ``PluginDirectoryFixture``. An example below: - - .. code-block:: python - - from neutron_lib.plugins import directory - from neutron_lib import fixture - - - def setup_test_directory_instance(self): - """Give a private copy of the directory to each test.""" - self._plugin_directory = directory._PluginDirectory() - self.useFixture(fixture.PluginDirectoryFixture( - plugin_directory=self._plugin_directory)) diff --git a/releasenotes/notes/dns-api-def-bc24a58f56c5fbfb.yaml b/releasenotes/notes/dns-api-def-bc24a58f56c5fbfb.yaml deleted file mode 100644 index 0eea4af..0000000 --- a/releasenotes/notes/dns-api-def-bc24a58f56c5fbfb.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - The ``DNS Integration`` extension API definition has been added as - ``neutron_lib.api.definitions.dns``. - - The ``validate_dns_name``, ``validate_fip_dns_name``, and - ``validate_dns_domain`` are now available as neutron-lib validators. \ No newline at end of file diff --git a/releasenotes/notes/dns-domain-ports-ext-39a069119e79e59b.yaml b/releasenotes/notes/dns-domain-ports-ext-39a069119e79e59b.yaml deleted file mode 100644 index fe0f2c4..0000000 --- a/releasenotes/notes/dns-domain-ports-ext-39a069119e79e59b.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``dns-domain-ports`` extension API definition has been added as - ``neutron_lib.api.definitions.dns_domain_ports``. diff --git a/releasenotes/notes/enable-hacking-check-H904-f512ecc98c0a4033.yaml b/releasenotes/notes/enable-hacking-check-H904-f512ecc98c0a4033.yaml deleted file mode 100644 index 7c42f29..0000000 --- a/releasenotes/notes/enable-hacking-check-H904-f512ecc98c0a4033.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -other: - - OpenStack dev hacking check ``H904`` is now enabled in ``tox.ini`` - via the ``enable-extensions`` configuration property. Neutron-lib - adopters should also enable this hacking check in their ``tox.ini``. diff --git a/releasenotes/notes/expose-and-enhance-callback-api-714cce65a3c44fe7.yaml b/releasenotes/notes/expose-and-enhance-callback-api-714cce65a3c44fe7.yaml deleted file mode 100644 index 7b6748e..0000000 --- a/releasenotes/notes/expose-and-enhance-callback-api-714cce65a3c44fe7.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -features: - - Neutron's callback API found in ``neutron.callbacks.*`` is now exposed - in ``neutron_lib.callbacks.*``. In addition, a set of event payload objects - are now available for use in transporting event payload data in a - standardized way. - - A test fixture is provided for isolating the global callback manager in - ``neutron_lib.callbacks.registry``. For more details see the comments in - ``neutron_lib.fixture.CallbackRegistryFixture``. -deprecations: - - The use of ``neutron_lib.callbacks.registry.notify()`` and - ``neutron_lib.callbacks.manager.CallbacksManager.notify()`` is deprecated in - favor of their ``publish()`` counterparts and will be removed in - the "Queens" release time-frame. diff --git a/releasenotes/notes/extension-fixture-b7fd61384f1a4d1d.yaml b/releasenotes/notes/extension-fixture-b7fd61384f1a4d1d.yaml deleted file mode 100644 index 5efd4af..0000000 --- a/releasenotes/notes/extension-fixture-b7fd61384f1a4d1d.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -features: - - A new fixture for testing with neutron-lib API definitions has - been added as ``neutron_lib.fixtures.APIDefinitionFixture``. This - fixture can be used anytime extension plugins are being tested - that modify resource attribute maps and ensures the single global - API definition attribute map is copied and restored. - - The ``neutron_lib.api.extensions.APIExtensionDescriptor`` class now - defines update_attributes_map that uses the API definitions attribute - map if none is given. This is the default behavior in most all - extensions today and thus is collapsed into the base class for convenience. - diff --git a/releasenotes/notes/extension_descriptor-04025e86249cc94c.yaml b/releasenotes/notes/extension_descriptor-04025e86249cc94c.yaml deleted file mode 100644 index 6e791f9..0000000 --- a/releasenotes/notes/extension_descriptor-04025e86249cc94c.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ExtensionDescriptor class moved from neutron.api.extensions to - neutron_lib.api.extensions. diff --git a/releasenotes/notes/extra-dhcp-opt-public-vars-ec4e1c2dcac43d69.yaml b/releasenotes/notes/extra-dhcp-opt-public-vars-ec4e1c2dcac43d69.yaml deleted file mode 100644 index 5eef55e..0000000 --- a/releasenotes/notes/extra-dhcp-opt-public-vars-ec4e1c2dcac43d69.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - The constants ``VALID_BLANK_EXTRA_DHCP_OPTS`` and ``DHCP_OPT_VALUE_MAX_LEN`` - are now public in the ``neutron_lib.api.definitions.extra_dhcp_opt`` API - definition module. diff --git a/releasenotes/notes/fip64-0c6bb38417d602f1.yaml b/releasenotes/notes/fip64-0c6bb38417d602f1.yaml deleted file mode 100644 index c44ba6c..0000000 --- a/releasenotes/notes/fip64-0c6bb38417d602f1.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - API reference and definition for networking-midonet's ``fip64`` extension. diff --git a/releasenotes/notes/flush_on_subtransaction-99ef11dfb56b706d.yaml b/releasenotes/notes/flush_on_subtransaction-99ef11dfb56b706d.yaml deleted file mode 100644 index db7e2ab..0000000 --- a/releasenotes/notes/flush_on_subtransaction-99ef11dfb56b706d.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -fixes: - - The oslo.db context manager returned by ``db.api.get_context_manager()`` - will be configured with flush_on_subtransaction=True to more closely - match the behavior of the previous session.begin(subtransactions=True) - pattern we used everywhere before. See bug 1664643 for more details. diff --git a/releasenotes/notes/fwaas-api-def-a6f03db369177b4a.yaml b/releasenotes/notes/fwaas-api-def-a6f03db369177b4a.yaml deleted file mode 100644 index d50724d..0000000 --- a/releasenotes/notes/fwaas-api-def-a6f03db369177b4a.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - Adds neutron-fwaas API definitions to neutron-lib. diff --git a/releasenotes/notes/fwaas-exceptions-e580766205b466d4.yaml b/releasenotes/notes/fwaas-exceptions-e580766205b466d4.yaml deleted file mode 100644 index 198d524..0000000 --- a/releasenotes/notes/fwaas-exceptions-e580766205b466d4.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -features: - - | - The exception classes have migrated from neutron_fwaas - to neutron_lib as mentioned below: - - * ``neutron_fwaas.extensions.firewall`` -> ``neutron_lib.exceptions.firewall_v1`` - * ``neutron_fwaas.extensions.firewallrouterinsertion`` -> ``neutron_lib.exceptions.firewall_v1`` - * ``neutron_fwaas.extensions.firewall_v2`` -> ``neutron_lib.exceptions.firewall_v2`` diff --git a/releasenotes/notes/fwaas_converters_validators-c310900b4386146e.yaml b/releasenotes/notes/fwaas_converters_validators-c310900b4386146e.yaml deleted file mode 100644 index 62b82ae..0000000 --- a/releasenotes/notes/fwaas_converters_validators-c310900b4386146e.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - Added the converter ``convert_string_to_case_insensitive``. - - Added the converter ``convert_to_protocol``. - - Added the validator ``validate_port_range_or_none``. diff --git a/releasenotes/notes/hacking-check-n537-280ec39c061d9dd7.yaml b/releasenotes/notes/hacking-check-n537-280ec39c061d9dd7.yaml deleted file mode 100644 index 258cfb6..0000000 --- a/releasenotes/notes/hacking-check-n537-280ec39c061d9dd7.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - Added hacking check ``N536``. This hacking check is added to the - incubating checks. diff --git a/releasenotes/notes/introduce-logging-api-031d00eb84d5d061.yaml b/releasenotes/notes/introduce-logging-api-031d00eb84d5d061.yaml deleted file mode 100644 index 943f39d..0000000 --- a/releasenotes/notes/introduce-logging-api-031d00eb84d5d061.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - API definition for the logging extension for ``security_group`` resource. diff --git a/releasenotes/notes/ipv6_address_usage-ef3d65ad5aa5798b.yaml b/releasenotes/notes/ipv6_address_usage-ef3d65ad5aa5798b.yaml deleted file mode 100644 index a988ce0..0000000 --- a/releasenotes/notes/ipv6_address_usage-ef3d65ad5aa5798b.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - | - A converter ``convert_ip_to_canonical_format`` has been added to - neutron-lib which allows IPv6 addresses to be stored and - displayed in canonical format. \ No newline at end of file diff --git a/releasenotes/notes/l3-apidef-exceptions-ee57b9df1c7443d4.yaml b/releasenotes/notes/l3-apidef-exceptions-ee57b9df1c7443d4.yaml deleted file mode 100644 index 97b822a..0000000 --- a/releasenotes/notes/l3-apidef-exceptions-ee57b9df1c7443d4.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The exception classes from ``neutron.extensions.l3`` have - been rehomed into ``neutron_lib.exceptions.l3``. diff --git a/releasenotes/notes/l3-apidefs-d028c708c22ef2a0.yaml b/releasenotes/notes/l3-apidefs-d028c708c22ef2a0.yaml deleted file mode 100644 index 72e7072..0000000 --- a/releasenotes/notes/l3-apidefs-d028c708c22ef2a0.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - The ``floating_ip`` and ``router`` API definitions from - ``neutron.extensions.l3`` have been rehomed to - ``neutron_lib.api.definitions`` as the module ``l3``. diff --git a/releasenotes/notes/logging-api-ref-fafb884367ca60a2.yaml b/releasenotes/notes/logging-api-ref-fafb884367ca60a2.yaml deleted file mode 100644 index 50d291d..0000000 --- a/releasenotes/notes/logging-api-ref-fafb884367ca60a2.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - API reference for the logging extension for ``security_group`` resource. diff --git a/releasenotes/notes/logging-resource-api-cecf33e3be468eb2.yaml b/releasenotes/notes/logging-resource-api-cecf33e3be468eb2.yaml deleted file mode 100644 index ab91847..0000000 --- a/releasenotes/notes/logging-resource-api-cecf33e3be468eb2.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - API reference and definition for networking-midonet's ``logging-resource`` extension. diff --git a/releasenotes/notes/migrate-public-to-shared-0c67b32f9c37c751.yaml b/releasenotes/notes/migrate-public-to-shared-0c67b32f9c37c751.yaml deleted file mode 100644 index 79e7017..0000000 --- a/releasenotes/notes/migrate-public-to-shared-0c67b32f9c37c751.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -upgrade: - - | - FWaaS has renamed the ``public`` attribute to ``shared`` to be - in-sync with Openstack nomenclature based on the functionality - the ``shared`` attribute provides. diff --git a/releasenotes/notes/move-get-random-mac-98f47d81cb34483d.yaml b/releasenotes/notes/move-get-random-mac-98f47d81cb34483d.yaml deleted file mode 100644 index c213235..0000000 --- a/releasenotes/notes/move-get-random-mac-98f47d81cb34483d.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``get_random_mac`` utility function from ``neutron.common.utils`` is - now in ``neutron_lib.utils.net`` with the same name, ``get_random_mac``. diff --git a/releasenotes/notes/moved-netmtu-extension-5999348000adcfaf.yaml b/releasenotes/notes/moved-netmtu-extension-5999348000adcfaf.yaml deleted file mode 100644 index b7a58b3..0000000 --- a/releasenotes/notes/moved-netmtu-extension-5999348000adcfaf.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``net-mtu`` extension API definition has been added as - ``neutron_lib.api.definitions.network_mtu``. diff --git a/releasenotes/notes/new-hacking-check-no-log-translations-4a430a38aeb06452.yaml b/releasenotes/notes/new-hacking-check-no-log-translations-4a430a38aeb06452.yaml deleted file mode 100644 index 380ac1d..0000000 --- a/releasenotes/notes/new-hacking-check-no-log-translations-4a430a38aeb06452.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -features: - - | - New ``N537`` hacking check is introduced that enforces no logging message - translations, in any logging level. The check is enabled by default. Also, - the ``N533`` hacking check is now removed because it is covered by - ``N537``. -upgrade: - - | - Library consumers may need to adopt their code to new requirements of ``N537`` hacking check, - removing translation markers from all logging messages. If for some reason - it doesn't fit the project, consumers can disable the new hacking check - using ``ignore`` statement in ``flake8`` section of their ``tox.ini`` file, - or by other means. diff --git a/releasenotes/notes/new-validator-range-or-none-dc8d557ec1f2622a.yaml b/releasenotes/notes/new-validator-range-or-none-dc8d557ec1f2622a.yaml deleted file mode 100644 index f926a8f..0000000 --- a/releasenotes/notes/new-validator-range-or-none-dc8d557ec1f2622a.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - Added validator ``range_or_none``. diff --git a/releasenotes/notes/one-hacking-factory-01053e8e3d88c3d5.yaml b/releasenotes/notes/one-hacking-factory-01053e8e3d88c3d5.yaml deleted file mode 100644 index c504f10..0000000 --- a/releasenotes/notes/one-hacking-factory-01053e8e3d88c3d5.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -other: - - The hacking check factory function - ``neutron_lib.hacking.checks.incubating_factory`` has been removed. - All consumers should use ``neutron_lib.hacking.checks.factory`` as per - the ``usage`` dev-ref. diff --git a/releasenotes/notes/plugin-directory-55861f4098813ba6.yaml b/releasenotes/notes/plugin-directory-55861f4098813ba6.yaml deleted file mode 100644 index 6d19888..0000000 --- a/releasenotes/notes/plugin-directory-55861f4098813ba6.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -features: - - | - Introduced neutron_lib.plugins.directory to get references - for loaded plugins in a neutron server process. For example: - - .. code-block:: python - - from neutron_lib import constants - from neutron_lib.plugins import directory - - core_plugin = directory.get_plugin() - l3_plugin = directory.get_plugin(constants.L3) - - For more examples, see: https://review.openstack.org/#/c/386845/ diff --git a/releasenotes/notes/policy-redux-25c26836219fd02d.yaml b/releasenotes/notes/policy-redux-25c26836219fd02d.yaml deleted file mode 100644 index e3668f8..0000000 --- a/releasenotes/notes/policy-redux-25c26836219fd02d.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -deprecations: - - | - ``policy.refresh()`` and ``policy.reset()`` have been removed. The library - policy module is not meant for public consumption, and it should be - considered in practice a private component of the library. If you use it, - you will do so at your own risk, as it has been marked as a private module. diff --git a/releasenotes/notes/portbindings-apidef-3d7893bcb94d7f61.yaml b/releasenotes/notes/portbindings-apidef-3d7893bcb94d7f61.yaml deleted file mode 100644 index bbe6de3..0000000 --- a/releasenotes/notes/portbindings-apidef-3d7893bcb94d7f61.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - The API definition and associated constants have been - rehomed from ``neutron.extensions.portbindings`` to - ``neutron_lib.api.definitions.portbindings``. diff --git a/releasenotes/notes/provider-net-apidef-9ebe9f56840c79f7.yaml b/releasenotes/notes/provider-net-apidef-9ebe9f56840c79f7.yaml deleted file mode 100644 index f84c9e8..0000000 --- a/releasenotes/notes/provider-net-apidef-9ebe9f56840c79f7.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The Neutron ``Provider network`` extension API definition has been added as - ``neutron_lib.api.definitions.provider_net``. diff --git a/releasenotes/notes/public-service-classes-e52d7c79a075b799.yaml b/releasenotes/notes/public-service-classes-e52d7c79a075b799.yaml deleted file mode 100644 index cfb3e4c..0000000 --- a/releasenotes/notes/public-service-classes-e52d7c79a075b799.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -features: - - The ``neutron_lib.api.extensions.ExtensionDescriptor`` class's - ``get_plugin_interface`` method now formally only supports - ``neutron_lib.services.base.ServicePluginBase``. This change reflects - the existing usage by consumers as almost all are returning - instances of ``ServicePluginBase`` already. - - The class ``WorkerBase`` is now available and provides the same - functionality that's provided by - ``neutron.worker.WorkerSupportServiceMixin``. diff --git a/releasenotes/notes/rehome-address-scope-apidef-f4e8bb74be61729a.yaml b/releasenotes/notes/rehome-address-scope-apidef-f4e8bb74be61729a.yaml deleted file mode 100644 index 2c13052..0000000 --- a/releasenotes/notes/rehome-address-scope-apidef-f4e8bb74be61729a.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The neutron ``address-scope`` extension's API definition is now available as - ``neutron_lib.api.definitions.address_scope``. diff --git a/releasenotes/notes/rehome-agent-apidef-7a2dde6a9810f55c.yaml b/releasenotes/notes/rehome-agent-apidef-7a2dde6a9810f55c.yaml deleted file mode 100644 index 106eefe..0000000 --- a/releasenotes/notes/rehome-agent-apidef-7a2dde6a9810f55c.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The neutron ``agent`` extension's API definition is now available as - ``neutron_lib.api.definitions.agent``. diff --git a/releasenotes/notes/rehome-api-faults-cf30246e5e5bf8b8.yaml b/releasenotes/notes/rehome-api-faults-cf30246e5e5bf8b8.yaml deleted file mode 100644 index b022c40..0000000 --- a/releasenotes/notes/rehome-api-faults-cf30246e5e5bf8b8.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``FAULT_MAP`` dictionary from ``neutron.api.v2.base`` - has been rehomed to ``neutron_lib.api.faults`` with the same name. diff --git a/releasenotes/notes/rehome-autotopology-apidef-4a77e8ba0c783f7e.yaml b/releasenotes/notes/rehome-autotopology-apidef-4a77e8ba0c783f7e.yaml deleted file mode 100644 index 8c86c72..0000000 --- a/releasenotes/notes/rehome-autotopology-apidef-4a77e8ba0c783f7e.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The neutron ``auto-allocated-topology`` extension's API definition is now - available as ``neutron_lib.api.definitions.auto_allocated_topology``. diff --git a/releasenotes/notes/rehome-common-constants-8ac9580e52fd3618.yaml b/releasenotes/notes/rehome-common-constants-8ac9580e52fd3618.yaml deleted file mode 100644 index 684e2a8..0000000 --- a/releasenotes/notes/rehome-common-constants-8ac9580e52fd3618.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - Constants from ``neutron.common.constants`` are now available in - neutron-lib. Note that consumers using ``ROUTER_STATUS_ACTIVE`` or - ``ROUTER_STATUS_ERROR`` should now just use ``ACTIVE`` and ``ERROR`` - from ``neutron_lib.constants``. diff --git a/releasenotes/notes/rehome-core-api-defs-390735ff3bd5d2ab.yaml b/releasenotes/notes/rehome-core-api-defs-390735ff3bd5d2ab.yaml deleted file mode 100644 index 9dbba96..0000000 --- a/releasenotes/notes/rehome-core-api-defs-390735ff3bd5d2ab.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``network``, ``port``, ``subnet`` and ``subnetpool`` API definitions - are now available in ``neutron_lib.api.definitions``. diff --git a/releasenotes/notes/rehome-dhcpopts-apidef-389ab9d8935e5e0d.yaml b/releasenotes/notes/rehome-dhcpopts-apidef-389ab9d8935e5e0d.yaml deleted file mode 100644 index 021bd78..0000000 --- a/releasenotes/notes/rehome-dhcpopts-apidef-389ab9d8935e5e0d.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -features: - - The ``extra_dhcp_opt`` API extension definition from ``neutron.extensions`` - has been rehomed to ``neutron_lib.api.definitions`` with the same name. - - A new validator ``validate_any_key_specs_or_none`` has been added for - the corresponding validation type ``type:list_of_any_key_specs_or_none``. - This validator can be used to check that a list of dicts match at least 1 - key spec allowing consumers the ability to define multiple formats for - their validated data. diff --git a/releasenotes/notes/rehome-ml2-driverapi-363db4b8fa42f8f1.yaml b/releasenotes/notes/rehome-ml2-driverapi-363db4b8fa42f8f1.yaml deleted file mode 100644 index 7caa2c4..0000000 --- a/releasenotes/notes/rehome-ml2-driverapi-363db4b8fa42f8f1.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The public APIs from ``neutron.plugins.ml2.driver_api`` are now in - ``neutron_lib.plugins.ml2.api``. diff --git a/releasenotes/notes/rehome-ml2-mechdriver-cc86d3a2fe4c2822.yaml b/releasenotes/notes/rehome-ml2-mechdriver-cc86d3a2fe4c2822.yaml deleted file mode 100644 index e129554..0000000 --- a/releasenotes/notes/rehome-ml2-mechdriver-cc86d3a2fe4c2822.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ML2 ``MechanismDriver`` class from ``neutron.plugins.ml2.driver_api`` - is now available in ``neutron_lib.plugins.ml2.api``. diff --git a/releasenotes/notes/rehome-ovo-exceptions-fbddfeea582ef3f1.yaml b/releasenotes/notes/rehome-ovo-exceptions-fbddfeea582ef3f1.yaml deleted file mode 100644 index dacbdd8..0000000 --- a/releasenotes/notes/rehome-ovo-exceptions-fbddfeea582ef3f1.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The neutron versioned object exceptions from ``neutron.objects.exceptions`` - are now available in ``neutron_lib.objects.exceptions``. diff --git a/releasenotes/notes/rehome-plugin-constants-ebf350dfd989957a.yaml b/releasenotes/notes/rehome-plugin-constants-ebf350dfd989957a.yaml deleted file mode 100644 index 9518a94..0000000 --- a/releasenotes/notes/rehome-plugin-constants-ebf350dfd989957a.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - Many of the constants from ``neutron.plugins.common.constants`` are - now available in ``neutron_lib.plugins.constants`` and - ``neutron_lib.constants``. diff --git a/releasenotes/notes/rehome-port-dev-util-ea6f4a5c4da42f6c.yaml b/releasenotes/notes/rehome-port-dev-util-ea6f4a5c4da42f6c.yaml deleted file mode 100644 index 857ee14..0000000 --- a/releasenotes/notes/rehome-port-dev-util-ea6f4a5c4da42f6c.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``neutron.common.utils`` function ``is_port_trusted`` is now available - in ``neutron_lib.utils.net``. diff --git a/releasenotes/notes/rehome-psec-apidef-bd9344ec1e6066b4.yaml b/releasenotes/notes/rehome-psec-apidef-bd9344ec1e6066b4.yaml deleted file mode 100644 index 509d209..0000000 --- a/releasenotes/notes/rehome-psec-apidef-bd9344ec1e6066b4.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - The ``port security`` extension API definition has been rehomed from - ``neutron`` to ``neutron_lib.api.definitions.port_security``. The - related exceptions can be found in the - ``neutron_lib.exceptions.port_security`` module. diff --git a/releasenotes/notes/rehome-qos-driverbase-f729875b2ad74ce0.yaml b/releasenotes/notes/rehome-qos-driverbase-f729875b2ad74ce0.yaml deleted file mode 100644 index 1bbf9b0..0000000 --- a/releasenotes/notes/rehome-qos-driverbase-f729875b2ad74ce0.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - The ``DriverBase`` class from ``neutron.services.qos.drivers.base`` is now - available in the ``neutron_lib.services.qos.base`` module. - - The constants defined in ``neutron.services.qos.qos_consts`` are now - available in ``neutron_lib.services.qos.constants``. diff --git a/releasenotes/notes/rehome-runtime-utils-acb4451326cbe4d9.yaml b/releasenotes/notes/rehome-runtime-utils-acb4451326cbe4d9.yaml deleted file mode 100644 index 4c2edfe..0000000 --- a/releasenotes/notes/rehome-runtime-utils-acb4451326cbe4d9.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -features: - - The ``load_class_by_alias_or_classname`` function from - ``neutron.common.utils`` is now available in ``neutron_lib.utils.runtime``. - - The ``synchronized`` decorator from ``neutron.common.utils`` is now - available in ``neutron_lib.utils.runtime``. diff --git a/releasenotes/notes/rehome-worker-b7e9c7f477bdb926.yaml b/releasenotes/notes/rehome-worker-b7e9c7f477bdb926.yaml deleted file mode 100644 index 6b1ecc1..0000000 --- a/releasenotes/notes/rehome-worker-b7e9c7f477bdb926.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The ``NeutronWorker`` class from the ``neutron.worker`` module is now - available as ``BaseWorker`` in ``neutron_lib.worker``. diff --git a/releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml b/releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml deleted file mode 100644 index 4a44b87..0000000 --- a/releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -other: - - The deprecated ``N523`` hacking check that ensures proper oslo namespace - imports has been removed. diff --git a/releasenotes/notes/router-interface-fip-1e79b7909f8b264f.yaml b/releasenotes/notes/router-interface-fip-1e79b7909f8b264f.yaml deleted file mode 100644 index 75986d9..0000000 --- a/releasenotes/notes/router-interface-fip-1e79b7909f8b264f.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - API reference and definition for networking-midonet's ``router-interface-fip`` extension. diff --git a/releasenotes/notes/separate-hacking-factories-6fc36b38de95662a.yaml b/releasenotes/notes/separate-hacking-factories-6fc36b38de95662a.yaml deleted file mode 100644 index 477e6d2..0000000 --- a/releasenotes/notes/separate-hacking-factories-6fc36b38de95662a.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -features: - - The hacking check factory ``incubating_factory`` has been added - to ``neutron_lib.hacking.checks`` allowing adopters to test - compliance on incubating hacking checks. See the usage documentation - for additional details. - diff --git a/releasenotes/notes/service-plugin-base-a42c2241a2fe0d26.yaml b/releasenotes/notes/service-plugin-base-a42c2241a2fe0d26.yaml deleted file mode 100644 index cb303d9..0000000 --- a/releasenotes/notes/service-plugin-base-a42c2241a2fe0d26.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -features: - - The class ``neutron.services.service_base.ServicePluginBase`` is - now available as ``neutron_lib.services.base.ServicePluginBase``. diff --git a/releasenotes/notes/transaction_constraint-d3f93c2ced4a74c6.yaml b/releasenotes/notes/transaction_constraint-d3f93c2ced4a74c6.yaml deleted file mode 100644 index 9bbdde2..0000000 --- a/releasenotes/notes/transaction_constraint-d3f93c2ced4a74c6.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -features: - - | - Contexts may now have transaction constraints set on them to be enforced - by the revision plugin in Neutron for generalized compare-and-swap updates. - Calling ``set_transaction_constraint`` on the context before performing a - resource mutation will setup the constraint. This is also exposed to users - via the HTTP API with ``if-match`` headers and the API layer sets the - constraint on the context. diff --git a/releasenotes/notes/trunk-api-08bfdcdd80f7e666.yaml b/releasenotes/notes/trunk-api-08bfdcdd80f7e666.yaml deleted file mode 100644 index c134150..0000000 --- a/releasenotes/notes/trunk-api-08bfdcdd80f7e666.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - API reference for the trunk extension. diff --git a/releasenotes/notes/update-hacking-check-n536-2f63898bea693125.yaml b/releasenotes/notes/update-hacking-check-n536-2f63898bea693125.yaml deleted file mode 100644 index f558eed..0000000 --- a/releasenotes/notes/update-hacking-check-n536-2f63898bea693125.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -fixes: - - Update hacking check ``N536``. Current implementation recognizes - ``self.assertEqual((None, None), A)`` as invalid incorrectly while - ``(None, None)`` is not ``None``. diff --git a/releasenotes/notes/validator_ip_or_subnet_or_none-0175f906a9113954.yaml b/releasenotes/notes/validator_ip_or_subnet_or_none-0175f906a9113954.yaml deleted file mode 100644 index 8a7506f..0000000 --- a/releasenotes/notes/validator_ip_or_subnet_or_none-0175f906a9113954.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -features: - - Added validator validate_ip_or_subnet_or_none diff --git a/releasenotes/source/README.rst b/releasenotes/source/README.rst deleted file mode 100644 index 99b646e..0000000 --- a/releasenotes/source/README.rst +++ /dev/null @@ -1,10 +0,0 @@ -=================================== -Neutron Library Release Notes Howto -=================================== - -Release notes for documenting new features in OpenStack projects. -Background on the process, tooling, and methodology is documented -in a `mailing list post by Doug Hellmann `_. - -For information on how to create release notes, please consult the -`Release Notes documentation `_. diff --git a/releasenotes/source/_static/.placeholder b/releasenotes/source/_static/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/releasenotes/source/_templates/.placeholder b/releasenotes/source/_templates/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py deleted file mode 100644 index 2b934ea..0000000 --- a/releasenotes/source/conf.py +++ /dev/null @@ -1,286 +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. - -# Neutron Library Release Notes documentation build configuration file, -# created by # sphinx-quickstart on Wed Oct 18 17:40:50 2015. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'openstackdocstheme', - 'reno.sphinxext', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Neutron Library Release Notes' -copyright = u'2016, Neutron Library Developers' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -from neutron_lib.version import version_info as neutron_dr_version -# The full version, including alpha/beta/rc tags. -release = neutron_dr_version.version_string_with_vcs() -# The short X.Y version. -version = neutron_dr_version.canonical_version_string() - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = [] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'openstackdocs' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' -html_last_updated_fmt = '%Y-%m-%d %H:%M' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'NeutronLibReleaseNotesdoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # 'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'NeutronLibReleaseNotes.tex', - u'Neutron Library Notes Documentation', - u'Neutron Library Developers', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'neutronlibreleasenotes', u'Neutron Library', - 'Neutron Library Release Notes Documentation', - [u'Neutron Library Developers'], - 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'NeutronLibReleaseNotes', u'Neutron Library', - 'Neutron Library Release Notes Documentation', - u'Neutron Library Developers', - 'NeutronLibReleaseNotes', - 'For sharing/decoupling neutron functionality across the Stadium.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# -- Options for Internationalization output ------------------------------ -locale_dirs = ['locale/'] - -# -- Options for openstackdocstheme ------------------------------------------- -repository_name = 'openstack/neutron-lib' -bug_project = 'neutron' -bug_tag = 'doc' diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst deleted file mode 100644 index 9522971..0000000 --- a/releasenotes/source/index.rst +++ /dev/null @@ -1,10 +0,0 @@ -=============================== - Neutron Library Release Notes -=============================== - -.. toctree:: - :maxdepth: 1 - - README.rst - unreleased - ocata diff --git a/releasenotes/source/ocata.rst b/releasenotes/source/ocata.rst deleted file mode 100644 index ebe62f4..0000000 --- a/releasenotes/source/ocata.rst +++ /dev/null @@ -1,6 +0,0 @@ -=================================== - Ocata Series Release Notes -=================================== - -.. release-notes:: - :branch: origin/stable/ocata diff --git a/releasenotes/source/unreleased.rst b/releasenotes/source/unreleased.rst deleted file mode 100644 index bd360ba..0000000 --- a/releasenotes/source/unreleased.rst +++ /dev/null @@ -1,5 +0,0 @@ -============================= - Current Series Release Notes -============================= - -.. release-notes:: diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0335bf3..0000000 --- a/requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. - -pbr!=2.1.0,>=2.0.0 # Apache-2.0 - -SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT -debtcollector>=1.2.0 # Apache-2.0 -stevedore>=1.20.0 # Apache-2.0 -oslo.concurrency>=3.8.0 # Apache-2.0 -oslo.config!=4.3.0,!=4.4.0,>=4.0.0 # Apache-2.0 -oslo.context>=2.14.0 # Apache-2.0 -oslo.db>=4.24.0 # Apache-2.0 -oslo.i18n!=3.15.2,>=2.1.0 # Apache-2.0 -oslo.log>=3.22.0 # Apache-2.0 -oslo.messaging!=5.25.0,>=5.24.2 # Apache-2.0 -oslo.policy>=1.23.0 # Apache-2.0 -oslo.service>=1.10.0 # Apache-2.0 -oslo.utils>=3.20.0 # Apache-2.0 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index eaf1f98..0000000 --- a/setup.cfg +++ /dev/null @@ -1,56 +0,0 @@ -[metadata] -name = neutron-lib -summary = Neutron shared routines and utilities -description-file = - README.rst -author = OpenStack -author-email = openstack-dev@lists.openstack.org -home-page = https://docs.openstack.org/neutron-lib/latest/ -classifier = - Environment :: OpenStack - Intended Audience :: Information Technology - Intended Audience :: System Administrators - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.5 - -[files] -packages = - neutron_lib - -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 -warning-is-error = 1 - -[upload_sphinx] -upload-dir = doc/build/html - -[compile_catalog] -directory = neutron_lib/locale -domain = neutron_lib - -[update_catalog] -domain = neutron_lib -output_dir = neutron_lib/locale -input_file = neutron_lib/locale/neutron_lib.pot - -[extract_messages] -keywords = _ gettext ngettext l_ lazy_gettext -mapping_file = babel.cfg -output_file = neutron_lib/locale/neutron_lib.pot - -[pbr] -autodoc_tree_index_modules = True -autodoc_tree_excludes = - setup.py - neutron_lib/tests - # In case neutron_lib.legacy has no actual content, this causes - # an error in sphinx autodoc, so let's exclude it. - neutron_lib/legacy -api_doc_dir = reference/modules diff --git a/setup.py b/setup.py deleted file mode 100644 index 566d844..0000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. -# -# 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. - -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT -import setuptools - -# In python < 2.7.4, a lazy loading of package `pbr` will break -# setuptools if some other modules registered functions in `atexit`. -# solution from: http://bugs.python.org/issue15881#msg170215 -try: - import multiprocessing # noqa -except ImportError: - pass - -setuptools.setup( - setup_requires=['pbr>=2.0.0'], - pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 51dd0cf..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,21 +0,0 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. - -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 - -coverage!=4.4,>=4.0 # Apache-2.0 -fixtures>=3.0.0 # Apache-2.0/BSD -flake8-import-order==0.12 # LGPLv3 -python-subunit>=0.0.18 # Apache-2.0/BSD -sphinx>=1.6.2 # BSD -openstackdocstheme>=1.11.0 # Apache-2.0 -oslotest>=1.10.0 # Apache-2.0 -os-api-ref>=1.0.0 # Apache-2.0 -os-testr>=0.8.0 # Apache-2.0 -reno!=2.3.1,>=1.8.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD -testresources>=0.2.4 # Apache-2.0/BSD -testscenarios>=0.4 # Apache-2.0/BSD -testtools>=1.4.0 # MIT -pep8==1.5.7 # MIT diff --git a/tools/api_report.sh b/tools/api_report.sh deleted file mode 100755 index c969ee8..0000000 --- a/tools/api_report.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash -# 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. - -set -eu - -TMPDIR=`mktemp -d /tmp/${0##*/}.XXXXXX` || exit 1 -trap "rm -rf $TMPDIR" EXIT - -PROJECT="neutron-lib" -PACKAGE="neutron_lib" -PYIR_PATH="tools/pyir.py" -TAG_RELEASE='' - - -usage() { - echo "Usage: $0 [OPTION]..." - echo "Generate a python API report between current and the said release tag." - echo "" - echo " -t, --tag=[] Release tag to generate API report difference with." - echo " Defaults to the latest git tag." - echo " -h, --help Print this usage message" - echo - exit 0 -} - - -install_project() { - git clone -b ${TAG_RELEASE} https://github.com/openstack/${PROJECT}.git ${TMPDIR}/${PROJECT} || (echo "Failed to install ${TAG_RELEASE}" && exit 2) -} - - -parse_args() { - while [ "$1" != "" ]; do - PARAM=`echo $1 | awk -F= '{print $1}'` - VALUE=`echo $1 | awk -F= '{print $2}'` - case ${PARAM} in - -h | --help) - usage - exit - ;; - -t | --tag) - TAG_RELEASE=${VALUE} - break - ;; - *) - echo "ERROR: unknown parameter \"${PARAM}\"" - usage - exit 1 - ;; - esac - shift - done -} - - -if [ $# -ne 0 ]; then - parse_args $@ -fi - - -if [[ ${TAG_RELEASE} == '' ]]; then - echo "Finding latest git tag..." - TAG_RELEASE=`git tag | tail -n1` - if [[ $? -ne 0 ]]; then - echo "Failed to find latest git tag! Exiting." - exit 1 - fi - echo "Set tag to: ${TAG_RELEASE}" -fi - - -${PYIR_PATH} generate --blacklist '.*\/tests\/.*','.*\._(\w*)' ${PACKAGE} > "${TMPDIR}/${PACKAGE}.master.json.txt" - -install_project -${PYIR_PATH} generate --blacklist '.*\/tests\/.*','.*\._(\w*)' ${TMPDIR}/${PROJECT}/${PACKAGE} > "${TMPDIR}/${PACKAGE}.${TAG_RELEASE}.json.txt" - - -echo "===========================================================" -echo "Changes between current commit and release tag ${TAG_RELEASE}" -echo "===========================================================" - -${PYIR_PATH} diff "${TMPDIR}/${PACKAGE}.master.json.txt" "${TMPDIR}/${PACKAGE}.${TAG_RELEASE}.json.txt" - diff --git a/tools/check_samples.sh b/tools/check_samples.sh deleted file mode 100755 index e11446d..0000000 --- a/tools/check_samples.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/sh - -# Copyright (C) 2017 Midokura SARL. -# 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. - -set -e - -DIR=api-ref/source/v2/samples -find $DIR -name "*.json" | while read f; do - if ! python -m json.tool $f > /dev/null; then - echo "$f had errors." - exit 1 - fi -done diff --git a/tools/migration_report.sh b/tools/migration_report.sh deleted file mode 100755 index e358df2..0000000 --- a/tools/migration_report.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -function count_imports() { - local module="$1" - local path="$2" - egrep -R -w "^(import|from) $module" --exclude-dir=".*tox" $your_project | wc -l -} - - -if [ $# -eq 0 ]; then - echo "Please specify path to your project." - exit 1 -else - your_project="$1" -fi - -command -v bc >/dev/null 2>&1 || { echo "I require bc but it's not installed. Aborting." >&2; exit 1; } - -total_imports=$(egrep -R -w "^(import|from)" --exclude-dir=".*tox" $your_project | wc -l) -neutron_imports=$(count_imports neutron $your_project) -lib_imports=$(count_imports neutron_lib $your_project) -total_neutron_related_imports=$((neutron_imports + lib_imports)) - -echo "You have $total_imports total imports" -echo "You imported Neutron $neutron_imports times" -echo "You imported Neutron-Lib $lib_imports times" - -if [ "$lib_imports" -eq 0 ]; then - echo "Your project does not import neutron-lib once, you suck!" -fi - -goal=$(bc -l <<< "scale=4; ($lib_imports/$total_neutron_related_imports*100)") -target=$(bc <<< "$goal>50") - -if [ "$target" -eq 0 ]; then - echo "You need to get to 100%, you are this far: $goal%, get on with it!" -else - echo "You need to get to 100%, you are close: $goal%, good job!" -fi diff --git a/tools/pyir.py b/tools/pyir.py deleted file mode 100755 index 062024f..0000000 --- a/tools/pyir.py +++ /dev/null @@ -1,1533 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 VMware, Inc. -# 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. -# - -import abc -import contextlib -import imp -import inspect -import os -from os import path -import re -import shutil -import sys -import tempfile - -import argparse -import six - -from oslo_serialization import jsonutils - -__version__ = '0.0.2' - -# NOTE(boden): This is a prototype and needs additional love - -_MOCK_SRC = ''' -class _PyIREmptyMock_(object): - - def __init__(self, *args, **kwargs): - self._args_ = args - self._kwargs_ = kwargs - - def __or__(self, o): - return o - - def __ror__(self, o): - return o - - def __xor__(self, o): - return o - - def __rxor__(self, o): - return o - - def __and__(self, o): - return o - - def __rand__(self, o): - return o - - def __rshift__(self, o): - return o - - def __rrshift__(self, o): - return o - - def __lshift__(self, o): - return o - - def __rlshift__(self, o): - return o - - def __pow__(self, o): - return o - - def __rpow__(self, o): - return o - - def __divmod__(self, o): - return o - - def __rdivmod__(self, o): - return o - - def __mod__(self, o): - return o - - def __rmod__(self, o): - return o - - def __floordiv__(self, o): - return o - - def __rfloordiv__(self, o): - return o - - def __truediv__(self, o): - return o - - def __rtrudiv__(self, o): - return o - - def __add__(self, o): - return o - - def __radd__(self, o): - return o - - def __sub__(self, o): - return o - - def __rsub__(self, o): - return o - - def __mul__(self, o): - return o - - def __rmul__(self, o): - return o - - def __matmul__(self, o): - return o - - def __rmatmul__(self, o): - return o - - def __getattribute__(self, name): - return _PyIREmptyMock_() - - def __call__(self, *args, **kwargs): - return _PyIREmptyMock_() - - def __iter__(self): - return [].__iter__() - - def __getitem__(self, item): - return _PyIREmptyMock_() - - def __setitem__(self, key, value): - pass - - def __delitem__(self, key): - pass - - def __enter__(self): - return self - - def __exit__(self, type, value, traceback): - pass - -class _PyIREmptyImport_(_PyIREmptyMock_): - pass - -''' -_MOCK_CLASS_NAME = '_PyIREmptyMock_' -_MOCK_IMPORT_CLASS_NAME = '_PyIREmptyImport_' - -UNKNOWN_VAL = 'PYIR UNKNOWN VALUE' -_BLACKLIST = [re.compile(".*\.%s" % _MOCK_CLASS_NAME), - re.compile(".*\.%s" % _MOCK_IMPORT_CLASS_NAME)] - - -def blacklist_filter(value): - for pattern in _BLACKLIST: - if pattern.match(value): - return False - return True - - -def add_blacklist_from_csv_str(csv_str): - global _BLACKLIST - _BLACKLIST.extend([re.compile(p) - for p in split_on_token(csv_str, ',')]) - - -def for_tokens(the_str, tokens, callback): - in_str = [] - tokens = list(tokens) - index = 0 - - def _compare_tokens(idx): - hits = [] - for token in tokens: - if the_str[idx:].startswith(token): - hits.append(token) - return hits - - for c in the_str: - if c == '\'' or c == '\"': - if in_str and in_str[len(in_str) - 1] == c: - in_str.pop() - else: - in_str.append(c) - elif not in_str: - matching_tokens = _compare_tokens(index) - if matching_tokens: - callback(matching_tokens, index, the_str[index:]) - index += 1 - - -def token_indexes(the_str, tokens): - indexes = [] - - def _count(toks, idx, substring): - indexes.append(idx) - - for_tokens(the_str, tokens, _count) - return indexes - - -def split_on_token(the_str, token): - indexes = token_indexes(the_str, [token]) - if not indexes: - return [the_str] - - strs = [] - indexes.insert(0, None) - for start, end in zip(indexes, indexes[1:] + [None]): - start = 0 if start is None else start + 1 - if end is None: - end = len(the_str) - strs.append(the_str[start:end]) - return strs - - -def count_tokens(the_str, tokens): - return len(token_indexes(the_str, tokens)) - - -def remove_tokens(the_str, tokens): - in_str = [] - tokens = list(tokens) - index = 0 - new_str = '' - - def _token(idx): - for token in tokens: - if the_str[idx:].startswith(token): - return token - return None - - while index < len(the_str): - c = the_str[index] - if c == '\'' or c == '\"': - if in_str and in_str[len(in_str) - 1] == c: - in_str.pop() - else: - in_str.append(c) - elif not in_str: - tok = _token(index) - if tok: - index += len(tok) - continue - new_str += c - index += 1 - - return new_str - - -def remove_brackets(the_str): - return remove_tokens(the_str, ['(', ')']) - - -def parent_path(file_path): - if not file_path or file_path == '/': - return None - return path.abspath(path.join(file_path, '..')) - - -def is_py_file(file_path): - file_path = file_path if filter(blacklist_filter, [file_path]) else None - return (file_path and - path.isfile(file_path) and - file_path.endswith('.py')) - - -def is_py_dir(dir_path): - if not filter(blacklist_filter, [dir_path]): - return False - - if path.isdir(dir_path): - for f in os.listdir(dir_path): - f = path.join(dir_path, f) - if is_py_file(f): - return True - return False - - -def is_py_package_dir(dir_path): - if not filter(blacklist_filter, [dir_path]): - return False - - if path.isdir(dir_path): - return '__init__.py' in os.listdir(dir_path) - return False - - -def parent_package_names(file_or_dir_path): - pkg_names = [] - file_or_dir_path = parent_path(file_or_dir_path) - while file_or_dir_path: - if is_py_package_dir(file_or_dir_path): - pkg_names.append(os.path.basename(file_or_dir_path)) - else: - break - file_or_dir_path = parent_path(file_or_dir_path) - return None if not pkg_names else reversed(pkg_names) - - -def whitespace(line): - if line.isspace(): - return line, '' - - char_index = 0 - for char_index in range(len(line)): - if not line[char_index].isspace(): - break - - return line[:char_index], line[char_index:].strip() - - -def ordered(obj): - if isinstance(obj, dict): - return sorted((k, ordered(v)) for k, v in obj.items()) - if isinstance(obj, list): - return sorted(ordered(x) for x in obj) - else: - return obj - - -def json_primitive(val): - if isinstance(val, (six.string_types, six.text_type, - six.integer_types, bool)): - return str(val) - elif str(val).startswith('<') or type(val) in [dict, list, set, tuple]: - return str(type(val)) - elif (str(val).count(_MOCK_CLASS_NAME) or - str(val).count(_MOCK_IMPORT_CLASS_NAME)): - return UNKNOWN_VAL - return val - - -def is_mock_import(obj): - return _MOCK_IMPORT_CLASS_NAME in str(obj) - - -def _member_filter(obj): - return not inspect.isbuiltin(obj) and not inspect.ismodule(obj) - - -class PyFiles(object): - - def __init__(self, files): - self._files = set(PyFiles.check_py_paths(files)) - - @staticmethod - def check_py_paths(py_paths): - checked = [] - for f in py_paths: - f = path.abspath(f) - assert path.exists(f) - if path.isfile(f): - if not is_py_file(f): - raise IOError("'%s' is not a .py file." % f) - else: - if not is_py_package_dir(f): - raise IOError("'%s' doesn't contain __init__.py." % f) - checked.append(f) - return checked - - @property - def files(self): - return set(self._files) - - @property - def has_files(self): - return len(self._files) > 0 - - def _path_to_tmp_tree(self, tree_dir, src_path): - tree_dest = path.join(tree_dir, path.basename(src_path)) - parent_dirs = list(parent_package_names(src_path) or []) - - if parent_dirs: - tree_dest = path.join(tree_dir, *tuple(parent_dirs)) - os.makedirs(tree_dest) - subpath = tree_dir - for subdir in parent_dirs: - subpath = path.join(subpath, subdir) - open(path.join(subpath, '__init__.py'), 'a').close() - tree_dest = path.join(tree_dest, path.basename(src_path)) - - copy_fn = shutil.copytree if path.isdir(src_path) else shutil.copyfile - copy_fn(src_path, tree_dest) - - return tree_dest - - def to_tmp_tree(self, tree_dir=None): - tree_dir = tree_dir or tempfile.mkdtemp() - assert path.isdir(tree_dir) - - subtrees = [] - for f in self._files: - subtrees.append(self._path_to_tmp_tree(tree_dir, f)) - - return tree_dir, subtrees - - @contextlib.contextmanager - def tmp_tree(self, delete_on_exit=True): - tree = None - try: - tree, subtress = self.to_tmp_tree() - yield tree - finally: - if tree and delete_on_exit: - shutil.rmtree(tree) - - @staticmethod - def filter_all_py_files(root_dir, filters): - for child in os.listdir(root_dir): - child_path = path.join(root_dir, child) - if is_py_file(child_path): - PyFile.rewrite(child_path, filters) - elif is_py_dir(child_path): - PyFiles.filter_all_py_files(child_path, filters) - - -class PyLine(object): - - def __init__(self, ws, logical_line, py_file): - self.ws = '' if ws is None else ws - if ws == "\n": - self.ws = '' - self.logical = '' if logical_line is None else logical_line - self._py_file = py_file - - @property - def is_str_line(self): - return ((self.logical.startswith('\'') and - self.logical.endswith('\'')) or - (self.logical.startswith('\"') and - self.logical.endswith('\"'))) - - @property - def is_empty_line(self): - return len(self.logical.strip()) == 0 - - @property - def indent(self): - return self.ws.count(' ') + (self.ws.count("\t") * 4) - - @property - def bracket_tics(self): - return (count_tokens(self.logical, PyLineTokens.OPEN_B) - - count_tokens(self.logical, PyLineTokens.CLOSED_B)) - - @property - def physical_line(self): - return str(self) - - @property - def is_comment(self): - return self.logical.startswith(PyLineTokens.COMMENT) - - def comment_out(self): - if not self.is_comment: - self.logical = PyLineTokens.COMMENT + self.logical - - @property - def has_unmatched_brackets(self): - return self.bracket_tics != 0 - - @property - def is_continuation(self): - return (self.logical.endswith(PyLineTokens.BACKSLASH) or - self.has_unmatched_brackets) - - @property - def is_space(self): - if self.logical == '': - return self.ws.isspace() - return self.logical.isspace() - - @property - def file_path(self): - return self._py_file.name - - @staticmethod - def from_string_lines(lines, py_file=None): - py_lines = [] - for l in lines: - ws, logical = whitespace(l) - py_lines.append(PyLine(ws, logical, py_file)) - return py_lines - - def __str__(self): - return self.ws + self.logical - - -class FilterMarker(object): - - def __init__(self, filt, markers=None): - self._filter = filt - self.markers = markers or [] - - def mark(self, line): - if self._filter.mark(line): - self.markers.append(line) - - def filter(self, py_file): - for marker in self.markers: - self._filter.filter(marker, py_file) - - def reset(self): - self.markers = [] - - -class PyFile(object): - - def __init__(self, py_filters): - self._markers = [] - self._add_filters(py_filters) - - self._lines = [] - - def prepend_lines(self, lines): - lines = list(lines) - lines.extend(self._lines) - self._lines = lines - - def reset(self): - self._lines = [] - for m in self._markers: - m.reset() - - def first_line(self): - return self._lines[0] if self._lines else None - - def next_line(self, py_line): - if py_line not in self._lines: - return None - index = self._lines.index(py_line) + 1 - if index >= len(self._lines): - return None - return self._lines[index] - - def prev_line(self, py_line): - if py_line not in self._lines: - return None - index = self._lines.index(py_line) - 1 - if index <= 0: - return None - return self._lines[index] - - def del_line(self, py_line): - self._lines.remove(py_line) - - def get_line(self, py_line): - return (None if not self.contains_line(py_line) - else self._lines[self._lines.index(py_line)]) - - def contains_line(self, py_line): - return py_line in self._lines - - def _add_filters(self, filters): - self._markers.extend([FilterMarker(f) for f in filters]) - - def _mark_line_filter(self, line): - for marker in self._markers: - marker.mark(line) - - def load_path(self, py_path): - with open(py_path, 'r') as py_file: - for line in py_file: - ws, logical = whitespace(line) - line = PyLine(ws, logical, py_file) - self._lines.append(line) - self._mark_line_filter(line) - - def filter(self): - if not self._lines or not self._markers: - return None - - for marker in self._markers: - marker.filter(self) - - def insert_after(self, py_line, py_line_to_add): - if py_line not in self._lines: - return False - self._lines.insert(self._lines.index(py_line) + 1, py_line_to_add) - return True - - def to_file_str(self): - buff = '' - for line in self._lines: - buff += str(line) + "\n" - return buff - - def save(self, py_path): - with open(py_path, 'w') as py_file: - py_file.write(self.to_file_str()) - - @staticmethod - def filter_to_file_str(py_path, filters): - py_file = PyFile(filters) - py_file.load_path(py_path) - py_file.filter() - return py_file.to_file_str() - - @staticmethod - def rewrite(py_path, filters): - py_file = PyFile(filters) - py_file.load_path(py_path) - py_file.filter() - py_file.save(py_path) - - -class ImportParser(object): - - def __init__(self): - self.names = [] - self.modules = [] - - def _segs(self, the_str, token=' '): - return [s.strip() for s in the_str.split(token) - if s and not s.isspace()] - - def _lstrip(self, the_str, to_strip): - return the_str[len(to_strip):].strip() - - def _next_token(self, the_str, delim=' ', strip=True): - try: - idx = the_str.index(delim) - content = the_str[:idx] - remainder = the_str[idx:] - if strip: - content.strip() - remainder.strip() - return content, remainder - - except ValueError: - return None, None - - def _parse_from(self, import_str): - import_str = self._lstrip(import_str, 'from ') - module_name, import_str = self._next_token(import_str) - import_str = self._lstrip(import_str, 'import ') - - for name_def in self._segs(import_str, token=','): - if name_def.count(' as '): - segs = self._segs(name_def, token=' as ') - self.names.append(segs[1]) - self.modules.append(module_name + '.' + segs[0]) - else: - self.names.extend(self._segs(name_def, '.')) - self.modules.append(module_name) - - def _parse_import(self, import_str): - import_str = self._lstrip(import_str, 'import ') - - for name_def in self._segs(import_str, token=','): - if name_def.count(' as '): - segs = self._segs(name_def, token=' as ') - self.names.append(segs[1]) - self.modules.append(segs[0]) - else: - self.names.extend(self._segs(name_def, '.')) - self.modules.append(name_def) - - def reset(self): - self.names = [] - self.modules = [] - - def is_statement(self, import_str): - return import_str.startswith(('import ', 'from ', )) - - def parse(self, import_str): - self.reset() - - import_str = import_str.replace('(', '').replace(')', '') - - if import_str.startswith('import '): - self._parse_import(import_str) - elif import_str.startswith('from '): - self._parse_from(import_str) - else: - raise IOError("Invalid import string: %s" % import_str) - return self - - -class PyLineTokens(object): - COMMENT = '#' - BACKSLASH = '\\' - DECORATOR = '@' - OPEN_B = '(' - CLOSED_B = ')' - - -@six.add_metaclass(abc.ABCMeta) -class AbstractFilter(object): - - @abc.abstractmethod - def mark(self, py_line): - pass - - @abc.abstractmethod - def filter(self, py_line, py_file): - pass - - -@six.add_metaclass(abc.ABCMeta) -class AbstractPerFileFilter(AbstractFilter): - - def __init__(self): - self._marked = [] - - def mark(self, py_line): - if py_line.file_path not in self._marked: - self._marked.append(py_line.file_path) - return True - return False - - @abc.abstractmethod - def _filter(self, py_line, py_file): - pass - - def filter(self, py_line, py_file): - if py_line.file_path not in self._marked: - return - self._marked.remove(py_line.file_path) - return self._filter(py_line, py_file) - - -class CommentOutDecorators(AbstractFilter): - - def mark(self, py_line): - if py_line.is_str_line: - return False - - if py_line.logical.startswith(PyLineTokens.DECORATOR): - return True - return False - - def filter(self, py_line, py_file): - if not py_file.get_line(py_line): - return - - py_line.comment_out() - - -class StripTrailingComments(AbstractFilter): - - _RE = re.compile('^([^#]*)#(.*)$') - - def mark(self, py_line): - if (py_line.is_str_line or - not count_tokens(py_line.logical, PyLineTokens.COMMENT)): - return False - - m = StripTrailingComments._RE.match(py_line.logical) - return True if m else False - - def filter(self, py_line, py_file): - if not py_file.get_line(py_line): - return - - m = StripTrailingComments._RE.match(py_line.logical) - py_line.logical = m.group(1).strip() - - -class AddMockDefinitions(AbstractPerFileFilter): - - _LINES = PyLine.from_string_lines(_MOCK_SRC.split("\n")) - - def _filter(self, py_line, py_file): - py_file.prepend_lines(AddMockDefinitions._LINES) - - -class PassEmptyDef(AbstractPerFileFilter): - - def _has_body(self, def_py_line, py_file): - indent = def_py_line.indent - line = py_file.next_line(def_py_line) - while line: - if line.is_empty_line: - line = py_file.next_line(line) - continue - elif line.indent > indent: - return True - elif line.indent <= indent: - return False - else: - line = py_file.next_line(line) - - return False - - def _filter(self, py_line, py_file): - line = py_file.first_line() - while line: - if (line.logical.startswith(('class ', 'def ',)) and - not self._has_body(line, py_file)): - pass_line = PyLine(line.ws + " ", 'pass', py_file) - py_file.insert_after(line, pass_line) - line = py_file.next_line(pass_line) - else: - line = py_file.next_line(line) - - -class RemoveDocStrings(AbstractPerFileFilter): - - _COMMENT = '"""' - - def _comment_count(self, py_line): - return count_tokens(py_line.logical, RemoveDocStrings._COMMENT) - - def _safe_delete_line(self, py_line, py_file): - if py_line.logical.endswith((',', ')',)): - return - py_file.del_line(py_line) - - def _filter(self, py_line, py_file): - in_comment = False - last_line = line = py_file.first_line() - while line: - comment_count = self._comment_count(line) - if comment_count: - if in_comment: - in_comment = False - elif comment_count == 1: - in_comment = True - py_file.del_line(line) - elif in_comment: - py_file.del_line(line) - - if not py_file.contains_line(line): - if not py_file.contains_line(last_line): - last_line = line = py_file.first_line() - else: - line = py_file.next_line(last_line) - else: - next_line = py_file.next_line(line) - last_line = line - line = next_line - - -class RemoveCommentLines(AbstractFilter): - - def mark(self, py_line): - return py_line.logical.startswith(PyLineTokens.COMMENT) - - def filter(self, py_line, py_file): - py_line = py_file.get_line(py_line) - if py_line and self.mark(py_line): - py_file.del_line(py_line) - - -@six.add_metaclass(abc.ABCMeta) -class AbstractMultiLineCollector(AbstractFilter): - - def __init__(self): - self._comment_stripper = StripTrailingComments() - - def _strip_backslash(self, py_line): - if py_line.logical.endswith(PyLineTokens.BACKSLASH): - py_line.logical = py_line.logical[:-1].strip() - return True - return False - - def _collect(self, py_line, py_file, continue_fn): - self._strip_backslash(py_line) - next_line = py_file.next_line(py_line) - - while next_line: - if not next_line.is_comment: - if self._comment_stripper.mark(next_line): - self._comment_stripper.filter(next_line, py_file) - if not next_line.is_space: - py_line.logical += ' ' + next_line.logical - - py_file.del_line(next_line) - - if continue_fn(py_line): - next_line = py_file.next_line(py_line) - continue - else: - break - - def _collect_backslash(self, py_line, py_file): - self._strip_backslash(py_line) - self._collect(py_line, py_file, self._strip_backslash) - - def _collect_brackets(self, py_line, py_file): - self._collect(py_line, py_file, lambda l: l.has_unmatched_brackets) - - def filter(self, py_line, py_file): - if py_line.logical.endswith(PyLineTokens.BACKSLASH): - self._collect_backslash(py_line, py_file) - else: - self._collect_brackets(py_line, py_file) - - -class MergeMultiLineImports(AbstractMultiLineCollector): - - def mark(self, py_line): - if py_line.is_str_line: - return False - - logical = py_line.logical - return (logical.startswith(('import ', 'from ',)) and - py_line.is_continuation) - - def filter(self, py_line, py_file): - super(MergeMultiLineImports, self).filter(py_line, py_file) - py_line.logical = remove_brackets(py_line.logical) - - -class MergeMultiLineClass(AbstractMultiLineCollector): - - def mark(self, py_line): - if py_line.is_str_line: - return False - return py_line.logical.startswith('class ') and py_line.is_continuation - - -class MergeMultiLineDef(AbstractMultiLineCollector): - - def mark(self, py_line): - if py_line.is_str_line: - return False - return py_line.logical.startswith('def ') and py_line.is_continuation - - -class MergeMultiLineDecorator(AbstractMultiLineCollector): - - def mark(self, py_line): - if py_line.is_str_line: - return False - return (py_line.logical.startswith(PyLineTokens.DECORATOR) and - py_line.is_continuation) - - -class MockParentClass(AbstractFilter): - - _PARENT_RE = re.compile('class \w*\((.*)\)\:$') - - def mark(self, py_line): - return (py_line.logical.startswith('class ') and - not py_line.is_str_line) - - def filter(self, py_line, py_file): - if not py_file.get_line(py_line): - return - - m = MockParentClass._PARENT_RE.match(py_line.logical) - if m: - py_line.logical = py_line.logical.replace( - "(%s):" % m.group(1), "(%s):" % _MOCK_CLASS_NAME) - - -class MockImports(AbstractFilter): - - def __init__(self): - self._parser = ImportParser() - - def mark(self, py_line): - return self._parser.is_statement(remove_brackets(py_line.logical)) - - def filter(self, py_line, py_file): - if not py_file.contains_line(py_line) or not self.mark(py_line): - return - - py_line.logical = remove_brackets(py_line.logical) - self._parser.parse(py_line.logical) - - if '*' in self._parser.names: - inferred_names = [] - for module in self._parser.modules: - if not module.startswith('.'): - inferred_names.extend(module.split('.')) - self._parser.names = inferred_names - - if not self._parser.names: - py_line.comment_out() - return - - py_line.logical = ', '.join(self._parser.names) + ' = ' + ', '.join( - [_MOCK_IMPORT_CLASS_NAME + '()' for n in self._parser.names]) - - if '_' in self._parser.names: - # TODO(boden): one off - mock_translate = PyLine(py_line.ws, '_ = lambda s: str(s)', - py_file) - py_file.insert_after(py_line, mock_translate) - - -class APISignature(object): - - class SignatureType(object): - CLASS = 'class' - FUNCTION = 'function' - METHOD = 'method' - CLASS_ATTR = 'class_attribute' - MODULE_ATTR = 'module_attribute' - - def __init__(self, signature_type, qualified_name, member, arg_spec): - self.signature_type = signature_type - self.qualified_name = qualified_name - self.member = member - self.arg_spec = arg_spec - - def to_dict(self): - defaults = ([json_primitive(d) for d in self.arg_spec.defaults] - if self.arg_spec.defaults else None) - return { - 'member_type': self.signature_type, - 'qualified_name': self.qualified_name, - 'member_value': json_primitive(self.member), - 'arg_spec': { - 'args': self.arg_spec.args, - 'varargs': self.arg_spec.varargs, - 'keywords': self.arg_spec.keywords, - 'defaults': defaults - } - } - - @staticmethod - def arg_spec_from_dict(arg_spec_dict): - defaults = arg_spec_dict['defaults'] - if defaults is not None: - defaults = tuple(defaults) - return inspect.ArgSpec(arg_spec_dict['args'], - arg_spec_dict['varargs'], - arg_spec_dict['keywords'], - defaults) - - @staticmethod - def from_dict(api_dict): - return APISignature( - api_dict['member_type'], - api_dict['qualified_name'], - api_dict['member_value'], - APISignature.arg_spec_from_dict(api_dict['arg_spec'])) - - @property - def signature(self): - return self._build_signature(self.to_dict()) - - @staticmethod - def get_signature(signature): - if isinstance(signature, dict): - signature = APISignature.from_dict(signature) - return signature.signature - - def _build_callable_signature(self, signature_dict): - arg_spec = signature_dict['arg_spec'] - arg_str = '' - defaults = arg_spec['defaults'] or [] - named_args = arg_spec['args'] or [] - named_kwargs = [] - - if defaults: - named_args = arg_spec['args'][:-len(defaults)] - named_kwargs = arg_spec['args'][-len(defaults):] - - if named_args: - arg_str += ", ".join(named_args) - if named_kwargs: - kw_args = [] - for kw_name, kw_default in zip(named_kwargs, defaults): - kw_args.append("%s=%s" % (kw_name, kw_default)) - arg_str += ", %s" % ", ".join(kw_args) - if arg_spec['varargs'] is not None: - arg_str = "*%s%s" % (arg_spec['varargs'], - '' if not arg_str else ', ' + arg_str) - if arg_spec['keywords'] is not None: - arg_str += "%s**%s" % (', ' if arg_str - else '', arg_spec['keywords']) - if arg_str.startswith(','): - arg_str = arg_str[1:] - return "%s(%s)" % (signature_dict['qualified_name'], arg_str.strip()) - - def _build_variable_signature(self, signature_dict): - return "%s = %s" % (signature_dict['qualified_name'], - signature_dict['member_value']) - - def _build_class_signature(self, signature_dict): - return signature_dict['qualified_name'] - - def _build_signature(self, signature_dict): - if (signature_dict['member_type'] in - [APISignature.SignatureType.FUNCTION, - APISignature.SignatureType.METHOD]): - return self._build_callable_signature(signature_dict) - elif signature_dict['member_type'] == APISignature.SignatureType.CLASS: - return self._build_class_signature(signature_dict) - else: - return self._build_variable_signature(signature_dict) - - -class ModuleParser(object): - - def __init__(self, listeners, abort_on_load_failure=False): - self.listeners = listeners - self.abort_on_load_failure = abort_on_load_failure - - def _notify(self, signature_type, qualified_name, member, arg_spec=None): - for listener in self.listeners: - notify = getattr(listener, 'parse_' + signature_type) - notify(APISignature(signature_type, qualified_name, - member, arg_spec or - inspect.ArgSpec(None, None, None, None))) - - def _collect_paths(self, paths, recurse=True): - inits, mods = [], [] - - if not paths: - return inits, mods - - for py_path in paths: - if is_py_file(py_path): - if path.basename(py_path) == '__init__.py': - inits.append(py_path) - else: - mods.append(py_path) - elif is_py_dir(py_path) and recurse: - c_inits, c_mods = self._collect_paths( - [path.join(py_path, c) for c in os.listdir(py_path)], - recurse=recurse) - inits.extend(c_inits) - mods.extend(c_mods) - return inits, mods - - def _load_path(self, module_path): - module_name = path.basename(path.splitext(module_path)[0]) - pkg_name = '.'.join(parent_package_names(module_path) or '') - defined_name = ('%s.%s' % (pkg_name, module_name) if pkg_name - else module_name) - if module_name == '__init__': - defined_name = pkg_name - - search_paths = [parent_path(module_path)] - f = None - try: - if defined_name in sys.modules: - del sys.modules[defined_name] - f, p, d = imp.find_module(module_name, search_paths) - module = imp.load_module(defined_name, f, p, d) - if defined_name == '__init__': - setattr(module, '__path__', search_paths) - return module - except Exception as e: - sys.stderr.write("Failed to load module '%s' due to: %s" % - (module_path, e)) - if self.abort_on_load_failure: - raise e - finally: - if f: - f.close() - - def load_modules(self, init_paths, module_paths): - init_mods, mods = [], [] - failed_to_load = [] - - def _load(paths, store): - for m_path in paths: - module = self._load_path(m_path) - if module: - store.append(module) - else: - failed_to_load.append(m_path) - - _load(init_paths, init_mods) - _load(module_paths, mods) - return init_mods, mods, failed_to_load - - def _fully_qualified_name(self, parent, name): - if inspect.isclass(parent): - prefix = parent.__module__ + '.' + parent.__name__ - else: - prefix = parent.__name__ - return prefix + '.' + name - - def parse_modules(self, modules): - for module in modules: - for member_name, member in inspect.getmembers( - module, _member_filter): - - if member_name.startswith('__') and member_name.endswith('__'): - continue - - fqn = self._fully_qualified_name(module, member_name) - - if inspect.isclass(member): - self._notify(APISignature.SignatureType.CLASS, - fqn, member) - self.parse_modules([member]) - elif inspect.isfunction(member): - self._notify(APISignature.SignatureType.FUNCTION, - fqn, member, - arg_spec=inspect.getargspec(member)) - elif inspect.ismethod(member): - self._notify(APISignature.SignatureType.METHOD, - fqn, member, - arg_spec=inspect.getargspec(member)) - else: - event = (APISignature.SignatureType.MODULE_ATTR - if inspect.ismodule(module) - else APISignature.SignatureType.CLASS_ATTR) - self._notify(event, fqn, member) - - def parse_paths(self, py_paths, recurse=True): - init_paths, mod_paths = self._collect_paths( - py_paths, recurse=recurse) - init_mods, pkg_mods, failed_mods = self.load_modules( - init_paths, mod_paths) - self.parse_modules(init_mods) - self.parse_modules(pkg_mods) - - -class APIReport(object): - - def __init__(self, abort_on_load_failure=False): - self._api = {} - self._parser = ModuleParser( - [self], abort_on_load_failure=abort_on_load_failure) - - def _add(self, event): - - if is_mock_import(event.member): - return - uuid = str(event.qualified_name) - if uuid in self._api: - # TODO(boden): configurable bail on duplicate flag - sys.stderr.write("Duplicate API signature: %s" % uuid) - return - - if not filter(blacklist_filter, [uuid]): - return - - self._api[uuid] = event.to_dict() - - def parse_method(self, event): - self._add(event) - - def parse_function(self, event): - self._add(event) - - def parse_class(self, event): - self._add(event) - - def parse_class_attribute(self, event): - self._add(event) - - def parse_module_attribute(self, event): - self._add(event) - - def parse_api_paths(self, api_paths, recurse=True): - self._parser.parse_paths(api_paths, recurse=recurse) - - def parse_api_path(self, api_path, recurse=True): - self.parse_api_paths([api_path], recurse=recurse) - - @property - def api(self): - return dict(self._api) - - def to_json(self): - return jsonutils.dumps(self._api) - - @staticmethod - def from_json(json_str): - api = APIReport() - api._api = jsonutils.loads(json_str) - return api - - @staticmethod - def from_json_file(file_path): - with open(file_path, 'r') as json_file: - data = json_file.read() - return APIReport.from_json(data) - - @staticmethod - def api_diff_files(new_api, old_api): - new_api = APIReport.from_json_file(new_api) - old_api = APIReport.from_json_file(old_api) - return new_api.api_diff(old_api) - - def get_filtered_signatures(self): - return filter(blacklist_filter, self.get_signatures()) - - def get_signatures(self): - return sorted([APISignature.get_signature(s) - for s in self._api.values()]) - - def api_diff(self, other_api): - our_keys = sorted(self.api.keys()) - other_keys = sorted(other_api.api.keys()) - - new_keys = set(our_keys) - set(other_keys) - removed_keys = set(other_keys) - set(our_keys) - common_keys = set(our_keys) & set(other_keys) - - common_key_changes = [k for k in common_keys - if ordered(self.api[k]) != - ordered(other_api.api[k])] - - for k in common_key_changes: - if (not blacklist_filter(self.api[k]['member_value']) and not - blacklist_filter(other_api.api[k]['member_value'])): - common_key_changes.remove(k) - - def _build_report(new_api): - apis = APIReport() - apis._api = new_api - return apis - - return { - 'new': _build_report({k: self.api[k] for k in new_keys}), - 'removed': _build_report({k: other_api.api[k] - for k in removed_keys}), - 'unchanged': _build_report({k: self.api[k] - for k in - set(common_keys) - - set(common_key_changes)}), - 'new_changed': _build_report({k: self.api[k] - for k in common_key_changes}), - 'old_changed': _build_report({k: other_api.api[k] - for k in common_key_changes}) - } - - -@six.add_metaclass(abc.ABCMeta) -class AbstractCommand(object): - - @abc.abstractmethod - def get_parser(self): - pass - - @abc.abstractmethod - def run(self, args): - pass - - -def _add_blacklist_opt(parser): - parser.add_argument( - '--blacklist', - help='One or more regular expressions used to filter out ' - 'API paths from the report. File path segments, module ' - 'names, class names, etc. are all subject to filtering. ' - 'Multiple regexes can be specified using a comma in the ' - '--blacklist argument.') - - -class GenerateReportCommand(AbstractCommand): - - PY_LINE_FILTERS = [RemoveDocStrings(), - RemoveCommentLines(), - StripTrailingComments(), - MergeMultiLineImports(), - MergeMultiLineClass(), - MergeMultiLineDef(), - MergeMultiLineDecorator(), - CommentOutDecorators(), - PassEmptyDef(), - MockParentClass(), - AddMockDefinitions(), - MockImports()] - - def __init__(self): - self._parser = argparse.ArgumentParser( - prog='generate', - description='Generate an interface report for python ' - 'source. The paths given can be a python ' - 'package or project directory, or a single ' - 'python source file. The program replaces ' - 'your imports with mocks, so no dependencies ' - 'are needed in the python env.') - _add_blacklist_opt(self._parser) - self._parser.add_argument( - '--debug', - help='Exit parsing on failure to load a module and ' - 'leave temp staging dir intact..', - action='store_const', - const=True) - self._parser.add_argument('PATH', nargs='+', metavar='PATH') - - def get_parser(self): - return self._parser - - def run(self, args): - if args.blacklist: - add_blacklist_from_csv_str(args.blacklist) - - files = PyFiles(args.PATH) - with files.tmp_tree(delete_on_exit=( - not args.debug)) as tmp_root: - PyFiles.filter_all_py_files( - tmp_root, GenerateReportCommand.PY_LINE_FILTERS) - report = APIReport(abort_on_load_failure=args.debug) - for child in os.listdir(tmp_root): - child_path = path.join(tmp_root, child) - report.parse_api_paths([child_path]) - - print("%s" % report.to_json()) - - -class PrintReportCommand(AbstractCommand): - - def __init__(self): - self._parser = argparse.ArgumentParser( - prog='print', - description='Given a JSON API file, print the API signatures ' - 'to STDOUT.') - _add_blacklist_opt(self._parser) - self._parser.add_argument('REPORT_FILE', - help='Path to JSON report file.') - - def get_parser(self): - return self._parser - - def run(self, args): - if args.blacklist: - add_blacklist_from_csv_str(args.blacklist) - report = APIReport.from_json_file(args.REPORT_FILE) - for signature in report.get_filtered_signatures(): - print(signature) - - -class DiffReportCommand(AbstractCommand): - - def __init__(self): - self._parser = argparse.ArgumentParser( - prog='diff', - description='Given a new and old JSON interface report ' - 'files, calculate the changes between new ' - 'and old and echo them to STDOUT.') - _add_blacklist_opt(self._parser) - self._parser.add_argument( - '--unchanged', - help='Used with --diff to specify that unchanged ' - 'public APIs should be reported in addition to ' - 'new and removed.', - action='store_const', - const=True) - self._parser.add_argument('NEW_REPORT_FILE', - help='Path to new report file.') - self._parser.add_argument('OLD_REPORT_FILE', - help='Path to old report file.') - - def get_parser(self): - return self._parser - - def _print_row(self, heading, content_list): - print(heading) - print("-----------------------------------------------------") - for content in content_list: - print(str(content)) - print("-----------------------------------------------------\n") - - def run(self, args): - if args.blacklist: - add_blacklist_from_csv_str(args.blacklist) - - api_diff = APIReport.api_diff_files( - args.NEW_REPORT_FILE, args.OLD_REPORT_FILE) - - self._print_row("New API Signatures", - api_diff['new'].get_filtered_signatures()) - self._print_row("Removed API Signatures", - api_diff['removed'].get_filtered_signatures()) - - new_sigs = api_diff['new_changed'].get_filtered_signatures() - old_sigs = api_diff['old_changed'].get_filtered_signatures() - if len(new_sigs) != len(old_sigs): - new_sigs = [] - old_sigs = [] - new_changed = api_diff['new_changed'].api - old_changed = api_diff['old_changed'].api - for n, new_spec in new_changed.items(): - display_old = blacklist_filter(old_changed[n]['member_value']) - display_new = blacklist_filter(new_spec['member_value']) - if display_old and display_new: - new_sigs.append(APISignature.get_signature(new_spec)) - old_sigs.append(APISignature.get_signature(old_changed[n])) - elif not display_old: - new_sigs.append(APISignature.get_signature(new_spec)) - old_sigs.append(n) - else: - new_sigs.append('UNKNOWN') - old_sigs.append(n) - self._print_row("Changed API Signatures", - ["%s [is now] %s" % - (old_sigs[i], new_sigs[i]) - for i in range(len(new_sigs))]) - - if args.unchanged: - self._print_row("Unchanged API Signatures", - api_diff['unchanged'].get_filtered_signatures()) - - -class CLI(object): - - def __init__(self, commands): - self._commands = {c.get_parser().prog: c for c in commands} - self.parser = argparse.ArgumentParser( - prog='pyir', - description='Python API report tooling.', - usage="pyir <%s> [args]" % "|".join(self._commands.keys()), - add_help=True) - self.parser.add_argument( - 'command', - help='The command to run. Known commands: ' - '%s . Try \'pyir --help\' for more info ' - 'on a specific command. ' % ", ".join(self._commands.keys())) - - args = self.parser.parse_args(sys.argv[1:2]) - if args.command not in self._commands.keys(): - print("Unknown command: %s" % args.command) - self.parser.print_help() - exit(1) - - cmd = self._commands[args.command] - cmd.get_parser().prog = self.parser.prog + ' ' + cmd.get_parser().prog - cmd.run(cmd.get_parser().parse_args(sys.argv[2:])) - - -def main(): - CLI([DiffReportCommand(), GenerateReportCommand(), PrintReportCommand()]) - -if __name__ == '__main__': - main() - exit(0) diff --git a/tools/tox_install.sh b/tools/tox_install.sh deleted file mode 100755 index 66e68c2..0000000 --- a/tools/tox_install.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -# Library constraint file contains this library version pin that is in conflict -# with installing the library from source. We should replace the version pin in -# the constraints file before applying it for from-source installation. - -ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner -BRANCH_NAME=master -LIB_NAME=neutron-lib -requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?) - -set -e - -CONSTRAINTS_FILE=$1 -shift - -install_cmd="pip install" -mydir=$(mktemp -dt "$LIB_NAME-tox_install-XXXXXXX") -trap "rm -rf $mydir" EXIT -localfile=$mydir/upper-constraints.txt -if [[ $CONSTRAINTS_FILE != http* ]]; then - CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE -fi -curl $CONSTRAINTS_FILE -k -o $localfile -install_cmd="$install_cmd -c$localfile" - -if [ $requirements_installed -eq 0 ]; then - echo "Requirements already installed; using existing package" -elif [ -x "$ZUUL_CLONER" ]; then - pushd $mydir - $ZUUL_CLONER --cache-dir \ - /opt/git \ - --branch $BRANCH_NAME \ - git://git.openstack.org \ - openstack/requirements - cd openstack/requirements - $install_cmd -e . - popd -else - if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then - REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements" - fi - $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION} -fi - -# This is the main purpose of the script: Allow local installation of -# the current repo. It is listed in constraints file and thus any -# install will be constrained and we need to unconstrain it. -edit-constraints $localfile -- $LIB_NAME "-e file://$PWD#egg=$LIB_NAME" - -$install_cmd -U $* -exit $? diff --git a/tox.ini b/tox.ini deleted file mode 100644 index b68c06e..0000000 --- a/tox.ini +++ /dev/null @@ -1,60 +0,0 @@ -[tox] -minversion = 2.0 -envlist = py35,py27,pep8 -skipsdist = True - -[testenv] -usedevelop = True -passenv = TRACE_FAILONLY -install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} -setenv = - VIRTUAL_ENV={envdir} - PYTHONWARNINGS=default::DeprecationWarning -deps = - -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt -commands = - ostestr --regex '{posargs}' - -[testenv:pep8] -commands = - flake8 - {toxinidir}/tools/check_samples.sh - -[testenv:releasenotes] -commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html - -[testenv:venv] -commands = {posargs} - -[testenv:cover] -commands = - python setup.py test --coverage --coverage-package-name=neutron_lib --testr-args='{posargs}' - coverage report - -[testenv:docs] -commands = python setup.py build_sphinx - -[testenv:api-ref] -whitelist_externals = rm -commands = - rm -rf api-ref/build - sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html - -[testenv:debug] -commands = oslo_debug_helper -t neutron_lib/tests/unit {posargs} - -[testenv:api-report] -commands = - {toxinidir}/tools/api_report.sh - -[flake8] -# H904: Delay string interpolations at logging calls -enable-extensions=H904 -show-source = True -exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools -import-order-style = pep8 - -[hacking] -import_exceptions = neutron_lib._i18n -local-check-factory = neutron_lib.hacking.checks._neutron_lib_factory