Package starcluster :: Package commands :: Module downloadimage
[hide private]
[frames] | no frames]

Source Code for Module starcluster.commands.downloadimage

 1  from starcluster.logger import log 
 2   
 3  from completers import S3ImageCompleter 
 4   
 5   
6 -class CmdDownloadImage(S3ImageCompleter):
7 """ 8 downloadimage [options] <image_id> <destination_directory> 9 10 Download the manifest.xml and all AMI parts for an instance-store AMI 11 12 Example: 13 14 $ starcluster downloadimage ami-asdfasdf /data/myamis/ami-asdfasdf 15 """ 16 names = ['downloadimage', 'di'] 17 18 bucket = None 19 image_name = None 20
21 - def execute(self, args):
22 if len(args) != 2: 23 self.parser.error( 24 'you must specify an <image_id> and <destination_directory>') 25 image_id, destdir = args 26 self.ec2.download_image_files(image_id, destdir) 27 log.info("Finished downloading AMI: %s" % image_id)
28