Skip to content

Latest commit

 

History

History
178 lines (126 loc) · 6.14 KB

TasksApi.md

File metadata and controls

178 lines (126 loc) · 6.14 KB

Swagger\Client\TasksApi

All URIs are relative to http://localhost:3000

Method HTTP request Description
tasksGet GET /tasks Get the list of Tasks.
tasksIdGet GET /tasks/{id} Get information on a Task.
tasksPost POST /tasks Create a new Task.

tasksGet

\Swagger\Client\Model\CbrainTask[] tasksGet($page, $per_page)

Get the list of Tasks.

This method returns the list of Tasks accessible to the current user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\TasksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$page = 56; // int | Page number when paginating. See also the per_page parameter
$per_page = 56; // int | Size of each page when paginating. See also the page parameter

try {
    $result = $apiInstance->tasksGet($page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TasksApi->tasksGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
page int Page number when paginating. See also the per_page parameter [optional]
per_page int Size of each page when paginating. See also the page parameter [optional]

Return type

\Swagger\Client\Model\CbrainTask[]

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tasksIdGet

\Swagger\Client\Model\CbrainTask tasksIdGet($id)

Get information on a Task.

This method returns information on a Task, including its status, Task restartability and information on where the results are kept.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\TasksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 56; // int | The ID number of the Task to delete.

try {
    $result = $apiInstance->tasksIdGet($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TasksApi->tasksIdGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int The ID number of the Task to delete.

Return type

\Swagger\Client\Model\CbrainTask

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tasksPost

\Swagger\Client\Model\CbrainTask[] tasksPost($cbrain_task)

Create a new Task.

This method allows the creation of a new Task.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\TasksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$cbrain_task = new \Swagger\Client\Model\CbrainTaskModReq(); // \Swagger\Client\Model\CbrainTaskModReq | The task to create.

try {
    $result = $apiInstance->tasksPost($cbrain_task);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TasksApi->tasksPost: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cbrain_task \Swagger\Client\Model\CbrainTaskModReq The task to create.

Return type

\Swagger\Client\Model\CbrainTask[]

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]