Statistics
| Branch: | Tag: | Revision:

root / docs / examplesdir / listing.rst @ f6822a26

History | View | Annotate | Download (18.7 kB)

1
Listing
2
=======
3

    
4
In this section we present the ways of kamaki for listing, an operation that is
5
common to most command groups.
6

    
7
The examples of this section run in a kamaki interactive shell.
8

    
9
.. code-block:: console
10

    
11
    $ kamaki
12
    kamaki v0.10 - Interactive Shell
13

    
14
    /exit       terminate kamaki
15
    exit or ^D  exit context
16
    ? or help   available commands
17
    ?command    help on command
18
    !<command>  execute OS shell command
19

    
20
    Session user is Tyler Durden <uuid: th3y-4r3-7h3-54m3-p3r50n>
21
    [kamaki]:
22

    
23
Simple listing
24
--------------
25

    
26
List configuration options, whether in the file or from defaults list
27

    
28
.. code-block:: console
29

    
30
    [kamaki]: config list
31
    cloud.default.url = https://astakos.example.com/identity/v2.0/
32
    cloud.default.token = my70k3n==
33
    global.default_cloud = default
34
    global.colors = on
35
    global.config_cli = config
36
    global.file_cli = pithos
37
    global.flavor_cli = cyclades
38
    global.history_cli = history
39
    global.history_file = /home/saxtouri/.kamaki.history
40
    global.image_cli = image
41
    global.log_file = /home/saxtouri/.kamaki.log
42
    global.log_token = one
43
    global.max_threads = 5
44
    global.network_cli = cyclades
45
    global.server_cli = cyclades
46
    global.user_cli = astakos
47
    [kamaki]:
48

    
49
List stored containers and then objects in container "pithos"
50

    
51
.. code-block:: console
52

    
53
    [kamaki]: file list
54
    pithos (36MB, 4 objects)
55
    trash (0B, 0 objects)
56
    [kamaki]: file list pithos
57
    . 2KB  info.txt
58
    . D    video/
59
    . 11MB video/tk1.mpg
60
    . 12MB video/tk2.mpg
61
    . 13MB video/tk3.mpg
62
    [kamaki]:
63

    
64
List virtual machines (servers)
65

    
66
.. code-block:: console
67

    
68
    [kamaki]: server list
69
    4201 example server 1
70
    4202 example server 2
71
    4203 example server 3
72
    4204 example server 4
73
    4205 example server 5
74
    4206 example server 6
75

    
76
List networks
77

    
78
.. code-block:: console
79

    
80
    [kamaki]: network list
81
    1 public_network
82
    42 my_private_network
83
    [kamaki]:
84

    
85
List flavors
86

    
87
.. code-block:: console
88

    
89
    [kamaki]: flavor list
90
    1 C1R1024D20drbd
91
    2 C1R1024D30drbd
92
    [kamaki]:
93

    
94
List images from Image API and from Compute APIs
95

    
96
.. code-block:: console
97

    
98
    [kamaki]: image list
99
    f1r57-1m4g3-1d Debian Base Alpha
100
     container_format: bare
101
     disk_format:      diskdump
102
     size:             474066944
103
     status:           available
104
    53c0nd-1m4g3-1d Beta Debian Base
105
     container_format: bare
106
     disk_format:      diskdump
107
     size:             474066944
108
     status:           available
109
    [kamaki]: image compute list
110
    f1r57-1m4g3-1d Debian Base Alpha
111
    53c0nd-1m4g3-1d Beta Debian Base
112
    [kamaki]:
113

    
114
Detailed pithos listing
115
-----------------------
116

    
117
Enter contect
118

    
119
.. code-block:: console
120

    
121
    [kamaki]: file
122
    [file]:
123

    
124
List pithos containers with details
125

    
126
.. code-block:: console
127

    
128
    [file]: list -l
129
    pithos
130
    bytes:    0 (0B)
131
    count:    3
132
    modified: 2013-06-17T12:35:11.613124+00:00
133
    policy:
134
            quota:      0
135
            versioning: auto
136
    trash
137
    bytes:    0 (0B)
138
    count:    0
139
    modified: 2013-06-06T14:24:23.675891+00:00
140
    policy:
141
            quota:      0
142
            versioning: auto
143
    [file]:
144

    
145
Create some more pithos container to experiment with
146

    
147
.. code-block:: console
148

    
149
    [file]: create cont1
150
    [file]: create cont2
151
    [file]: create cont3
152
    [file]: create cont4
