Statistics
| Branch: | Tag: | Revision:

root / docs / commands.rst @ 2151584b

History | View | Annotate | Download (13.4 kB)

1
Commands
2
========
3

    
4
List of commands
5
----------------
6

    
7
The commands described bellow are grouped by service. The examples showcase a sample set of group commands. The kamaki interactive shell (check `Usage section <usage.html#interactive-shell>`_ for details) is chosen as the execution environment:
8

    
9
astakos (Identity Manager)
10
^^^^^^^^^^^^^^^^^^^^^^^^^^
11

    
12
.. code-block:: text
13

    
14
    authenticate:  Authenticate a user
15

    
16
Showcase: get user information, provided the token was set
17

    
18
.. code-block:: console
19
    :emphasize-lines: 1,4
20

    
21
    * Enter astakos context *
22
    [kamaki]:astakos
23

    
24
    * Authenticate user *
25
    [astakos]:authenticate
26
    auth_token        :  s0m3t0k3nth@t1sr3m0v3d==
27
    auth_token_created:  2012-11-13T14:12:40.917034
28
    auth_token_expires:  2012-12-13T14:12:40.917035
29
    groups            : 
30
                      default
31
    has_credits       :  False
32
    has_signed_terms  :  True
33
    uniq              :  myaccount@grnet.gr
34
    username          :  4215th3b357num9323v32
35

    
36
flavor (Compute/Cyclades)
37
^^^^^^^^^^^^^^^^^^^^^^^^^
38

    
39
.. code-block:: text
40

    
41
    info:  Get flavor details
42
    list:  List flavors
43

    
44
Showcase: show details for flavor with id 43
45

    
46
.. code-block:: console
47
    :emphasize-lines: 1,4
48

    
49
    * Enter flavor context *
50
    [kamaki]: flavor
51

    
52
    * Get details about flavor with id 43 *
53
    [flavor]: info 43
54
    SNF:disk_template:  drbd
55
    cpu              :  4
56
    disk             :  10
57
    id               :  43
58
    name             :  C4R2048D10
59
    ram              :  2048
60

    
61
image (Compute/Cyclades + Glance)
62
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63

    
64
.. code-block:: text
65

    
66
    addmember  :  Add a member to an image
67
    addproperty:  Add an image property
68
    delete     :  Delete image
69
    delmember  :  Remove a member from an image
70
    delproperty:  Delete an image property
71
    info       :  Get image details
72
    list       :  List images
73
    members    :  Get image members
74
    meta       :  Get image metadata
75
    properties :  Get image properties
76
    public     :  List public images
77
    register   :  (Re)Register an image
78
    setmembers :  Set the members of an image
79
    setproperty:  Update an image property
80
    shared     :  List shared images
81

    
82
Showcase: Pick an image and list the properties
83

    
84
.. code-block:: console
85
    :emphasize-lines: 1,4,18
86

    
87
    * Enter image context *
88
    [kamaki]:image
89

    
90
    * list all available images *
91
    [image]:list
92
    1395fdfb-51b4-419f-bb02-f7d632860611 (Ubuntu Desktop LTS)
93
    1580deb4-edb3-4496-a27f-7a246c4c0528 (Ubuntu Desktop)
94
    18a82962-43eb-4b32-8e28-8f8880af89d7 (Kubuntu LTS)
95
    6aa6eafd-dccb-422d-a904-67fe2bdde87e (Debian Desktop)
96
    6b5681e4-7502-46ae-b1e9-9fd837932095 (maelstrom)
97
    78262ee7-949e-4d70-af3a-85360c3de57a (Windows Server 2012)
98
    86bc2414-0fb3-4898-a637-240292243302 (Fedora)
99
    926ab1c5-2d85-49d4-aebe-0fce712789b9 (Windows Server 2008)
100
    b2dffe52-64a4-48c3-8a4c-8214cc3165cf (Debian Base)
101
    baf2321c-57a0-4a69-825d-49f49cea163a (CentOS)
102
    c1d27b46-d875-4f5c-b7f1-f39b5af62905 (Kubuntu)
103

    
104
    * Get properties of image with id b2dffe52-64a4-48c3-8a4c-8214cc3165cf *
105
    [image]:properties b2dffe52-64a4-48c3-8a4c-8214cc3165cf
106
    description   :  Debian 6.0.6 (Squeeze) Base System
107
    gui           :  No GUI
108
    kernel        :  2.6.32
109
    os            :  debian
110
    osfamily      :  linux
111
    root_partition:  1
112
    sortorder     :  1
113
    users         :  root
114

    
115
server (Compute/Cyclades)
116
^^^^^^^^^^^^^^^^^^^^^^^^^
117

    
118
.. code-block:: text
119

    
120
    addmeta :  Add server metadata
121
    addr    :  List a server's nic address
122
    console :  Get a VNC console
123
    create  :  Create a server
124
    delete  :  Delete a server
125
    delmeta :  Delete server metadata
126
    firewall:  Set the server's firewall profile
127
    info    :  Get server details
128
    list    :  List servers
129
    meta    :  Get a server's metadata
130
    reboot  :  Reboot a server
131
    rename  :  Update a server's name
132
    setmeta :  Update server's metadata
133
    shutdown:  Shutdown a server
134
    start   :  Start a server
135
    stats   :  Get server statistics
136
    wait    :  Wait for server to finish
137

    
138
Showcase: Create a server.
139

    
140
.. code-block:: console
141
    :emphasize-lines: 1,4,21,35,44,62
142

    
143
    * Enter server context *
144
    [kamaki]:server
145

    
146
    * See server-create help *
147
    [server]:create -h
148
    usage: create <name> <flavor id> <image id>
149
            [--personality PERSONALITY] [-h] [--config CONFIG]
150

    
151
    Create a server
152

    
153
    optional arguments:
154
      -v, --verbose         More info at response
155
      --personality PERSONALITY
156
                            add a personality file
157
      -d, --debug           Include debug output
158
      -h, --help            Show help message
159
      -i, --include         Include protocol headers in the output
160
      --config CONFIG       Path to configuration file
161
      -s, --silent          Do not output anything
162

    
163
    * List all available images *
164
    [server]:/image list
165
    1395fdfb-51b4-419f-bb02-f7d632860611 (Ubuntu Desktop LTS)
166
    1580deb4-edb3-4496-a27f-7a246c4c0528 (Ubuntu Desktop)
167
    18a82962-43eb-4b32-8e28-8f8880af89d7 (Kubuntu LTS)
168
    6aa6eafd-dccb-422d-a904-67fe2bdde87e (Debian Desktop)
169
    6b5681e4-7502-46ae-b1e9-9fd837932095 (maelstrom)
170
    78262ee7-949e-4d70-af3a-85360c3de57a (Windows Server 2012)
171
    86bc2414-0fb3-4898-a637-240292243302 (Fedora)
172
    926ab1c5-2d85-49d4-aebe-0fce712789b9 (Windows Server 2008)
173
    b2dffe52-64a4-48c3-8a4c-8214cc3165cf (Debian Base)
174
    baf2321c-57a0-4a69-825d-49f49cea163a (CentOS)
175
    c1d27b46-d875-4f5c-b7f1-f39b5af62905 (Kubuntu)
176

    
177
    * See details of flavor with id 1 *
178
    [server]:/flavor info 1
179
    SNF:disk_template:  drbd
180
    cpu              :  1
181
    disk             :  20
182
    id               :  1
183
    name             :  C1R1024D20
184
    ram              :  1024
185

    
186
    * Create a debian server named 'My Small Debian Server'
187
    [server]:create 'My Small Debian Server' 1 b2dffe52-64a4-48c3-8a4c-8214cc3165cf
188
    adminPass:  L8gu2wbZ94
189
    created  :  2012-11-23T16:56:04.190813+00:00
190
    flavorRef:  1
191
    hostId   :  
192
    id       :  11687
193
    imageRef :  b2dffe52-64a4-48c3-8a4c-8214cc3165cf
194
    metadata : 
195
             values: 
196
                   os   :  debian
197
                   users:  root
198
    name     :  My Small Debian Server
199
    progress :  0
200
    status   :  BUILD
201
    suspended:  False
202
    updated  :  2012-11-23T16:56:04.761962+00:00
203

    
204
    * wait for server to build (optional) *
205
    [server]:wait 11687
206
    Server 11687 still in BUILD mode |||||||||||||||||    | 80% - 3s
207
    Server 11687 is now in ACTIVE mode
