Skip to content

Commit

Permalink
refs #13207 add method for getting list of application tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
lafin committed Nov 20, 2017
1 parent f6d9193 commit 67f3255
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ For more info read [API reference](http://public.innomdc.com/inno-helper/)

### [0.0.8] - 2017-06-26
- Added validation in methods for the Scheduler API

### [0.0.9] - 2017-11-20
- Added method getting list of tasks
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "library",
"description": "Innometrics helper",
"homepage": "http://www.innometrics.com",
"version": "0.0.8",
"version": "0.0.9",
"require": {
"php": ">=5.3.2",
"illuminate/container": "v5.0.33",
Expand Down
27 changes: 26 additions & 1 deletion lib/Innometrics/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,18 @@ protected function getSchedulerApiHost () {
* @return string
*/
protected function getSchedulerApiUrl (array $params = array()) {
$optional = '';
if (isset($params['taskId'])) {
$optional = '/'.$params['taskId'];
} elseif (isset($params['getTasksAsString'])) {
$optional = '/tasks';
}

return sprintf(
'%s/scheduler/%s%s?token=%s',
$this->getSchedulerApiHost(),
$this->getSchedulerId(),
isset($params['taskId']) ? '/'.$params['taskId'] : '',
$optional,
$this->getSchedulerToken()
);
}
Expand Down Expand Up @@ -150,6 +157,24 @@ public function getTasks () {
return $body;
}

/**
* Get list of application tasks
* @return array
*/
public function getListTasks () {
$url = $this->getSchedulerApiUrl(array(
'getTasksAsString' => true
));
$response = $this->request(array(
'url' => $url
));
$this->checkErrors($response, 200);

$body = $response['body'];

return $body;
}

/**
* Add application task
* @param array
Expand Down

0 comments on commit 67f3255

Please sign in to comment.