class Api::Tasks::CheckTask
- Api::Tasks::CheckTask
- ApiAction
- Lucky::Action
- Reference
- Object
Overview
JSON API: On http get with and id, checks the database for the id and returns the task if completed and existing.
This class harbours the api functionality of the server regarding checking if a transcompilation task exists
or is finished. The user must supply an #id
of the task and his own api token (auth_token
).
The function then returns HTTP::Status::OK
(200) if the task exists.
Is completed
true means that the task was executed and output_code
is then also returned.
Example for calling the api:
curl example.com/api/checktask/task-id -X GET -d "auth_token=your-token"
Possible return values:
The task exists but is not completed. HTTP::Status::OK
{"id": "task-id", "completed": "false"}
The task exists and is completed. HTTP::Status::OK
{"id": "task-id", "completed": "true", "output_code": "output_code"}
The task does not exist. HTTP::Status::NOT_FOUND
{id: id, completed: false}
{id: id}
The former means there is still no such task. The later means there is something wrong: The task was fetched but is nil.
Defined in:
actions/api/tasks/check_task.crConstant Summary
-
AFTER_PIPES =
[] of Symbol
-
JSON API: On http get with and id, checks the database for the id and returns the task if completed and existing.
This class harbours the api functionality of the server regarding checking if a transcompilation task exists or is finished. The user must supply an
#id
of the task and his own api token (auth_token
). The function then returnsHTTP::Status::OK
(200) if the task exists. Iscompleted
true means that the task was executed andoutput_code
is then also returned.Example for calling the api:
curl example.com/api/checktask/task-id -X GET -d "auth_token=your-token"
Possible return values: The task exists but is not completed.
HTTP::Status::OK
{"id": "task-id", "completed": "false"}
The task exists and is completed.
HTTP::Status::OK
{"id": "task-id", "completed": "true", "output_code": "output_code"}
The task does not exist.
HTTP::Status::NOT_FOUND
{id: id, completed: false} {id: id}
The former means there is still no such task. The later means there is something wrong: The task was fetched but is nil.
-
BEFORE_PIPES =
[verify_accepted_format, require_auth_token] of Symbol
-
JSON API: On http get with and id, checks the database for the id and returns the task if completed and existing.
This class harbours the api functionality of the server regarding checking if a transcompilation task exists or is finished. The user must supply an
#id
of the task and his own api token (auth_token
). The function then returnsHTTP::Status::OK
(200) if the task exists. Iscompleted
true means that the task was executed andoutput_code
is then also returned.Example for calling the api:
curl example.com/api/checktask/task-id -X GET -d "auth_token=your-token"
Possible return values: The task exists but is not completed.
HTTP::Status::OK
{"id": "task-id", "completed": "false"}
The task exists and is completed.
HTTP::Status::OK
{"id": "task-id", "completed": "true", "output_code": "output_code"}
The task does not exist.
HTTP::Status::NOT_FOUND
{id: id, completed: false} {id: id}
The former means there is still no such task. The later means there is something wrong: The task was fetched but is nil.
-
EXPOSURES =
[] of Symbol
-
JSON API: On http get with and id, checks the database for the id and returns the task if completed and existing.
This class harbours the api functionality of the server regarding checking if a transcompilation task exists or is finished. The user must supply an
#id
of the task and his own api token (auth_token
). The function then returnsHTTP::Status::OK
(200) if the task exists. Iscompleted
true means that the task was executed andoutput_code
is then also returned.Example for calling the api:
curl example.com/api/checktask/task-id -X GET -d "auth_token=your-token"
Possible return values: The task exists but is not completed.
HTTP::Status::OK
{"id": "task-id", "completed": "false"}
The task exists and is completed.
HTTP::Status::OK
{"id": "task-id", "completed": "true", "output_code": "output_code"}
The task does not exist.
HTTP::Status::NOT_FOUND
{id: id, completed: false} {id: id}
The former means there is still no such task. The later means there is something wrong: The task was fetched but is nil.
-
PARAM_DECLARATIONS =
[] of Crystal::Macros::TypeDeclaration
-
JSON API: On http get with and id, checks the database for the id and returns the task if completed and existing.
This class harbours the api functionality of the server regarding checking if a transcompilation task exists or is finished. The user must supply an
#id
of the task and his own api token (auth_token
). The function then returnsHTTP::Status::OK
(200) if the task exists. Iscompleted
true means that the task was executed andoutput_code
is then also returned.Example for calling the api:
curl example.com/api/checktask/task-id -X GET -d "auth_token=your-token"
Possible return values: The task exists but is not completed.
HTTP::Status::OK
{"id": "task-id", "completed": "false"}
The task exists and is completed.
HTTP::Status::OK
{"id": "task-id", "completed": "true", "output_code": "output_code"}
The task does not exist.
HTTP::Status::NOT_FOUND
{id: id, completed: false} {id: id}
The former means there is still no such task. The later means there is something wrong: The task was fetched but is nil.
-
ROUTE_SETTINGS =
{prefix: ""}
-
JSON API: On http get with and id, checks the database for the id and returns the task if completed and existing.
This class harbours the api functionality of the server regarding checking if a transcompilation task exists or is finished. The user must supply an
#id
of the task and his own api token (auth_token
). The function then returnsHTTP::Status::OK
(200) if the task exists. Iscompleted
true means that the task was executed andoutput_code
is then also returned.Example for calling the api:
curl example.com/api/checktask/task-id -X GET -d "auth_token=your-token"
Possible return values: The task exists but is not completed.
HTTP::Status::OK
{"id": "task-id", "completed": "false"}
The task exists and is completed.
HTTP::Status::OK
{"id": "task-id", "completed": "true", "output_code": "output_code"}
The task does not exist.
HTTP::Status::NOT_FOUND
{id: id, completed: false} {id: id}
The former means there is still no such task. The later means there is something wrong: The task was fetched but is nil.
-
SKIPPED_PIPES =
[] of Symbol
-
JSON API: On http get with and id, checks the database for the id and returns the task if completed and existing.
This class harbours the api functionality of the server regarding checking if a transcompilation task exists or is finished. The user must supply an
#id
of the task and his own api token (auth_token
). The function then returnsHTTP::Status::OK
(200) if the task exists. Iscompleted
true means that the task was executed andoutput_code
is then also returned.Example for calling the api:
curl example.com/api/checktask/task-id -X GET -d "auth_token=your-token"
Possible return values: The task exists but is not completed.
HTTP::Status::OK
{"id": "task-id", "completed": "false"}
The task exists and is completed.
HTTP::Status::OK
{"id": "task-id", "completed": "true", "output_code": "output_code"}
The task does not exist.
HTTP::Status::NOT_FOUND
{id: id, completed: false} {id: id}
The former means there is still no such task. The later means there is something wrong: The task was fetched but is nil.
Class Method Summary
- .path(*args, **named_args) : String
- .path_without_query_params(id)
- .route(id, anchor : String | Nil = nil) : Lucky::RouteHelper
- .url(*args, **named_args) : String
- .url_without_query_params(id)
- .with(id, anchor : String | Nil = nil) : Lucky::RouteHelper