(self, sketch_id)
return jsonify(schema)
Handles GET request to the resource.

        Returns:
            A analyzer session in JSON (instance of flask.wrappers.Response)
Handles GET request to the resource.
Handles GET request to the resource .
def get(self, sketch_id):
        """Handles GET request to the resource.

        Returns:
            A analyzer session in JSON (instance of flask.wrappers.Response)
        """
        sketch = Sketch.query.get_with_acl(sketch_id)

        if not sketch:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND, 'No sketch found with this ID.')

        if not sketch.has_permission(current_user, 'read'):
            abort(
                HTTP_STATUS_CODE_FORBIDDEN,
                'User does not have read access to sketch')

        counter = collections.Counter(PENDING=0, STARTED=0, ERROR=0, DONE=0)
        session_ids = set()

        active_sessions = sketch.get_active_analysis_sessions()
        for session in active_sessions:
            session_ids.add(session.id)
            for analysis in session.analyses:
                counter[analysis.get_status.status] += 1

        schema = {
            'objects': [{
                'total_tasks': sum(counter.values()),
                'total_sessions': len(active_sessions),
                'tasks_status_count': counter,
                'sessions': list(session_ids)
            }]
        }
        return jsonify(schema)
def get ( self , sketch_id ) : sketch = Sketch . query . get_with_acl ( sketch_id ) if not sketch : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No sketch found with this ID.' ) if not sketch . has_permission ( current_user , 'read' ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'User does not have read access to sketch' ) counter = collections . Counter ( PENDING = 0 , STARTED = 0 , ERROR = 0 , DONE = 0 ) session_ids = set ( ) active_sessions = sketch . get_active_analysis_sessions ( ) for session in active_sessions : session_ids . add ( session . id ) for analysis in session . analyses : counter [ analysis . get_status . status ] += 1 schema = { 'objects' : [ { 'total_tasks' : sum ( counter . values ( ) ) , 'total_sessions' : len ( active_sessions ) , 'tasks_status_count' : counter , 'sessions' : list ( session_ids ) } ] } return jsonify ( schema )