Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for mismatch # of parameters with importSupertask in the User API #1102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion doc/user-api/sections/supertask.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ \section*{Supertasks (\textit{supertask})}
"section": "supertask",
"request": "importSupertask",
"name": "Mask Supertask",
"maxAgents": 10,
"isCpuOnly": false,
"isSmall": false,
"masks": [
Expand All @@ -19,7 +20,7 @@ \section*{Supertasks (\textit{supertask})}
],
"optimizedFlag": true,
"crackerTypeId": 1,
"benchtype": "speed",
"benchmarkType": "speed",
"accessKey": "mykey"
}
\end{verbatim}
Expand Down
4 changes: 3 additions & 1 deletion doc/user-api/user-api.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
\maketitle
\section*{Introduction}
The communication for the User API is always in JSON formatted values. When sending a request to the server, it should be a POST containing the JSON data.
Every request has a \textit{section} and a \textit{request} field to state which action should be executed. Every response again then contains the requested section and request and gives a \textit{status} to indicate if the query was successful or not. To increase the readability of this document, requests are always in blue, successful responses in green and error messages in red.
Every request has a \textit{section} and a \textit{request} field to state which action should be executed. Every response again then contains the requested section and request and gives a \textit{status} to indicate if the query was successful or not. To increase the readability of this document, requests are always in blue, successful responses in green and error messages in red. \\

The User API can be found at http[s]://[YOUR_SERVER]:8080/api/user.php. All of the below payloads should be sent to that endpoint.

\section*{Errors}
In case of an error with the query which the user sends to the server, the response will have following format with the corresponding action which was requested and the error message which should help in getting information about this error.
Expand Down
1 change: 1 addition & 0 deletions src/inc/user-api/UserAPISupertask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ private function importSupertask($QUERY) {
SupertaskUtils::importSupertask(
$QUERY[UQueryTask::SUPERTASK_NAME],
$QUERY[UQueryTask::TASK_CPU_ONLY],
$QUERY[UQueryTask::TASK_MAX_AGENTS],
$QUERY[UQueryTask::TASK_SMALL],
$QUERY[UQueryTask::TASK_OPTIMIZED],
$QUERY[UQueryTask::TASK_CRACKER_TYPE],
Expand Down
1 change: 1 addition & 0 deletions src/inc/utils/SupertaskUtils.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ public static function createSupertask($name, $pretasks) {
/**
* @param string $name
* @param boolean $isCpuOnly
* @param int $maxAgents
* @param boolean $isSmall
* @param boolean $useOptimized
* @param int $crackerBinaryTypeId
Expand Down