153
    [file]: list
154
    cont1 (0B, 0 objects)
155
    cont2 (0B, 0 objects)
156
    cont3 (0B, 0 objects)
157
    cont4 (0B, 0 objects)
158
    pithos (36B, 5 objects)
159
    trash (0B, 0 objects)
160
    [file]:
161

    
162
List only 3, then list three by three
163

    
164
.. code-block:: console
165

    
166
    [file]: list -n 3
167
    cont1 (0B, 0 objects)
168
    cont2 (0B, 0 objects)
169
    cont3 (0B, 0 objects)
170
    [file]: list -n 3 --more
171
    cont1 (0B, 0 objects)
172
    cont2 (0B, 0 objects)
173
    cont3 (0B, 0 objects)
174
    (3 listed - 3 more - "enter" to continue)
175
    <enter is pressed>
176
    cont4 (0B, 0 objects)
177
    pithos (36B, 4 objects)
178
    trash (0B, 0 objects)
179
    [file]:
180

    
181
List contents of container `pithos`
182

    
183
.. code-block:: console
184

    
185
    [file]: list -l pithos
186
    info.txt
187
    by:        s0m3-u53r-1d
188
    bytes:     2000 (2ΚB)
189
    hash:      427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92
190
    modified:  2013-06-17T13:09:44.529579+00:00
191
    timestamp: 1371474584.5295789
192
    type:      plan-text/unicode
193
    uuid:      0493f1d9-9410-4f4b-a81f-fe42f9cefa70
194
    version:   1085
195
     
196
    video
197
    by:        s0m3-u53r-1d
198
    bytes:     0
199
    hash:      e3b0c44298fc1c149afbf44ca495991b7852b855c8996fb92427ae41e4649b93
200
    modified:  2013-06-17T13:11:39.050090+00:00
201
    timestamp: 1371474699.0500901
202
    type:      application/directory
203
    uuid:      80e719f5-9d68-4333-9846-9943972ef1fd
204
    version:   1086
205
     
206
    video/tk1.mpg
207
    by:        s0m3-u53r-1d
208
    bytes:     11000000 (11ΜΒB)
209
    hash:      fbf4c8996fb92427ae41e464e3b0c44298fc1c5991b7852b855149a9b934ca49
210
    modified:  2013-06-17T13:09:15.866515+00:00
211
    timestamp: 1371474555.8665149
212
    type:      video/mpeg
213
    uuid:      b0b46b39-c59a-4adc-a386-6a169cb9f8a5
214
    version:   1079
215
     
216
    video/tk2.mpg
217
    by:        s0m3-u53r-1d
218
    bytes:     12000000 (12MB)
219
    hash:      44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b78e3b0c52b855
220
    modified:  2013-06-17T13:09:23.898652+00:00
221
    timestamp: 1371474563.8986521
222
    type:      video/mpeg
223
    uuid:      12a81309-db3c-4e30-ae9a-4ac2b8289def
224
    version:   1081
225
     
226
    video/tk3.mpg
227
    by:        s0m3-u53r-1d
228
    bytes:     13000000 (13MB)
229
    hash:      1e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae4
230
    modified:  2013-06-17T13:09:28.222536+00:00
231
    timestamp: 1371474568.2225361
232
    type:      video/mpeg
233
    uuid:      4195e8c3-9b9a-4e97-8c20-fdfef34892fe
234
    version:   1083
235
    [kamaki]:
236

    
237
List only objects starting with "video" and exit "file" context
238

    
239
.. code-block:: console
240

    
241
    [file]: list -l pithos:video/
242
    video/tk1.mpg
243
    by:        s0m3-u53r-1d
244
    bytes:     11000000 (11ΜΒB)
245
    hash:      fbf4c8996fb92427ae41e464e3b0c44298fc1c5991b7852b855149a9b934ca49
246
    modified:  2013-06-17T13:09:15.866515+00:00
247
    timestamp: 1371474555.8665149
248
    type:      video/mpeg
249
    uuid:      b0b46b39-c59a-4adc-a386-6a169cb9f8a5
250
    version:   1079
251
     
252
    video/tk2.mpg
253
    by:        s0m3-u53r-1d
254
    bytes:     12000000 (12MB)
255
    hash:      44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b78e3b0c52b855
256
    modified:  2013-06-17T13:09:23.898652+00:00
257
    timestamp: 1371474563.8986521
258
    type:      video/mpeg
259
    uuid:      12a81309-db3c-4e30-ae9a-4ac2b8289def
260
    version:   1081
261
     
262
    video/tk3.mpg
263
    by:        s0m3-u53r-1d
264
    bytes:     13000000 (13MB)
265
    hash:      1e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae4
266
    modified:  2013-06-17T13:09:28.222536+00:00
267
    timestamp: 1371474568.2225361
268
    type:      video/mpeg
269
    uuid:      4195e8c3-9b9a-4e97-8c20-fdfef34892fe
270
    version:   1083
271

    
272

    
273
Exit context
274

    
275
.. code-block:: console
276

    
277
    [file]: exit
278
    [kamaki]:
279

    
280
Detailed Server Listing
281
-----------------------
282

    
283
Enter context
284

    
285
.. code-block:: console
286

    
287
    [kamaki]: server
288
    [server]:
289

    
290
List only 3, then list three by three, all with enumeration
291

    
292
.. code-block:: console
293

    
294
    [server]: list -n 3 --enumerate
295
    1. 4201 example server 1
296
    2. 4202 example server 2
297
    3. 4203 example server 3
298
    4. 4204 example server 4
299
    5. 4205 example server 5
300
    6. 4206 example server 6
301
    [server]: list -n 3 --more --enumerate
302
    1. 4201 example server 1
303
    2. 4202 example server 2
304
    3. 4203 example server 3
305
    (3 listed - 3 more - "enter" to continue)
306
    <press "enter">
307
    4. 4204 example server 4
308
    5. 4205 example server 5
309
    6. 4206 example server 6
310
    [server]:
311

    
312
Get json output returned by the compute API server (only first two VMs)
313

    
314
.. code-block:: console
315

    
316
    [server]: list -j -n 2
317
    [
318
        {
319
            "name": "example server 1",
320
            "links": [
321
              {
322
                "href": "https://example.com/compute/v2.0/servers/4201",
323
                "rel": "self"
324
              },
325
              {
326
                "href": "https://example.com/compute/v2.0/servers/4201",
327
                "rel": "bookmark"
328
              }
329
            ],
330
            "id": 4201
331
          },
332
          {
333
            "name": "example server 2",
334
            "links": [
335
              {
336
                "href": "https://example.com/compute/v2.0/servers/4202",
337
                "rel": "self"
338
              },
339
              {
340
                "href": "https://example.com/compute/v2.0/servers/4202",
341
                "rel": "bookmark"
342
              }
343
            ],
344
            "id": 4202
345
          }
346
    ]
347
    [server]:
348

    
349
Server details (first two only)
350

    
351
.. code-block:: console
352

    
353
    [server]: list -l -n 2
354
    4201 my example server 1
355
        accessIPv4:
356
        accessIPv6:
357
        addresses:
358
                    42:
359
                           OS-EXT-IPS:type: fixed
360
                           addr:            192.168.12.4
361
                           version:         4
362
                        
363
                           OS-EXT-IPS:type: fixed
364
                           addr:            2001:648:2ffc:1222:a800:2ff:fee3:49f1
365
                           version:         6
366
        attachments:
367
                       firewallProfile: DISABLED
368
                       id:              nic-37231-0
369
                       ipv4:            192.168.12.4
370
                       ipv6:            2001:648:2ffc:1222:a800:2ff:fee3:49f1
371
                       mac_address:     aa:00:02:e3:49:f8
372
                       network_id:      4161
373
        config_drive:
374
        created:         2013-05-11T18:03:41.471605+00:00
375
        diagnostics:
376
                       created:     2013-05-11T18:04:23.298132+00:00
377
                       details:     None
378
                       level:       DEBUG
379
                       message:     Image customization finished successfully.
380
                       source:      image-info
381
                       source_date: 2013-05-11T18:04:23.286869+00:00
382
        flavor:
383
                    id:    1
384
                    links:
385
                            href: https://example.com/compute/v2.0/flavors/1
386
                            rel:  bookmark
387
                        
388
                            href: https://example.com/compute/v2.0/flavors/1
389
                            rel:  self
390
        hostId:
391
        image:
392
                    id:    f1r57-1m4g3-1d
393
                    links:
394
                            href: https://example.com/compute/v2.0/images/f1r57-1m4g3-1d
395
                            rel:  bookmark
396

    
397
                            href: https://example.com/compute/v2.0/images/f1r57-1m4g3-1d
398
                            rel:  self
399

    
400
                            href: https:/example.com/image/v1.0/images/f1r57-1m4g3-1d
