diff options
author | Joao Targino <joaotargino@gmail.com> | 2016-06-16 16:17:31 -0300 |
---|---|---|
committer | Joao Targino <joaotargino@gmail.com> | 2016-06-16 16:30:23 -0300 |
commit | 5f63dee3506cce11f3ef8495327304e6b64732e6 (patch) | |
tree | aebe9a9b202e3022738a222dd82e6db9b3eacaa5 /README.rst | |
parent | a70de7e5900fd0e71e49b31e81e3f8c23f0c1c83 (diff) | |
download | python-novaclient-5f63dee3506cce11f3ef8495327304e6b64732e6.tar.gz |
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
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 36 |
1 files changed, 21 insertions, 15 deletions
@@ -51,24 +51,21 @@ Installing this package gets you a shell command, ``nova``, that you can use to interact with any OpenStack cloud. 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:: - export OS_USERNAME=openstack - export OS_PASSWORD=yadayada - export OS_TENANT_NAME=myproject + export OS_USERNAME=<username> + export OS_PASSWORD=<password> + export OS_PROJECT_NAME=<project-name> + 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 -an environment variables as well:: - - export OS_AUTH_URL=http://example.com:8774/v2/ - export OS_COMPUTE_API_VERSION=2 +environment variables as well and set the OS_AUTH_URL to the keystone endpoint:: -If you are using Keystone, you need to set the OS_AUTH_URL to the keystone -endpoint:: + export OS_AUTH_URL=http://<url-to-openstack-keystone>:5000/v3/ + export OS_COMPUTE_API_VERSION=2.1 - export OS_AUTH_URL=http://example.com:5000/v2.0/ Since Keystone can return multiple regions in the Service Catalog, you 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:: + >>> from keystoneauth1.identity import v3 + >>> from keystoneauth1 import session >>> from novaclient import client - >>> nt = client.Client(VERSION, USER, PASSWORD, TENANT, AUTH_URL) - >>> nt.flavors.list() + >>> auth = v3.Password(auth_url='http://example.com:5000/v3', + ... 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() [...] |