async def METHOD_NAME(request):
    """extract a snapshot
    :Example:
        curl -X PUT http://localhost:8081/fledge/snapshot/plugins/1554204238
        When auth is mandatory:
        curl -X PUT http://localhost:8081/fledge/snapshot/plugins/1554204238 -H "authorization: <token>" 
    """
    try:
        snapshot_id = request.match_info.get('id', None)
        snapshot_name = "snapshot-plugin-{}.tar.gz".format(snapshot_id)
        try:
            snapshot_id = int(snapshot_id)
        except:
            raise ValueError('Invalid snapshot id: {}'.format(snapshot_id))
        if not os.path.isdir(_get_snapshot_dir()):
            raise web.HTTPNotFound(reason="No snapshot found.")
        snapshot_dir = _get_snapshot_dir()
        for root, dirs, files in os.walk(snapshot_dir):
            if str(snapshot_name) not in files:
                raise web.HTTPNotFound(reason='{} not found'.format(snapshot_name))
        p = "{}/{}".format(snapshot_dir, snapshot_name)
        SnapshotPluginBuilder(snapshot_dir).extract_files(p)
    except ValueError as ex:
        raise web.HTTPBadRequest(reason=str(ex))
    except Exception as ex:
        raise web.HTTPInternalServerError(
            reason='Snapshot {} could not be restored. {}'.format(snapshot_name,
                                                                  str(ex)))
    else:
        return web.json_response(
            {"message": "snapshot {} restored successfully.".format(
                snapshot_name)})