print "Enter the image_id you want to see attributes and attribute you want\n" live_at = raw_input("Enter live instance_id:") attribute = raw_input("Enter attribute:") latt = ec2conn.get_instance_attribute(live_at, attribute) print latt elif service == "s3": print "Already existing buckets are\n" rs = s3conn.get_all_buckets() c = len(rs) print 'The no of already existing buckets %s' % c for b in rs: print "The buckets names are\n" print b.name #bucket.delete() print "Enter name for bucket\n" bucket_name = raw_input("Enter bucket_name:") bucket = s3conn.create_bucket(bucket_name) k = Key(bucket) k.key = 'myfile' print "Enter filenames \n" cn = raw_input("Enter source_file_name:") df = raw_input("Enter des_file_name:") k.set_content_from_filename(cn) k.get_content_from_filename(df) elif service == "quit": print "You have quited the VM_CONTROLLER" break else: print "Enter the correct service you need\n"
print latt elif service=="s3": print "Already existing buckets are\n" rs= s3conn.get_all_buckets() c=len(rs) print 'The no of already existing buckets %s' % c for b in rs: print "The buckets names are\n" print b.name #bucket.delete() print "Enter name for bucket\n" bucket_name=raw_input("Enter bucket_name:") bucket=s3conn.create_bucket(bucket_name) k=Key(bucket) k.key = 'myfile' print "Enter filenames \n" cn=raw_input("Enter source_file_name:") df=raw_input("Enter des_file_name:") k.set_content_from_filename(cn) k.get_content_from_filename(df) elif service=="quit": print "You have quited the VM_CONTROLLER" break else: print "Enter the correct service you need\n"