src/Controller/TaskRunnerController.php
public function getTaskAction($taskId, Request $request)
    {
        // Retrieve the status file of the task.
        $task   = $this->getTensideTasks()->getTask($taskId);
        $offset = null;

        if (!$task) {
            throw new NotFoundHttpException('No such task.');
        }

        if ($request->query->has('offset')) {
            $offset = (int) $request->query->get('offset');
        }

        return $this->createJsonResponse([$this->convertTaskToArray($task, true, $offset)]);
    }
public function getTaskAction($taskId, Request $request)
    {
        // Retrieve the status file of the task.
        $task   = $this->getTensideTasks()->getTask($taskId);
        $offset = null;

        if (!$task) {
            throw new NotFoundHttpException('No such task.');
        }

        if ($request->query->has('offset')) {
            $offset = (int) $request->query->get('offset');
        }

        return $this->createJsonResponse([$this->convertTaskToArray($task, true, $offset)]);
    }
public function getTaskAction ( $ taskId , Request $ request ) { // Retrieve the status file of the task. $ task = $ this -> getTensideTasks ( ) -> getTask ( $ taskId ) ; $ offset = null ; if ( ! $ task ) { throw new NotFoundHttpException ( 'No such task.' ) ; } if ( $ request -> query -> has ( 'offset' ) ) { $ offset = ( int ) $ request -> query -> get ( 'offset' ) ; } return $ this -> createJsonResponse ( [ $ this -> convertTaskToArray ( $ task , true , $ offset ) ] ) ; }
Retrieve the given task task.

@param string  $taskId  The id of the task to retrieve.

@param Request $request The request.

@return JsonResponse

@throws NotFoundHttpException When the task could not be found.

@ApiDoc(
section="tasks",
statusCodes = {
200 = "When everything worked out ok"
},
authentication = true,
authenticationRoles = {
"ROLE_MANIPULATE_REQUIREMENTS"
},
filters = {
{
"name"="offset",
"dataType" = "int",
"description"="If present, the output will be returned from the given byte offset."
}
}
)
@ApiDescription(
response={
"status" = {
"dataType" = "string",
"description" = "OK on success"
},
"task" = {
"id" = {
"dataType" = "string",
"description" = "The task id."
},
"status" = {
"dataType" = "string",
"description" = "The task status."
},
"type" = {
"dataType" = "string",
"description" = "The type of the task."
},
"created_at" = {
"dataType" = "string",
"description" = "The date the task was created in ISO 8601 format."
},
"user_data" = {
"dataType" = "object",
"description" = "The user submitted additional data."
},
"output" = {
"dataType" = "string",
"description" = "The command line output of the task."
}
}
}
)
Retrieve the given task task .