diff --git a/doc/source/index.rst b/doc/source/index.rst index cd3fcff4..0080645e 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