Revision cb813272 kamaki/cli.py
b/kamaki/cli.py | ||
---|---|---|
103 | 103 |
'config': "Configuration commands", |
104 | 104 |
'server': "Compute API server commands", |
105 | 105 |
'flavor': "Compute API flavor commands", |
106 |
'image': "Compute API image commands", |
|
106 |
'image': "Compute or Glance API image commands",
|
|
107 | 107 |
'network': "Compute API network commands (Cyclades extension)", |
108 |
'glance': "Image API commands", |
|
109 | 108 |
'store': "Storage API commands", |
110 | 109 |
'astakos': "Astakos API commands"} |
111 | 110 |
|
... | ... | |
429 | 428 |
|
430 | 429 |
|
431 | 430 |
@command(api='compute') |
432 |
class image_meta(object):
|
|
433 |
"""Get image metadata"""
|
|
431 |
class image_properties(object):
|
|
432 |
"""Get image properties"""
|
|
434 | 433 |
|
435 | 434 |
def main(self, image_id, key=None): |
436 | 435 |
reply = self.client.get_image_metadata(image_id, key) |
... | ... | |
438 | 437 |
|
439 | 438 |
|
440 | 439 |
@command(api='compute') |
441 |
class image_addmeta(object):
|
|
442 |
"""Add image metadata"""
|
|
440 |
class image_addproperty(object):
|
|
441 |
"""Add an image property"""
|
|
443 | 442 |
|
444 | 443 |
def main(self, image_id, key, val): |
445 | 444 |
reply = self.client.create_image_metadata(image_id, key, val) |
... | ... | |
447 | 446 |
|
448 | 447 |
|
449 | 448 |
@command(api='compute') |
450 |
class image_setmeta(object):
|
|
451 |
"""Update image metadata"""
|
|
449 |
class image_setproperty(object):
|
|
450 |
"""Update an image property"""
|
|
452 | 451 |
|
453 | 452 |
def main(self, image_id, key, val): |
454 | 453 |
metadata = {key: val} |
... | ... | |
457 | 456 |
|
458 | 457 |
|
459 | 458 |
@command(api='compute') |
460 |
class image_delmeta(object):
|
|
461 |
"""Delete image metadata"""
|
|
459 |
class image_delproperty(object):
|
|
460 |
"""Delete an image property"""
|
|
462 | 461 |
|
463 | 462 |
def main(self, image_id, key): |
464 | 463 |
self.client.delete_image_metadata(image_id, key) |
... | ... | |
528 | 527 |
|
529 | 528 |
|
530 | 529 |
@command(api='image') |
531 |
class glance_list(object):
|
|
532 |
"""List images""" |
|
530 |
class image_public(object):
|
|
531 |
"""List public images"""
|
|
533 | 532 |
|
534 | 533 |
def update_parser(self, parser): |
535 | 534 |
parser.add_option('-l', dest='detail', action='store_true', |
... | ... | |
564 | 563 |
|
565 | 564 |
|
566 | 565 |
@command(api='image') |
567 |
class glance_meta(object):
|
|
566 |
class image_meta(object):
|
|
568 | 567 |
"""Get image metadata""" |
569 | 568 |
|
570 | 569 |
def main(self, image_id): |
... | ... | |
573 | 572 |
|
574 | 573 |
|
575 | 574 |
@command(api='image') |
576 |
class glance_register(object):
|
|
575 |
class image_register(object):
|
|
577 | 576 |
"""Register an image""" |
578 | 577 |
|
579 | 578 |
def update_parser(self, parser): |
... | ... | |
596 | 595 |
help='set image size') |
597 | 596 |
|
598 | 597 |
def main(self, name, location): |
598 |
if not location.startswith('pithos://'): |
|
599 |
account = self.config.get('storage', 'account') |
|
600 |
container = self.config.get('storage', 'container') |
|
601 |
location = 'pithos://%s/%s/%s' % (account, container, location) |
|
602 |
|
|
599 | 603 |
params = {} |
600 | 604 |
for key in ('checksum', 'container_format', 'disk_format', 'id', |
601 | 605 |
'owner', 'size'): |
... | ... | |
618 | 622 |
|
619 | 623 |
|
620 | 624 |
@command(api='image') |
621 |
class glance_members(object):
|
|
625 |
class image_members(object):
|
|
622 | 626 |
"""Get image members""" |
623 | 627 |
|
624 | 628 |
def main(self, image_id): |
... | ... | |
628 | 632 |
|
629 | 633 |
|
630 | 634 |
@command(api='image') |
631 |
class glance_shared(object):
|
|
635 |
class image_shared(object):
|
|
632 | 636 |
"""List shared images""" |
633 | 637 |
|
634 | 638 |
def main(self, member): |
... | ... | |
638 | 642 |
|
639 | 643 |
|
640 | 644 |
@command(api='image') |
641 |
class glance_addmember(object):
|
|
645 |
class image_addmember(object):
|
|
642 | 646 |
"""Add a member to an image""" |
643 | 647 |
|
644 | 648 |
def main(self, image_id, member): |
... | ... | |
646 | 650 |
|
647 | 651 |
|
648 | 652 |
@command(api='image') |
649 |
class glance_delmember(object):
|
|
653 |
class image_delmember(object):
|
|
650 | 654 |
"""Remove a member from an image""" |
651 | 655 |
|
652 | 656 |
def main(self, image_id, member): |
... | ... | |
654 | 658 |
|
655 | 659 |
|
656 | 660 |
@command(api='image') |
657 |
class glance_setmembers(object):
|
|
661 |
class image_setmembers(object):
|
|
658 | 662 |
"""Set the members of an image""" |
659 | 663 |
|
660 | 664 |
def main(self, image_id, *member): |
Also available in: Unified diff