Statistics
| Branch: | Tag: | Revision:

root / docs / usage.rst @ c93d5123

History | View | Annotate | Download (21.7 kB)

1 8f489707 Stavros Sachtouris
Usage
2 8f489707 Stavros Sachtouris
=====
3 8f489707 Stavros Sachtouris
4 a6370d73 Stavros Sachtouris
Kamaki offers command line interfaces that implement specific command specifications. A detailed list of the command specifications can be found in `Commands <commands.html>`_ section. This guide covers the generic usage of both interfaces.
5 f23a5cdb Stavros Sachtouris
6 c93d5123 Stavros Sachtouris
What's more, kamaki offers a clients API that allows the development of external applications for synnefo. The clients API is listed in the `Clients lib <developers/code.html#the-clients-api>`_ section. The recommended method of utilizing this API is explained in the present.
7 f23a5cdb Stavros Sachtouris
8 961e6040 Stavros Sachtouris
Quick Setup
9 961e6040 Stavros Sachtouris
-----------
10 f23a5cdb Stavros Sachtouris
11 7536c9bf Stavros Sachtouris
Kamaki interfaces rely on a list of configuration options. In the initial state, kamaki is configured to communicate with the Okeanos IaaS. A detailed guide for setting up kamaki can be found in the `Setup <setup.html>`_ section.
12 f23a5cdb Stavros Sachtouris
13 961e6040 Stavros Sachtouris
It is essential for users to get a configuration token (okeanos.grnet.gr users go `here <https://accounts.okeanos.grnet.gr/im/>`_) and provide it to kamaki:
14 f23a5cdb Stavros Sachtouris
15 f23a5cdb Stavros Sachtouris
.. code-block:: console
16 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
17 f23a5cdb Stavros Sachtouris
18 961e6040 Stavros Sachtouris
    Example 1.1: Set user token to myt0k3n==
19 f23a5cdb Stavros Sachtouris
20 f3446cf0 Stavros Sachtouris
    $ kamaki set token myt0k3n==
21 f3446cf0 Stavros Sachtouris
22 7536c9bf Stavros Sachtouris
To use the storage service, a user should also provide the corresponding user-name:
23 f23a5cdb Stavros Sachtouris
24 f23a5cdb Stavros Sachtouris
.. code-block:: console
25 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
26 f23a5cdb Stavros Sachtouris
27 961e6040 Stavros Sachtouris
    Example 1.2: Set user name to user@domain.com
28 f23a5cdb Stavros Sachtouris
29 f3446cf0 Stavros Sachtouris
    $ kamaki set account user@domain.com
30 f3446cf0 Stavros Sachtouris
31 a6370d73 Stavros Sachtouris
Shell vs one-command
32 7536c9bf Stavros Sachtouris
--------------------
33 7536c9bf Stavros Sachtouris
Kamaki users can access synnefo services through either the interactive shell or the one-command behaviors. In practice, both systems rely on the same command set implementations and API clients, with identical responses and error messages. Still, there are some differences.
34 7536c9bf Stavros Sachtouris
35 a6370d73 Stavros Sachtouris
In favor of interactive shell behavior:
36 a6370d73 Stavros Sachtouris
37 a6370d73 Stavros Sachtouris
* tab completion for commands
38 7536c9bf Stavros Sachtouris
* session history with "up" / "down" keys
39 7536c9bf Stavros Sachtouris
* shorter commands with command context switching
40 a6370d73 Stavros Sachtouris
41 a6370d73 Stavros Sachtouris
In favor of one-command behavior:
42 a6370d73 Stavros Sachtouris
43 a6370d73 Stavros Sachtouris
* can be used along with advanced shell features (pipelines, redirection, etc.)
44 a6370d73 Stavros Sachtouris
* can be used in shell scripts
45 a6370d73 Stavros Sachtouris
* prints debug and verbose messages if needed
46 a6370d73 Stavros Sachtouris
47 f23a5cdb Stavros Sachtouris
Run as shell
48 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^
49 a6370d73 Stavros Sachtouris
To use kamaki as a shell, run:
50 f23a5cdb Stavros Sachtouris
51 f23a5cdb Stavros Sachtouris
* without any parameters or arguments
52 f23a5cdb Stavros Sachtouris
53 f23a5cdb Stavros Sachtouris
.. code-block:: console
54 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
55 f23a5cdb Stavros Sachtouris
56 f3446cf0 Stavros Sachtouris
    Example 2.2.1: Run kamaki shell
57 f23a5cdb Stavros Sachtouris
58 f3446cf0 Stavros Sachtouris
    $ kamaki
59 f23a5cdb Stavros Sachtouris
60 f23a5cdb Stavros Sachtouris
* with any kind of '-' prefixed arguments, except '-h', '--help'.
61 f23a5cdb Stavros Sachtouris
62 f23a5cdb Stavros Sachtouris
.. code-block:: console
63 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
64 f23a5cdb Stavros Sachtouris
65 f3446cf0 Stavros Sachtouris
    Example 2.2.2: Run kamaki shell with custom configuration file
66 f23a5cdb Stavros Sachtouris
67 f3446cf0 Stavros Sachtouris
    $ kamaki --config myconfig.file
68 f23a5cdb Stavros Sachtouris
69 f23a5cdb Stavros Sachtouris
70 f23a5cdb Stavros Sachtouris
Run as one-command
71 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^^^^^^
72 a6370d73 Stavros Sachtouris
To use kamaki as an one-command tool, run:
73 f23a5cdb Stavros Sachtouris
74 f23a5cdb Stavros Sachtouris
* with the '-h' or '--help' arguments (help for kamaki one-command)
75 f23a5cdb Stavros Sachtouris
76 f23a5cdb Stavros Sachtouris
.. code-block:: console
77 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
78 f23a5cdb Stavros Sachtouris
79 a6370d73 Stavros Sachtouris
    Example 2.3.1: Kamaki help
80 f23a5cdb Stavros Sachtouris
81 f3446cf0 Stavros Sachtouris
    $kamaki -h
82 f3446cf0 Stavros Sachtouris
83 f23a5cdb Stavros Sachtouris
* with one or more command parameters:
84 f23a5cdb Stavros Sachtouris
85 f23a5cdb Stavros Sachtouris
.. code-block:: console
86 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
87 f23a5cdb Stavros Sachtouris
88 a6370d73 Stavros Sachtouris
    Example 2.3.2: List VMs managed by user
