summaryrefslogtreecommitdiffstats
path: root/client/doc/source/apiv2.rst
diff options
context:
space:
mode:
authorZhou Ya <zhou.ya@zte.com.cn>2016-11-24 13:57:31 +0800
committerZhou Ya <zhou.ya@zte.com.cn>2016-11-28 15:25:44 +0800
commit3f262284f3ce78ce23b4e3c8e9fed112fc56e37d (patch)
treea00651eaff5d1aa60f1972c6b7172abcd1562297 /client/doc/source/apiv2.rst
parent7db4ee4e743d8ec55a4552560427c0ff37ec6de5 (diff)
add escalator cli framework
JIRA:ESCALATOR-36 This patch will support escalatorclient,and this is just the frame of escalatorclient,with this code you can use 'python setup.py sdist' to generate escalatorclient package. Change-Id: Id7b602345f7cb78bb548b589d1297a201056699a Signed-off-by: Zhou Ya <zhou.ya@zte.com.cn>
Diffstat (limited to 'client/doc/source/apiv2.rst')
-rw-r--r--client/doc/source/apiv2.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/client/doc/source/apiv2.rst b/client/doc/source/apiv2.rst
new file mode 100644
index 0000000..0695b2a
--- /dev/null
+++ b/client/doc/source/apiv2.rst
@@ -0,0 +1,27 @@
+Python API v1
+=============
+
+To create a client::
+
+ from keystoneclient.auth.identity import v2 as identity
+ from keystoneclient import session
+ from escalatorclient import Client
+
+ auth = identity.Password(auth_url=AUTH_URL,
+ username=USERNAME,
+ password=PASSWORD,
+ tenant_name=PROJECT_ID)
+
+ sess = session.Session(auth=auth)
+ token = auth.get_token(sess)
+
+ escalator = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=token)
+
+
+List
+----
+List nodes you can access::
+
+ for node in escalator.nodes.list():
+ print node
+