Move Python API doc to the right folder
Change-Id: I8cdc6591ffc203e1770f27497a0a68b89ac1ba99
This commit is contained in:
parent
c352dbcc7e
commit
125598233f
@ -8,5 +8,6 @@ Contents:
|
|||||||
|
|
||||||
readme
|
readme
|
||||||
installation
|
installation
|
||||||
usage
|
usage_cli
|
||||||
|
usage_api
|
||||||
contributing
|
contributing
|
||||||
|
@ -10,9 +10,9 @@ Usage
|
|||||||
First, create an Almanach Client instance with your credentials::
|
First, create an Almanach Client instance with your credentials::
|
||||||
|
|
||||||
>>> from almanachclient.v1.client import Client
|
>>> from almanachclient.v1.client import Client
|
||||||
>>> almanach = Client(URL, AUTH_TOKEN)
|
>>> almanach = Client(ALMANACH_URL, AUTH_TOKEN)
|
||||||
|
|
||||||
Here ``URL`` will be a string that represents the url of your API.
|
Here ``ALMANACH_URL`` will be a string that represents the url of Almanach API.
|
||||||
``AUTH_TOKEN`` will be the authorization token you use to acces the API.
|
``AUTH_TOKEN`` will be the authorization token you use to acces the API.
|
||||||
|
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ You can also create a Keystone Client instance and access the API with it::
|
|||||||
|
|
||||||
>>> from almanachclient.keystone_client import KeystoneClient
|
>>> from almanachclient.keystone_client import KeystoneClient
|
||||||
>>> keystone_client = KeystoneClient(KEYSTONE_URL, USERNAME, PASSWORD, SERVICE, REGION)
|
>>> keystone_client = KeystoneClient(KEYSTONE_URL, USERNAME, PASSWORD, SERVICE, REGION)
|
||||||
>>> keystone_client.get_endpoint_url('admin')
|
>>> almanach_url = keystone_client.get_endpoint_url('admin')
|
||||||
|
|
||||||
In this case ``KEYSTONE_URL`` will be a string that represents the url of your keystone catalog.
|
In this case ``KEYSTONE_URL`` will be a string that represents the url of your keystone catalog.
|
||||||
The nature of ``USERNAME`` and ``PASSWORD`` speak for themselves. ``SERVICE`` will be a string
|
The nature of ``USERNAME`` and ``PASSWORD`` speak for themselves. ``SERVICE`` will be a string
|
||||||
@ -30,13 +30,14 @@ you use to identify the "almanach" service. ``REGION`` is used to determine whic
|
|||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
>>> import datetime
|
>>> import datetime
|
||||||
>>> from almanachclient.v1.client import Client
|
>>> from almanachclient.v1.client import Client
|
||||||
|
|
||||||
>>> start_date = datetime.datetime(2017,01,05)
|
>>> start_date = datetime.datetime(2017, 01, 05)
|
||||||
>>> end_date = datetime.datetime(2017,02,05)
|
>>> end_date = datetime.datetime(2017, 02, 05)
|
||||||
|
|
||||||
>>> almanach = Client('http://api.region.example.org', 'myApiAuthorizationToken')
|
>>> almanach = Client('http://api.region.example.org', 'myApiAuthorizationToken')
|
||||||
>>> almanach.get_info()
|
>>> almanach.get_info()
|
||||||
|
|
||||||
>>> almanach.get_volume_types()
|
>>> almanach.get_volume_types()
|
Loading…
x
Reference in New Issue
Block a user