89 f23a5cdb Stavros Sachtouris
90 f3446cf0 Stavros Sachtouris
    $ kamaki server list
91 f3446cf0 Stavros Sachtouris
92 457cb69b Stavros Sachtouris
One-command interface
93 7536c9bf Stavros Sachtouris
---------------------
94 a6370d73 Stavros Sachtouris
95 a6370d73 Stavros Sachtouris
Kamaki usage as a one-command tool is detailed in this section
96 a6370d73 Stavros Sachtouris
97 a6370d73 Stavros Sachtouris
Using help
98 7536c9bf Stavros Sachtouris
^^^^^^^^^^
99 a6370d73 Stavros Sachtouris
100 a6370d73 Stavros Sachtouris
Kamaki help is used to see available commands, with description, syntax and their corresponding optional arguments.
101 a6370d73 Stavros Sachtouris
102 a6370d73 Stavros Sachtouris
To see the command groups, users should use -h or --help like in example 1.3.1. In the same way, help information for command groups and commands is printed. In the following examples, the help messages of kamaki, of a command group (server) and of a command in that group (list) are shown.
103 a6370d73 Stavros Sachtouris
104 a6370d73 Stavros Sachtouris
.. code-block:: console
105 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
106 f3446cf0 Stavros Sachtouris
107 2151584b Stavros Sachtouris
    Example 3.1.1: kamaki help shows available parameters and command groups
108 f3446cf0 Stavros Sachtouris
109 a6370d73 Stavros Sachtouris
110 a6370d73 Stavros Sachtouris
    $ kamaki -h
111 f3446cf0 Stavros Sachtouris
    usage: kamaki <cmd_group> [<cmd_subbroup> ...] <cmd>
112 f3446cf0 Stavros Sachtouris
        [-s] [-V] [-i] [--config CONFIG] [-o OPTIONS] [-h]
113 a6370d73 Stavros Sachtouris
114 a6370d73 Stavros Sachtouris
    optional arguments:
115 a6370d73 Stavros Sachtouris
      -v, --verbose         More info at response
116 a6370d73 Stavros Sachtouris
      -s, --silent          Do not output anything
117 a6370d73 Stavros Sachtouris
      -V, --version         Print current version
118 a6370d73 Stavros Sachtouris
      -d, --debug           Include debug output
119 a6370d73 Stavros Sachtouris
      -i, --include         Include protocol headers in the output
120 a6370d73 Stavros Sachtouris
      --config CONFIG       Path to configuration file
121 a6370d73 Stavros Sachtouris
      -o OPTIONS, --options OPTIONS
122 a6370d73 Stavros Sachtouris
                            Override a config value
123 a6370d73 Stavros Sachtouris
      -h, --help            Show help message
124 a6370d73 Stavros Sachtouris
125 a6370d73 Stavros Sachtouris
    Options:
126 a6370d73 Stavros Sachtouris
     - - - -
127 a6370d73 Stavros Sachtouris
    astakos:  Astakos API commands
128 a6370d73 Stavros Sachtouris
    config :  Configuration commands
129 a6370d73 Stavros Sachtouris
    flavor :  Compute/Cyclades API flavor commands
130 a6370d73 Stavros Sachtouris
    history:  Command history
131 a6370d73 Stavros Sachtouris
    image  :  Compute/Cyclades or Glance API image commands
132 a6370d73 Stavros Sachtouris
    network:  Compute/Cyclades API network commands
133 a6370d73 Stavros Sachtouris
    server :  Compute/Cyclades API server commands
134 a6370d73 Stavros Sachtouris
    store  :  Pithos+ storage commands
135 a6370d73 Stavros Sachtouris
136 f3446cf0 Stavros Sachtouris
.. code-block:: console
137 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
138 a6370d73 Stavros Sachtouris
139 2151584b Stavros Sachtouris
    Example 3.1.2: Cyclades help contains all first-level commands of Cyclades command group
140 a6370d73 Stavros Sachtouris
141 a6370d73 Stavros Sachtouris
142 a6370d73 Stavros Sachtouris
    $ kamaki cyclades -h
143 a6370d73 Stavros Sachtouris
    usage: kamaki server <...> [-v] [-s] [-V] [-d] [-i] [--config CONFIG]
144 a6370d73 Stavros Sachtouris
                               [-o OPTIONS] [-h]
145 a6370d73 Stavros Sachtouris
146 a6370d73 Stavros Sachtouris
    optional arguments:
147 a6370d73 Stavros Sachtouris
      -v, --verbose         More info at response
148 a6370d73 Stavros Sachtouris
      -s, --silent          Do not output anything
149 a6370d73 Stavros Sachtouris
      -V, --version         Print current version
150 a6370d73 Stavros Sachtouris
      -d, --debug           Include debug output
151 a6370d73 Stavros Sachtouris
      -i, --include         Include protocol headers in the output
152 a6370d73 Stavros Sachtouris
      --config CONFIG       Path to configuration file
153 a6370d73 Stavros Sachtouris
      -o OPTIONS, --options OPTIONS
154 a6370d73 Stavros Sachtouris
                            Override a config value
155 a6370d73 Stavros Sachtouris
      -h, --help            Show help message
156 a6370d73 Stavros Sachtouris
157 a6370d73 Stavros Sachtouris
    Options:
158 a6370d73 Stavros Sachtouris
     - - - -
159 a6370d73 Stavros Sachtouris
    addmeta :  Add server metadata
160 a6370d73 Stavros Sachtouris
    addr    :  List a server's nic address
161 a6370d73 Stavros Sachtouris
    console :  Get a VNC console
162 a6370d73 Stavros Sachtouris
    create  :  Create a server
163 a6370d73 Stavros Sachtouris
    delete  :  Delete a server
164 a6370d73 Stavros Sachtouris
    delmeta :  Delete server metadata
165 a6370d73 Stavros Sachtouris
    firewall:  Set the server's firewall profile
166 a6370d73 Stavros Sachtouris
    info    :  Get server details
167 a6370d73 Stavros Sachtouris
    list    :  List servers
168 a6370d73 Stavros Sachtouris
    meta    :  Get a server's metadata
169 a6370d73 Stavros Sachtouris
    reboot  :  Reboot a server
170 a6370d73 Stavros Sachtouris
    rename  :  Update a server's name
171 a6370d73 Stavros Sachtouris
    setmeta :  Update server's metadata
172 a6370d73 Stavros Sachtouris
    shutdown:  Shutdown a server
