summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Dunsmore <jasondunsmore@gmail.com>2017-02-10 17:12:22 -0600
committerJason Dunsmore <jasondunsmore@gmail.com>2017-02-15 14:16:39 -0600
commite6329a75f9536828c07fb2b65a30df20b18092ae (patch)
tree9514ade496a62f18445c19f15ce215e304d63a55
parent52af76481ff50b4b3c8914056231bfac2cd5ca86 (diff)
Add usage docs for magnum client2.5.0
Notes
Notes (review): Code-Review+2: Adrian Otto <adrian.otto@rackspace.com> Code-Review+2: yatin <yatin.karel@nectechnologies.in> Workflow+1: yatin <yatin.karel@nectechnologies.in> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 16 Feb 2017 04:50:45 +0000 Reviewed-on: https://review.openstack.org/433238 Project: openstack/python-magnumclient Branch: refs/heads/master
-rw-r--r--doc/source/usage.rst63
1 files changed, 58 insertions, 5 deletions
diff --git a/doc/source/usage.rst b/doc/source/usage.rst
index 6581f9a..2b1f49a 100644
--- a/doc/source/usage.rst
+++ b/doc/source/usage.rst
@@ -1,7 +1,60 @@
1======== 1Python bindings to the OpenStack Magnum API
2Usage 2===========================================
3========
4 3
5To use python-magnumclient in a project:: 4This is a client for the OpenStack Magnum API. It includes a Python
5API (the :mod:`magnumclient` module) and a command-line script
6(installed as :program:`magnum`).
6 7
7 import magnumclient \ No newline at end of file 8Python API
9==========
10
11To use python-magnumclient in a project, create a client instance
12using the keystoneauth session API::
13
14 from keystoneauth1.identity import v3
15 from keystoneauth1 import session
16 from keystoneclient.v3 import client
17
18 from magnumclient.client import Client
19
20 magnum_endpoint = "http://magnum.example.com:9511/v1"
21
22 auth = v3.Password(auth_url='http://my.keystone.com:5000/v3',
23 username='myuser',
24 password='mypassword',
25 project_name='myproject',
26 user_domain_id='default',
27 project_domain_id='default')
28 sess = session.Session(auth=auth)
29
30 magnum = Client('1', endpoint_override=magnum_endpoint, session=sess)
31 magnum.clusters.list()
32
33For more information on keystoneauth API, see `Using Sessions`_.
34
35.. _Using Sessions: http://docs.openstack.org/developer/keystoneauth/using-sessions.html
36
37Command-line tool
38=================
39
40In order to use the CLI, you must provide your OpenStack username,
41password, project name, user domain ID, project domain ID, and auth
42endpoint. Use the corresponding configuration options (--os-username,
43--os-password, --os-project-name, --os-project-domain-id,
44--os-user-domain-id, and --os-auth-url) or set them in environment
45variables::
46
47 export OS_USERNAME=myuser
48 export OS_PASSWORD=mypassword
49 export OS_PROJECT_NAME=myproject
50 export OS_USER_DOMAIN_ID=default
51 export OS_PROJECT_DOMAIN_ID=default
52 export OS_AUTH_URL=http://my.keystone.com:5000/v3
53
54From there, all shell commands take the form::
55
56 magnum <command> [arguments...]
57
58Run :program:`magnum help` to see a complete listing of available
59commands. Run :program:`magnum help <command>` to get detailed help
60for that command.