401
                            rel:  alternate
402
        key_name:        None
403
        links:
404
                       href: https://example.com/compute/v2.0/servers/4201
405
                       rel:  bookmark
406

    
407
                       href: https://example.com/compute/v2.0/servers/4201
408
                       rel:  self
409
        metadata:
410
                    os:    ubuntu
411
                    users: user
412
        progress:        100
413
        security_groups:
414
                       name: default
415
        status:          ACTIVE
416
        suspended:       False
417
        tenant_id:       s0m3-u53r-1d
418
        updated:         2013-06-17T07:57:50.054550+00:00
419
        user_id:         s0m3-u53r-1d
420
    4202 my example server 2
421
        accessIPv4:
422
        accessIPv6:
423
        addresses:
424
                    42:
425
                           OS-EXT-IPS:type: fixed
426
                           addr:            192.168.12.4
427
                           version:         4
428

    
429
                           OS-EXT-IPS:type: fixed
430
                           addr:            2002:648:2ffc:1222:a800:2ff:fee3:49f1
431
                           version:         6
432
        attachments:
433
                       firewallProfile: DISABLED
434
                       id:              nic-37231-0
435
                       ipv4:            192.168.12.4
436
                       ipv6:            2002:648:2ffc:1222:a800:2ff:fee3:49f1
437
                       mac_address:     aa:00:02:e3:49:f8
438
                       network_id:      42
439
        config_drive:
440
        created:         2013-05-11T18:03:41.471605+00:00
441
        diagnostics:
442
                       created:     2013-05-11T18:04:23.298132+00:00
443
                       details:     None
444
                       level:       DEBUG
445
                       message:     Image customization finished successfully.
446
                       source:      image-info
447
                       source_date: 2013-05-11T18:04:23.286869+00:00
448
        flavor:
449
                    id:    2
450
                    links:
451
                            href: https://example.com/compute/v2.0/flavors/2
452
                            rel:  bookmark
453

    
454
                            href: https://example.com/compute/v2.0/flavors/2
455
                            rel:  self
456
        hostId:
457
        image:
458
                    id:    53c0nd-1m4g3-1d
459
                    links:
460
                            href: https://example.com/compute/v2.0/images/53c0nd-1m4g3-1d
461
                            rel:  bookmark
462
                        
463
                            href: https://example.com/compute/v2.0/images/53c0nd-1m4g3-1d
464
                            rel:  self
465
                        
466
                            href: https:/example.com/image/v1.0/images/53c0nd-1m4g3-1d
467
                            rel:  alternate
468
        key_name:        None
469
        links:
470
                       href: https://example.com/compute/v2.0/servers/4202
471
                       rel:  bookmark
472
                   
473
                       href: https://example.com/compute/v2.0/servers/4202
474
                       rel:  self
475
        metadata:
476
                    os:    ubuntu
477
                    users: user
478
        progress:        100
479
        security_groups:
480
                       name: default
481
        status:          ACTIVE
482
        suspended:       False
483
        tenant_id:       s0m3-u53r-1d
484
        updated:         2013-06-17T07:57:50.054550+00:00
485
        user_id:         s0m3-u53r-1d
486
    [server]:
487

    
488
Exit context
489

    
490
.. code-block:: console
491

    
492
    [server]: exit
493
    [kamaki]:
494

    
495
.. note:: `network` and `flavor list` behave in the same way as `server list`
496

    
497
Detailed image listing
498
----------------------
499

    
500
Enter context
501

    
502
.. code-block:: console
503

    
504
    [kamaki]: image
505
    [image]:
506

    
507
Detailed listing
508

    
509
.. code-block:: console
510

    
511
    [image]: list -l
512
    f1r57-1m4g3-1d Debian Base Alpha
513
        checksum:         9344d77620cde1dd77da...7b70badda34b26d782
514
        container_format: bare
515
        created_at:       2013-06-03 16:44:16
516
        deleted_at:
517
        disk_format:      diskdump
518
        is_public:        True
519
        location:         pithos://s0m3-5up3r-u53r-1d/pithos/debian_base1.diskdump
520
        owner:            s0m3-5up3r-u53r-1d
521
        properties:
522
                    description:    Debian 6.0.6 (Squeeze) Base System
523
                    gui:            No GUI
524
                    kernel:         2.6.32
525
                    os:             debian
526
                    osfamily:       linux
527
                    root_partition: 1
528
                    sortorder:      1
529
                    users:          root
530
        size:             474066944
531
        status:           available
