Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions core/Controller/TaskProcessingApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct(
}

/**
* This endpoint returns all available TaskProcessing task types
* Returns all available TaskProcessing task types
*
* @return DataResponse<Http::STATUS_OK, array{types: array<string, CoreTaskProcessingTaskType>}, array{}>
*
Expand Down Expand Up @@ -100,7 +100,7 @@ public function taskTypes(): DataResponse {
}

/**
* This endpoint allows scheduling a task
* Schedules a task
*
* @param array<string, mixed> $input Task's input parameters
* @param string $type Type of the task
Expand Down Expand Up @@ -141,7 +141,8 @@ public function schedule(array $input, string $type, string $appId, string $cust
}

/**
* This endpoint allows checking the status and results of a task.
* Gets a task including status and result
*
* Tasks are removed 1 week after receiving their last update
*
* @param int $id The id of the task
Expand Down Expand Up @@ -171,7 +172,7 @@ public function getTask(int $id): DataResponse {
}

/**
* This endpoint allows to delete a scheduled task for a user
* Deletes a task
*
* @param int $id The id of the task
*
Expand All @@ -197,8 +198,7 @@ public function deleteTask(int $id): DataResponse {


/**
* This endpoint returns a list of tasks of a user that are related
* with a specific appId and optionally with an identifier
* Returns tasks for the current user filtered by the appId and optional customId
*
* @param string $appId ID of the app
* @param string|null $customId An arbitrary identifier for the task
Expand Down Expand Up @@ -227,8 +227,7 @@ public function listTasksByApp(string $appId, ?string $customId = null): DataRes
}

/**
* This endpoint returns a list of tasks of a user that are related
* with a specific appId and optionally with an identifier
* Returns tasks for the current user filtered by the optional taskType and optional customId
*
* @param string|null $taskType The task type to filter by
* @param string|null $customId An arbitrary identifier for the task
Expand All @@ -238,7 +237,7 @@ public function listTasksByApp(string $appId, ?string $customId = null): DataRes
*/
#[NoAdminRequired]
#[ApiRoute(verb: 'GET', url: '/tasks', root: '/taskprocessing')]
public function listTasksByUser(?string $taskType, ?string $customId = null): DataResponse {
public function listTasks(?string $taskType, ?string $customId = null): DataResponse {
try {
$tasks = $this->taskProcessingManager->getUserTasks($this->userId, $taskType, $customId);
/** @var CoreTaskProcessingTask[] $json */
Expand All @@ -257,7 +256,7 @@ public function listTasksByUser(?string $taskType, ?string $customId = null): Da
}

/**
* This endpoint returns the contents of a file referenced in a task
* Returns the contents of a file referenced in a task
*
* @param int $taskId The id of the task
* @param int $fileId The file id of the file to retrieve
Expand Down Expand Up @@ -333,7 +332,7 @@ private function extractFileIdsFromTask(Task $task): array {
}

/**
* This endpoint sets the task progress
* Sets the task progress
*
* @param int $taskId The id of the task
* @param float $progress The progress
Expand Down Expand Up @@ -363,7 +362,7 @@ public function setProgress(int $taskId, float $progress): DataResponse {
}

/**
* This endpoint sets the task progress
* Sets the task result
*
* @param int $taskId The id of the task
* @param array<string,mixed>|null $output The resulting task output
Expand Down Expand Up @@ -397,7 +396,7 @@ public function setResult(int $taskId, ?array $output = null, ?string $errorMess
}

/**
* This endpoint cancels a task
* Cancels a task
*
* @param int $taskId The id of the task
* @return DataResponse<Http::STATUS_OK, array{task: CoreTaskProcessingTask}, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_NOT_FOUND, array{message: string}, array{}>
Expand Down
23 changes: 12 additions & 11 deletions core/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3345,7 +3345,7 @@
"/ocs/v2.php/taskprocessing/tasktypes": {
"get": {
"operationId": "task_processing_api-task-types",
"summary": "This endpoint returns all available TaskProcessing task types",
"summary": "Returns all available TaskProcessing task types",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -3418,7 +3418,7 @@
"/ocs/v2.php/taskprocessing/schedule": {
"post": {
"operationId": "task_processing_api-schedule",
"summary": "This endpoint allows scheduling a task",
"summary": "Schedules a task",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -3676,7 +3676,8 @@
"/ocs/v2.php/taskprocessing/task/{id}": {
"get": {
"operationId": "task_processing_api-get-task",
"summary": "This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update",
"summary": "Gets a task including status and result",
"description": "Tasks are removed 1 week after receiving their last update",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -3830,7 +3831,7 @@
},
"delete": {
"operationId": "task_processing_api-delete-task",
"summary": "This endpoint allows to delete a scheduled task for a user",
"summary": "Deletes a task",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -3939,7 +3940,7 @@
"/ocs/v2.php/taskprocessing/tasks/app/{appId}": {
"get": {
"operationId": "task_processing_api-list-tasks-by-app",
"summary": "This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier",
"summary": "Returns tasks for the current user filtered by the appId and optional customId",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -4066,8 +4067,8 @@
},
"/ocs/v2.php/taskprocessing/tasks": {
"get": {
"operationId": "task_processing_api-list-tasks-by-user",
"summary": "This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier",
"operationId": "task_processing_api-list-tasks",
"summary": "Returns tasks for the current user filtered by the optional taskType and optional customId",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -4195,7 +4196,7 @@
"/ocs/v2.php/taskprocessing/tasks/{taskId}/file/{fileId}": {
"get": {
"operationId": "task_processing_api-get-file-contents",
"summary": "This endpoint returns the contents of a file referenced in a task",
"summary": "Returns the contents of a file referenced in a task",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -4333,7 +4334,7 @@
"/ocs/v2.php/taskprocessing/tasks/{taskId}/progress": {
"post": {
"operationId": "task_processing_api-set-progress",
"summary": "This endpoint sets the task progress",
"summary": "Sets the task progress",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -4498,7 +4499,7 @@
"/ocs/v2.php/taskprocessing/tasks/{taskId}/result": {
"post": {
"operationId": "task_processing_api-set-result",
"summary": "This endpoint sets the task progress",
"summary": "Sets the task result",
"tags": [
"task_processing_api"
],
Expand Down Expand Up @@ -4671,7 +4672,7 @@
"/ocs/v2.php/taskprocessing/tasks/{taskId}/cancel": {
"post": {
"operationId": "task_processing_api-cancel-task",
"summary": "This endpoint cancels a task",
"summary": "Cancels a task",
"tags": [
"task_processing_api"
],
Expand Down