add escalator cli framework
[escalator.git] / client / doc / source / apiv2.rst
1 Python API v1
2 =============
3
4 To create a client::
5
6    from keystoneclient.auth.identity import v2 as identity
7    from keystoneclient import session
8    from escalatorclient import Client
9
10    auth = identity.Password(auth_url=AUTH_URL,
11                             username=USERNAME,
12                             password=PASSWORD,
13                             tenant_name=PROJECT_ID)
14
15    sess = session.Session(auth=auth)
16    token = auth.get_token(sess)
17
18    escalator = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=token)
19
20
21 List
22 ----
23 List nodes you can access::
24
25    for node in escalator.nodes.list():
26       print node
27