diff options
author | rabi <ramishra@redhat.com> | 2016-12-08 12:48:58 +0530 |
---|---|---|
committer | rabi <ramishra@redhat.com> | 2016-12-08 13:03:20 +0530 |
commit | 3d60183120ca709e4298fa516bc1c7b639db770b (patch) | |
tree | fd423b4db5daabf6b959477f622622fd5a1e3a22 | |
parent | 1eb72804d62da2216afe4a5a83919bf47f229746 (diff) | |
download | python-heatclient-3d60183120ca709e4298fa516bc1c7b639db770b.tar.gz |
Fix doc on keystoneauth session api usage
This fixes documentation on client creation with keystoneauth
session api.
Change-Id: I0f6bb6f4f9bbaa84b5185c0a9e9db6a4184702d4
Partial-Bug: #1646539
-rw-r--r-- | doc/source/index.rst | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst index cd3fcff..0080645 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -22,18 +22,23 @@ Once you have done so, you can use the API like so:: Alternatively, you can create a client instance using the keystoneauth session API:: + >>> from keystoneauth1 import loading >>> from keystoneauth1 import session - >>> from keystoneauth1.identity import v3 >>> from heatclient import client - >>> password = v3.PasswordMethod(username=USERNAME, - ... password=PASSWORD, - ... user_domain_name=DEFAULT) - >>> auth = v3.Auth(auth_url=AUTH_URL, auth_methods=[password], - ... project_id=PROJECT_ID) + >>> loader = loading.get_plugin_loader('password') + >>> auth = loader.load_from_options(auth_url=AUTH_URL, + ... username=USERNAME, + ... password=PASSWORD, + ... project_id=PROJECT_ID) >>> sess = session.Session(auth=auth) - >>> heat = client.Client('1', endpoint=heat_url, session=sess) + >>> heat = client.Client('1', session=sess) >>> heat.stacks.list() +If you have PROJECT_NAME instead of a PROJECT_ID, use the project_name +parameter. Similarly, if your cloud uses keystone v3 and you have a DOMAIN_NAME +or DOMAIN_ID, provide it as `user_domain_(name|id)` and if you are using a +PROJECT_NAME also provide the domain information as `project_domain_(name|id)`. + For more information on keystoneauth API, see `Using Sessions`_. .. _Using Sessions: http://docs.openstack.org/developer/keystoneauth/using-sessions.html |