| 1 |
=============================== |
| 2 |
Transition from OpenStackClient |
| 3 |
=============================== |
| 4 |
|
| 5 |
``osc-lib`` was extracted from the main OpenStackClient repo after the |
| 6 |
OSC 2.4.0 release. During the migration all module names have changed |
| 7 |
from ``openstackclient.*`` to ``osc_lib.*``. In addition, some re-arranging |
| 8 |
has been done internally to better align modules. |
| 9 |
|
| 10 |
The complete list of public module name changes: |
| 11 |
|
| 12 |
* ``openstackclient.api.api`` -> ``osc_lib.api.api`` |
| 13 |
* ``openstackclient.api.auth`` -> ``osc_lib.api.auth`` |
| 14 |
* ``openstackclient.api.utils`` -> ``osc_lib.api.utils`` |
| 15 |
* ``openstackclient.common.command`` -> ``osc_lib.command.command`` |
| 16 |
* ``openstackclient.common.commandmanager`` -> |
| 17 |
``osc_lib.command.commandmanager`` |
| 18 |
* ``openstackclient.common.exceptions`` -> ``osc_lib.exceptions`` |
| 19 |
* ``openstackclient.common.logs`` -> ``osc_lib.logs`` |
| 20 |
* ``openstackclient.common.parseractions`` -> ``osc_lib.cli.parseractions`` |
| 21 |
* ``openstackclient.common.session`` -> ``osc_lib.session`` |
| 22 |
* ``openstackclient.common.utils`` -> ``osc_lib.utils`` |
| 23 |
* ``openstackclient.tests.fakes`` -> ``osc_lib.tests.fakes`` |
| 24 |
* ``openstackclient.tests.utils`` -> ``osc_lib.tests.utils`` |
| 25 |
|
| 26 |
Additional Changes |
| 27 |
================== |
| 28 |
|
| 29 |
In addition to the existing public modules, other parts of OSC have been |
| 30 |
extracted, including the base ``Command``, ``CommandManager``, |
| 31 |
``ClientManager`` and ``Session`` classes. |
| 32 |
|
| 33 |
ClientManager |
| 34 |
------------- |
| 35 |
|
| 36 |
The OSC ``ClientManager`` is responsible for managing all of the handles to the |
| 37 |
individual API client objects as well as coordinating session and |
| 38 |
authentication objects. |
| 39 |
|
| 40 |
Plugins are encouraged to use the ClientManager interface for obtaining |
| 41 |
information about global configuration. |
| 42 |
|
| 43 |
* ``openstackclient.common.clientmanager`` -> ``osc_lib.clientmanager`` |
| 44 |
* All of the handling of the ``verify``/``insecure``/``cacert`` configuration |
| 45 |
options has been consolidated into ``ClientManager``. This converts the |
| 46 |
``--verify``, ``--insecure`` and ``--os-cacert`` options into a |
| 47 |
``Requests``-compatible ``verify`` attribute and a ``cacert`` attribute for |
| 48 |
the legacy client libraries. both are now public; the ``_insecure`` attribute |
| 49 |
has been removed. |
| 50 |
|
| 51 |
.. list-table:: Verify/Insecure/CACert |
| 52 |
:header-rows: 1 |
| 53 |
|
| 54 |
* - --verify |
| 55 |
- --insecure |
| 56 |
- --cacert |
| 57 |
- Result |
| 58 |
* - None |
| 59 |
- None |
| 60 |
- |
| 61 |
- ``verify=True``, ``cacert=None`` |
| 62 |
* - True |
| 63 |
- None |
| 64 |
- None |
| 65 |
- ``verify=True``, ``cacert=None`` |
| 66 |
* - None |
| 67 |
- True |
| 68 |
- None |
| 69 |
- ``verify=False``, ``cacert=None`` |
| 70 |
* - None |
| 71 |
- None |
| 72 |
- <filename> |
| 73 |
- ``verify=cacert``, ``cacert=<filename>`` |
| 74 |
* - True |
| 75 |
- None |
| 76 |
- <filename> |
| 77 |
- ``verify=cacert``, ``cacert=<filename>`` |
| 78 |
* - None |
| 79 |
- True |
| 80 |
- <filename> |
| 81 |
- ``verify=False``, ``cacert=None`` |
| 82 |
|
| 83 |
* A number of other ``ClientManager`` attributes have also been made public to |
| 84 |
encourage their direct use rather than reaching in to the global options |
| 85 |
passed in the ``ClientManager`` constructor: |
| 86 |
|
| 87 |
* ``_verify`` -> ``verify`` |
| 88 |
* ``_cacert`` -> ``cacert`` |
| 89 |
* ``_cert`` -> ``cert`` |
| 90 |
* ``_insecure`` -> removed, use '`not verify'` |
| 91 |
* ``_interface`` -> ``interface`` |
| 92 |
* ``_region_name`` -> ``region_name`` |
| 93 |
|
| 94 |
Shell |
| 95 |
===== |
| 96 |
|
| 97 |
* ``openstackclient.shell`` -> ``osc_lib.shell`` |
| 98 |
* Break up ``OpenStackShell.initialize_app()`` |
| 99 |
* leave all plugin initialization in OSC in ``_load_plugins()`` |
| 100 |
* leave all command loading in OSC in ``_load_commands()`` |
| 101 |
|
| 102 |
API |
| 103 |
=== |
| 104 |
|
| 105 |
The API base layer is the common point for all API subclasses. It is a |
| 106 |
wrapper around ``keystoneauth1.session.Session`` that fixes the ``request()`` |
| 107 |
interface and provides simple endpoint handling that is useful when a Service |
| 108 |
Catalog is either not available or is insufficient. It also adds simple |
| 109 |
implementations of the common API CRUD operations: create(), delete(), etc. |
| 110 |
|
| 111 |
* ``KeystoneSession`` -> merged into ``BaseAPI`` |