208

    
209
.. Note:: In kamaki shell, / is used to access top-level command groups while working in command group contexts
210

    
211
network (Compute/Cyclades)
212
^^^^^^^^^^^^^^^^^^^^^^^^^^
213

    
214
.. code-block:: text
215

    
216
    connect   :  Connect a server to a network
217
    create    :  Create a network
218
    delete    :  Delete a network
219
    disconnect:  Disconnect a nic of a server to a network
220
    info      :  Get network details
221
    list      :  List networks
222
    rename    :  Update network name
223

    
224
Showcase: Connect a network to a VM
225

    
226
.. code-block:: console
227
    :emphasize-lines: 1,4,9,24,27,44
228

    
229
    * Enter network context *
230
    [kamaki]:network
231

    
232
    * List user-owned VMs *
233
    [network]:/server list
234
    11687 (My Small Debian Server)
235
    11688 (An Ubuntu server)
236

    
237
    * Try network-connect (to get help) *
238
    [network]:connect 
239
    Syntax error
240
    usage: connect <server id> <network id> [-s] [-h] [-i] [--config CONFIG]
241

    
242
    Connect a server to a network
243

    
244
    Syntax: connect  <server id> <network id>
245
      --config    :  Path to configuration file
246
      -d,--debug  :  Include debug output
247
      -h,--help   :  Show help message
248
      -i,--include:  Include protocol headers in the output
249
      -s,--silent :  Do not output anything
250
      -v,--verbose:  More info at response
251

    
252
    * Connect VM with id 11687 to network with id 1409
253
    [network]: connect 11687 1409
254

    
255
    * Get details on network with id 1409
256
    [network]:info 1409
257
      attachments: 
258
                 nic-11687-1
259
      cidr       :  192.168.1.0/24
260
      cidr6      :  None
261
      created    :  2012-11-23T17:17:20.560098+00:00
262
      dhcp       :  True
263
      gateway    :  None
264
      gateway6   :  None
265
      id         :  1409
266
      name       :  my network
267
      public     :  False
268
      status     :  ACTIVE
269
      type       :  PRIVATE_MAC_FILTERED
270
      updated    :  2012-11-23T17:18:25.095225+00:00
271

    
272
    * Get connectivity details on VM with id 11687 *
273
    [network]:/server addr 11687
274
    id:  nic-11687-1
275
        ipv4       :  192.168.1.1
276
        ipv6       :  None
277
        mac_address:  aa:0f:c2:0b:0e:85
278
        network_id :  1409
279
        firewallProfile:  DISABLED
280
    id:  nic-11687-0
281
        ipv4           :  83.212.106.111
282
        ipv6           :  2001:648:2ffc:1116:a80c:f2ff:fe12:a9e
283
        mac_address    :  aa:0c:f2:12:0a:9e
284
        network_id     :  1369
285

    
286
.. Note:: In kamaki shell, / is used to access top-level command groups while working in command group contexts
287

    
288
store (Storage/Pithos+)
289
^^^^^^^^^^^^^^^^^^^^^^^
290

    
291
.. code-block:: text
292

    
293
    append        :  Append local file to remote
294
    cat           :  Print a file to console
295
    copy          :  Copy an object
296
    create        :  Create a container or a directory object
297
    delete        :  Delete a container [or an object]
298
    delgroup      :  Delete a user group on an account
299
    delmeta       :  Delete an existing metadatum of account [, container [or object]]
300
    delpermissions:  Delete all sharing permissions
301
    download      :  Download a file
302
    group         :  Get user groups details for account
303
    hashmap       :  Get the hashmap of an object
304
    info          :  Get information for account [, container [or object]]
305
    list          :  List containers, object trees or objects in a directory
306
    manifest      :  Create a remote file with uploaded parts by manifestation
307
    meta          :  Get custom meta-content for account [, container [or object]]
308
    mkdir         :  Create a directory
309
    move          :  Copy an object
310
    overwrite     :  Overwrite part (from start to end) of a remote file
311
    permissions   :  Get object read/write permissions
312
    publish       :  Publish an object
313
    purge         :  Purge a container
314
    quota         :  Get  quota for account [or container]
315
    setgroup      :  Create/update a new user group on account
316
    setmeta       :  Set a new metadatum for account [, container [or object]]
