summaryrefslogtreecommitdiff
path: root/doc/source/user/index.rst
blob: 2656e4254c53f07e57aff4df94b6fb883ab70849 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
=========================
 Trove Client User Guide
=========================

Command-line API
----------------

Installing this package gets you a shell command, ``trove``, that you
can use to interact with any OpenStack cloud.

You'll need to provide your OpenStack username and password. You can do this
with the ``--os-username``, ``--os-password`` and  ``--os-tenant-name``
params, but it's easier to just set them as environment variables::

    export OS_USERNAME=openstack
    export OS_PASSWORD=yadayada
    export OS_TENANT_NAME=myproject

You will also need to define the authentication url with ``--os-auth-url`` and
the version of the API with ``--os-database-api-version`` (default is version
1.0).  Or set them as an environment variables as well::

    export OS_AUTH_URL=http://example.com:5000/v2.0/
    export OS_AUTH_URL=1.0

If you are using Keystone, you need to set the OS_AUTH_URL to the keystone
endpoint::

        export OS_AUTH_URL=http://example.com:5000/v2.0/

Since Keystone can return multiple regions in the Service Catalog, you
can specify the one you want with ``--os-region-name`` (or
``export OS_REGION_NAME``). It defaults to the first in the list returned.

Argument ``--profile`` is available only when the osprofiler lib is installed.

You'll find complete documentation on the shell by running
``trove help``.

For more details, refer to :doc:`../cli/index`.

Python API
----------

There's also a complete Python API.

Quick-start using keystone::

    # use v2.0 auth with http://example.com:5000/v2.0/
    >>> from troveclient.v1 import client
    >>> nt = client.Client(USERNAME, PASSWORD, TENANT_NAME, AUTH_URL)
    >>> nt.datastores.list()
    [...]
    >>> nt.flavors.list()
    [...]
    >>> nt.instances.list()
    [...]

.. toctree::
   :maxdepth: 2

   api