703 |
703 |
|
704 |
704 |
@command(api='storage')
|
705 |
705 |
class store_info(_store_account_command):
|
706 |
|
"""Get account information"""
|
|
706 |
"""Get information for account [, container [or object]]"""
|
707 |
707 |
|
708 |
|
def main(self):
|
|
708 |
def main(self, container=None, object=None):
|
709 |
709 |
super(store_info, self).main()
|
710 |
|
r = self.client.get_account_info()
|
711 |
|
print_dict(r)
|
|
710 |
if container is None:
|
|
711 |
reply = self.client.get_account_info()
|
|
712 |
elif object is None:
|
|
713 |
reply = self.client.get_container_info(container)
|
|
714 |
else:
|
|
715 |
self.client.container = container
|
|
716 |
reply = self.client.get_object_info(object)
|
|
717 |
print_dict(reply)
|
712 |
718 |
|
713 |
719 |
@command(api='storage')
|
714 |
720 |
class store_mkdir(_store_container_command):
|
... | ... | |
735 |
741 |
self.client.delete_container(container)
|
736 |
742 |
|
737 |
743 |
@command(api='storage')
|
738 |
|
class store_container_info(_store_account_command):
|
739 |
|
"""Get container info"""
|
740 |
|
|
741 |
|
def main(self, container):
|
742 |
|
super(store_container_info, self).main()
|
743 |
|
reply = self.client.get_container_info(container)
|
744 |
|
print_dict(reply)
|
745 |
|
|
746 |
|
@command(api='storage')
|
747 |
744 |
class store_list_containers(_store_account_command):
|
748 |
745 |
"""List containers"""
|
749 |
746 |
|
... | ... | |
752 |
749 |
for object in self.client.list_containers():
|
753 |
750 |
size = format_size(object['bytes'])
|
754 |
751 |
print('%s (%s, %s objects)' % (object['name'], size, object['count']))
|
755 |
|
|
756 |
|
@command(api='storage')
|
757 |
|
class store_object_info(_store_container_command):
|
758 |
|
"""Get object info"""
|
759 |
|
|
760 |
|
def main(self, object_path):
|
761 |
|
super(store_object_info, self).main()
|
762 |
|
reply = self.client.get_object_info(object_path)
|
763 |
|
print_dict(reply)
|
764 |
|
|
765 |
752 |
@command(api='storage')
|
766 |
753 |
class store_list_path(_store_container_command):
|
767 |
754 |
"""List objects in remote path"""
|