commands.rst 16.3 KB
Newer Older
1
List of commands
2
3
================

4
5
6
7
8
9
10
Kamaki commands follow this scheme::

    [kamaki] <object> <action> [identifiers] [non-positional arguments]

In this context, objects are not services, but virtual objects like a server, a
file or an image. The action concerns objects of the specified type. Some
actions (e.g. "delete" or "info") need to operate on an existing object. The
11
12
identifiers strictly identify this object and they should have the form of an id
(e.g., `server delete <SERVER_ID>`).
13
14

The examples bellow showcase some commands. The kamaki-shell (check
15
16
`Usage section <usage.html#interactive-shell>`_ for details) is chosen as the
execution environment.
17
18


19
user (Identity/Astakos)
20
-----------------------
21
22
23

.. code-block:: text

24
25
26
27
28
29
30
31
    info          Get info for (current) session user
    uuid2name     Get user name(s) from uuid(s)
    authenticate  Authenticate a user and get all authentication information
    list          List (cached) session users
    add           Authenticate user by token and add to kamaki session (cache)
    name2uuid     Get user uuid(s) from name(s)
    select        Select user from the (cached) list as current session user
    delete        Delete user (token) from the (cached) list of session users
32

33
34
35
Showcase: get user information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

36
In the following, cloud URL and TOKEN were set in a previous step (see
37
38
`setup section <setup.html>`_ or the
`quick setup guide <usage.html#quick-setup>`_)
39
40
41
42

.. code-block:: console
    :emphasize-lines: 1,4

43
44
    * Enter user context *
    [kamaki]: user
45
46

    * Authenticate user *
47
    [user]: info
48
    ...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
    name:  My Real Name
    id:  ab1cde23-45fg-6h7i-8j9k-10l1m11no2pq

    [user]: exit
    [kamaki]:

project (Astakos)
-----------------

.. code-block:: text

    info          Get details for a project
    unsuspend     Resume a suspended project (special privileges needed)
    suspend       Suspend a project (special privileges needed)
    list          List all projects
    create        Apply for a new project
    modify        Modify a project
    terminate     Terminate a project (special privileges needed)
    application   Application management commands
    reinstate     Reinstate a terminated project (special privileges needed)

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
membership (Astakos)
--------------------

.. code-block:: text

    info    Details on a membership
    enroll  Enroll somebody to a project you manage
    join    Join a project
    list    List all memberships
    accept  Accept a membership for a project you manage
    leave   Leave a project you have membership to
    remove  Remove a membership for a project you manage
    reject  Reject a membership for a project you manage
    cancel  Cancel your (probably pending) membership to a project

85
86
87
88
quota (Account/Astakos)
-----------------------

.. code-block:: text
89

90
91
92
93
94
95
96
97
98
    list          Get user quotas
    info          Get quota for a service (cyclades, pithos, astakos)

resource (Astakos)
------------------

.. code-block:: text

    list          List user resources
Stavros Sachtouris's avatar
Stavros Sachtouris committed
99

100
flavor (Compute/Cyclades)
101
-------------------------
102
103
104
105
106
107
108

.. code-block:: text

    info:  Get flavor details
    list:  List flavors

Showcase: show details for flavor with id 43
109
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110
111
112
113
114
115
116
117
118
119

.. code-block:: console
    :emphasize-lines: 1,4

    * Enter flavor context *
    [kamaki]: flavor

    * Get details about flavor with id 43 *
    [flavor]: info 43
    SNF:disk_template:  drbd
120
    cpu:  4
121
    disk:  10
122
    id:  43
123
    name:  C4R2048D10
124
    ram:  2048
125

126
127
image (Image/Plankton)
----------------------
128
129
130

.. code-block:: text

131
132
133
134
135
    info          Get image metadata
    list          List images accessible by user
    register      (Re)Register an image file to an Image service
    modify        Add / update metadata and properties for an image
    unregister    Unregister an image (does not delete the image file)
136
137

Showcase: Pick an image and list the properties
138
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
140
141
142
143

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

    * Enter image context *
144
    [kamaki]: image
145
146

    * list all available images *
147
    [image]: list
148
    926ab1c5-2d85-49d4-aebe-0fce712789b9 Windows Server 2008
149
     container_format:  bare
150
151
152
153
     disk_format:  diskdump
     id:  926ab1c5-2d85-49d4-aebe-0fce712789b9
     size:  11917066240
     status:  available
154
    78262ee7-949e-4d70-af3a-85360c3de57a Windows Server 2012
