os-service-types-1.7.0/0000775000175000017500000000000013466005776015000 5ustar zuulzuul00000000000000os-service-types-1.7.0/LICENSE0000666000175000017500000002363713466005577016021 0ustar zuulzuul00000000000000 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. os-service-types-1.7.0/CONTRIBUTING.rst0000666000175000017500000000121513466005577017441 0ustar zuulzuul00000000000000If 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 Storyboard: https://storyboard.openstack.org/#!/project/904 os-service-types-1.7.0/test-requirements.txt0000666000175000017500000000114513466005577021243 0ustar zuulzuul00000000000000# 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>=1.1.0,<1.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 python-subunit>=1.0.0 # Apache-2.0/BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD stestr>=2.0.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD requests-mock>=1.2.0 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0 keystoneauth1>=3.4.0 # Apache-2.0 # releasenotes reno>=2.5.0 # Apache-2.0 six>=1.10.0 # MIT os-service-types-1.7.0/PKG-INFO0000664000175000017500000000355313466005776016103 0ustar zuulzuul00000000000000Metadata-Version: 1.1 Name: os-service-types Version: 1.7.0 Summary: Python library for consuming OpenStack sevice-types-authority data Home-page: https://docs.openstack.org/os-service-types/latest/ Author: OpenStack Author-email: openstack-discuss@lists.openstack.org License: UNKNOWN Description: ================ os-service-types ================ Python library for consuming OpenStack sevice-types-authority data The `OpenStack Service Types Authority`_ contains information about official OpenStack services and their historical ``service-type`` aliases. The data is in JSON and the latest data should always be used. This simple library exists to allow for easy consumption of the data, along with a built-in version of the data to use in case network access is for some reason not possible and local caching of the fetched data. * Free software: Apache license * Documentation: https://docs.openstack.org/os-service-types/latest/ * Source: https://opendev.org/openstack/os-service-types * Bugs: https://storyboard.openstack.org/#!/project/904 * Release notes: https://docs.openstack.org/releasenotes/os-service-types/ .. _OpenStack Service Types Authority: https://service-types.openstack.org/ Platform: UNKNOWN Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 os-service-types-1.7.0/AUTHORS0000664000175000017500000000106613466005776016053 0ustar zuulzuul0000000000000098k <18552437190@163.com> Andreas Jaeger Colleen Murphy Colleen Murphy Eric Fried Federico Ressi Monty Taylor OpenStack Release Bot Pavlo Shchelokovskyy Sahid Orentino Ferdjaoui Vieri <15050873171@163.com> ZhijunWei huang.zhiping melissaml qingszhao os-service-types-1.7.0/doc/0000775000175000017500000000000013466005776015545 5ustar zuulzuul00000000000000os-service-types-1.7.0/doc/source/0000775000175000017500000000000013466005776017045 5ustar zuulzuul00000000000000os-service-types-1.7.0/doc/source/reference/0000775000175000017500000000000013466005776021003 5ustar zuulzuul00000000000000os-service-types-1.7.0/doc/source/reference/index.rst0000666000175000017500000000030313466005577022641 0ustar zuulzuul00000000000000============= API Reference ============= .. module:: os_service_types :synopsis: OpenStack Service Types Data .. autoclass:: os_service_types.ServiceTypes :members: :inherited-members: os-service-types-1.7.0/doc/source/library/0000775000175000017500000000000013466005776020511 5ustar zuulzuul00000000000000os-service-types-1.7.0/doc/source/library/index.rst0000666000175000017500000000134513466005577022356 0ustar zuulzuul00000000000000===== Usage ===== The most basic use of `os-service-types` in a project: .. code-block:: python import os_service_types service_types = os_service_types.ServiceTypes() However, `os-service-types` expects to be able to fetch remote data, so it's better to pass in a ``Session`` object. Both :class:`requests.sessions.Session` and :class:`keystoneauth1.session.Session` objects are supported. A :class:`keystoneauth1.session.Session` object does not need auth information attached, although it will not break anything if it does. .. code-block:: python import keystoneauth1.session import os_service_types session = keystoneauth1.session.Session() service_types = os_service_types.ServiceTypes(session=session) os-service-types-1.7.0/doc/source/contributor/0000775000175000017500000000000013466005776021417 5ustar zuulzuul00000000000000os-service-types-1.7.0/doc/source/contributor/index.rst0000666000175000017500000000020313466005577023254 0ustar zuulzuul00000000000000=========================== Contributor Documentation =========================== .. toctree:: :maxdepth: 2 contributing os-service-types-1.7.0/doc/source/contributor/contributing.rst0000666000175000017500000000011613466005577024657 0ustar zuulzuul00000000000000============ Contributing ============ .. include:: ../../../CONTRIBUTING.rst os-service-types-1.7.0/doc/source/index.rst0000666000175000017500000000102113466005577020701 0ustar zuulzuul00000000000000.. os-service-types documentation master file, created by sphinx-quickstart on Tue Jul 9 22:26:36 2013. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to os-service-types's documentation! ======================================================== Contents: .. toctree:: :maxdepth: 2 readme install/index library/index contributor/index reference/index Indices and tables ================== * :ref:`genindex` * :ref:`search` os-service-types-1.7.0/doc/source/conf.py0000777000175000017500000000513513466005577020354 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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 os import sys 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. extensions = [ 'sphinx.ext.autodoc', 'openstackdocstheme', #'sphinx.ext.intersphinx', ] # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. # execute "export SPHINX_DEBUG=1" in your terminal to disable # The suffix of source filenames. source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = u'os-service-types' copyright = u'2017, OpenStack Developers' # openstackdocstheme options repository_name = 'openstack/os-service-types' bug_project = '904' bug_tag = '' html_last_updated_fmt = '%Y-%m-%d %H:%M' # 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 # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # -- 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_static_path = ['static'] html_theme = 'openstackdocs' # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', '%s.tex' % project, u'%s Documentation' % project, u'OpenStack Foundation', 'manual'), ] # Example configuration for intersphinx: refer to the Python standard library. #intersphinx_mapping = {'http://docs.python.org/': None} os-service-types-1.7.0/doc/source/readme.rst0000666000175000017500000000003613466005577021034 0ustar zuulzuul00000000000000.. include:: ../../README.rst os-service-types-1.7.0/doc/source/install/0000775000175000017500000000000013466005776020513 5ustar zuulzuul00000000000000os-service-types-1.7.0/doc/source/install/index.rst0000666000175000017500000000033113466005577022352 0ustar zuulzuul00000000000000============ Installation ============ At the command line:: $ pip install os-service-types Or, if you have virtualenvwrapper installed:: $ mkvirtualenv os-service-types $ pip install os-service-types os-service-types-1.7.0/HACKING.rst0000666000175000017500000000023213466005577016574 0ustar zuulzuul00000000000000os-service-types Style Commandments =================================== Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ os-service-types-1.7.0/.stestr.conf0000666000175000017500000000011113466005577017243 0ustar zuulzuul00000000000000[DEFAULT] test_path=${OS_TEST_PATH:-./os_service_types/tests} top_dir=./ os-service-types-1.7.0/setup.cfg0000666000175000017500000000160513466005776016625 0ustar zuulzuul00000000000000[metadata] name = os-service-types summary = Python library for consuming OpenStack sevice-types-authority data description-file = README.rst author = OpenStack author-email = openstack-discuss@lists.openstack.org home-page = https://docs.openstack.org/os-service-types/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 = os_service_types [build_sphinx] all-files = 1 warning-is-error = 1 source-dir = doc/source build-dir = doc/build [upload_sphinx] upload-dir = doc/build/html [egg_info] tag_build = tag_date = 0 os-service-types-1.7.0/os_service_types/0000775000175000017500000000000013466005776020365 5ustar zuulzuul00000000000000os-service-types-1.7.0/os_service_types/data/0000775000175000017500000000000013466005776021276 5ustar zuulzuul00000000000000os-service-types-1.7.0/os_service_types/data/service-types.json0000666000175000017500000005764613466005577025016 0ustar zuulzuul00000000000000{ "all_types_by_service_type": { "accelerator": [ "accelerator" ], "admin-logic": [ "admin-logic", "registration" ], "alarm": [ "alarm", "alarming" ], "application-catalog": [ "application-catalog" ], "application-container": [ "application-container", "container" ], "application-deployment": [ "application-deployment", "application_deployment" ], "backup": [ "backup" ], "baremetal": [ "baremetal", "bare-metal" ], "baremetal-introspection": [ "baremetal-introspection" ], "block-storage": [ "block-storage", "volumev3", "volumev2", "volume", "block-store" ], "clustering": [ "clustering", "resource-cluster", "cluster" ], "compute": [ "compute" ], "container-infrastructure-management": [ "container-infrastructure-management", "container-infrastructure", "container-infra" ], "data-processing": [ "data-processing" ], "data-protection-orchestration": [ "data-protection-orchestration" ], "database": [ "database" ], "dns": [ "dns" ], "ec2-api": [ "ec2-api" ], "event": [ "event", "events" ], "function-engine": [ "function-engine" ], "identity": [ "identity" ], "image": [ "image" ], "instance-ha": [ "instance-ha", "ha" ], "key-manager": [ "key-manager" ], "load-balancer": [ "load-balancer" ], "message": [ "message", "messaging" ], "meter": [ "meter", "metering", "telemetry" ], "monitoring": [ "monitoring" ], "monitoring-events": [ "monitoring-events" ], "monitoring-logging": [ "monitoring-logging", "monitoring-log-api" ], "multi-region-network-automation": [ "multi-region-network-automation", "tricircle" ], "network": [ "network" ], "nfv-orchestration": [ "nfv-orchestration" ], "object-store": [ "object-store" ], "operator-policy": [ "operator-policy", "policy" ], "orchestration": [ "orchestration" ], "placement": [ "placement" ], "rating": [ "rating" ], "reservation": [ "reservation" ], "resource-optimization": [ "resource-optimization", "infra-optim" ], "root-cause-analysis": [ "root-cause-analysis", "rca" ], "search": [ "search" ], "shared-file-system": [ "shared-file-system", "sharev2", "share" ], "workflow": [ "workflow", "workflowv2" ] }, "forward": { "admin-logic": [ "registration" ], "alarm": [ "alarming" ], "application-container": [ "container" ], "application-deployment": [ "application_deployment" ], "baremetal": [ "bare-metal" ], "block-storage": [ "volumev3", "volumev2", "volume", "block-store" ], "clustering": [ "resource-cluster", "cluster" ], "container-infrastructure-management": [ "container-infrastructure", "container-infra" ], "event": [ "events" ], "instance-ha": [ "ha" ], "message": [ "messaging" ], "meter": [ "metering", "telemetry" ], "monitoring-logging": [ "monitoring-log-api" ], "multi-region-network-automation": [ "tricircle" ], "operator-policy": [ "policy" ], "resource-optimization": [ "infra-optim" ], "root-cause-analysis": [ "rca" ], "shared-file-system": [ "sharev2", "share" ], "workflow": [ "workflowv2" ] }, "primary_service_by_project": { "adjutant": { "aliases": [ "registration" ], "api_reference": "https://developer.openstack.org/api-ref/admin-logic/", "project": "adjutant", "service_type": "admin-logic" }, "aodh": { "aliases": [ "alarming" ], "api_reference": "https://docs.openstack.org/developer/aodh/webapi/index.html", "project": "aodh", "service_type": "alarm" }, "barbican": { "api_reference": "https://docs.openstack.org/barbican/latest/api/", "project": "barbican", "service_type": "key-manager" }, "blazar": { "api_reference": "https://developer.openstack.org/api-ref/reservation/", "project": "blazar", "service_type": "reservation" }, "ceilometer": { "aliases": [ "metering", "telemetry" ], "api_reference": "https://docs.openstack.org/developer/ceilometer/webapi/index.html", "project": "ceilometer", "service_type": "meter" }, "cinder": { "aliases": [ "volumev3", "volumev2", "volume", "block-store" ], "api_reference": "https://developer.openstack.org/api-ref/block-storage/", "project": "cinder", "service_type": "block-storage" }, "cloudkitty": { "api_reference": "https://docs.openstack.org/cloudkitty/latest/api-reference/index.html", "project": "cloudkitty", "service_type": "rating" }, "congress": { "aliases": [ "policy" ], "api_reference": "https://docs.openstack.org/congress/latest/user/api.html", "project": "congress", "service_type": "operator-policy" }, "cyborg": { "api_reference": "https://docs.openstack.org/cyborg/latest/admin/api.html", "project": "cyborg", "service_type": "accelerator" }, "designate": { "api_reference": "https://developer.openstack.org/api-ref/dns/", "project": "designate", "service_type": "dns" }, "ec2-api": { "api_reference": "https://developer.openstack.org/api-ref/ec2-api/", "project": "ec2-api", "service_type": "ec2-api" }, "freezer-api": { "api_reference": "https://developer.openstack.org/api-ref/backup/", "project": "freezer-api", "service_type": "backup" }, "glance": { "api_reference": "https://developer.openstack.org/api-ref/image/", "project": "glance", "service_type": "image" }, "heat": { "api_reference": "https://developer.openstack.org/api-ref/orchestration/", "project": "heat", "service_type": "orchestration" }, "ironic": { "aliases": [ "bare-metal" ], "api_reference": "https://developer.openstack.org/api-ref/baremetal/", "project": "ironic", "service_type": "baremetal" }, "ironic-inspector": { "api_reference": "https://docs.openstack.org/ironic-inspector/latest/user/http-api.html", "project": "ironic-inspector", "service_type": "baremetal-introspection" }, "karbor": { "api_reference": "https://developer.openstack.org/api-ref/data-protection-orchestration/", "project": "karbor", "service_type": "data-protection-orchestration" }, "keystone": { "api_reference": "https://developer.openstack.org/api-ref/identity/", "project": "keystone", "service_type": "identity" }, "magnum": { "aliases": [ "container-infrastructure", "container-infra" ], "api_reference": "https://developer.openstack.org/api-ref/container-infrastructure-management/", "project": "magnum", "service_type": "container-infrastructure-management" }, "manila": { "aliases": [ "sharev2", "share" ], "api_reference": "https://developer.openstack.org/api-ref/shared-file-system/", "project": "manila", "service_type": "shared-file-system" }, "masakari": { "aliases": [ "ha" ], "api_reference": "https://developer.openstack.org/api-ref/instance-ha/", "project": "masakari", "service_type": "instance-ha" }, "mistral": { "aliases": [ "workflowv2" ], "api_reference": "https://docs.openstack.org/mistral/latest/api/index.html", "project": "mistral", "service_type": "workflow" }, "monasca-api": { "api_reference": "https://developer.openstack.org/api-ref/monitoring/", "project": "monasca-api", "service_type": "monitoring" }, "monasca-events-api": { "api_reference": "https://developer.openstack.org/api-ref/monitoring-events/", "project": "monasca-events-api", "service_type": "monitoring-events" }, "monasca-log-api": { "aliases": [ "monitoring-log-api" ], "api_reference": "https://developer.openstack.org/api-ref/monitoring-logging/", "project": "monasca-log-api", "service_type": "monitoring-logging" }, "murano": { "api_reference": "https://developer.openstack.org/api-ref/application-catalog/", "project": "murano", "service_type": "application-catalog" }, "neutron": { "api_reference": "https://developer.openstack.org/api-ref/network/", "api_reference_project": "neutron-lib", "project": "neutron", "service_type": "network" }, "neutron-lib": { "api_reference": "https://developer.openstack.org/api-ref/network/", "api_reference_project": "neutron-lib", "project": "neutron", "service_type": "network" }, "nova": { "api_reference": "https://developer.openstack.org/api-ref/compute/", "project": "nova", "service_type": "compute" }, "octavia": { "api_reference": "https://developer.openstack.org/api-ref/load-balancer/", "project": "octavia", "service_type": "load-balancer" }, "panko": { "aliases": [ "events" ], "api_reference": "https://docs.openstack.org/developer/panko/webapi/index.html", "project": "panko", "service_type": "event" }, "placement": { "api_reference": "https://developer.openstack.org/api-ref/placement/", "project": "placement", "service_type": "placement" }, "qinling": { "api_reference": "https://developer.openstack.org/api-ref/function-engine/", "project": "qinling", "service_type": "function-engine" }, "sahara": { "api_reference": "https://developer.openstack.org/api-ref/data-processing/", "project": "sahara", "service_type": "data-processing" }, "searchlight": { "api_reference": "https://developer.openstack.org/api-ref/search/", "project": "searchlight", "service_type": "search" }, "senlin": { "aliases": [ "resource-cluster", "cluster" ], "api_reference": "https://developer.openstack.org/api-ref/clustering/", "project": "senlin", "service_type": "clustering" }, "solum": { "aliases": [ "application_deployment" ], "api_reference": "https://docs.openstack.org/solum/latest/admin/webapi/index.html", "project": "solum", "service_type": "application-deployment" }, "swift": { "api_reference": "https://developer.openstack.org/api-ref/object-store/", "project": "swift", "service_type": "object-store" }, "tacker": { "api_reference": "https://developer.openstack.org/api-ref/nfv-orchestration/", "project": "tacker", "service_type": "nfv-orchestration" }, "tricircle": { "aliases": [ "tricircle" ], "api_reference": "https://docs.openstack.org/tricircle/latest/admin/api_v1.html", "project": "tricircle", "service_type": "multi-region-network-automation" }, "trove": { "api_reference": "https://developer.openstack.org/api-ref/database/", "project": "trove", "service_type": "database" }, "vitrage": { "aliases": [ "rca" ], "api_reference": "https://docs.openstack.org/vitrage/latest/contributor/vitrage-api.html", "project": "vitrage", "service_type": "root-cause-analysis" }, "watcher": { "aliases": [ "infra-optim" ], "api_reference": "https://developer.openstack.org/api-ref/resource-optimization/", "project": "watcher", "service_type": "resource-optimization" }, "zaqar": { "aliases": [ "messaging" ], "api_reference": "https://developer.openstack.org/api-ref/message/", "project": "zaqar", "service_type": "message" }, "zun": { "aliases": [ "container" ], "api_reference": "https://developer.openstack.org/api-ref/application-container/", "project": "zun", "service_type": "application-container" } }, "reverse": { "alarming": "alarm", "application_deployment": "application-deployment", "bare-metal": "baremetal", "block-store": "block-storage", "cluster": "clustering", "container": "application-container", "container-infra": "container-infrastructure-management", "container-infrastructure": "container-infrastructure-management", "events": "event", "ha": "instance-ha", "infra-optim": "resource-optimization", "messaging": "message", "metering": "meter", "monitoring-log-api": "monitoring-logging", "policy": "operator-policy", "rca": "root-cause-analysis", "registration": "admin-logic", "resource-cluster": "clustering", "share": "shared-file-system", "sharev2": "shared-file-system", "telemetry": "meter", "tricircle": "multi-region-network-automation", "volume": "block-storage", "volumev2": "block-storage", "volumev3": "block-storage", "workflowv2": "workflow" }, "service_types_by_project": { "adjutant": [ "admin-logic" ], "aodh": [ "alarm" ], "barbican": [ "key-manager" ], "blazar": [ "reservation" ], "ceilometer": [ "meter" ], "cinder": [ "block-storage" ], "cloudkitty": [ "rating" ], "congress": [ "operator-policy" ], "cyborg": [ "accelerator" ], "designate": [ "dns" ], "ec2-api": [ "ec2-api" ], "freezer-api": [ "backup" ], "glance": [ "image" ], "heat": [ "orchestration" ], "ironic": [ "baremetal" ], "ironic-inspector": [ "baremetal-introspection" ], "karbor": [ "data-protection-orchestration" ], "keystone": [ "identity" ], "magnum": [ "container-infrastructure-management" ], "manila": [ "shared-file-system" ], "masakari": [ "instance-ha" ], "mistral": [ "workflow" ], "monasca-api": [ "monitoring" ], "monasca-events-api": [ "monitoring-events" ], "monasca-log-api": [ "monitoring-logging" ], "murano": [ "application-catalog" ], "neutron": [ "network" ], "neutron-lib": [ "network" ], "nova": [ "compute" ], "octavia": [ "load-balancer" ], "panko": [ "event" ], "placement": [ "placement" ], "qinling": [ "function-engine" ], "sahara": [ "data-processing" ], "searchlight": [ "search" ], "senlin": [ "clustering" ], "solum": [ "application-deployment" ], "swift": [ "object-store" ], "tacker": [ "nfv-orchestration" ], "tricircle": [ "multi-region-network-automation" ], "trove": [ "database" ], "vitrage": [ "root-cause-analysis" ], "watcher": [ "resource-optimization" ], "zaqar": [ "message" ], "zun": [ "application-container" ] }, "services": [ { "api_reference": "https://developer.openstack.org/api-ref/identity/", "project": "keystone", "service_type": "identity" }, { "api_reference": "https://developer.openstack.org/api-ref/compute/", "project": "nova", "service_type": "compute" }, { "api_reference": "https://developer.openstack.org/api-ref/image/", "project": "glance", "service_type": "image" }, { "api_reference": "https://developer.openstack.org/api-ref/load-balancer/", "project": "octavia", "service_type": "load-balancer" }, { "api_reference": "https://developer.openstack.org/api-ref/object-store/", "project": "swift", "service_type": "object-store" }, { "aliases": [ "resource-cluster", "cluster" ], "api_reference": "https://developer.openstack.org/api-ref/clustering/", "project": "senlin", "service_type": "clustering" }, { "api_reference": "https://developer.openstack.org/api-ref/data-processing/", "project": "sahara", "service_type": "data-processing" }, { "aliases": [ "bare-metal" ], "api_reference": "https://developer.openstack.org/api-ref/baremetal/", "project": "ironic", "service_type": "baremetal" }, { "api_reference": "https://docs.openstack.org/ironic-inspector/latest/user/http-api.html", "project": "ironic-inspector", "service_type": "baremetal-introspection" }, { "api_reference": "https://docs.openstack.org/barbican/latest/api/", "project": "barbican", "service_type": "key-manager" }, { "api_reference": "https://developer.openstack.org/api-ref/ec2-api/", "project": "ec2-api", "service_type": "ec2-api" }, { "aliases": [ "infra-optim" ], "api_reference": "https://developer.openstack.org/api-ref/resource-optimization/", "project": "watcher", "service_type": "resource-optimization" }, { "aliases": [ "messaging" ], "api_reference": "https://developer.openstack.org/api-ref/message/", "project": "zaqar", "service_type": "message" }, { "api_reference": "https://developer.openstack.org/api-ref/application-catalog/", "project": "murano", "service_type": "application-catalog" }, { "aliases": [ "container-infrastructure", "container-infra" ], "api_reference": "https://developer.openstack.org/api-ref/container-infrastructure-management/", "project": "magnum", "service_type": "container-infrastructure-management" }, { "api_reference": "https://developer.openstack.org/api-ref/search/", "project": "searchlight", "service_type": "search" }, { "api_reference": "https://developer.openstack.org/api-ref/dns/", "project": "designate", "service_type": "dns" }, { "aliases": [ "workflowv2" ], "api_reference": "https://docs.openstack.org/mistral/latest/api/index.html", "project": "mistral", "service_type": "workflow" }, { "api_reference": "https://docs.openstack.org/cloudkitty/latest/api-reference/index.html", "project": "cloudkitty", "service_type": "rating" }, { "aliases": [ "policy" ], "api_reference": "https://docs.openstack.org/congress/latest/user/api.html", "project": "congress", "service_type": "operator-policy" }, { "aliases": [ "sharev2", "share" ], "api_reference": "https://developer.openstack.org/api-ref/shared-file-system/", "project": "manila", "service_type": "shared-file-system" }, { "api_reference": "https://developer.openstack.org/api-ref/data-protection-orchestration/", "project": "karbor", "service_type": "data-protection-orchestration" }, { "api_reference": "https://developer.openstack.org/api-ref/orchestration/", "project": "heat", "service_type": "orchestration" }, { "aliases": [ "volumev3", "volumev2", "volume", "block-store" ], "api_reference": "https://developer.openstack.org/api-ref/block-storage/", "project": "cinder", "service_type": "block-storage" }, { "aliases": [ "alarming" ], "api_reference": "https://docs.openstack.org/developer/aodh/webapi/index.html", "project": "aodh", "service_type": "alarm" }, { "aliases": [ "metering", "telemetry" ], "api_reference": "https://docs.openstack.org/developer/ceilometer/webapi/index.html", "project": "ceilometer", "service_type": "meter" }, { "aliases": [ "events" ], "api_reference": "https://docs.openstack.org/developer/panko/webapi/index.html", "project": "panko", "service_type": "event" }, { "aliases": [ "application_deployment" ], "api_reference": "https://docs.openstack.org/solum/latest/admin/webapi/index.html", "project": "solum", "service_type": "application-deployment" }, { "aliases": [ "tricircle" ], "api_reference": "https://docs.openstack.org/tricircle/latest/admin/api_v1.html", "project": "tricircle", "service_type": "multi-region-network-automation" }, { "api_reference": "https://developer.openstack.org/api-ref/database/", "project": "trove", "service_type": "database" }, { "aliases": [ "container" ], "api_reference": "https://developer.openstack.org/api-ref/application-container/", "project": "zun", "service_type": "application-container" }, { "aliases": [ "rca" ], "api_reference": "https://docs.openstack.org/vitrage/latest/contributor/vitrage-api.html", "project": "vitrage", "service_type": "root-cause-analysis" }, { "api_reference": "https://developer.openstack.org/api-ref/nfv-orchestration/", "project": "tacker", "service_type": "nfv-orchestration" }, { "api_reference": "https://developer.openstack.org/api-ref/network/", "api_reference_project": "neutron-lib", "project": "neutron", "service_type": "network" }, { "api_reference": "https://developer.openstack.org/api-ref/backup/", "project": "freezer-api", "service_type": "backup" }, { "aliases": [ "monitoring-log-api" ], "api_reference": "https://developer.openstack.org/api-ref/monitoring-logging/", "project": "monasca-log-api", "service_type": "monitoring-logging" }, { "api_reference": "https://developer.openstack.org/api-ref/monitoring/", "project": "monasca-api", "service_type": "monitoring" }, { "api_reference": "https://developer.openstack.org/api-ref/monitoring-events/", "project": "monasca-events-api", "service_type": "monitoring-events" }, { "api_reference": "https://developer.openstack.org/api-ref/placement/", "project": "placement", "service_type": "placement" }, { "aliases": [ "ha" ], "api_reference": "https://developer.openstack.org/api-ref/instance-ha/", "project": "masakari", "service_type": "instance-ha" }, { "api_reference": "https://developer.openstack.org/api-ref/reservation/", "project": "blazar", "service_type": "reservation" }, { "api_reference": "https://developer.openstack.org/api-ref/function-engine/", "project": "qinling", "service_type": "function-engine" }, { "api_reference": "https://docs.openstack.org/cyborg/latest/admin/api.html", "project": "cyborg", "service_type": "accelerator" }, { "aliases": [ "registration" ], "api_reference": "https://developer.openstack.org/api-ref/admin-logic/", "project": "adjutant", "service_type": "admin-logic" } ], "sha": "4a8e2d261fb5a4283d7d0eae9c39ead15dfd799c", "version": "2019-05-01T19:53:21.498745" }os-service-types-1.7.0/os_service_types/data/__init__.py0000666000175000017500000000155313466005577023414 0ustar zuulzuul00000000000000# Copyright 2017 Red Hat, 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 json import os __all__ = ['read_data'] DATA_DIR = os.path.dirname(__file__) def read_data(filename): """Return data that is shipped inside the Python package. """ filepath = os.path.join(DATA_DIR, filename) with open(filepath, 'r') as fd: return json.load(fd) os-service-types-1.7.0/os_service_types/service_types.py0000666000175000017500000002572613466005577023640 0ustar zuulzuul00000000000000# Copyright 2017 Red Hat, 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 copy import os_service_types.data from os_service_types import exc __all__ = ['ServiceTypes'] BUILTIN_DATA = os_service_types.data.read_data('service-types.json') SERVICE_TYPES_URL = "https://service-types.openstack.org/service-types.json" def _normalize_type(service_type): if service_type: return service_type.replace('_', '-') class ServiceTypes(object): """Encapsulation of the OpenStack Service Types Authority data. The Service Types Authority data will be either pulled from its remote location or from local files as is appropriate. If the user passes a Session, remote data will be fetched. If the user does not do that, local builtin data will be used. :param session: An object that behaves like a `requests.sessions.Session` or a `keystoneauth1.session.Session` that provides a get method and returns an object that behaves like a `requests.models.Response`. Optional. If session is omitted, no remote actions will be performed. :param bool only_remote: By default if there is a problem fetching data remotely the builtin data will be returned as a fallback. only_remote will cause remote failures to raise an error instead of falling back. Optional, defaults to False. :param bool warn: Emit warnings when a non-official service_type is provided. This provides an easy way for consuming applications to warn users when they are using old types. :raises ValueError: If session is None and only_remote is True :raises IOError: If session is given and only_remote is True and there is an error fetching remote data. """ def __init__(self, session=None, only_remote=False, warn=False): if not session and only_remote: raise ValueError( "only_remote was requested but no Session was provided.") self._service_types_data = BUILTIN_DATA self._warn = warn if session: try: response = session.get(SERVICE_TYPES_URL) response.raise_for_status() self._service_types_data = response.json() except IOError: # If we can't fetch, fall backto BUILTIN if only_remote: raise def _canonical_project_name(self, name): "Convert repo name to project name." if name is None: raise ValueError("Empty project name is not allowed") # Handle openstack/ prefix going away from STA data return name.rpartition('/')[-1] @property def url(self): "The URL from which the data was retrieved." return SERVICE_TYPES_URL @property def version(self): "The version of the data." return self._service_types_data['version'] @property def forward(self): "Mapping service-type names to their aliases." return copy.deepcopy(self._service_types_data['forward']) @property def reverse(self): "Mapping aliases to their service-type names." return copy.deepcopy(self._service_types_data['reverse']) @property def services(self): "Full service-type data listing." return copy.deepcopy(self._service_types_data['services']) @property def all_types_by_service_type(self): "Mapping of official service type to official type and aliases." return copy.deepcopy( self._service_types_data['all_types_by_service_type']) @property def primary_service_by_project(self): "Mapping of project name to the primary associated service." return copy.deepcopy( self._service_types_data['primary_service_by_project']) @property def service_types_by_project(self): "Mapping of project name to a list of all associated service-types." return copy.deepcopy( self._service_types_data['service_types_by_project']) def get_official_service_data(self, service_type): """Get the service data for an official service_type. :param str service_type: The official service-type to get data for. :returns dict: Service data for the service or None if not found. """ service_type = _normalize_type(service_type) for service in self._service_types_data['services']: if service_type == service['service_type']: return service return None def get_service_data(self, service_type): """Get the service data for a given service_type. :param str service_type: The service-type or alias to get data for. :returns dict: Service data for the service or None if not found. """ service_type = self.get_service_type(service_type) if not service_type: return None return self.get_official_service_data(service_type) def is_official(self, service_type): """Is the given service-type an official service-type? :param str service_type: The service-type to test. :returns bool: True if it's an official type, False otherwise. """ return self.get_official_service_data(service_type) is not None def is_alias(self, service_type): """Is the given service-type an alias? :param str service_type: The service-type to test. :returns bool: True if it's an alias type, False otherwise. """ service_type = _normalize_type(service_type) return service_type in self._service_types_data['reverse'] def is_known(self, service_type): """Is the given service-type an official type or an alias? :param str service_type: The service-type to test. :returns bool: True if it's a known type, False otherwise. """ return self.is_official(service_type) or self.is_alias(service_type) def is_match(self, requested, found): """Does a requested service-type match one found in the catalog? A requested service-type matches a service-type in the catalog if it is either a direct match, if the service-type in the catalog is an official type and the requested type is one of its aliases, or if the requested type is an official type and the type in the catalog is one of its aliases. A requested alias cannot match a different alias because there are historical implications related to versioning to some historical aliases that cannot be safely reasoned about in an automatic fashion. :param str requested: A service-type that someone is looking for. :param str found: A service-type found in a catalog :returns bool: True if the service-type being requested matches the entry in the catalog. False if it does not. """ # Exact match if requested == found: return True # Found is official type, requested is one of its aliases if requested in self.get_aliases(found): return True # Found is an alias, requested is an official type if requested == self.get_service_type(found): return True return False def get_aliases(self, service_type): """Returns the list of aliases for a given official service-type. :param str service_type: An official service-type. :returns list: List of aliases, or empty list if there are none. """ service_type = _normalize_type(service_type) return self._service_types_data['forward'].get(service_type, []) def get_service_type(self, service_type, permissive=False): """Given a possible service_type, return the official type. :param str service_type: A potential service-type. :param bool permissive: Return the original type if the given service_type is not found. :returns str: The official service-type, or None if there is no match. """ service_type = _normalize_type(service_type) if self.is_official(service_type): return service_type official = self._service_types_data['reverse'].get(service_type) if permissive and official is None: if self._warn: exc.warn( exc.UnofficialUsageWarning, given=service_type) return service_type if self._warn: exc.warn( exc.AliasUsageWarning, given=service_type, official=official) return official def get_all_types(self, service_type): """Get a list of official types and all known aliases. :param str service_type: The service-type or alias to get data for. :returns dict: Service data for the service or None if not found. """ service_type = _normalize_type(service_type) if not self.is_known(service_type): return [service_type] return self.all_types_by_service_type[ self.get_service_type(service_type)] def get_project_name(self, service_type): """Return the OpenStack project name for a given service_type. :param str service_type: An official service-type or alias. :returns str: The OpenStack project name or None if there is no match. """ service_type = _normalize_type(service_type) service = self.get_service_data(service_type) if service: return service['project'] return None def get_service_data_for_project(self, project_name): """Return the service information associated with a project. :param name: A repository or project name in the form ``'openstack/{project}'`` or just ``'{project}'``. :type name: str :raises ValueError: If project_name is None :returns: dict or None if not found """ project_name = self._canonical_project_name(project_name) return self.primary_service_by_project.get(project_name) def get_all_service_data_for_project(self, project_name): """Return the information for every service associated with a project. :param name: A repository or project name in the form ``'openstack/{project}'`` or just ``'{project}'``. :type name: str :raises ValueError: If project_name is None :returns: list of dicts """ data = [] for service_type in self.service_types_by_project.get( project_name, []): data.append(self.get_service_data(service_type)) return data os-service-types-1.7.0/os_service_types/__init__.py0000666000175000017500000000266713466005577022512 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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. __all__ = ['__version__', 'ServiceTypes'] import pbr.version from os_service_types.service_types import ServiceTypes # flake8: noqa __version__ = pbr.version.VersionInfo('os-service-types').version_string() _service_type_manager = None def get_service_types(*args, **kwargs): """Return singleton instance of the ServiceTypes object. Parameters are all passed through to the :class:`~os_service_types.service_types.ServiceTypes` constructor. .. note:: Only one singleton is kept, so if instances with different parameter values are desired, directly calling the constructor is necessary. :returns: Singleton instance of :class:`~os_service_types.service_types.ServiceTypes` """ global _service_type_manager if not _service_type_manager: _service_type_manager = ServiceTypes(*args, **kwargs) return _service_type_manager os-service-types-1.7.0/os_service_types/exc.py0000666000175000017500000000245513466005577021525 0ustar zuulzuul00000000000000# Copyright 2017 Red Hat, 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 textwrap import warnings __all__ = ['warn', 'AliasUsageWarning'] def warn(warning, **kwargs): """Emit a warning that has builtin message text.""" message = textwrap.fill(textwrap.dedent(warning.details.format(**kwargs))) warnings.warn(message, category=warning) class AliasUsageWarning(Warning): """Use of historical service-type aliases is discouraged.""" details = """ Requested service_type {given} is an old alias. Please update your code to reference the official service_type {official}. """ class UnofficialUsageWarning(Warning): """Use of unofficial service-types is discouraged.""" details = """ Requested service_type {given} is not a known official OpenStack project. """ os-service-types-1.7.0/os_service_types/tests/0000775000175000017500000000000013466005776021527 5ustar zuulzuul00000000000000os-service-types-1.7.0/os_service_types/tests/test_remote.py0000666000175000017500000000354413466005577024442 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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_remote ----------- Tests for `ServiceTypes` class remote data. oslotest sets up a TempHomeDir for us, so there should be no ~/.cache files available in these tests. """ from requests_mock.contrib import fixture as rm_fixture from testscenarios import load_tests_apply_scenarios as load_tests # noqa import keystoneauth1.session import os_service_types import os_service_types.service_types from os_service_types.tests import base class TestRemote(base.TestCase, base.ServiceDataMixin): def setUp(self): super(TestRemote, self).setUp() # Set up a requests_mock fixture for all HTTP traffic adapter = self.useFixture(rm_fixture.Fixture()) adapter.register_uri( 'GET', os_service_types.service_types.SERVICE_TYPES_URL, json=self.remote_content, headers={'etag': self.getUniqueString('etag')}) # use keystoneauth1 to get a Sessiom with no auth information self.session = keystoneauth1.session.Session() # Make an object that fetches from the network self.service_types = os_service_types.ServiceTypes( session=self.session) self.assertEqual(1, len(adapter.request_history)) def test_remote_version(self): self.assertEqual(self.remote_version, self.service_types.version) os-service-types-1.7.0/os_service_types/tests/test_warn.py0000666000175000017500000000416113466005577024112 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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_warn --------- Tests for warnings """ import warnings import os_service_types from os_service_types import exc from os_service_types.tests import base class TestWarnOn(base.TestCase): def setUp(self): super(TestWarnOn, self).setUp() # Cause all warnings to always be triggered. warnings.simplefilter("always") self.service_types = os_service_types.ServiceTypes(warn=True) def test_warning_emitted_on_alias(self): with warnings.catch_warnings(record=True) as w: self.service_types.get_service_type('volumev2') self.assertEqual(1, len(w)) self.assertTrue(issubclass(w[-1].category, exc.AliasUsageWarning)) def test_warning_not_emitted_on_official(self): with warnings.catch_warnings(record=True) as w: self.service_types.get_service_type('block-storage') self.assertEqual(0, len(w)) class TestWarnOff(base.TestCase): def setUp(self): super(TestWarnOff, self).setUp() # Cause all warnings to always be triggered. warnings.simplefilter("always") self.service_types = os_service_types.ServiceTypes() def test_warning_not_emitted_on_alias(self): with warnings.catch_warnings(record=True) as w: self.service_types.get_service_type('volumev2') self.assertEqual(0, len(w)) def test_warning_not_emitted_on_official(self): with warnings.catch_warnings(record=True) as w: self.service_types.get_service_type('block-storage') self.assertEqual(0, len(w)) os-service-types-1.7.0/os_service_types/tests/base.py0000666000175000017500000002404213466005577023016 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # Copyright 2010-2011 OpenStack Foundation # 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. import copy import datetime import os import tempfile from oslotest import base import os_service_types.service_types class TestCase(base.BaseTestCase): """Base test case class before singleton protection is added.""" def setUp(self): super(TestCase, self).setUp() self.builtin_content = os_service_types.service_types.BUILTIN_DATA self.builtin_version = self.builtin_content['version'] # Set up copies of the data so that we can verify that we got the # copy of it we think we should. self.remote_version = datetime.datetime.utcnow().isoformat() self.remote_content = copy.deepcopy(self.builtin_content) self.remote_content['version'] = self.remote_version class ServiceDataMixin(object): scenarios = [ ('compute', dict( service_type='compute', official='compute', aliases=[], all_types=['compute'], api_reference='compute', api_reference_project=None, is_secondary=False, all_services=['compute'], is_known=True, is_alias=False, is_official=True, project='nova')), ('volumev2', dict( service_type='volumev2', official='block-storage', aliases=[], all_types=['block-storage', 'volumev3', 'volumev2', 'volume', 'block-store'], api_reference='block-storage', api_reference_project=None, is_known=True, is_alias=True, is_official=False, is_secondary=False, all_services=['block-storage'], project='cinder')), ('volumev3', dict( service_type='volumev3', official='block-storage', aliases=[], all_types=['block-storage', 'volumev3', 'volumev2', 'volume', 'block-store'], api_reference='block-storage', api_reference_project=None, is_known=True, is_alias=True, is_official=False, is_secondary=False, all_services=['block-storage'], project='cinder')), ('block-storage', dict( service_type='block-storage', official='block-storage', all_types=['block-storage', 'volumev3', 'volumev2', 'volume', 'block-store'], api_reference='block-storage', api_reference_project=None, aliases=['volumev3', 'volumev2', 'volume', 'block-store'], is_known=True, is_alias=False, is_official=True, is_secondary=False, all_services=['block-storage'], project='cinder')), ('block_storage', dict( service_type='block_storage', official='block-storage', all_types=['block-storage', 'volumev3', 'volumev2', 'volume', 'block-store'], api_reference='block-storage', api_reference_project=None, aliases=['volumev3', 'volumev2', 'volume', 'block-store'], is_known=True, is_alias=False, is_official=True, is_secondary=False, all_services=['block-storage'], project='cinder')), ('network', dict( service_type='network', official='network', aliases=[], all_types=['network'], api_reference='network', api_reference_project='neutron-lib', is_known=True, is_alias=False, is_official=True, is_secondary=False, all_services=['network'], project='neutron')), ('placement', dict( service_type='placement', official='placement', aliases=[], all_types=['placement'], all_services=['placement'], api_reference='placement', api_reference_project=None, is_known=True, is_alias=False, is_official=True, is_secondary=False, project='placement')), ('missing', dict( service_type='missing', official=None, aliases=[], all_services=[], all_types=['missing'], api_reference=None, api_reference_project=None, is_known=False, is_alias=False, is_official=False, is_secondary=False, project=None)), ] def test_get_service_type(self): if self.official: self.assertEqual( self.official, self.service_types.get_service_type(self.service_type)) else: self.assertIsNone( self.service_types.get_service_type(self.service_type)) def test_get_service_type_permissive(self): self.assertEqual( self.official or self.service_type, self.service_types.get_service_type( self.service_type, permissive=True)) def test_get_aliases(self): self.assertEqual( self.aliases, self.service_types.get_aliases(self.service_type)) def test_is_known(self): self.assertEqual( self.is_known, self.service_types.is_known(self.service_type)) def test_is_alias(self): self.assertEqual( self.is_alias, self.service_types.is_alias(self.service_type)) def test_is_official(self): self.assertEqual( self.is_official, self.service_types.is_official(self.service_type)) def test_get_project_name(self): self.assertEqual( self.project, self.service_types.get_project_name(self.service_type)) def test_get_service_data(self): service_data = self.service_types.get_service_data(self.service_type) # TODO(mordred) Once all the docs have been aligned, remove # self.api_reference and replace with self.service_type api_url = 'https://developer.openstack.org/api-ref/{api_reference}/' # Tests self.official here, since we expect to get data back for all # official projects, regardless of service_type being an alias or not if not self.official: self.assertIsNone(service_data) else: self.assertIsNotNone(service_data) self.assertEqual(self.project, service_data['project']) self.assertEqual(self.official, service_data['service_type']) self.assertEqual( api_url.format(api_reference=self.api_reference), service_data['api_reference']) def test_get_official_service_data(self): service_data = self.service_types.get_official_service_data( self.service_type) # TODO(mordred) Once all the docs have been aligned, remove # self.api_reference and replace with self.service_type api_url = 'https://developer.openstack.org/api-ref/{api_reference}/' # Tests self.is_official here, since we expect only get data back for # official projects. if not self.is_official: self.assertIsNone(service_data) else: self.assertIsNotNone(service_data) self.assertEqual(self.project, service_data['project']) self.assertEqual(self.official, service_data['service_type']) self.assertEqual( api_url.format(api_reference=self.api_reference), service_data['api_reference']) def test_empty_project_error(self): if not self.project: self.assertRaises( ValueError, self.service_types.get_service_data_for_project, self.project) def test_get_service_data_for_project(self): if self.is_secondary: self.skipTest("Secondary services have no project mapping") return elif not self.project: self.skipTest("Empty project is invalid but tested elsewhere.") return service_data = self.service_types.get_service_data_for_project( self.project) # TODO(mordred) Once all the docs have been aligned, remove # self.api_reference and replace with self.service_type api_url = 'https://developer.openstack.org/api-ref/{api_reference}/' self.assertIsNotNone(service_data) if self.api_reference_project: self.assertEqual( self.api_reference_project, service_data['api_reference_project']) else: self.assertEqual(self.project, service_data['project']) self.assertEqual(self.official, service_data['service_type']) self.assertEqual( api_url.format(api_reference=self.api_reference), service_data['api_reference']) def test_get_all_types(self): self.assertEqual( self.all_types, self.service_types.get_all_types(self.service_type)) def test_all_get_service_data_for_project(self): if not self.project: self.skipTest("Empty project is invalid but tested elsewhere.") return all_data = self.service_types.get_all_service_data_for_project( self.project) for (index, data) in enumerate(all_data): self.assertEqual( data, self.service_types.get_service_data(self.all_services[index])) class TemporaryFileMixin(base.BaseTestCase): def create_temp_file(self, mode='w', suffix='', prefix='tmp', dir=None, text=False, delete=True): fd, name = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir, text=text) fd = os.fdopen(fd, mode) if delete: self.addCleanup(self._delete_temp, fd, name) return fd, name def _delete_temp(self, fd, name): fd.close() os.unlink(name) os-service-types-1.7.0/os_service_types/tests/test_singleton.py0000666000175000017500000000236013466005577025144 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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_singleton ------------ Tests for `get_service_types` singleton factory function. """ import os_service_types from os_service_types.tests import base class TestSingleton(base.TestCase): def setUp(self): super(TestSingleton, self).setUp() # Make an object with no network access self.service_types = os_service_types.get_service_types() def test_singleton_same(self): service_types = os_service_types.get_service_types() self.assertTrue(service_types is self.service_types) def test_singleton_different(self): service_types = os_service_types.ServiceTypes() self.assertFalse(service_types is self.service_types) os-service-types-1.7.0/os_service_types/tests/test_data.py0000666000175000017500000000333413466005577024055 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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_data ------------ Tests for `os_service_types.data` module. """ import json import six from os_service_types import data from os_service_types.tests import base if six.PY2: # Python 2 has not FileNotFoundError exception FileNotFoundError = IOError class TestData(base.TestCase, base.TemporaryFileMixin): def setUp(self): super(TestData, self).setUp() def test_load(self): json_data = {'some_key': 'some_value'} filename = self.create_json(json_data) actual_data = data.read_data(filename) self.assertEqual(json_data, actual_data) def test_load_service_types(self): json_data = data.read_data('service-types.json') for key in ["all_types_by_service_type", "forward", "primary_service_by_project", "reverse"]: self.assertIn(key, json_data) def test_load_non_existing(self): self.assertRaises(FileNotFoundError, data.read_data, '/non-existing-file') def create_json(self, json_data): fd, name = self.create_temp_file(suffix='.json') with fd: json.dump(json_data, fd) return name os-service-types-1.7.0/os_service_types/tests/__init__.py0000666000175000017500000000000013466005577023627 0ustar zuulzuul00000000000000os-service-types-1.7.0/os_service_types/tests/test_builtin.py0000666000175000017500000000232513466005577024611 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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_builtin ------------ Tests for `ServiceTypes` class builtin data. oslotest sets up a TempHomeDir for us, so there should be no ~/.cache files available in these tests. """ from testscenarios import load_tests_apply_scenarios as load_tests # noqa import os_service_types from os_service_types.tests import base class TestBuiltin(base.TestCase, base.ServiceDataMixin): def setUp(self): super(TestBuiltin, self).setUp() # Make an object with no network access self.service_types = os_service_types.ServiceTypes() def test_builtin_version(self): self.assertEqual(self.builtin_version, self.service_types.version) os-service-types-1.7.0/os_service_types/tests/test_match.py0000666000175000017500000000410313466005577024233 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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_match ---------- Tests for is_match logic oslotest sets up a TempHomeDir for us, so there should be no ~/.cache files available in these tests. """ from testscenarios import load_tests_apply_scenarios as load_tests # noqa import os_service_types from os_service_types.tests import base class TestMatch(base.TestCase): scenarios = [ ('match-official', dict( requested='compute', found='compute', is_match=True)), ('direct-match-unknown', dict( requested='unknown', found='unknown', is_match=True)), ('volumev2-finds-block', dict( requested='volumev2', found='block-storage', is_match=True)), ('volumev3-finds-block', dict( requested='volumev3', found='block-storage', is_match=True)), ('block-finds-volumev2', dict( requested='block-storage', found='volumev2', is_match=True)), ('block-finds-volumev3', dict( requested='block-storage', found='volumev3', is_match=True)), ('volumev2-not-volumev3', dict( requested='volumev2', found='volumev3', is_match=False)), ('non-match', dict( requested='unknown', found='compute', is_match=False)), ] def setUp(self): super(TestMatch, self).setUp() # Make an object with no network access self.service_types = os_service_types.ServiceTypes() def test_is_match(self): self.assertEqual( self.is_match, self.service_types.is_match(self.requested, self.found)) os-service-types-1.7.0/os_service_types/tests/test_misc.py0000666000175000017500000000166113466005577024100 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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_misc --------- Miscellaneous tests """ from os_service_types import service_types from os_service_types.tests import base class TestMisc(base.TestCase): def test_normalize(self): self.assertEqual('foo-bar', service_types._normalize_type('foo_bar')) def test_normalize_none(self): self.assertIsNone(service_types._normalize_type(None)) os-service-types-1.7.0/requirements.txt0000666000175000017500000000036313466005577020267 0ustar zuulzuul00000000000000# 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 os-service-types-1.7.0/tox.ini0000666000175000017500000000234713466005577016322 0ustar zuulzuul00000000000000[tox] minversion = 2.0 envlist = py35,py37,py27,pep8 skipsdist = True [testenv] usedevelop = True install_command = pip install {opts} {packages} setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = stestr run --slowest {posargs} [testenv:pep8] basepython = python3 commands = flake8 {posargs} [testenv:venv] basepython = python3 commands = {posargs} [testenv:cover] basepython = python3 setenv = PYTHON=coverage run --source os_service_types --parallel-mode commands = stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report [testenv:docs] basepython = python3 commands = python setup.py build_sphinx [testenv:releasenotes] basepython = python3 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:debug] basepython = python3 commands = oslo_debug_helper {posargs} [flake8] show-source = True builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build os-service-types-1.7.0/README.rst0000666000175000017500000000161313466005577016471 0ustar zuulzuul00000000000000================ os-service-types ================ Python library for consuming OpenStack sevice-types-authority data The `OpenStack Service Types Authority`_ contains information about official OpenStack services and their historical ``service-type`` aliases. The data is in JSON and the latest data should always be used. This simple library exists to allow for easy consumption of the data, along with a built-in version of the data to use in case network access is for some reason not possible and local caching of the fetched data. * Free software: Apache license * Documentation: https://docs.openstack.org/os-service-types/latest/ * Source: https://opendev.org/openstack/os-service-types * Bugs: https://storyboard.openstack.org/#!/project/904 * Release notes: https://docs.openstack.org/releasenotes/os-service-types/ .. _OpenStack Service Types Authority: https://service-types.openstack.org/ os-service-types-1.7.0/.zuul.yaml0000666000175000017500000000037113466005577016743 0ustar zuulzuul00000000000000- project: templates: - openstack-python-jobs - openstack-python35-jobs - openstack-python36-jobs - openstack-python37-jobs - publish-openstack-docs-pti - check-requirements - release-notes-jobs-python3 os-service-types-1.7.0/os_service_types.egg-info/0000775000175000017500000000000013466005776022057 5ustar zuulzuul00000000000000os-service-types-1.7.0/os_service_types.egg-info/PKG-INFO0000664000175000017500000000355313466005776023162 0ustar zuulzuul00000000000000Metadata-Version: 1.1 Name: os-service-types Version: 1.7.0 Summary: Python library for consuming OpenStack sevice-types-authority data Home-page: https://docs.openstack.org/os-service-types/latest/ Author: OpenStack Author-email: openstack-discuss@lists.openstack.org License: UNKNOWN Description: ================ os-service-types ================ Python library for consuming OpenStack sevice-types-authority data The `OpenStack Service Types Authority`_ contains information about official OpenStack services and their historical ``service-type`` aliases. The data is in JSON and the latest data should always be used. This simple library exists to allow for easy consumption of the data, along with a built-in version of the data to use in case network access is for some reason not possible and local caching of the fetched data. * Free software: Apache license * Documentation: https://docs.openstack.org/os-service-types/latest/ * Source: https://opendev.org/openstack/os-service-types * Bugs: https://storyboard.openstack.org/#!/project/904 * Release notes: https://docs.openstack.org/releasenotes/os-service-types/ .. _OpenStack Service Types Authority: https://service-types.openstack.org/ Platform: UNKNOWN Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 os-service-types-1.7.0/os_service_types.egg-info/requires.txt0000664000175000017500000000002313466005776024452 0ustar zuulzuul00000000000000pbr!=2.1.0,>=2.0.0 os-service-types-1.7.0/os_service_types.egg-info/top_level.txt0000664000175000017500000000002113466005776024602 0ustar zuulzuul00000000000000os_service_types os-service-types-1.7.0/os_service_types.egg-info/dependency_links.txt0000664000175000017500000000000113466005776026125 0ustar zuulzuul00000000000000 os-service-types-1.7.0/os_service_types.egg-info/pbr.json0000664000175000017500000000005613466005776023536 0ustar zuulzuul00000000000000{"git_version": "0b2f473", "is_release": true}os-service-types-1.7.0/os_service_types.egg-info/not-zip-safe0000664000175000017500000000000113466005776024305 0ustar zuulzuul00000000000000 os-service-types-1.7.0/os_service_types.egg-info/SOURCES.txt0000664000175000017500000000305713466005776023750 0ustar zuulzuul00000000000000.coveragerc .mailmap .stestr.conf .zuul.yaml AUTHORS CONTRIBUTING.rst ChangeLog HACKING.rst LICENSE README.rst requirements.txt setup.cfg setup.py test-requirements.txt tox.ini doc/source/conf.py doc/source/index.rst doc/source/readme.rst doc/source/contributor/contributing.rst doc/source/contributor/index.rst doc/source/install/index.rst doc/source/library/index.rst doc/source/reference/index.rst os_service_types/__init__.py os_service_types/exc.py os_service_types/service_types.py os_service_types.egg-info/PKG-INFO os_service_types.egg-info/SOURCES.txt os_service_types.egg-info/dependency_links.txt os_service_types.egg-info/not-zip-safe os_service_types.egg-info/pbr.json os_service_types.egg-info/requires.txt os_service_types.egg-info/top_level.txt os_service_types/data/__init__.py os_service_types/data/service-types.json os_service_types/tests/__init__.py os_service_types/tests/base.py os_service_types/tests/test_builtin.py os_service_types/tests/test_data.py os_service_types/tests/test_match.py os_service_types/tests/test_misc.py os_service_types/tests/test_remote.py os_service_types/tests/test_singleton.py os_service_types/tests/test_warn.py releasenotes/notes/.placeholder releasenotes/notes/add-service-types-class-574caf54f7461163.yaml releasenotes/notes/get-service-types-f5e56799a55a6df4.yaml releasenotes/notes/missed-notes-d16705a6a56eb3c6.yaml releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/master.rst releasenotes/source/unreleased.rst releasenotes/source/_static/.placeholder releasenotes/source/_templates/.placeholderos-service-types-1.7.0/.coveragerc0000666000175000017500000000011513466005577017117 0ustar zuulzuul00000000000000[run] branch = True source = os_service_types [report] ignore_errors = True os-service-types-1.7.0/releasenotes/0000775000175000017500000000000013466005776017471 5ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/notes/0000775000175000017500000000000013466005776020621 5ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/notes/.placeholder0000666000175000017500000000000013466005577023073 0ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/notes/missed-notes-d16705a6a56eb3c6.yaml0000666000175000017500000000054313466005577026334 0ustar zuulzuul00000000000000--- features: - | Added ``permissive`` flag to ``get_service_type`` defaulting to ``False`` to allow returning the given type instead of ``None`` if the given type is unknown. - | Added ``container-infra`` alias for ``container-infrastructure-management``. - | Added ``function-engine`` service type for ``qinling`` project. os-service-types-1.7.0/releasenotes/notes/get-service-types-f5e56799a55a6df4.yaml0000666000175000017500000000042713466005577027331 0ustar zuulzuul00000000000000--- features: - | Factory function ``os_service_types.get_service_types`` added. Returns a singleton instance of ServiceTypes. ServiceTypes is a very low cost object in the first place, but it does read a data file from disk and then the data is pretty static. os-service-types-1.7.0/releasenotes/notes/add-service-types-class-574caf54f7461163.yaml0000666000175000017500000000025213466005577030222 0ustar zuulzuul00000000000000--- features: - Added ServiceTypes class, which is the primary entry point for Python developers who need access to the OpenStack Service Types Authority data. os-service-types-1.7.0/releasenotes/source/0000775000175000017500000000000013466005776020771 5ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/source/index.rst0000666000175000017500000000026113466005577022632 0ustar zuulzuul00000000000000============================================ os_service_types Release Notes ============================================ .. toctree:: :maxdepth: 1 unreleased master os-service-types-1.7.0/releasenotes/source/_static/0000775000175000017500000000000013466005776022417 5ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/source/_static/.placeholder0000666000175000017500000000000013466005577024671 0ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/source/conf.py0000666000175000017500000002176213466005577022301 0ustar zuulzuul00000000000000# -*- coding: utf-8 -*- # 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 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'os-service-types Release Notes' copyright = u'2017, OpenStack Developers' # openstackdocstheme options repository_name = 'openstack/os-service-types' bug_project = '904' bug_tag = '' html_last_updated_fmt = '%Y-%m-%d %H:%M' # 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. # The full version, including alpha/beta/rc tags. release = '' # The short X.Y version. version = '' # 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' # 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 = 'os_service_typesReleaseNotesdoc' # -- 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', 'os_service_typesReleaseNotes.tex', u'os_service_types Release Notes 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 # 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', 'os_service_typesrereleasenotes', u'os_service_types Release Notes Documentation', [u'OpenStack 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', 'os_service_types ReleaseNotes', u'os_service_types Release Notes Documentation', u'OpenStack Developers', 'os_service_typesReleaseNotes', 'One line description of project.', '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/'] os-service-types-1.7.0/releasenotes/source/_templates/0000775000175000017500000000000013466005776023126 5ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/source/_templates/.placeholder0000666000175000017500000000000013466005577025400 0ustar zuulzuul00000000000000os-service-types-1.7.0/releasenotes/source/master.rst0000666000175000017500000000021413466005577023014 0ustar zuulzuul00000000000000=================================== master Series Release Notes =================================== .. release-notes:: :branch: master os-service-types-1.7.0/releasenotes/source/unreleased.rst0000666000175000017500000000016013466005577023650 0ustar zuulzuul00000000000000============================== Current Series Release Notes ============================== .. release-notes:: os-service-types-1.7.0/setup.py0000666000175000017500000000200613466005577016511 0ustar zuulzuul00000000000000# 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) os-service-types-1.7.0/ChangeLog0000664000175000017500000000455213466005776016560 0ustar zuulzuul00000000000000CHANGES ======= 1.7.0 ----- * Updated from OpenStack Service Type Authority * Update links for opendev * OpenDev Migration Patch * add python 3.7 unit test job 1.6.0 ----- * Updated from OpenStack Service Type Authority 1.5.0 ----- * Updated from OpenStack Service Type Authority * Update home-page * Update hacking version * Change openstack-dev to openstack-discuss 1.4.0 ----- * Updated from OpenStack Service Type Authority * Update the hacking to latst * Don't quote {posargs} in tox.ini * Removed older version of python added 3.5 * Add unittest for os\_service\_types.data module * Use keystoneauth only in applicable test * Close descriptor after reading file * add python 3.6 unit test job * switch documentation job to new PTI * import zuul job settings from project-config 1.3.0 ----- * Add missing release notes * Fix service\_type normalization * Add flag for returning unofficial types * Allow passing in service types with \_ in them * Updated from OpenStack Service Type Authority * Switch to stestr * Add release note link in README * fix tox python3 overrides * Updated from global requirements * Fix docs link in the README * Updated from OpenStack Service Type Authority * Updated from global requirements * Updated from global requirements 1.2.0 ----- * Updated from OpenStack Service Type Authority * Sort json data * Updated from global requirements * Updated from global requirements * Add factory helper function which returns a singleton * Updated from global requirements * Remove -U from pip install * Updated from global requirements * Remove reference to stable/pike from releasenotes * Avoid tox\_install.sh for constraints support * Updated from global requirements * Update api-refs * Updated from global requirements * Updated from global requirements 1.1.0 ----- * Sync from latest service-types-authority * Consume new mapping fields from service-type-authority * Support secondary services * Update unittests to be able to sync latest data * Update reno for stable/pike * Updated from global requirements * Use tox\_install.sh to install dependencies 1.0.0 ----- * Add ability to warn on use of non-official types * Refresh local service-types.json * Throw an exception on conflicting arguments * Updated from global requirements * Updated from global requirements * Implement fetching and accessor methods * Add cookiecutter boilerplate * Added .gitreview os-service-types-1.7.0/.mailmap0000666000175000017500000000013113466005577016415 0ustar zuulzuul00000000000000# Format is: # #