317
    setpermissions:  Set sharing permissions
318
    setquota      :  Set new quota (in KB) for account [or container]
319
    setversioning :  Set new versioning (auto, none) for account [or container]
320
    sharers       :  List the accounts that share objects with default account
321
    truncate      :  Truncate remote file up to a size
322
    unpublish     :  Unpublish an object
323
    upload        :  Upload a file
324
    versioning    :  Get  versioning for account [or container ]
325
    versions      :  Get the version list of an object
326

    
327
Showcase: Upload and download a file.
328

    
329
.. code-block:: console
330
    :emphasize-lines: 1,7,11,16,21,29,33,37,41,44,51,55,60,64
331

    
332
    * Create a random binarry file at current OS path *
333
    [kamaki]:!dd bs=4M if=/dev/zero of=rndm_local.file count=5
334
    5+0 records in
335
    5+0 records out
336
    20971520 bytes (21 MB) copied, 0.016162 s, 1.3 GB/s
337

    
338
    * Enter store context *
339
    [kamaki]:store
340

    
341

    
342
    * Check local file *
343
    [store]:!ls -lh rndm_local.file
344
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file
345

    
346

    
347
    * Create two containers *
348
    [store]:create mycont1
349
    [store]:create mycont2
350

    
351

    
352
    * List accessible containers *    
353
    [store]:list
354
    1. mycont1 (0B, 0 objects)
355
    2. mycont2 (0B, 0 objects)
356
    3. pithos (0B, 0 objects)
357
    4. trash (0B, 0 objects)
358

    
359

    
360
    * Upload local file to 1st container *
361
    [store]:upload rndm_local.file mycont1
362

    
363

    
364
    * Check if file has been uploaded *
365
    [store]:list mycont1
366
    1.    20M rndm_local.file
367

    
368
    * Create directory mydir on second container *
369
    [store]:mkdir mycont2:mydir
370

    
371

    
372
    * Move file from 1st to 2nd container (and in the directory) *
373
    [store]:move mycont1:rndm_local.file mycont2:mydir/rndm_local.file
374

    
375
    * Check contents of both containers *
376
    [store]:list mycont1
377
    [store]:list mycont2
378
    1.      D mydir/
379
    2.    20M mydir/rndm_local.file
380

    
381

    
382
    * Copy file from 2nd to 1st container, with a new name *
383
    [store]:copy mycont2:mydir/rndm_local.file mycont1:rndm_remote.file
384

    
385

    
386
    * Check pasted file *
387
    [store]:list mycont1
388
    1.    20M rndm_remote.file
389

    
390

    
391
    * Download pasted file to local file system *
392
    [store]:download mycont1:rndm_remote.file rndm_remote.file
393

    
394

    
395
    * Check if file is downloaded and if it is the same to original *
396
    [store]:!ls -lh *.file
397
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file
398
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:42 rndm_remote.file
399
    [store]:!diff rndm_local.file rndm_remote.file
400

    
401
.. Note:: In kamaki shell, ! is used to execute OS shell commands (bash in the above)
402

    
403

    
404
Command specifications
405
----------------------
406

    
407
cyclades_cli
408
^^^^^^^^^^^^
409

    
410
.. automodule:: kamaki.cli.commands.cyclades_cli
411
    :members:
412
    :undoc-members:
413

    
414

    
415
pithos_cli
416
^^^^^^^^^^
417

    
418
.. automodule:: kamaki.cli.commands.pithos_cli
419
    :members:
420
    :show-inheritance:
421
    :undoc-members:
422

    
423
image_cli
424
^^^^^^^^^
425

    
426
.. automodule:: kamaki.cli.commands.image_cli
427
    :members:
428
    :show-inheritance:
429
    :undoc-members:
430

    
431

    
432
astakos_cli
433
^^^^^^^^^^^
434

    
435
.. automodule:: kamaki.cli.commands.astakos_cli
436
    :members:
437
    :undoc-members:
438

    
439
config_cli
440
^^^^^^^^^^
441

    
442
.. automodule:: kamaki.cli.commands.config_cli
443
    :members:
444
    :undoc-members:
445

    
446
history_cli
447
^^^^^^^^^^^
448

    
449
.. automodule:: kamaki.cli.commands.history_cli
450
    :members:
451
    :undoc-members: