Revision 823477e2 docs/examplesdir/configuration.rst

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
    $

Also available in: Unified diff