Esempio n. 1
0
 def create_image(self):
     name = self.querystring.get('Name')[0]
     description = self.querystring.get('Description')[0]
     instance_id = self.instance_ids[0]
     image = ec2_backend.create_image(instance_id, name, description)
     if not image:
         return "There is not instance with id {}".format(instance_id), dict(status=404)
     template = Template(CREATE_IMAGE_RESPONSE)
     return template.render(image=image)
Esempio n. 2
0
File: amis.py Progetto: invenia/moto
 def create_image(self):
     name = self.querystring.get('Name')[0]
     if "Description" in self.querystring:
         description = self.querystring.get('Description')[0]
     else:
         description = ""
     instance_ids = instance_ids_from_querystring(self.querystring)
     instance_id = instance_ids[0]
     image = ec2_backend.create_image(instance_id, name, description)
     template = Template(CREATE_IMAGE_RESPONSE)
     return template.render(image=image)
Esempio n. 3
0
File: amis.py Progetto: bobbyi/moto
 def create_image(self):
     name = self.querystring.get('Name')[0]
     if "Description" in self.querystring:
         description = self.querystring.get('Description')[0]
     else:
         description = ""
     instance_ids = instance_ids_from_querystring(self.querystring)
     instance_id = instance_ids[0]
     image = ec2_backend.create_image(instance_id, name, description)
     template = Template(CREATE_IMAGE_RESPONSE)
     return template.render(image=image)
Esempio n. 4
0
 def create_image(self):
     name = self.querystring.get('Name')[0]
     description = self.querystring.get('Description')[0]
     instance_ids = instance_ids_from_querystring(self.querystring)
     instance_id = instance_ids[0]
     image = ec2_backend.create_image(instance_id, name, description)
     if not image:
         return "There is not instance with id {}".format(
             instance_id), dict(status=404)
     template = Template(CREATE_IMAGE_RESPONSE)
     return template.render(image=image)