Statistics
| Branch: | Tag: | Revision:

root / docs / commands.rst @ 395fbf9e

History | View | Annotate | Download (14.2 kB)

1
List of commands
2
================
3

    
4
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.
5

    
6

    
7
user (Identity Manager)
8
-----------------------
9

    
10
.. code-block:: text
11

    
12
    authenticate:  Authenticate a user
13

    
14
Showcase: get user information
15
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16

    
17
In the following, the token has been set in a previous step (see `setup section <setup.html>`_ or the `quick setup guide <usage.html#quick-setup>`_)
18

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

    
22
    * Enter user context *
23
    [kamaki]: user
24

    
25
    * Authenticate user *
26
    [user]: authenticate
27
    auth_token_created:  2012-11-13T14:12:40.917034
28
    auth_token_expires:  2012-12-13T14:12:40.917035
29
    email             :  
30
                       myaccount@grnet.gr
31
                       myotheraccount@grnet.gr
32
    name              :  My Real Name
33
    username          :  usually@an.email.org
34
    uuid              :  ab1cde23-45fg-6h7i-8j9k-10l1m11no2pq
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

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

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

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

    
62
image (Plankton commands + Compute Image subcommands)
63
-----------------------------------------------------
64

    
65
.. code-block:: text
66

    
67
    list       :  List images accessible by user
68
    meta       :  Get image metadata
69
    register   :  (Re)Register an image
70
    unregister :  Unregister an image (does not delete the image file)
71
    shared     :  List shared images
72
    compute    :  Compute Image API commands
73
        list       :  List images
74
        delete     :  Delete image
75
        info       :  Get image details
76
        properties :  Manage properties related to OS installation in an image
77
            add   :  Add a property to an image
78
            delete:  Delete a property from an image
79
            get   :  Get an image property
80
            list  :  List all image properties
81
            set   :  Add / update a set of properties for an image
82
    members    :  Manage members (users who can modify an image)
83
        add    :  Add a member to an image
84
        delete :  Remove a member from an image
85
        list   :  List members of an image
86
        set    :  Set the members of an image
87

    
88
Showcase: Pick an image and list the properties
89
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90

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

    
94
    * Enter image context *
95
    [kamaki]: image
96

    
97
    * list all available images *
98
    [image]: list
99
    1. Windows Server 2008
100
     container_format:  bare
101
     disk_format     :  diskdump
102
     id              :  926ab1c5-2d85-49d4-aebe-0fce712789b9
103
     size            :  11917066240
104
     status          :  available
105
    2. Windows Server 2012
106
     container_format:  bare
107
     disk_format     :  diskdump
108
     id              :  78262ee7-949e-4d70-af3a-85360c3de57a
109
     size            :  11697913856
110
     status          :  available
111
    3. ubuntu
112
     container_format:  bare
113
     disk_format     :  diskdump
114
     id              :  5ed5a29b-292c-4fe0-b32c-2e2b65628635
115
     size            :  2578100224
116
     status          :  available
117
    4. Debian_Wheezy_Base
118
     container_format:  bare
119
     disk_format     :  diskdump
120
     id              :  1f8454f0-8e3e-4b6c-ab8e-5236b728dffe
121
     size            :  795107328
122
     status          :  available
123

    
124
    * Get properties of image with id 1f8454f0-8e3e-4b6c-ab8e-5236b728dffe *
125
    [image]: compute properties 1f8454f0-8e3e-4b6c-ab8e-5236b728dffe
126
    description   :  Debian 6.0.6 (Squeeze) Base System
127
    gui           :  No GUI
128
    kernel        :  2.6.32
129
    os            :  debian
130
    osfamily      :  linux
131
    root_partition:  1
132
    sortorder     :  1
133
    users         :  root
134

    
135
server (Compute/Cyclades)
136
-------------------------
137

    
138
.. code-block:: text
139

    
140
    addmeta :  Add server metadata
141
    addr    :  List a server's nic address
142
    console :  Get a VNC console
143
    create  :  Create a server
144
    delete  :  Delete a server
145
    delmeta :  Delete server metadata
146
    firewall:  Set the server's firewall profile
147
    info    :  Get server details
148
    list    :  List servers
149
    meta    :  Get a server's metadata
150
    reboot  :  Reboot a server
151
    rename  :  Update a server's name
152
    setmeta :  Update server's metadata
153
    shutdown:  Shutdown a server
154
    start   :  Start a server
155
    stats   :  Get server statistics
156
    wait    :  Wait for server to finish
157

    
158
Showcase: Create a server
159
^^^^^^^^^^^^^^^^^^^^^^^^^
160

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

    
164
    * Enter server context *
165
    [kamaki]: server
166

    
167
    * See server-create help *
168
    [server]: create -h
169
    usage: create <name> <flavor id> <image id>
170
            [--personality PERSONALITY] [-h] [--config CONFIG]
171

    
172
    Create a server
173

    
174
    optional arguments:
175
      -v, --verbose         More info at response
176
      --personality PERSONALITY
177
                            add a personality file
178
      -d, --debug           Include debug output
179
      -h, --help            Show help message
180
      -i, --include         Include protocol headers in the output
181
      --config CONFIG       Path to configuration file
182
      -s, --silent          Do not output anything
183

    
184
    * List all available images *
185
    [server]: /image compute list
186
    1395fdfb-51b4-419f-bb02-f7d632860611 Ubuntu Desktop LTS
187
    1580deb4-edb3-4496-a27f-7a246c4c0528 Ubuntu Desktop
188
    18a82962-43eb-4b32-8e28-8f8880af89d7 Kubuntu LTS
189
    6aa6eafd-dccb-422d-a904-67fe2bdde87e Debian Desktop
190
    6b5681e4-7502-46ae-b1e9-9fd837932095 maelstrom
191
    78262ee7-949e-4d70-af3a-85360c3de57a Windows Server 2012
192
    86bc2414-0fb3-4898-a637-240292243302 Fedora
193
    926ab1c5-2d85-49d4-aebe-0fce712789b9 Windows Server 2008
194
    b2dffe52-64a4-48c3-8a4c-8214cc3165cf Debian Base
195
    baf2321c-57a0-4a69-825d-49f49cea163a CentOS
196
    c1d27b46-d875-4f5c-b7f1-f39b5af62905 Kubuntu
197

    
198
    * See details of flavor with id 1 *
199
    [server]: /flavor info 1
200
    SNF:disk_template:  drbd
201
    cpu              :  1
202
    disk             :  20
203
    id               :  1
204
    name             :  C1R1024D20
205
    ram              :  1024
206

    
207
    * Create a debian server named 'My Small Debian Server'
208
    [server]: create 'My Small Debian Server' 1 b2dffe52-64a4-48c3-8a4c-8214cc3165cf
209
    adminPass:  L8gu2wbZ94
210
    created  :  2012-11-23T16:56:04.190813+00:00
211
    flavorRef:  1
212
    hostId   :  
213
    id       :  11687
214
    imageRef :  b2dffe52-64a4-48c3-8a4c-8214cc3165cf
215
    metadata : 
216
             values: 
217
                   os   :  debian
218
                   users:  root
219
    name     :  My Small Debian Server
220
    progress :  0
221
    status   :  BUILD
222
    suspended:  False
223
    updated  :  2012-11-23T16:56:04.761962+00:00
224

    
225
    * wait for server to build (optional) *
226
    [server]: wait 11687
227
    Server 11687 still in BUILD mode |||||||||||||||||    | 80%
228
    Server 11687 is now in ACTIVE mode
229

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

    
232
network (Compute/Cyclades)
233
--------------------------
234

    
235
.. code-block:: text
236

    
237
    connect   :  Connect a server to a network
238
    create    :  Create a network
239
    delete    :  Delete a network
240
    disconnect:  Disconnect a nic of a server to a network
241
    info      :  Get network details
242
    list      :  List networks
243
    rename    :  Update network name
244

    
245
Showcase: Connect a network to a VM
246
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
247

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

    
251
    * Enter network context *
252
    [kamaki]: network
253

    
254
    * List user-owned VMs *
255
    [network]: /server list
256
    11687 (My Small Debian Server)
257
    11688 (An Ubuntu server)
258

    
259
    * Try network-connect (to get help) *
260
    [network]: connect 
261
    Syntax error
262
    usage: connect <server id> <network id> [-s] [-h] [-i] [--config CONFIG]
263

    
264
    Connect a server to a network
265

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

    
274
    * Connect VM with id 11687 to network with id 1409
275
    [network]: connect 11687 1409
276

    
277
    * Get details on network with id 1409
278
    [network]: info 1409
279
      attachments: 
280
                 nic-11687-1
281
      cidr       :  192.168.1.0/24
282
      cidr6      :  None
283
      created    :  2012-11-23T17:17:20.560098+00:00
284
      dhcp       :  True
285
      gateway    :  None
286
      gateway6   :  None
287
      id         :  1409
288
      name       :  my network
289
      public     :  False
290
      status     :  ACTIVE
291
      type       :  PRIVATE_MAC_FILTERED
292
      updated    :  2012-11-23T17:18:25.095225+00:00
293

    
294
    * Get connectivity details on VM with id 11687 *
295
    [network]: /server addr 11687
296
    id:  nic-11687-1
297
        ipv4       :  192.168.1.1
298
        ipv6       :  None
299
        mac_address:  aa:0f:c2:0b:0e:85
300
        network_id :  1409
301
        firewallProfile:  DISABLED
302
    id:  nic-11687-0
303
        ipv4           :  83.212.106.111
304
        ipv6           :  2001:648:2ffc:1116:a80c:f2ff:fe12:a9e
305
        mac_address    :  aa:0c:f2:12:0a:9e
306
        network_id     :  1369
307

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

    
310
file (Storage/Pithos+)
311
----------------------
312

    
313
.. code-block:: text
314

    
315
    append        :  Append local file to remote
316
    cat           :  Print a file to console
317
    copy          :  Copy an object
318
    containerlimit:  Container size limit commands
319
        set       :  Set container data limit
320
        get       :  Get container data limit
321
    create        :  Create a container
322
    delete        :  Delete a container [or an object]
323
    download      :  Download a file or directory
324
    group         :  Manage access groups and group members
325
        delete:  Delete a user group
326
        get   :  Get groups and group members
327
        set   :  Set a user group
328
    hashmap       :  Get the hashmap of an object
329
    info          :  Get information for account [, container [or object]]
330
    list          :  List containers, object trees or objects in a directory
331
    manifest      :  Create a remote file with uploaded parts by manifestation
332
    metadata      :  Metadata are attached on objects (key:value pairs)
333
        delete:  Delete metadata with given key
334
        get   :  Get metadatum
335
        set   :  Set a piece of metadata
336
    mkdir         :  Create a directory
337
    move          :  Copy an object
338
    overwrite     :  Overwrite part (from start to end) of a remote file
339
    permissions   :  Manage user and group accessibility for objects
340
        delete:  Delete all permissions set on object
341
        get   :  Get read and write permissions of an object
342
        set   :  Set permissions for an object
343
    publish       :  Publish an object
344
    purge         :  Purge a container
345
    quota         :  Get  quota for account
346
    sharers       :  List the accounts that share objects with default account
347
    touch         :  Create an empty object (file)
348
    truncate      :  Truncate remote file up to a size
349
    unpublish     :  Unpublish an object
350
    upload        :  Upload a file or directory
351
    versioning    :  Manage the versioning scheme of current pithos user account
352
        get:  Get  versioning for account or container
353
        set:  Set versioning mode (auto, none) for account or container
354
    versions      :  Get the version list of an object
355

    
356
Showcase: Upload and download a file
357
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
358

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

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

    
368
    * Enter file context *
369
    [kamaki]: file
370

    
371

    
372
    * Check local file *
373
    [file]: !ls -lh rndm_local.file
374
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file
375

    
376

    
377
    * Create two containers *
378
    [file]: create mycont1
379
    [file]: create mycont2
380

    
381

    
382
    * List accessible containers *    
383
    [file]: list
384
    1. mycont1 (0B, 0 objects)
385
    2. mycont2 (0B, 0 objects)
386
    3. pithos (0B, 0 objects)
387
    4. trash (0B, 0 objects)
388

    
389

    
390
    * Upload local file to 1st container *
391
    [file]: upload rndm_local.file mycont1
392

    
393

    
394
    * Check if file has been uploaded *
395
    [file]: list mycont1
396
    1.    20M rndm_local.file
397

    
398
    * Create directory mydir on second container *
399
    [file]: mkdir mycont2:mydir
400

    
401

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

    
405
    * Check contents of both containers *
406
    [file]: list mycont1
407
    [file]: list mycont2
408
    1.      D mydir/
409
    2.    20M mydir/rndm_local.file
410

    
411

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

    
415

    
416
    * Check pasted file *
417
    [file]: list mycont1
418
    1.    20M rndm_remote.file
419

    
420

    
421
    * Download pasted file to local file system *
422
    [file]: download mycont1:rndm_remote.file rndm_remote.file
423

    
424

    
425
    * Check if file is downloaded and if it is the same to original *
426
    [file]: !ls -lh *.file
427
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file
428
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:42 rndm_remote.file
429
    [file]: !diff rndm_local.file rndm_remote.file
430

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

    
433
.. warning:: The container:object/path syntax does not function if the container and / or the object path contain one or more : characters. To use containers and objects with : use the --container and --dst-container arguments, e.g. to copy test.py object from grnet:dev container to grnet:deploy ::
434

    
435
        $ kamaki file copy --container=grnet:dev test.py --dst-container=grnet:deploy