Ejemplo n.º 1
0
def createSnapshot(name, container):
    try:
        input = request.get_json(silent=True)
        stateful = False
        if input != None:
            if input.get('stateful') != None:
                stateful = input.get('stateful')

        snapshot = LXCSnapshot({'name': name, 'container': container})
        return response.replySuccess(snapshot.snapshot(stateful), message='Snapshot {} for container {} created successfully.'.format(name, container))
    except ValueError as e:
        return response.replyFailed(message=e.__str__())
Ejemplo n.º 2
0
def createSnapshot(name, container):
    try:
        snapshot = LXCSnapshot({'name': name, 'container': container})
        return response.replySuccess(snapshot.snapshot())
    except ValueError as e:
        return response.replyFailed(message=e.__str__())