Update README to comply with Identity v3

Updated the README instructions to use Identity V3 parameters
and removed the reference to the deprecated Nova 2.0 as an auth endpoint.

Change-Id: I78bef987986c461651ba4331bc7cc7db97ce91fb
This commit is contained in:
Joao Targino 2016-06-16 16:17:31 -03:00
parent a70de7e590
commit 5f63dee350
1 changed files with 21 additions and 15 deletions

View File

@ -51,24 +51,21 @@ Installing this package gets you a shell command, ``nova``, that you
can use to interact with any OpenStack cloud. can use to interact with any OpenStack cloud.
You'll need to provide your OpenStack username and password. You can do this You'll need to provide your OpenStack username and password. You can do this
with the ``--os-username``, ``--os-password`` and ``--os-tenant-name`` with the ``--os-username``, ``--os-password`` and ``--os-project-name``
params, but it's easier to just set them as environment variables:: params, but it's easier to just set them as environment variables::
export OS_USERNAME=openstack export OS_USERNAME=<username>
export OS_PASSWORD=yadayada export OS_PASSWORD=<password>
export OS_TENANT_NAME=myproject export OS_PROJECT_NAME=<project-name>
You will also need to define the authentication url with ``--os-auth-url`` You will also need to define the authentication url with ``--os-auth-url``
and the version of the API with ``--os-compute-api-version``. Or set them as and the version of the API with ``--os-compute-api-version``. Or set them as
an environment variables as well:: environment variables as well and set the OS_AUTH_URL to the keystone endpoint::
export OS_AUTH_URL=http://example.com:8774/v2/ export OS_AUTH_URL=http://<url-to-openstack-keystone>:5000/v3/
export OS_COMPUTE_API_VERSION=2 export OS_COMPUTE_API_VERSION=2.1
If you are using Keystone, you need to set the OS_AUTH_URL to the keystone
endpoint::
export OS_AUTH_URL=http://example.com:5000/v2.0/
Since Keystone can return multiple regions in the Service Catalog, you Since Keystone can return multiple regions in the Service Catalog, you
can specify the one you want with ``--os-region-name`` (or can specify the one you want with ``--os-region-name`` (or
@ -85,13 +82,22 @@ There's also a complete Python API, with documentation linked below.
To use with keystone as the authentication system:: To use with keystone as the authentication system::
>>> from keystoneauth1.identity import v3
>>> from keystoneauth1 import session
>>> from novaclient import client >>> from novaclient import client
>>> nt = client.Client(VERSION, USER, PASSWORD, TENANT, AUTH_URL) >>> auth = v3.Password(auth_url='http://example.com:5000/v3',
>>> nt.flavors.list() ... username='username',
... password='password',
... project_name='project-name',
... user_domain_id='default',
... project_domain_id='default')
>>> sess = session.Session(auth=auth)
>>> nova = client.Client("2.1", session=sess)
>>> nova.flavors.list()
[...] [...]
>>> nt.servers.list() >>> nova.servers.list()
[...] [...]
>>> nt.keypairs.list() >>> nova.keypairs.list()
[...] [...]