Get task information.

@param integer $taskId The id of the task.

@return array Returns the task.
@throws Exception
434388
public function getTask($taskId)
    {


        if ($taskId == '')
            throw new Exception('Task ID not specified');

        //build URI
        $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/tasks/' . $taskId;

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        if ($json->Code == 200)
            return $json->Task;
        else
            return false;
    }
199588
private function getTableTaskInfo($taskName)
    {
        $table = TableManager::getInstance()->get(self::$__swooleTableName);
        if ($table) {
            if ($table->exist($taskName)) {
                return $table->get($taskName);
            } else {
                throw new CronTaskNotExist($taskName);
            }
        } else {
            throw new \Exception('Crontab tasks have not yet started!');
        }
    }
44598
public function getFilesFromId( $taskId){
        $Service = sprintf( self::API_DOWNLOAD_FILES, $taskId);
        $rest = $this->getService( $Service);
        $rest->GET();

        return $rest->getResultAsArray( models\Download\File::class);
    }
161904
public function getTaskById($taskId)
    {
        $result = $this->callService('GET', self::API_FS_TASK . $taskId);

        return $result->getModel(models\FileSystem\FsTask::class);
    }
131964
public function get($id) {
		if (!isset($id)) throw new \Exception('ID for job is missing.');
		$id_file = $this->_save_path . $id;
		if (!is_file($id_file)) throw new \Exception('Job file for ID is missing.');

		// get the requested ID
		$item = json_decode(file_get_contents($id_file), true);

		return $item;
	}
442016
public function actionTasknotecreate($projectid, $taskid)
    {
        $model = new TaskNote();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(Url::toRoute(['tasknoteview', 'projectid' => $projectid, 'taskid' => $taskid, 'id' => $model->id,]));
        } else {
            $model->taskID = $taskid;
            return $this->render('tasknotecreate', [
                'model' => $model,]);
        }
    }
273057
public function getOneById($id)
    {
        $plugin = $this->getById($id);
        if (!$plugin) {
            throw new Exception(sprintf('Plugin "%s" not found', $id));
        }

        return $plugin;
    }
1050795
public function getTaskStatus($id, $options=array()){

        $data = array();
        
        $data['id'] = $id;

        $data = array_merge($data, $options);

        return $this->request($this->taskStatusUrl, $data);
    }
28794
public function cancelTask($task_id)
    {
        if (empty($task_id)) {
            throw new \InvalidArgumentException("Please set task_id");
        }
        $url = "projects/{$this->project_id}/tasks/$task_id/cancel";
        $request = array();

        $this->setCommonHeaders();
        $res = $this->apiCall(self::POST, $url, $request);
        return self::json_decode($res);
    }
279783
public function getPayload($currentUserId = null)
    {
        $class = $this->getOption('payload');
        if(!is_a($class , TaskPayLoad::class , true)) {
            throw new BadTaskQueueOption('task payload must implement ' . TaskPayLoad::class);
        }
        /**
         * @var $payload TaskPayLoad
         */
        $payload = new $class($this->getPersistence() , $currentUserId);
        $payload->setServiceLocator($this->getServiceLocator());
        /**
         * @var TaskPayLoad $payload
         */
        return $payload;
    }
982755
public function restart($taskId) {
		if (!$this->stop($taskId)) {
			return false;
		}

		$task = array(
			'id' => null,
			'stderr' => '',
			'stdout' => '',
			'status' => TaskType::UNSTARTED,
			'code' => '',
			'code_string' => '',
			'started' => '',
			'stopped' => '',
			'server_id' => 0,
				) + $this->read(null, $taskId)[$this->alias];
		$this->create();		
		$success = (bool)$this->saveAssociated(array(
					$this->alias => $task,
					$this->DependsOnTask->alias => array($taskId)
		));
		return $success ? $this->id : $success;
	}
1027103
public function get($coid) {
		if (is_string($coid))
			return $this->getObject(new IRI($coid));

		if (is_object($coid) && get_class($coid)=='ML\IRI\IRI')
			return $this->getObject($coid);

		throw new \Exception('COID must be passed as a string or an IRI object.');
	}
108931
public function getServerAllTaskMessage()
    {
        $tasks = [];
        foreach ($this->tid_pid_table as $id => $row) {
            $row['task_id'] = $id;
            $row['run_time'] = time() - $row['start_time'];
            $tasks[] = $row;
        }

        return $tasks;
    }
978564
public function getTaskInfo($id, $options=array()){

        $data = array();
        
        $data['id'] = $id;

        $data = array_merge($data, $options);

        return $this->request($this->taskInfoUrl, $data);
    }
600738
def get_task_id(self):
        """"""
        task_id = self.json_response.get("task_id", None)
        self.logger.info("%s\t%s" % (self.request_method, self.request_url))
        return task_id
108964
public function view($taskId) {
		$task = $this->TaskClient->find('first', array(
			'conditions' => array(
				'id' => $taskId
			),
			'contain' => array(
				'DependsOnTask' => array(
					'id',
					'status'
				)
			)
		));

		if (!$task) {
			throw new NotFoundException("Task id=$taskId not found!");
		}

		$commandList = array($task['TaskClient']['command'] => $task['TaskClient']['command']);
		$approximateRuntimes = array_map(function($command) {
			return $this->TaskProfiler->approximateRuntime($command);
		}, $commandList);
		$this->set('task', $task['TaskClient']);
		$this->set('dependentTasks', $task['DependsOnTask']);
		$statistics = $this->TaskStatistics->find('all', array(
			'conditions' => array(
				'task_id' => $taskId
			),
			'group' => array('CEIL(memory)', 'CEIL(cpu)', 'status'),
			'order' => array(
				'created' => 'asc'
			)
		));
		$this->set('statistics', Hash::extract($statistics, '{n}.{s}'));
		$this->set('approximateRuntimes', $approximateRuntimes);
	}
346517
public function actionTasknotelist($taskid = null)
    {
        if (!isset($taskid)) {
            return false;
        }
        $task = Task::getTaskModel($taskid);
        $tasknotes = $task->TaskNotes();
        return $this->render('tasknotelist', [
            'tasknotes' => $tasknotes, 'task' => $task,
        ]);

    }