155
     container_format:  bare
156
157
158
159
     disk_format:  diskdump
     id:  78262ee7-949e-4d70-af3a-85360c3de57a
     size:  11697913856
     status:  available
160
    5ed5a29b-292c-4fe0-b32c-2e2b65628635 ubuntu
161
     container_format:  bare
162
163
164
165
     disk_format:  diskdump
     id:  5ed5a29b-292c-4fe0-b32c-2e2b65628635
     size:  2578100224
     status:  available
166
    1f8454f0-8e3e-4b6c-ab8e-5236b728dffe Debian_Wheezy_Base
167
     container_format:  bare
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
     disk_format:  diskdump
     id:  1f8454f0-8e3e-4b6c-ab8e-5236b728dffe
     size:  795107328
     status:  available

    * Get details for image with id 1f8454f0-8e3e-4b6c-ab8e-5236b728dffe *
    [image]: info 1f8454f0-8e3e-4b6c-ab8e-5236b728dffe
     name: Debian_Wheezy_Base
     container_format:  bare
     disk_format:  diskdump
     id:  1f8454f0-8e3e-4b6c-ab8e-5236b728dffe
     size:  795107328
     status:  available
     owner:  s0m3-u53r-1d (user@example.com)
        DESCRIPTION:  Debian Wheezy Base (Stable)
        GUI:  No GUI
        KERNEL:  2.6.32
        OS:  debian
        OSFAMILY:  linux
        ROOT_PARTITION:  1
        SORTORDER:  1
        USERS:  root

imagecompute (Compute/Cyclades)
-------------------------------

.. code-block:: text

    info      Get detailed information on an image
    list      List images
    modify    Modify image properties (metadata)
    delete    Delete an image (WARNING: image file is also removed)
200
201

server (Compute/Cyclades)
202
-------------------------
203
204
205

.. code-block:: text

206
207
208
209
210
211
212
213
    info      Detailed information on a Virtual Machine
    modify    Modify attributes of a virtual server
    create    Create a server (aka Virtual Machine)
    list      List virtual servers accessible by user
    reboot    Reboot a virtual server
    start     Start an existing virtual server
    shutdown  Shutdown an active virtual server
    delete    Delete a virtual server
Stavros Sachtouris's avatar
Stavros Sachtouris committed
214
    console   Create a VMC console and show connection information
215
    wait      Wait for server to finish [BUILD, STOPPED, REBOOT, ACTIVE]
216

217
218
Showcase: Create a server
^^^^^^^^^^^^^^^^^^^^^^^^^
219
220
221
222

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

223
    [kamaki]: server
224

225
    [server]: create -h
226
    usage: create --name NAME --flavor-id FLAVOR_ID --image-id IMAGE_ID
227
            [--personality PERSONALITY] [-h] [--config CONFIG] [--cloud CLOUD]
228
229
230
231
232
233
234
235
236
237
238
239

    Create a server

    optional arguments:
      -v, --verbose         More info at response
      --personality PERSONALITY
                            add a personality file
      -d, --debug           Include debug output
      -h, --help            Show help message
      -i, --include         Include protocol headers in the output
      --config CONFIG       Path to configuration file
      -s, --silent          Do not output anything
240
      --cloud CLOUD         Chose a cloud to connect to
241
242

    * List all available images *
243
    [server]: /image compute list
Stavros Sachtouris's avatar
Stavros Sachtouris committed
244
245
246
247
248
249
250
251
252
253
254
    1395fdfb-51b4-419f-bb02-f7d632860611 Ubuntu Desktop LTS
    1580deb4-edb3-4496-a27f-7a246c4c0528 Ubuntu Desktop
    18a82962-43eb-4b32-8e28-8f8880af89d7 Kubuntu LTS
    6aa6eafd-dccb-422d-a904-67fe2bdde87e Debian Desktop
    6b5681e4-7502-46ae-b1e9-9fd837932095 maelstrom
    78262ee7-949e-4d70-af3a-85360c3de57a Windows Server 2012
    86bc2414-0fb3-4898-a637-240292243302 Fedora
    926ab1c5-2d85-49d4-aebe-0fce712789b9 Windows Server 2008
    b2dffe52-64a4-48c3-8a4c-8214cc3165cf Debian Base
    baf2321c-57a0-4a69-825d-49f49cea163a CentOS
    c1d27b46-d875-4f5c-b7f1-f39b5af62905 Kubuntu
255
256

    * See details of flavor with id 1 *
257
    [server]: /flavor info 1
