
This paragraph at the bottom of the connection page duplicates the content just above it. Change-Id: Icb718a469940d17dff7d0401ceb3f03e88d5af30
33 lines
1.1 KiB
ReStructuredText
33 lines
1.1 KiB
ReStructuredText
Connect
|
|
=======
|
|
|
|
In order to work with an OpenStack cloud you first need to create a
|
|
:class:`~openstack.connection.Connection` to it using your credentials. A
|
|
:class:`~openstack.connection.Connection` can be
|
|
created in 3 ways, using the class itself, :ref:`config-clouds-yaml`, or
|
|
:ref:`config-environment-variables`. It is recommended to always use
|
|
:ref:`config-clouds-yaml` as the same config can be used across tools and
|
|
languages.
|
|
|
|
Create Connection
|
|
-----------------
|
|
|
|
To create a :class:`~openstack.connection.Connection` instance, use the
|
|
:func:`~openstack.connect` factory function.
|
|
|
|
.. literalinclude:: ../examples/connect.py
|
|
:pyobject: create_connection
|
|
|
|
Full example at `connect.py <http://git.openstack.org/cgit/openstack/openstacksdk/tree/examples/connect.py>`_
|
|
|
|
.. note:: To enable logging, see the :doc:`logging` user guide.
|
|
|
|
Next
|
|
----
|
|
Now that you can create a connection, continue with the :ref:`user_guides`
|
|
to work with an OpenStack service.
|
|
|
|
.. TODO(shade) Update the text here and consolidate with the old
|
|
os-client-config docs so that we have a single and consistent explanation
|
|
of the envvars cloud, etc.
|