532
        updated_at:       2013-06-03 16:44:16
533
    53c0nd-1m4g3-1d Beta Debian Base
534
        checksum:         9344d77620cde1dd77da...7b70badda34b26d782
535
        container_format: bare
536
        created_at:       2013-06-03 16:44:16
537
        deleted_at:
538
        disk_format:      diskdump
539
        is_public:        True
540
        location:         pithos://s0m3-5up3r-u53r-1d/pithos/debian_base2.diskdump
541
        owner:            s0m3-5up3r-u53r-1d
542
        properties:
543
                    description:    Debian 6.0.6 (Squeeze) Base System
544
                    gui:            No GUI
545
                    kernel:         2.6.32
546
                    os:             debian
547
                    osfamily:       linux
548
                    root_partition: 1
549
                    sortorder:      1
550
                    users:          root
551
        size:             474066944
552
        status:           available
553
        updated_at:       2013-06-03 16:44:16
554
    [image]: compute list
555
    f1r57-1m4g3-1d Debian Base Alpha
556
        created:   2013-06-03T16:21:53+00:00
557
        links:
558
             href: https://example.com/cyclades/compute/v2.0/images/f1r57-1m4g3-1d
559
             rel:  bookmark
560
         
561
             href: https://example.com/cyclades/compute/v2.0/images/f1r57-1m4g3-1d
562
             rel:  self
563
         
564
             href: https://example.com/cyclades/image/v1.0/images/f1r57-1m4g3-1d
565
             rel:  alternate
566
        metadata:
567
          description:    Debian 6.0.6 (Squeeze) Base System
568
          gui:            No GUI
569
          kernel:         2.6.32
570
          os:             debian
571
          osfamily:       linux
572
          root_partition: 1
573
          sortorder:      1
574
          users:          root
575
        progress:  100
576
        status:    ACTIVE
577
        tenant_id: s0m3-5up3r-u53r-1d
578
        updated:   2013-06-03T16:21:53+00:00
579
        user_id:   s0m3-5up3r-u53r-1d
580
    53c0nd-1m4g3-1d Beta Debian Base
581
        created:   2013-06-03T16:21:53+00:00
582
        links:
583
             href: https://example.com/cyclades/compute/v2.0/images/53c0nd-1m4g3-1d
584
             rel:  bookmark
585
         
586
             href: https://example.com/cyclades/compute/v2.0/images/53c0nd-1m4g3-1d
587
             rel:  self
588
         
589
             href: https://example.com/cyclades/image/v1.0/images/53c0nd-1m4g3-1d
590
             rel:  alternate
591
        metadata:
592
          description:    Debian 6.0.6 (Squeeze) Base System
593
          gui:            No GUI
594
          kernel:         2.6.32
595
          os:             debian
596
          osfamily:       linux
597
          root_partition: 1
598
          sortorder:      1
599
          users:          root
600
        progress:  100
601
        status:    ACTIVE
602
        tenant_id: s0m3-5up3r-u53r-1d
603
        updated:   2013-06-03T16:21:53+00:00
604
        user_id:   s0m3-5up3r-u53r-1d
605
    [image]:
606

    
607
Filter listing by prefix, suffix or words in image names
608

    
609
.. code-block:: console
610

    
611
    [image]: list --name-prefix=Debian
612
    f1r57-1m4g3-1d Debian Base Alpha
613
    [image]: list --name-suffix=Base
614
    53c0nd-1m4g3-1d Beta Debian Base
615
    [image]: list --name-like=Alpha
616
    f1r57-1m4g3-1d Debian Base Alpha
617
    [image]: list --name-like=Beta
618
    53c0nd-1m4g3-1d Beta Debian Base
619
    [image]: list --name-like="Debian Base"
620
    f1r57-1m4g3-1d Debian Base Alpha
621
    53c0nd-1m4g3-1d Beta Debian Base
622
    [image]:
623

    
624
Filter by owner and container format
625

    
626
.. code-block:: console
627

    
628
    [image]: list --owner=s0m3-u53r-1d
629
    f1r57-1m4g3-1d Debian Base Alpha
630
    53c0nd-1m4g3-1d Beta Debian Base
631
    [image]: list --container-format=bare
632
    f1r57-1m4g3-1d Debian Base Alpha
633
    53c0nd-1m4g3-1d Beta Debian Base
634
    [image]:
635

    
636
Exit context:
637

    
638
.. code-block:: console
639

    
640
    [image]: exit
641
    [kamaki]: