Statistics
| Branch: | Tag: | Revision:

root / docs / commands.rst @ 0ea31480

History | View | Annotate | Download (13.7 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
    addmember  :  Add a member to an image
68
    addproperty:  Add an image property
69
    delmember  :  Remove a member from an image
70
    list       :  List images accessible by user
71
    members    :  Get image members
72
    meta       :  Get image metadata
73
    register   :  (Re)Register an image
74
    setmembers :  Set the members of an image
75
    shared     :  List shared images
76
    compute    :  Compute Image API commands
77
        list       :  List images
78
        delete     :  Delete image
79
        info       :  Get image details
80
        properties :  Get image properties
81
        delproperty:  Delete an image property
82
        setproperty:  Update an image property
83

    
84
Showcase: Pick an image and list the properties
85
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86

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

    
90
    * Enter image context *
91
    [kamaki]: image
92

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

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

    
131
server (Compute/Cyclades)
132
-------------------------
133

    
134
.. code-block:: text
135

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

    
154
Showcase: Create a server
155
^^^^^^^^^^^^^^^^^^^^^^^^^
156

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

    
160
    * Enter server context *
161
    [kamaki]: server
162

    
163
    * See server-create help *
164
    [server]: create -h
165
    usage: create <name> <flavor id> <image id>
166
            [--personality PERSONALITY] [-h] [--config CONFIG]
167

    
168
    Create a server
169

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

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

    
194
    * See details of flavor with id 1 *
195
    [server]: /flavor info 1
196
    SNF:disk_template:  drbd
197
    cpu              :  1
198
    disk             :  20
199
    id               :  1
200
    name             :  C1R1024D20
201
    ram              :  1024
202

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

    
221
    * wait for server to build (optional) *
222
    [server]: wait 11687
223
    Server 11687 still in BUILD mode |||||||||||||||||    | 80%
224
    Server 11687 is now in ACTIVE mode
225

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

    
228
network (Compute/Cyclades)
229
--------------------------
230

    
231
.. code-block:: text
232

    
233
    connect   :  Connect a server to a network
234
    create    :  Create a network
235
    delete    :  Delete a network
236
    disconnect:  Disconnect a nic of a server to a network
237
    info      :  Get network details
238
    list      :  List networks
239
    rename    :  Update network name
240

    
241
Showcase: Connect a network to a VM
242
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
243

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

    
247
    * Enter network context *
248
    [kamaki]: network
249

    
250
    * List user-owned VMs *
251
    [network]: /server list
252
    11687 (My Small Debian Server)
253
    11688 (An Ubuntu server)
254

    
255
    * Try network-connect (to get help) *
256
    [network]: connect 
257
    Syntax error
258
    usage: connect <server id> <network id> [-s] [-h] [-i] [--config CONFIG]
259

    
260
    Connect a server to a network
261

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

    
270
    * Connect VM with id 11687 to network with id 1409
271
    [network]: connect 11687 1409
272

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

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

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

    
306
file (Storage/Pithos+)
307
----------------------
308

    
309
.. code-block:: text
310

    
311
    append        :  Append local file to remote
312
    cat           :  Print a file to console
313
    copy          :  Copy an object
314
    create        :  Create a container
315
    delete        :  Delete a container [or an object]
316
    delgroup      :  Delete a user group
317
    delmeta       :  Delete an existing metadatum for an account [, container [or object]]
318
    delpermissions:  Delete all sharing permissions
319
    download      :  Download a file
320
    group         :  Get user groups details
321
    hashmap       :  Get the hashmap of an object
322
    info          :  Get information for account [, container [or object]]
323
    list          :  List containers, object trees or objects in a directory
324
    manifest      :  Create a remote file with uploaded parts by manifestation
325
    meta          :  Get custom meta-content for account [, container [or object]]
326
    mkdir         :  Create a directory
327
    move          :  Copy an object
328
    overwrite     :  Overwrite part (from start to end) of a remote file
329
    permissions   :  Get object read/write permissions
330
    publish       :  Publish an object
331
    purge         :  Purge a container
332
    quota         :  Get  quota for account [or container]
333
    setgroup      :  Create/update a new user group
334
    setmeta       :  Set a new metadatum for account [, container [or object]]
335
    setpermissions:  Set sharing permissions
336
    setquota      :  Set new quota (in KB) for account [or container]
337
    setversioning :  Set new versioning (auto, none) for account [or container]
338
    sharers       :  List the accounts that share objects with default account
339
    touch         :  Create an empty object (file)
340
    truncate      :  Truncate remote file up to a size
341
    unpublish     :  Unpublish an object
342
    upload        :  Upload a file
343
    versioning    :  Get  versioning for account [or container ]
344
    versions      :  Get the version list of an object
345

    
346
Showcase: Upload and download a file
347
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
348

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

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

    
358
    * Enter file context *
359
    [kamaki]: file
360

    
361

    
362
    * Check local file *
363
    [file]: !ls -lh rndm_local.file
364
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file
365

    
366

    
367
    * Create two containers *
368
    [file]: create mycont1
369
    [file]: create mycont2
370

    
371

    
372
    * List accessible containers *    
373
    [file]: list
374
    1. mycont1 (0B, 0 objects)
375
    2. mycont2 (0B, 0 objects)
376
    3. pithos (0B, 0 objects)
377
    4. trash (0B, 0 objects)
378

    
379

    
380
    * Upload local file to 1st container *
381
    [file]: upload rndm_local.file mycont1
382

    
383

    
384
    * Check if file has been uploaded *
385
    [file]: list mycont1
386
    1.    20M rndm_local.file
387

    
388
    * Create directory mydir on second container *
389
    [file]: mkdir mycont2:mydir
390

    
391

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

    
395
    * Check contents of both containers *
396
    [file]: list mycont1
397
    [file]: list mycont2
398
    1.      D mydir/
399
    2.    20M mydir/rndm_local.file
400

    
401

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

    
405

    
406
    * Check pasted file *
407
    [file]: list mycont1
408
    1.    20M rndm_remote.file
409

    
410

    
411
    * Download pasted file to local file system *
412
    [file]: download mycont1:rndm_remote.file rndm_remote.file
413

    
414

    
415
    * Check if file is downloaded and if it is the same to original *
416
    [file]: !ls -lh *.file
417
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file
418
    -rw-rw-r-- 1 ******** ******** 20M Nov 26 15:42 rndm_remote.file
419
    [file]: !diff rndm_local.file rndm_remote.file
420

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

    
423
.. 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 ::
424

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