258
259
260
261
262
263
264
265
    SNF:disk_template:  drbd
    cpu              :  1
    disk             :  20
    id               :  1
    name             :  C1R1024D20
    ram              :  1024

    * Create a debian server named 'My Small Debian Server'
266
    [server]: create --name='My Small Debian Server' --flavor-id=1 --image-id=b2dffe52-64a4-48c3-8a4c-8214cc3165cf
267
268
269
270
271
272
273
    adminPass:  L8gu2wbZ94
    created  :  2012-11-23T16:56:04.190813+00:00
    flavorRef:  1
    hostId   :  
    id       :  11687
    imageRef :  b2dffe52-64a4-48c3-8a4c-8214cc3165cf
    metadata : 
274
275
               os   :  debian
               users:  root
276
277
278
279
280
281
282
    name     :  My Small Debian Server
    progress :  0
    status   :  BUILD
    suspended:  False
    updated  :  2012-11-23T16:56:04.761962+00:00

    * wait for server to build (optional) *
283
    [server]: wait 11687
Stavros Sachtouris's avatar
Stavros Sachtouris committed
284
    Server 11687 still in BUILD mode |||||||||||||||||    | 80%
285
286
    Server 11687 is now in ACTIVE mode

287
.. Note:: In kamaki shell, / is used to access commands from top-level
288

289
ip (Network/Cyclades)
290
291
292
293
---------------------

.. code-block:: text

294
295
296
297
    info      Get details on a floating IP
    create    Reserve an IP on a network
    list      List reserved floating IPs
    delete    Unreserve an IP (also delete the port, if attached)
Stavros Sachtouris's avatar
Stavros Sachtouris committed
298
299
    attach    Attach an IP on a virtual server
    detach    Detach an IP from a virtual server
300
301
302
303
304
305
306
307
308
309
310
311

port (Network/Cyclades)
-----------------------

.. code-block:: text

    info      Get details about a port
    list      List all ports
    create    Create a new port (== connect server to network)
    modify    Modify the attributes of a port
    delete    Delete a port (== disconnect server from network)
    wait      Wait for port to finish [ACTIVE, DOWN, BUILD, ERROR]
312
313

Showcase: Reserve and attach IP to server
314
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
315
316
317

.. code-block:: text

318
319
    * Enter port context *
    [kamaki]: port
320

321
322
    * Reserve an IP and see servers and networks*
    [port]: /ip create
323
    123.456.78.9
324
    [port]: /server list
325
326
    42   My Windows Server
    43   My Linux Server
327
328
329
    [port]: /network list
    101  My Network 1
    102  My Network 2
330
331

    * Attach IP to server
332
333
334
335
    [port]: port create --device-id=43 --network-id=101 --ip-address=123.456.78.9 --wait
    Creating new port 7 between server 43 and network 101
    Port 7 still in BUILD mode |||||||||||||||||    | 80%
    Port 7 is now in ACTIVE mode
336
337
338
339

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

Stavros Sachtouris's avatar
Stavros Sachtouris committed
340
network (Network/Cyclades)
341
--------------------------
342
343
344

.. code-block:: text

345
346
347
348
349
350
351
    info        Get details about a network
    disconnect  Disconnect a network from a device
    modify      Modify network attributes
    create      Create a new network
    list        List networks
    connect     Connect a network with a device (server or router)
    delete      Delete a network
352
353

Showcase: Connect a network to a VM
354
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
355
356
357
358
359

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

    * Enter network context *
360
    [kamaki]: network
361
362

    * List user-owned VMs *
363
    [network]: /server list
364
365
366
367
    11687 (My Small Debian Server)
    11688 (An Ubuntu server)

    * Try network-connect (to get help) *
368
    [network]: connect 
369
    Syntax error
370
    usage: connect <network id> --device-id <DEVICE_ID> [-s] [-h] [-i] [--config CONFIG]
371
372
373
374
375
376
377
378
379
380
381
382

    Connect a server to a network

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

    * Connect VM with id 11687 to network with id 1409
383
    [network]: connect 11687 --device-id=1409 --wait
384
385
    Creating port between network 1409 and server 11687
    New port: 8
386
387

    * Get details on network with id 1409
388
    [network]: info 1409
389
390
      attachments:
                8
391
392
393
394
395
396
397
398
399
400
401
402
      cidr    :  192.168.1.0/24
      cidr6   :  None
      created :  2012-11-23T17:17:20.560098+00:00
      dhcp    :  True
      gateway :  None
      gateway6:  None
      id      :  1409
      name    :  my network
      public  :  False
      status  :  ACTIVE
      type    :  MAC_FILTERED
      updated :  2012-11-23T17:18:25.095225+00:00
