|
1 | 1 | stackdio-python-client |
2 | 2 | ====================== |
3 | 3 |
|
4 | | -[](https://travis-ci.org/stackdio/stackdio-python-client) |
| 4 | +|Travis CI| |
5 | 5 |
|
6 | 6 | The canonical Python client and cli for the stackd.io API |
7 | 7 |
|
8 | 8 |
|
9 | | -## Overview |
| 9 | +Overview |
| 10 | +-------- |
| 11 | + |
10 | 12 | This is a small set of tools for internal use of stackd.io. After cloning |
11 | 13 | this repo, you should be able to quickly get up and running with your own |
12 | 14 | stacks. |
13 | 15 |
|
14 | 16 | Advanced usage like creating custom blueprints or writing your own formulas is |
15 | 17 | beyond the scope of this. |
16 | 18 |
|
17 | | -## Installation |
18 | | -We recommend using virtualenv via [virtualenvwrapper] to install this in a |
| 19 | +Installation |
| 20 | +------------ |
| 21 | + |
| 22 | +We recommend using virtualenv via `virtualenvwrapper`_ to install this in a |
19 | 23 | virtualenv. If you consider yourself a knowledgeable Pythonista, feel free to |
20 | 24 | install this however you'd like, but this document will assume that you are |
21 | | -using virtualenvwrapper. See the full [virtualenvwrapper] docs for details, |
| 25 | +using virtualenvwrapper. See the full `virtualenvwrapper`_ docs for details, |
22 | 26 | but in short you can install it on most systems like: |
23 | 27 |
|
| 28 | +.. code:: bash |
| 29 | +
|
24 | 30 | pip install virtualenvwrapper |
25 | 31 |
|
26 | 32 | Once you've got it, installing this tool goes something like: |
27 | 33 |
|
| 34 | +.. code:: bash |
| 35 | +
|
28 | 36 | mkvirtualenv stackdio-client |
29 | 37 |
|
30 | | - # assuming you are in whatever dir you cloned this repo to: |
31 | | - pip install . |
| 38 | + pip install stackdio |
32 | 39 |
|
33 | 40 | You'll see a few things scrolling by, but should be set after this. To use |
34 | 41 | this later, you'll need to re-activate the virtualenv like: |
35 | 42 |
|
| 43 | +.. code:: bash |
| 44 | +
|
36 | 45 | workon stackdio-client |
37 | 46 |
|
38 | | -Whenever it's activated, `stackdio-cli` should be on your path. |
| 47 | +Whenever it's activated, ``stackdio-cli`` should be on your path. |
| 48 | + |
| 49 | +First Use |
| 50 | +--------- |
39 | 51 |
|
40 | | -## First Use |
41 | | -The first time that you fire up `stackdio-cli`, you'll need to run the |
42 | | -`initial_setup` command. This will prompt you for your LDAP username and |
| 52 | +The first time that you fire up ``stackdio-cli``, you'll need to run the |
| 53 | +``configure`` command. This will prompt you for your LDAP username and |
43 | 54 | password, and store them securely in your OS keychain for later use. It will |
44 | 55 | import some standard formula, and create a few commonly used blueprints. |
45 | 56 |
|
| 57 | +.. code:: bash |
| 58 | +
|
46 | 59 | $ stackdio-cli |
47 | 60 | None @ None |
48 | | - > initial_setup |
| 61 | + > configure |
49 | 62 | # YOU WILL BE WALKED THROUGH A SIMPLE SET OF QUESTIONS |
50 | 63 |
|
51 | | -## Stack Operations |
52 | | -All of the following assume that you have run `initial_setup` successfully. To |
| 64 | +Stack Operations |
| 65 | +---------------- |
| 66 | + |
| 67 | +All of the following assume that you have run ``initial_setup`` successfully. To |
53 | 68 | launch the cli, simply type: |
54 | 69 |
|
| 70 | +.. code:: bash |
| 71 | +
|
55 | 72 | $ stackdio-cli |
56 | 73 |
|
57 | | -You can run `help` at any point to see available commands. For details on a |
58 | | -specific command you can run `help COMMAND`, e.g. `help stacks`. The rest of |
| 74 | +You can run ``help`` at any point to see available commands. For details on a |
| 75 | +specific command you can run ``help COMMAND``, e.g. ``help stacks``. The rest of |
59 | 76 | these commands assume you have the cli running. |
60 | 77 |
|
61 | | -### Launching Stacks |
| 78 | +Launching Stacks |
| 79 | +~~~~~~~~~~~~~~~~ |
62 | 80 | Stacks are launched from blueprints. To launch the 3 node HBase stack that's |
63 | 81 | included with this you do: |
64 | 82 |
|
| 83 | +.. code:: bash |
| 84 | +
|
65 | 85 | > stacks launch cdh450-ipa-3 MYSTACKNAME |
66 | 86 |
|
67 | | -**NOTE:** To avoid DNS namespace collisions, the stack name needs to be unique. |
68 | | -An easy way to ensure this is to include your name in the stack name. |
69 | 87 |
|
70 | | -### Deleting Stacks |
| 88 | +.. note:: |
| 89 | + |
| 90 | + To avoid DNS namespace collisions, the stack name needs to be unique. |
| 91 | + An easy way to ensure this is to include your name in the stack name. |
| 92 | + |
| 93 | +Deleting Stacks |
| 94 | +~~~~~~~~~~~~~~~ |
| 95 | + |
71 | 96 | When you are done with a stack you can delete it. This is destructive and |
72 | 97 | cannot be recovered from, so think carefully before deleting your stack! |
73 | 98 |
|
| 99 | +.. code:: bash |
| 100 | +
|
74 | 101 | > stacks delete STACK_NAME |
75 | 102 |
|
76 | | -Alternatively you can `terminate` a stack which will terminate all instances, |
| 103 | +Alternatively you can ``terminate`` a stack which will terminate all instances, |
77 | 104 | but leave the stack definition in place. |
78 | 105 |
|
79 | | -### Provisioning Stacks |
| 106 | +Provisioning Stacks |
| 107 | +~~~~~~~~~~~~~~~~~~~ |
| 108 | + |
80 | 109 | Occassionally something will go wrong when launching your stack, e.g. network |
81 | 110 | connections may flake out causing some package installations to fail. If this |
82 | 111 | happens you can manually provision your stack, causing everything to be brought |
83 | 112 | back up to date: |
84 | 113 |
|
| 114 | +.. code:: bash |
| 115 | +
|
85 | 116 | > stacks provision STACK_NAME |
86 | 117 |
|
87 | | -### Stack Info |
| 118 | +Stack Info |
| 119 | +~~~~~~~~~~ |
| 120 | + |
88 | 121 | Once you have launched a stack, you can then monitor the status of it like: |
89 | 122 |
|
| 123 | +.. code:: bash |
| 124 | +
|
90 | 125 | > stacks history STACK_NAME |
91 | 126 |
|
92 | 127 | This displays the top level information for a stack. You can supply additional |
93 | 128 | arguments to pull back additional info about a stack. For example, to get a |
94 | 129 | list of FQDNs (aka hostnames) for a stack: |
95 | 130 |
|
| 131 | +.. code:: bash |
| 132 | +
|
96 | 133 | > stacks hostnames STACK_NAME |
97 | 134 |
|
98 | | -There are various logs available that you can access with the `stacks logs` |
| 135 | +There are various logs available that you can access with the ``stacks logs`` |
99 | 136 | command. |
100 | 137 |
|
101 | | -## What's Next? |
| 138 | +What's Next? |
| 139 | +------------ |
| 140 | + |
102 | 141 | For anything not covered by this tool, you'll need to use the stackdio-server web UI or |
103 | 142 | API directly. For more information on that, check out http://docs.stackd.io. |
104 | 143 |
|
105 | | -[virtualenvwrapper]: https://pypi.python.org/pypi/virtualenvwrapper |
| 144 | + |
| 145 | +.. |Travis CI| image:: https://travis-ci.org/stackdio/stackdio-python-client.svg?branch=master |
| 146 | + :target: https://travis-ci.org/stackdio/stackdio-python-client |
| 147 | + :alt: Build Status |
| 148 | + |
| 149 | +.. _virtualenvwrapper: https://pypi.python.org/pypi/virtualenvwrapper |
0 commit comments