Exemplo n.º 1
0
def destroy(uid):
    user = User.get(uid)
    if user:
        zfs_service = ZFSService(uid)
        data = zfs_service.destroy(user)
        if data is not True:
            abort(500, data['error'])
        return jsonify(data)
    abort(404, USER_ERROR_MSG.format(u=uid))
Exemplo n.º 2
0
def create(uid, size):
    """
    Create ZFS Filesystem for user
    :param uid:
    :param size:
    """
    zfs_service = ZFSService(uid)
    data = zfs_service.create(size)
    if data is not True:
        abort(500, data['error'])
    return jsonify(data)