173 a6370d73 Stavros Sachtouris
    start   :  Start a server
174 a6370d73 Stavros Sachtouris
    stats   :  Get server statistics
175 a6370d73 Stavros Sachtouris
    wait    :  Wait for server to finish [BUILD, STOPPED, REBOOT, ACTIVE]
176 a6370d73 Stavros Sachtouris
177 f3446cf0 Stavros Sachtouris
.. code-block:: console
178 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
179 a6370d73 Stavros Sachtouris
180 2151584b Stavros Sachtouris
    Example 3.1.3: Help for command "server list" with syntax, description and available user options
181 a6370d73 Stavros Sachtouris
182 a6370d73 Stavros Sachtouris
183 a6370d73 Stavros Sachtouris
    $ kamaki server list -h
184 f3446cf0 Stavros Sachtouris
    usage: kamaki server list [-V] [-i] [--config CONFIG] [-h] [-l]
185 a6370d73 Stavros Sachtouris
186 a6370d73 Stavros Sachtouris
    List servers
187 a6370d73 Stavros Sachtouris
188 a6370d73 Stavros Sachtouris
    optional arguments:
189 a6370d73 Stavros Sachtouris
      -v, --verbose         More info at response
190 a6370d73 Stavros Sachtouris
      -s, --silent          Do not output anything
191 a6370d73 Stavros Sachtouris
      -V, --version         Print current version
192 a6370d73 Stavros Sachtouris
      -d, --debug           Include debug output
193 a6370d73 Stavros Sachtouris
      -i, --include         Include protocol headers in the output
194 a6370d73 Stavros Sachtouris
      --config CONFIG       Path to configuration file
195 a6370d73 Stavros Sachtouris
      -o OPTIONS, --options OPTIONS
196 a6370d73 Stavros Sachtouris
                            Override a config value
197 a6370d73 Stavros Sachtouris
      -h, --help            Show help message
198 a6370d73 Stavros Sachtouris
      -l                    show detailed output
199 a6370d73 Stavros Sachtouris
200 e5d1d5c2 Stavros Sachtouris
.. _using-history-ref:
201 e5d1d5c2 Stavros Sachtouris
202 a6370d73 Stavros Sachtouris
Using history
203 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^
204 a6370d73 Stavros Sachtouris
205 a6370d73 Stavros Sachtouris
Kamaki command history is stored in a file at user home (".kamaki.history" by default). To set a custom history file path users must set the history.file config option (see `available config options <setup.html#editing-options>`_).
206 a6370d73 Stavros Sachtouris
207 a6370d73 Stavros Sachtouris
Every syntactically correct command is appended at the end of that file. In order to see how to use history, use the kamaki help system:
208 a6370d73 Stavros Sachtouris
209 a6370d73 Stavros Sachtouris
.. code-block:: console
210 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
211 f3446cf0 Stavros Sachtouris
212 2151584b Stavros Sachtouris
    Example 3.2.1: Available history options
213 f3446cf0 Stavros Sachtouris
214 a6370d73 Stavros Sachtouris
215 a6370d73 Stavros Sachtouris
    $ kamaki history -h
216 a6370d73 Stavros Sachtouris
    ...
217 a6370d73 Stavros Sachtouris
    clean:  Clean up history
218 a6370d73 Stavros Sachtouris
    show :  Show history
219 a6370d73 Stavros Sachtouris
220 a6370d73 Stavros Sachtouris
The following example showcases how to use history in kamaki
221 a6370d73 Stavros Sachtouris
222 a6370d73 Stavros Sachtouris
.. code-block:: console
223 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
224 f3446cf0 Stavros Sachtouris
225 2151584b Stavros Sachtouris
    Example 3.2.2: Clean up everything, run a kamaki command, show full and filtered history
226 f3446cf0 Stavros Sachtouris
    
227 a6370d73 Stavros Sachtouris
228 e5d1d5c2 Stavros Sachtouris
    $ kamaki history clean
229 a6370d73 Stavros Sachtouris
    $ kamaki server list
230 a6370d73 Stavros Sachtouris
    ...
231 a6370d73 Stavros Sachtouris
    $ kamaki history show
232 a6370d73 Stavros Sachtouris
    1.  kamaki server list
233 a6370d73 Stavros Sachtouris
    2.  kamaki history show
234 a6370d73 Stavros Sachtouris
    $ kamaki history show --match server
235 a6370d73 Stavros Sachtouris
    1. kamaki server list
236 a6370d73 Stavros Sachtouris
    3. kamaki history show --match server
237 a6370d73 Stavros Sachtouris
238 a6370d73 Stavros Sachtouris
Debug
239 7536c9bf Stavros Sachtouris
^^^^^
240 a6370d73 Stavros Sachtouris
241 7536c9bf Stavros Sachtouris
In case of errors, kamaki in debug mode shows useful debug information, like the stack trace, instead of a user-friendly error message. Kamaki also suppresses various warning messages that are also allowed in debug mode.
242 a6370d73 Stavros Sachtouris
243 a6370d73 Stavros Sachtouris
To run kamaki in debug mode use the -d or --debug option
244 a6370d73 Stavros Sachtouris
245 a6370d73 Stavros Sachtouris
Verbose
246 a6370d73 Stavros Sachtouris
"""""""
247 a6370d73 Stavros Sachtouris
248 7536c9bf Stavros Sachtouris
Most kamaki commands are translated into http requests. Kamaki clients API translated the semantics to REST and handles the response. Users who need to have access to these commands can use the verbose mode that presents the HTTP Request details as well as the full server response.
249 a6370d73 Stavros Sachtouris
250 a6370d73 Stavros Sachtouris
To run kamaki in verbose mode use the -v or --verbose option
251 a6370d73 Stavros Sachtouris
252 f3446cf0 Stavros Sachtouris
One-command features
253 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^^
254 a6370d73 Stavros Sachtouris
255 a6370d73 Stavros Sachtouris
Kamaki commands can be used along with advanced shell features.
256 a6370d73 Stavros Sachtouris
257 a6370d73 Stavros Sachtouris
.. code-block:: console
258 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
259 f3446cf0 Stavros Sachtouris
260 2151584b Stavros Sachtouris
    Example 3.4.1: Print username for token us3rt0k3n== using grep
261 f3446cf0 Stavros Sachtouris
    
262 a6370d73 Stavros Sachtouris
263 f3446cf0 Stavros Sachtouris
    $ kamaki astakos authenticate -o token=us3rt0k3n== | grep uniq
264 f3446cf0 Stavros Sachtouris
    uniq        : user@synnefo.org
265 a6370d73 Stavros Sachtouris
266 7536c9bf Stavros Sachtouris
The -o argument can be used to override temporarily various (set or unset) options. In one command, all -o options are forgotten just after the command had been completed, and the previous settings are restored (the configuration file is not modified).
267 a6370d73 Stavros Sachtouris
268 2151584b Stavros Sachtouris
The astakos-authenticate command in example 3.4.1 run against an explicitly provided token, which temporarily overrode the token provided in the configuration file.
269 457cb69b Stavros Sachtouris
270 457cb69b Stavros Sachtouris
Interactive shell
271 7536c9bf Stavros Sachtouris
-----------------
272 f23a5cdb Stavros Sachtouris
273 f3446cf0 Stavros Sachtouris
Kamaki interactive shell is details in this section
274 f3446cf0 Stavros Sachtouris
275 f3446cf0 Stavros Sachtouris
Command Contexts
276 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^^^^
277 f3446cf0 Stavros Sachtouris
278 2151584b Stavros Sachtouris
The kamaki interactive shell implements the notion of command contexts. Each command group is also a context where the users can **enter** by typing the group name. If the context switch is successful, the kamaki shell prompt changes to present the new context ("store" in example 4.1.1).
279 f3446cf0 Stavros Sachtouris
280 f3446cf0 Stavros Sachtouris
.. code-block:: console
281 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
282 f3446cf0 Stavros Sachtouris
283 2151584b Stavros Sachtouris
    Example 4.1.1: Enter store commands context / group
284 f3446cf0 Stavros Sachtouris
285 f3446cf0 Stavros Sachtouris
286 f3446cf0 Stavros Sachtouris
    $ kamaki
287 f3446cf0 Stavros Sachtouris
    [kamaki]:store
288 f3446cf0 Stavros Sachtouris
    [store]:
289 f3446cf0 Stavros Sachtouris
290 7536c9bf Stavros Sachtouris
Type **exit** or **ctrl-D** to exit a context and return to the context of origin. If already at the top context (kamaki), an exit is equivalent to exiting the program.
291 f3446cf0 Stavros Sachtouris
292 f3446cf0 Stavros Sachtouris
.. code-block:: console
293 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
294 f3446cf0 Stavros Sachtouris
295 2151584b Stavros Sachtouris
    Example 4.1.2: Exit store context and then exit kamaki
296 f3446cf0 Stavros Sachtouris
297 f3446cf0 Stavros Sachtouris
    [store]: exit
298 f3446cf0 Stavros Sachtouris
    [kamaki]: exit
299 f3446cf0 Stavros Sachtouris
    $
300 f3446cf0 Stavros Sachtouris
301 f3446cf0 Stavros Sachtouris
A user might **browse** through different contexts during one session.
302 f3446cf0 Stavros Sachtouris
303 f3446cf0 Stavros Sachtouris
.. code-block:: console
304 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
305 f3446cf0 Stavros Sachtouris
306 2151584b Stavros Sachtouris
    Example 4.1.3: Execute list command in different contexts
307 f3446cf0 Stavros Sachtouris
308 f3446cf0 Stavros Sachtouris
    $ kamaki
309 f3446cf0 Stavros Sachtouris
    [kamaki]:config
310 f3446cf0 Stavros Sachtouris
    [config]:list
311 f3446cf0 Stavros Sachtouris
    ... (configuration options listing) ...
312 f3446cf0 Stavros Sachtouris
    [config]:exit
313 f3446cf0 Stavros Sachtouris
    [kamaki]:store
314 f3446cf0 Stavros Sachtouris
    [store]:list
315 f3446cf0 Stavros Sachtouris
    ... (storage containers listing) ...
316 f3446cf0 Stavros Sachtouris
    [store]:exit
317 f3446cf0 Stavros Sachtouris
    [kamaki]:server
318 f3446cf0 Stavros Sachtouris
    [server]:list
319 f3446cf0 Stavros Sachtouris
    ... (VMs listing) ...
320 f3446cf0 Stavros Sachtouris
    [server]: exit
321 f3446cf0 Stavros Sachtouris
    [kamaki]:
322 f3446cf0 Stavros Sachtouris
323 2151584b Stavros Sachtouris
Users have the option to avoid switching between contexts: all commands can run from the **top context**. As a result, examples 4.1.3 and 4.1.4 are equivalent.
324 f3446cf0 Stavros Sachtouris
325 f3446cf0 Stavros Sachtouris
.. code-block:: console
326 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
327 f3446cf0 Stavros Sachtouris
328 2151584b Stavros Sachtouris
    Example 4.1.4: Execute different "list" commands from top context
329 f3446cf0 Stavros Sachtouris
330 f3446cf0 Stavros Sachtouris
331 f3446cf0 Stavros Sachtouris
    [kamaki]:config list
332 f3446cf0 Stavros Sachtouris
    ... (configuration options listing) ...
333 f3446cf0 Stavros Sachtouris
    [kamaki]:store list
334 f3446cf0 Stavros Sachtouris
    ... (storage container listing) ...
335 f3446cf0 Stavros Sachtouris
    [kamaki]:server list
336 f3446cf0 Stavros Sachtouris
    ... (VMs listing) ...
337 f3446cf0 Stavros Sachtouris
    [kamaki]:
338 f3446cf0 Stavros Sachtouris
339 7536c9bf Stavros Sachtouris
Using Help
340 7536c9bf Stavros Sachtouris
^^^^^^^^^^
341 f3446cf0 Stavros Sachtouris
342 f3446cf0 Stavros Sachtouris
There are two help mechanisms: a context-level and a command-level.
343 f3446cf0 Stavros Sachtouris
344 f3446cf0 Stavros Sachtouris
**Context-level help** lists the available commands in a context and can also offer a short description for each command.
345 f3446cf0 Stavros Sachtouris
346 f3446cf0 Stavros Sachtouris
Context-level help syntax::
347 f3446cf0 Stavros Sachtouris
348 f3446cf0 Stavros Sachtouris
    * Show available commands in current context *
349 f3446cf0 Stavros Sachtouris
    [context]:help
350 f3446cf0 Stavros Sachtouris
    [context]:?
351 f3446cf0 Stavros Sachtouris
352 f3446cf0 Stavros Sachtouris
    * Show help for command cmd *
353 f3446cf0 Stavros Sachtouris
    [context]:help cmd
