Пример #1
0
 def reboot_instance(instance_id):
     ec2 = EC2Provider()
     return ec2.reboot_instance(instance_id)
Пример #2
0
 def terminate_instance(instance_id):
     ec2 = EC2Provider()
     return ec2.delete_instance(instance_id)
Пример #3
0
 def start_instance(instance_id):
     ec2 = EC2Provider()
     return ec2.start_instance(instance_id)
Пример #4
0
 def from_instance_id(instance_id):
     return Instance.from_EC2Instance(EC2Provider().get_instance_by_id(instance_id))
Пример #5
0
 def from_hostname(hostname):
     ec2 = EC2Provider()
     return Instance.from_EC2Instance(ec2.get_instances_by_tag("Name", hostname)[0])
Пример #6
0
 def get_user_instances(creator):
     ec2 = EC2Provider()
     return [Instance.from_EC2Instance(inst) for inst in ec2.get_instances_by_tag('creator', creator)]
Пример #7
0
 def __init__(self):
     self.provider = EC2Provider()