async def METHOD_NAME(request):
    """restore a snapshot
    :Example:
        curl -X PUT http://localhost:8081/fledge/snapshot/category/1554202741
        curl -X PUT http://localhost:8081/fledge/snapshot/schedule/1554202742
        When auth is mandatory:
        curl -X PUT http://localhost:8081/fledge/snapshot/category/1554202741 -H "authorization: <token>"
        curl -X PUT http://localhost:8081/fledge/snapshot/schedule/1554202742 -H "authorization: <token>"
    """
    try:
        r_path = request.path.split('/fledge/snapshot/')
        table = _tables[r_path[1].split('/')[0]]
        snapshot_id = request.match_info.get('id', None)
        try:
            snapshot_id = int(snapshot_id)
        except:
            raise ValueError('Invalid snapshot id: {}'.format(snapshot_id))
        _storage = get_storage_async()  # from fledge.services.core.connect
        retval = await _storage.METHOD_NAME(table, snapshot_id)
    except StorageServerError as ex:
        if int(ex.code) in range(400, 500):
            raise web.HTTPBadRequest(
                reason='{} table snapshot could not be restored. {}'.format(table, json.loads(ex.error)['message']))
        else:
            raise web.HTTPInternalServerError(
                reason='{} table snapshot could not be restored. {}'.format(table, json.loads(ex.error)['message']))
    except ValueError as ex:
        raise web.HTTPBadRequest(reason=str(ex))
    except Exception as ex:
        raise web.HTTPInternalServerError(reason='{} table snapshot could not be restored. {}'.format(table, str(ex)))
    else:
        return web.json_response(retval["loaded"])