354 f3446cf0 Stavros Sachtouris
    [context]:?cmd
355 f3446cf0 Stavros Sachtouris
356 f3446cf0 Stavros Sachtouris
The context-level help results change from context to context
357 f3446cf0 Stavros Sachtouris
358 f3446cf0 Stavros Sachtouris
.. code-block:: console
359 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
360 f3446cf0 Stavros Sachtouris
361 2151584b Stavros Sachtouris
    Example 4.2.1: Get available commands, pick a context and get help there as well
362 f3446cf0 Stavros Sachtouris
363 f3446cf0 Stavros Sachtouris
364 f3446cf0 Stavros Sachtouris
    [kamaki]:help
365 f3446cf0 Stavros Sachtouris
366 f3446cf0 Stavros Sachtouris
    kamaki commands:
367 f3446cf0 Stavros Sachtouris
    ================
368 f3446cf0 Stavros Sachtouris
    astakos  config  flavor  history  image  network  server  store
369 f3446cf0 Stavros Sachtouris
370 f3446cf0 Stavros Sachtouris
    interactive shell commands:
371 f3446cf0 Stavros Sachtouris
    ===========================
372 f3446cf0 Stavros Sachtouris
    exit  help  shell
373 f3446cf0 Stavros Sachtouris
374 f3446cf0 Stavros Sachtouris
    [kamaki]:?config
375 f3446cf0 Stavros Sachtouris
    Configuration commands (config -h for more options)
376 f3446cf0 Stavros Sachtouris
377 f3446cf0 Stavros Sachtouris
    [kamaki]:config
378 f3446cf0 Stavros Sachtouris
379 f3446cf0 Stavros Sachtouris
    [config]:?
380 f3446cf0 Stavros Sachtouris
381 f3446cf0 Stavros Sachtouris
    config commands:
382 f3446cf0 Stavros Sachtouris
    ================
383 f3446cf0 Stavros Sachtouris
    delete  get  list  set
384 f3446cf0 Stavros Sachtouris
385 f3446cf0 Stavros Sachtouris
    interactive shell commands:
386 f3446cf0 Stavros Sachtouris
    ===========================
387 f3446cf0 Stavros Sachtouris
    exit  help  shell
388 f3446cf0 Stavros Sachtouris
389 f3446cf0 Stavros Sachtouris
    [config]:help set
390 f3446cf0 Stavros Sachtouris
    Set a configuration option (set -h for more options)
391 f3446cf0 Stavros Sachtouris
392 7536c9bf Stavros Sachtouris
In context-level, there is a distinction between kamaki-commands and interactive shell commands. The former are available in one-command mode and are related to the cloud client setup and use, while the later are context-shell functions.
393 f3446cf0 Stavros Sachtouris
394 f3446cf0 Stavros Sachtouris
**Command-level help** prints the syntax, arguments and description of a specific (terminal) command
395 f3446cf0 Stavros Sachtouris
396 f3446cf0 Stavros Sachtouris
Command-level help syntax::
397 f3446cf0 Stavros Sachtouris
398 f3446cf0 Stavros Sachtouris
    * Get help for command cmd1 cmd2 ... cmdN *
399 f3446cf0 Stavros Sachtouris
    [context]:cmd1 cmd2 ... cmdN -h
400 f3446cf0 Stavros Sachtouris
    <syntax>
401 f3446cf0 Stavros Sachtouris
402 f3446cf0 Stavros Sachtouris
    <description>
403 f3446cf0 Stavros Sachtouris
404 7536c9bf Stavros Sachtouris
    <arguments and possible extensions>
405 f3446cf0 Stavros Sachtouris
406 f3446cf0 Stavros Sachtouris
Command-level help mechanism is exactly the same as the one used in one-command mode. For example, it is invoked by using the -h or --help parameter at any point.
407 f3446cf0 Stavros Sachtouris
408 f3446cf0 Stavros Sachtouris
.. code-block:: console
409 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
410 f3446cf0 Stavros Sachtouris
411 2151584b Stavros Sachtouris
    Example 4.2.2: Get command-level help for config and config-set
412 f3446cf0 Stavros Sachtouris
413 f3446cf0 Stavros Sachtouris
414 f3446cf0 Stavros Sachtouris
    [kamaki]:config --help
415 f3446cf0 Stavros Sachtouris
    config: Configuration commands
416 f3446cf0 Stavros Sachtouris
    delete:  Delete a configuration option (and use the default value)
417 f3446cf0 Stavros Sachtouris
    get   :  Show a configuration option
418 f3446cf0 Stavros Sachtouris
    list  :  List configuration options
419 f3446cf0 Stavros Sachtouris
    set   :  Set a configuration option
420 f3446cf0 Stavros Sachtouris
421 f3446cf0 Stavros Sachtouris
    [kamaki]:config
422 f3446cf0 Stavros Sachtouris
423 f3446cf0 Stavros Sachtouris
    [config]:set -h
424 f3446cf0 Stavros Sachtouris
    usage: set <option> <value> [-v] [-d] [-h] [-i] [--config CONFIG] [-s]
425 f3446cf0 Stavros Sachtouris
426 f3446cf0 Stavros Sachtouris
    Set a configuration option
427 f3446cf0 Stavros Sachtouris
428 f3446cf0 Stavros Sachtouris
    optional arguments:
429 f3446cf0 Stavros Sachtouris
      -v, --verbose    More info at response
430 f3446cf0 Stavros Sachtouris
      -d, --debug      Include debug output
431 f3446cf0 Stavros Sachtouris
      -h, --help       Show help message
432 f3446cf0 Stavros Sachtouris
      -i, --include    Include protocol headers in the output
433 f3446cf0 Stavros Sachtouris
      --config CONFIG  Path to configuration file
434 f3446cf0 Stavros Sachtouris
      -s, --silent     Do not output anything
435 f3446cf0 Stavros Sachtouris
436 2151584b Stavros Sachtouris
There are many ways of producing a help message, as shown in example 4.2.3
437 f3446cf0 Stavros Sachtouris
438 f3446cf0 Stavros Sachtouris
.. code-block:: console
439 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
440 f3446cf0 Stavros Sachtouris
441 2151584b Stavros Sachtouris
    Example 4.2.3: Equivalent calls of command-level help for config-set
442 f3446cf0 Stavros Sachtouris
443 f3446cf0 Stavros Sachtouris
444 f3446cf0 Stavros Sachtouris
    [config]:set -h
445 f3446cf0 Stavros Sachtouris
    [config]:set -help
446 f3446cf0 Stavros Sachtouris
    [kamaki]:config set -h
447 f3446cf0 Stavros Sachtouris
    [kamaki]:config set --help
448 f3446cf0 Stavros Sachtouris
    [store]:/config set -h
449 f3446cf0 Stavros Sachtouris
    [server]:/config set --help
450 f3446cf0 Stavros Sachtouris
451 e5d1d5c2 Stavros Sachtouris
.. _accessing-top-level-commands-ref:
452 e5d1d5c2 Stavros Sachtouris
453 f3446cf0 Stavros Sachtouris
Accessing top-level commands
454 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
455 f3446cf0 Stavros Sachtouris
456 7536c9bf Stavros Sachtouris
When working in a context, it is often useful to access other contexts or top-level commands. Kamaki offers access to top-level commands by using the / prefix, as shown bellow::
457 f3446cf0 Stavros Sachtouris
458 f3446cf0 Stavros Sachtouris
    * access a command "anothercontext cmd1 cmd2 ... cmdN"
459 f3446cf0 Stavros Sachtouris
    [context]:/anothercontext cmd1 cmd2 ... cmdN
460 f3446cf0 Stavros Sachtouris
461 2151584b Stavros Sachtouris
An example (4.3.1) that showcases how top-level access improves user experience is the creation of a VM. A VM is created with the command server-create. This command is called with three parameters:
462 f3446cf0 Stavros Sachtouris
463 f3446cf0 Stavros Sachtouris
* the name of the new VM
464 f3446cf0 Stavros Sachtouris
* the flavor id
465 f3446cf0 Stavros Sachtouris
* the image id
466 f3446cf0 Stavros Sachtouris
467 7536c9bf Stavros Sachtouris
It is often the case that a user who works in the context command, needs to create a new VM, but doesn't know the flavor or image id of preference. Therefore, it is necessary to list all available flavors (flavor-list) or images (image-list. Both commands belong to different contexts.
468 f3446cf0 Stavros Sachtouris
469 f3446cf0 Stavros Sachtouris
.. code-block:: console
470 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
471 f3446cf0 Stavros Sachtouris
472 2151584b Stavros Sachtouris
    Example 4.3.1: Create a VM from server context
473 f3446cf0 Stavros Sachtouris
474 f3446cf0 Stavros Sachtouris
    [server]:create -h
475 f3446cf0 Stavros Sachtouris
    create <name> <flavor id> <image id> ...
476 f3446cf0 Stavros Sachtouris
    ...
477 f3446cf0 Stavros Sachtouris
    
478 f3446cf0 Stavros Sachtouris
    [server]:/flavor list
479 f3446cf0 Stavros Sachtouris
    ...
480 f3446cf0 Stavros Sachtouris
    20. AFLAVOR
481 f3446cf0 Stavros Sachtouris
        SNF:disk_template:  drbd
482 f3446cf0 Stavros Sachtouris
        cpu              :  4
483 f3446cf0 Stavros Sachtouris
        disk             :  10
484 f3446cf0 Stavros Sachtouris
        id               :  43
485 f3446cf0 Stavros Sachtouris
        ram              :  2048
486 f3446cf0 Stavros Sachtouris
    
487 f3446cf0 Stavros Sachtouris
    [server]:/image list
488 f3446cf0 Stavros Sachtouris
    1580deb4-edb3-7a246c4c0528 (Ubuntu Desktop)
489 f3446cf0 Stavros Sachtouris
    18a82962-43eb-8f8880af89d7 (Windows 7)
490 f3446cf0 Stavros Sachtouris
    531aa018-9a40-a4bfe6a0caff (Windows XP)
491 f3446cf0 Stavros Sachtouris
    6aa6eafd-dccb-67fe2bdde87e (Debian Desktop)
492 f3446cf0 Stavros Sachtouris
    
493 f3446cf0 Stavros Sachtouris
    [server]:create 'my debian' 43 6aa6eafd-dccb-67fe2bdde87e
494 f3446cf0 Stavros Sachtouris
    ...
495 f3446cf0 Stavros Sachtouris
496 2151584b Stavros Sachtouris
An other example (4.3.2) showcases how to acquire and modify configuration settings from a different context. In this scenario, the user token expires at server side while the user is working. When that happens, the system responds with an *(401) UNAUTHORIZED* message. The user can acquires a new token (with a browser) which has to be set to kamaki.
497 f3446cf0 Stavros Sachtouris
498 f3446cf0 Stavros Sachtouris
.. code-block:: console
499 f3446cf0 Stavros Sachtouris
    :emphasize-lines: 1
500 f3446cf0 Stavros Sachtouris
501 2151584b Stavros Sachtouris
    Example 4.3.2: Set a new token from store context
502 f3446cf0 Stavros Sachtouris
503 f3446cf0 Stavros Sachtouris
504 f3446cf0 Stavros Sachtouris
    [store]:list
505 f3446cf0 Stavros Sachtouris
    (401) UNAUTHORIZED Access denied
506 f3446cf0 Stavros Sachtouris
507 f3446cf0 Stavros Sachtouris
    [store]:/astakos authenticate
508 f3446cf0 Stavros Sachtouris
    (401) UNAUTHORIZED Invalid X-Auth-Token
509 f3446cf0 Stavros Sachtouris
510 f3446cf0 Stavros Sachtouris
    [store]:/config get token
511 f3446cf0 Stavros Sachtouris
    my3xp1r3dt0k3n==
512 f3446cf0 Stavros Sachtouris
513 f3446cf0 Stavros Sachtouris
    [store]:/config set token myfr35ht0k3n==
514 f3446cf0 Stavros Sachtouris
515 f3446cf0 Stavros Sachtouris
    [store]:/config get token
516 f3446cf0 Stavros Sachtouris
    myfr35ht0k3n==
517 f3446cf0 Stavros Sachtouris
518 f3446cf0 Stavros Sachtouris
    [store]:list
519 f3446cf0 Stavros Sachtouris
    1.  pithos (10MB, 2 objects)
520 f3446cf0 Stavros Sachtouris
    2.  trash (0B, 0 objects)
521 f3446cf0 Stavros Sachtouris
522 7de017e5 Stavros Sachtouris
The following example compares some equivalent calls that run *astakos-authenticate* after a *store-list* 401 failure.
523 f3446cf0 Stavros Sachtouris
524 f3446cf0 Stavros Sachtouris
.. code-block:: console
525 e5d1d5c2 Stavros Sachtouris
    :emphasize-lines: 1,3,10,17,26
526 f3446cf0 Stavros Sachtouris
527 2151584b Stavros Sachtouris
    Example 4.3.3: Equivalent astakos-authenticate calls after a store-list 401 failure
528 f3446cf0 Stavros Sachtouris
529 7de017e5 Stavros Sachtouris
    * without kamaki interactive shell *
530 f3446cf0 Stavros Sachtouris
    $ kamaki store list
531 f3446cf0 Stavros Sachtouris
    (401) UNAUTHORIZED Access denied
532 f3446cf0 Stavros Sachtouris
    $ kamaki astakos authenticate
533 f3446cf0 Stavros Sachtouris
    ...
534 f3446cf0 Stavros Sachtouris
    $
535 f3446cf0 Stavros Sachtouris
536 f3446cf0 Stavros Sachtouris
    * from top-level context *
537 f3446cf0 Stavros Sachtouris
    [kamaki]:store list
538 f3446cf0 Stavros Sachtouris
    (401) UNAUTHORIZED Access denied
539 f3446cf0 Stavros Sachtouris
    [kamaki]:astakos authenticate
540 f3446cf0 Stavros Sachtouris
    ...
541 f3446cf0 Stavros Sachtouris
    [kamaki]
542 f3446cf0 Stavros Sachtouris
543 f3446cf0 Stavros Sachtouris
    * maximum typing *
544 f3446cf0 Stavros Sachtouris
    [store]:list
545 f3446cf0 Stavros Sachtouris
    (401) UNAUTHORIZED Access denied
546 f3446cf0 Stavros Sachtouris
    [store]:exit
547 f3446cf0 Stavros Sachtouris
    [kamaki]:astakos
548 f3446cf0 Stavros Sachtouris
    [astakos]:authenticate
549 f3446cf0 Stavros Sachtouris
    ...
550 7de017e5 Stavros Sachtouris
    [astakos]:
551 f3446cf0 Stavros Sachtouris
552 f3446cf0 Stavros Sachtouris
    * minimum typing *
553 f3446cf0 Stavros Sachtouris
    [store]: list
554 f3446cf0 Stavros Sachtouris
    (401) UNAUTHORIZED Access denied
555 f3446cf0 Stavros Sachtouris
    [store]:/astakos authenticate
556 f3446cf0 Stavros Sachtouris
    ...
557 f3446cf0 Stavros Sachtouris
    [store]:
558 f3446cf0 Stavros Sachtouris
559 e5d1d5c2 Stavros Sachtouris
.. hint:: To exit kamaki shell while in a context, try */exit*
560 e5d1d5c2 Stavros Sachtouris
561 7536c9bf Stavros Sachtouris
Using config
562 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^
563 f3446cf0 Stavros Sachtouris
564 7536c9bf Stavros Sachtouris
The configuration mechanism of kamaki is detailed at the `setup section <setup.html>`_ and it is common for both interaction modes. In specific, the configuration mechanism is implemented as a command group, namely *config*. Using the config commands is as straightforward as any other kamaki commands.
565 e5d1d5c2 Stavros Sachtouris
566 7536c9bf Stavros Sachtouris
It is often useful to set, delete or update a value. This can be managed either inside the config context or from any command context by using the / detour.
567 e5d1d5c2 Stavros Sachtouris
568 e5d1d5c2 Stavros Sachtouris
.. Note:: config updates in kamaki shell persist even after the session is over. All setting changes affects the physical kamaki config file (automatically created, if not set manually)
569 e5d1d5c2 Stavros Sachtouris
570 2151584b Stavros Sachtouris
In example 4.4.1 the user is going to work with only one storage container. The store commands use the container:path syntax, but if the user could set a container as a default, the container name could be omitted in most cases. This is possible by setting a store.container setting.
571 e5d1d5c2 Stavros Sachtouris
572 e5d1d5c2 Stavros Sachtouris
.. code-block:: console
573 e5d1d5c2 Stavros Sachtouris
    :emphasize-lines: 1
574 e5d1d5c2 Stavros Sachtouris
575 2151584b Stavros Sachtouris
    Example 4.4.1: Set default storage container
576 e5d1d5c2 Stavros Sachtouris
577 e5d1d5c2 Stavros Sachtouris
578 e5d1d5c2 Stavros Sachtouris
    [store]:list
579 e5d1d5c2 Stavros Sachtouris
    1.  mycontainer (32MB, 2 objects)
580 e5d1d5c2 Stavros Sachtouris
    2.  pithos (0B, 0 objects)
581 e5d1d5c2 Stavros Sachtouris
    3.  trash (2MB, 1 objects)
582 e5d1d5c2 Stavros Sachtouris
583 e5d1d5c2 Stavros Sachtouris
    [store]:list mycontainer
584 e5d1d5c2 Stavros Sachtouris
    1.  D mydir/
585 e5d1d5c2 Stavros Sachtouris
    2.  20M mydir/rndm_local.file
586 e5d1d5c2 Stavros Sachtouris
    
587 e5d1d5c2 Stavros Sachtouris
    [store]:/config set store.container mycontainer
588 e5d1d5c2 Stavros Sachtouris
589 e5d1d5c2 Stavros Sachtouris
    [store]: list
590 e5d1d5c2 Stavros Sachtouris
    1.  D mydir/
591 e5d1d5c2 Stavros Sachtouris
    2.  20M mydir/rndm_local.file
592 e5d1d5c2 Stavros Sachtouris
593 2151584b Stavros Sachtouris
After a while, the user needs to work with multiple containers, therefore a default container is not longer needed. The store.container setting can be deleted, as shown in example 4.4.2 .
594 e5d1d5c2 Stavros Sachtouris
595 e5d1d5c2 Stavros Sachtouris
.. code-block:: console
596 e5d1d5c2 Stavros Sachtouris
    :emphasize-lines: 1
597 e5d1d5c2 Stavros Sachtouris
598 2151584b Stavros Sachtouris
    Example 4.4.2: Delete a setting option
599 e5d1d5c2 Stavros Sachtouris
600 e5d1d5c2 Stavros Sachtouris
601 e5d1d5c2 Stavros Sachtouris
    [store]:/config delete store.container
602 e5d1d5c2 Stavros Sachtouris
603 e5d1d5c2 Stavros Sachtouris
    [store]:list
604 e5d1d5c2 Stavros Sachtouris
    1.  mycontainer (32MB, 2 objects)
605 e5d1d5c2 Stavros Sachtouris
    2.  pithos (0B, 0 objects)
606 e5d1d5c2 Stavros Sachtouris
    3.  trash (2MB, 1 objects)
607 e5d1d5c2 Stavros Sachtouris
608 7536c9bf Stavros Sachtouris
.. warning:: In some cases, the config setting updates are not immediately effective. If that is the case, they will be after the next command run, whatever that command is.
609 e5d1d5c2 Stavros Sachtouris
610 7536c9bf Stavros Sachtouris
Using history
611 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^
612 f3446cf0 Stavros Sachtouris
613 e5d1d5c2 Stavros Sachtouris
There are two history modes: session and permanent. Session history keeps record of all actions in a kamaki shell session, while permanent history appends all commands to an accessible history file.
614 e5d1d5c2 Stavros Sachtouris
615 7536c9bf Stavros Sachtouris
Session history is only available in interactive shell mode. Users can iterate through past commands in the same session by with the *up* and *down* keys. Session history is not stored, although syntactically correct commands are recorded through the permanent history mechanism
616 e5d1d5c2 Stavros Sachtouris
617 e5d1d5c2 Stavros Sachtouris
Permanent history is implemented as a command group and is common to both the one-command and shell interfaces. In specific, every syntactically correct command is appended in a history file (configured as *history.file* in settings, see `setup section <setup.html>`_ for details). Commands executed in one-command mode are mixed with the ones run in kamaki shell (also see :ref:`using-history-ref` section on this guide).
618 e5d1d5c2 Stavros Sachtouris
619 f3446cf0 Stavros Sachtouris
Tab completion
620 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^^
621 b8e90894 Stavros Sachtouris
622 5f5045b5 Stavros Sachtouris
Kamaki shell features tab completion for the first level of command terms of the current context. Tab completion pool changes dynamically when the context is switched. Currently, tab completion is not supported when the / detour is used (see :ref:`accessing-top-level-commands-ref` ).
623 e5d1d5c2 Stavros Sachtouris
624 f3446cf0 Stavros Sachtouris
OS Shell integration
625 7536c9bf Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^^
626 b8e90894 Stavros Sachtouris
627 e5d1d5c2 Stavros Sachtouris
Kamaki shell features the ability to execute OS-shell commands from any context. This can be achieved by typing *!* or *shell*::
628 e5d1d5c2 Stavros Sachtouris
629 e5d1d5c2 Stavros Sachtouris
    [kamaki_context]:!<OS shell command>
630 e5d1d5c2 Stavros Sachtouris
    ... OS shell command output ...
631 e5d1d5c2 Stavros Sachtouris
632 e5d1d5c2 Stavros Sachtouris
    [kamaki_context]:shell <OS shell command>
633 e5d1d5c2 Stavros Sachtouris
    ... OS shell command output ...
634 e5d1d5c2 Stavros Sachtouris
635 e5d1d5c2 Stavros Sachtouris
.. code-block:: console
636 e5d1d5c2 Stavros Sachtouris
    :emphasize-lines: 1
637 e5d1d5c2 Stavros Sachtouris
638 2151584b Stavros Sachtouris
    Example 4.7.1: Run unix-style shell commands from kamaki shell
639 e5d1d5c2 Stavros Sachtouris
640 e5d1d5c2 Stavros Sachtouris
641 e5d1d5c2 Stavros Sachtouris
    [kamaki]:!ls -al
642 e5d1d5c2 Stavros Sachtouris
    total 16
643 e5d1d5c2 Stavros Sachtouris
    drwxrwxr-x 2 saxtouri saxtouri 4096 Nov 27 16:47 .
644 e5d1d5c2 Stavros Sachtouris
    drwxrwxr-x 7 saxtouri saxtouri 4096 Nov 27 16:47 ..
645 e5d1d5c2 Stavros Sachtouris
    -rw-rw-r-- 1 saxtouri saxtouri 8063 Jun 28 14:48 kamaki-logo.png
646 e5d1d5c2 Stavros Sachtouris
647 e5d1d5c2 Stavros Sachtouris
    [kamaki]:shell cp kamaki-logo.png logo-copy.png
648 e5d1d5c2 Stavros Sachtouris
649 e5d1d5c2 Stavros Sachtouris
    [kamaki]:shell ls -al
650 e5d1d5c2 Stavros Sachtouris
    total 24
651 e5d1d5c2 Stavros Sachtouris
    drwxrwxr-x 2 saxtouri saxtouri 4096 Nov 27 16:47 .
652 e5d1d5c2 Stavros Sachtouris
    drwxrwxr-x 7 saxtouri saxtouri 4096 Nov 27 16:47 ..
653 e5d1d5c2 Stavros Sachtouris
    -rw-rw-r-- 1 saxtouri saxtouri 8063 Jun 28 14:48 kamaki-logo.png
654 e5d1d5c2 Stavros Sachtouris
    -rw-rw-r-- 1 saxtouri saxtouri 8063 Jun 28 14:48 logo-copy.png
655 e5d1d5c2 Stavros Sachtouris
656 e5d1d5c2 Stavros Sachtouris
657 2151584b Stavros Sachtouris
Kamaki shell commits command strings to the outside shell and prints the results, without interacting with it. After a command is finished, kamaki shell returns to its initial state, which involves the current directory, as show in example 4.7.2 .
658 e5d1d5c2 Stavros Sachtouris
659 e5d1d5c2 Stavros Sachtouris
.. code-block:: console
660 e5d1d5c2 Stavros Sachtouris
    :emphasize-lines: 1
661 e5d1d5c2 Stavros Sachtouris
662 2151584b Stavros Sachtouris
    Example 4.7.2: Attempt (and fail) to change working directory
663 e5d1d5c2 Stavros Sachtouris
664 e5d1d5c2 Stavros Sachtouris
665 e5d1d5c2 Stavros Sachtouris
    [kamaki]:!pwd
666 e5d1d5c2 Stavros Sachtouris
    /home/username
667 e5d1d5c2 Stavros Sachtouris
668 e5d1d5c2 Stavros Sachtouris
    [kamaki]:!cd ..
669 e5d1d5c2 Stavros Sachtouris
670 e5d1d5c2 Stavros Sachtouris
    [kamaki]:shell pwd
671 e5d1d5c2 Stavros Sachtouris
    /home/username