Last active
December 11, 2015 10:38
-
-
Save flavianmissi/4587616 to your computer and use it in GitHub Desktop.
backuper structure for tsuru
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Backuper(object): | |
def __init__(access, secret): | |
pass | |
def backup(self, instances): | |
image_id = self.snapshot(instances) | |
self.remove_old() | |
self.save_current(image_id) | |
def snapshot(self, instances): | |
"""takes a snapshot of the given VMs""" | |
pass | |
def remove_old(self): | |
"""removes the old image (which is the only one for an instance) | |
from the database""" | |
pass | |
def save_current(self, image_id): | |
"""stores the image id in the databse""" | |
pass | |
def cleaner(self): | |
"""compares the images on s3 with the images on database, | |
if there are extra images in the database, delete them""" | |
pass | |
def backup(access, secret, instances): | |
Backuper(access, secret).backup(instances) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def backup(access, secret, instances): | |
image_id = snapshot() | |
remove_old() | |
save_current(image_id) | |
def snapshot(self, instances): | |
"""takes a snapshot of the given VMs""" | |
pass | |
def remove_old(self): | |
"""removes the old image (which is the only one for an instance) | |
from the database""" | |
pass | |
def save_current(self, image_id): | |
"""stores the image id in the databse""" | |
pass | |
def clean(self): | |
"""compares the images on s3 with the images on database, | |
if there are extra images in the database, delete them""" | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment