Revision 823477e2

b/docs/examplesdir/configuration.rst
1 1
Configuration
2 2
=============
3 3

  
4
The following refers to the configuration version 0.9 or better. There is also
4
The following refers to the configuration version 0.12 or better. There is also
5 5
information on how to convert from older configuration files.
6 6

  
7 7
In this scenario, we start with an old configuration file at
......
22 22

  
23 23
.. code-block:: console
24 24

  
25
    $ kamaki user authenticate
26
    . Config file format version >= 9.0 is required
25
    $ kamaki user info
26
    . Config file format version >= 0.12 is required
27 27
    . Configuration file: /home/someuser/.kamakirc
28 28
    . Attempting to fix this:
29 29
    . Calculating changes while preserving information
......
37 37
    . ... rescue server.cli => global.server_cli
38 38
    . ... rescue history.file => global.history_file
39 39
    . ... rescue history.cli => global.history_cli
40
    . ... change network_cli value: cyclades => network
40 41
    . ... DONE
41 42
    . The following information will NOT be preserved:
42 43
    .     global.account = AccountName
......
80 81

  
81 82
.. code-block:: console
82 83

  
83
    $ kamaki -c nonexisting.cnf user authenticate
84
    $ kamaki -c nonexisting.cnf user info
84 85
    . No cloud is configured
85 86
    . |  To configure a new cloud "<cloud name>", find and set the
86 87
    . |  single authentication URL and token:
......
106 107

  
107 108
.. code-block:: console
108 109

  
109
    $ kamaki -c nonexisting.cnf user authenticate
110
    $ kamaki -c nonexisting.cnf user info
110 111
    . No authentication token provided for cloud "mytest"
111 112
    . |  Set a token for cloud mytest:
112 113
    . |    kamaki config set cloud.mytest.token <token>
......
149 150

  
150 151
    $ kamaki config get cloud
151 152
    . cloud.default.token = my0ld70k3n==
152
    $ kamaki user authenticate
153
    $ kamaki user info
153 154
    . No authentication URL provided for cloud "mytest"
154 155
    . |  Set a URL for cloud mytest:
155 156
    . |    kamaki config set cloud.mytest.url <URL>
......
160 161
.. code-block:: console
161 162

  
162 163
    $ kamaki config set cloud.default.url https://nonexisting.example.com
163
    $ kamaki user authenticate
164
    $ kamaki user info
164 165
    . Failed while http-connecting to https://nonexisting.example.com
165 166
    $
166 167

  
......
169 170
.. code-block:: console
170 171

  
171 172
    $ kamaki config set cloud.default.url https://accounts.example.com/identity/v2.0/
172
    $ kamaki user authenticate
173
    $ kamaki user info
173 174
    . (401) Authorization failed for token gZH99orgkfYHmGksZKvHJw==
174 175
    . |  UNAUTHORIZED unauthorized (Invalid token)
175 176
    $
......
186 187

  
187 188
    $ kamaki config set cloud.default.url https://accounts.deploymentexample.com/identity/v2.0
188 189
    $ kamaki config set cloud.default.token myd3pl0ym3nt70k3n==
189
    $ kamaki user authenticate
190
    $ kamaki user info
190 191
    . ...
191 192
    . user:
192 193
    .     id: my-d3pl0ym3nt-u53r-1d
......
242 243

  
243 244
.. code-block:: console
244 245

  
245
    $ kamaki user authenticate
246
    $ kamaki user info
246 247
    . ...
247 248
    . <response from deploymentexample.com>
248 249
    . ...
249
    $ kamaki --cloud=mytest user authenticate
250
    $ kamaki --cloud=mytest user info
250 251
    . ...
251 252
    . <response from example.com>
252 253
    . ...
253
    $ kamaki --cloud=default user authenticate
254
    $ kamaki --cloud=default user info
254 255
    . ...
255 256
    . <response from deploymentexample.com, same as default behavior>
256 257
    . ...
257
    $ kamaki --cloud=nonexistingcloud user authenticate
258
    $ kamaki --cloud=nonexistingcloud user info
258 259
    . No cloud "nonexistingcloud" is configured
259 260
    . |  To configure a new cloud "nonexistingcloud", find and set the
260 261
    . |  single authentication URL and token:
......
267 268
.. code-block:: console
268 269

  
269 270
    $ kamaki config delete default_cloud
270
    $ kamaki user authenticate
271
    $ kamaki user info
271 272
    . Found 2 clouds but none of them is set as default