403
404

    * Get connectivity details on VM with id 11687 *
405
406
    [network]: /server info 11687 --nics 
    nic-11687-1
407
408
409
410
411
        ipv4       :  192.168.1.1
        ipv6       :  None
        mac_address:  aa:0f:c2:0b:0e:85
        network_id :  1409
        firewallProfile:  DISABLED
412
    nic-11687-0
413
414
415
416
417
418
419
        ipv4           :  83.212.106.111
        ipv6           :  2001:648:2ffc:1116:a80c:f2ff:fe12:a9e
        mac_address    :  aa:0c:f2:12:0a:9e
        network_id     :  1369

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

420
421
422
container (Storage/Pithos+)
---------------------------

Stavros Sachtouris's avatar
Stavros Sachtouris committed
423
424
.. code-block:: text

425
426
427
428
429
430
431
432
433
434
    info      Get information about a container
    modify    Modify the properties of a container
    create    Create a new container
    list      List all containers, or their contents
    empty     Empty a container
    delete    Delete a container

group (Storage/Pithos+)
-----------------------

Stavros Sachtouris's avatar
Stavros Sachtouris committed
435
436
.. code-block:: text

437
438
439
440
441
442
443
    create    Create a group of users
    list      List all groups and group members
    delete    Delete a user group

sharer (Storage/Pithos+)
------------------------

Stavros Sachtouris's avatar
Stavros Sachtouris committed
444
445
.. code-block:: text

446
447
448
    info      Details on a Pithos+ sharer account (default: current account)
    list      List accounts who share file objects with current user

449
450
file (Storage/Pithos+)
----------------------
451
452
453

.. code-block:: text

454
455
456
457
458
459
460
461
462
463
464
465
466
467
    info      Get information/details about a file
    truncate  Truncate remote file up to size
    mkdir     Create a directory
    create    Create an empty file
    move      Move objects, even between different accounts or containers
    list      List all objects in a container or a directory object
    upload    Upload a file
    cat       Fetch remote file contents
    modify    Modify the attributes of a file or directory object
    append    Append local file to (existing) remote object
    download  Download a remove file or directory object to local file system
    copy      Copy objects, even between different accounts or containers
    overwrite Overwrite part of a remote file
    delete    Delete a file or directory object
468

469
470
Showcase: Upload and download a file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471
472
473
474
475

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

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

481
482
    * Enter file context *
    [kamaki]: file
483
484
485


    * Check local file *
486
    [file]: !ls -lh rndm_local.file
487
488
489
490
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file


    * Create two containers *
491
492
    [file]: /container create mycont1
    [file]: /container create mycont2
493
494
495


    * List accessible containers *    
496
    [file]: /container list
497
498
499
500
501
502
503
    1. mycont1 (0B, 0 objects)
    2. mycont2 (0B, 0 objects)
    3. pithos (0B, 0 objects)
    4. trash (0B, 0 objects)


    * Upload local file to 1st container *
504
    [file]: upload /mycont1/rndm_local.file
505
506
507


    * Check if file has been uploaded *
508
    [file]: list /mycont1
509
510
511
    1.    20M rndm_local.file

    * Create directory mydir on second container *
512
    [file]: mkdir /mycont2/mydir
513
514

    * Move file from 1st to 2nd container (and in the directory) *
515
    [file]: move /mycont1/rndm_local.file /mycont2/mydir/rndm_local.file
516
517

    * Check contents of both containers *
518
519
    [file]: list /mycont1
    [file]: list /mycont2
520
521
522
523
    1.      D mydir/
    2.    20M mydir/rndm_local.file

    * Copy file from 2nd to 1st container, with a new name *
524
    [file]: copy /mycont2/mydir/rndm_local.file /mycont1/rndm_remote.file
525
526

    * Check pasted file *
527
    [file]: list /mycont1
528
529
530
    1.    20M rndm_remote.file

    * Download pasted file to local file system *
531
532
    [file]: download /mycont1/rndm_remote.file
    Downloading: |||||||||||||||||   | 72%
533
534

    * Check if file is downloaded and if it is the same to original *
535
    [file]: !ls -lh *.file
536
537
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:42 rndm_remote.file
538
    [file]: !diff rndm_local.file rndm_remote.file
539

540
.. Note:: In kamaki shell, ! is used to execute OS shell commands (e.g., bash)