272 273
    . |  Please, choose one of the following cloud names:
273 274
    . |  default, mytest
274 275
    . |  To set a default cloud:
275 276
    . |    kamaki config set default_cloud <cloud name>
276 277
    $ kamaki config set default_cloud mytest
277
    $ kamaki user authenticate
278
    $ kamaki user info
278 279
    . ...
279 280
    . <response from example.com>
280 281
    . ...
......
287 288

  
288 289
    $ kamaki config delete cloud.default
289 290
    $ kamaki config delete default_cloud
290
    $ kamaki user authenticate
291
    $ kamaki user info
291 292
    . ...
292 293
    . <response from example.com>
293 294
    . ...
......
296 297
`Answer`: kamaki doesn't have a default_cloud option, but there is only one
297 298
cloud configuration (`mytest`), therefore there is no ambiguity in resolving
298 299
the default cloud.
299

  
300
Multiple configurations
301
-----------------------
302

  
303
In the following example, we experiment with the higher number of threads when
304
uploading and downloading. The plan is to contact a set of tests with 3 threads
305
at most and another one with 5. All experiments will be run against the same
306
Synnefo cloud (the "mytest" cloud from the previous example).
307

  
308
Let's create the 3-threaded configuration first
309

  
310
.. code-block:: console
311

  
312
    $ kamaki -c 3thread config set cloud.test.url https://accounts.example.com/identity/v2.0/
313
    $ kamaki -c 3thread config set cloud.test.token myt35t70k3n==
314
    $
315

  
316
Let's set the max_thread option to 3 as well as a seperate file for logs.
317

  
318
.. code-block:: console
319

  
320
    $ kamaki -c 3thread config set max_thread 3
321
    $ kamaki -c 3thread config log_file ./logs/kamaki.3threads.log
322
    $
323

  
324
Now, let's create the 5-threaded configuration by modifying a copy of 3thread
325

  
326
.. code-block:: console
327

  
328
    $ cp 3thread 5thread
329
    $ kamaki -c 5thread config set max_thread 5
330
    $ kamaki -c 5thread config log_file ./logs/kamaki.5threads.log
331
    $
332

  
333
Use kamaki to upload with 3 threads and 5 threads respectively
334

  
335
.. code-block:: console
336

  
337
    $ kamaki -c 3thread file upload testfiles/test1 testcontainer
338
    $ kamaki -c 5thread file upload testfiles/test1 testcontainer
339
    $
b/docs/examplesdir/imageregister.rst
8 8

  
9 9
The image location format at user level::
10 10

  
11
    <container>:<object path>
11
    pithos://<user_uuid>/<container>/<object path>
12 12

  
13
    e.g.,:
13
    e.g., pithos://my-u53r-1d/images/debian_base3.diskdump
14 14

  
15
    pithos:debian_base3.diskdump
15
In **file** and **container** contexts, users may also use the shortcut:
16 16

  
17
.. note:: The image API requires the image location in the form
18

  
19
    *pithos://<user uuid>/<container>/<object path>*
20

  
21
    The translation between the two formats is handled internally by kamaki.
22
    The latest format is still acceptable by kamaki due to backward
23
    compatibility but it is going to be deprecated from kamaki 0.12 and on.
17
    /<container>/<object path>
24 18

  
19
    e.g., /images/debian_base3.diskdump
25 20

  
26 21
Register an image
27 22
-----------------
28 23

  
29 24
Let the image file `debian_base3.diskdump` be a debian image located at the
30
current directory.
25
current local directory.
31 26

  
32 27
Upload the image to container `pithos`
33 28

  
34 29
.. code-block:: console
35 30

  
36
    [kamaki]: file upload debian_base3.diskdump pithos
37
    Uploading /home/someuser/debian_base3.diskdump --> pithos:debian_base3.diskdump
38
    Done
39
    [kamaki]:
31
    $ kamaki file upload debian_base3.diskdump pithos
40 32

  
41 33
Register the image object with the name 'Debian Base Alpha'
42 34

  
43

  
44 35
.. code-block:: console
45 36

  
46
    [kamaki]: image register 'Debian Base Alpha' pithos:debian_base3.diskdump
37
    kamaki image register 'Debian Base Alpha' pithos:debian_base3.diskdump
47 38
    checksum:         3cb03556ec971f...e8dd6190443b560cb7
48 39
    container-format: bare
49 40
    created-at:       2013-06-19 08:00:22

Also available in: Unified diff