Skip to content
Snippets Groups Projects
Commit 56206910 authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

Add scripting ServerMessages to ScriptExecutionResult

parent 2167c859
No related branches found
No related tags found
1 merge request!13Add server-side scripting to gRPC API
Pipeline #61780 failed
...@@ -34,14 +34,16 @@ message NamedArgument { ...@@ -34,14 +34,16 @@ message NamedArgument {
message ExecuteScriptRequest { message ExecuteScriptRequest {
// The script to execute // The script to execute
string script_filename = 1; string script_filename = 1;
// IDEA: Whether the script should be executed asynchronously // The timeout for the script execution in milliseconds
bool is_async = 2; int64 timeout_ms = 2;
// The positional arguments for the script // The positional arguments for the script
repeated string positional_arguments = 3; repeated string positional_arguments = 3;
// The named arguments for the script // The named arguments for the script
repeated NamedArgument named_arguments = 4; repeated NamedArgument named_arguments = 4;
// The files to be used by the script (will be uploaded to the server) // The files to be used by the script (will be uploaded to the server)
repeated string script_files = 5; repeated string script_files = 5;
// IDEA: Whether the script should be executed asynchronously
bool run_async = 6;
} }
enum ScriptExecutionResult { enum ScriptExecutionResult {
...@@ -51,16 +53,22 @@ enum ScriptExecutionResult { ...@@ -51,16 +53,22 @@ enum ScriptExecutionResult {
SCRIPT_EXECUTION_RESULT_SUCCESS = 1; SCRIPT_EXECUTION_RESULT_SUCCESS = 1;
// The script execution failed (general/unspecified failure) // The script execution failed (general/unspecified failure)
SCRIPT_EXECUTION_RESULT_GENERAL_FAILURE = 2; SCRIPT_EXECUTION_RESULT_GENERAL_FAILURE = 2;
// The script execution was cancelled // The script does not exist
SCRIPT_EXECUTION_RESULT_CANCELLED = 3; SCRIPT_EXECUTION_RESULT_SCRIPT_DOES_NOT_EXIST = 3;
// The script execution was denied due to insufficient permissionss // The script is not executable
SCRIPT_EXECUTION_RESULT_PERMISSION_DENIED = 4; SCRIPT_EXECUTION_RESULT_SCRIPT_NOT_EXECUTABLE = 4;
// The script execution was denied due to a timeout // The script execution failed due to a script error
SCRIPT_EXECUTION_RESULT_TIMEOUT = 5; SCRIPT_EXECUTION_RESULT_SCRIPT_ERROR = 5;
// The script execution failed during setup, e.g. due to configuration errors
SCRIPT_EXECUTION_RESULT_SCRIPT_SETUP_ERROR = 6;
// The script execution timed out
SCRIPT_EXECUTION_RESULT_SCRIPT_TIMEOUT = 7;
// The script execution was cancelled for another reason
SCRIPT_EXECUTION_RESULT_CANCELLED = 8;
// The script execution was denied due to insufficient permissions
SCRIPT_EXECUTION_RESULT_PERMISSION_DENIED = 9;
// The script is running and the result is not yet available (only for async scripts) // The script is running and the result is not yet available (only for async scripts)
SCRIPT_EXECUTION_RESULT_RUNNING = 6; SCRIPT_EXECUTION_RESULT_RUNNING = 10;
// The script execution was denied due to a missing script file
SCRIPT_EXECUTION_RESULT_MISSING_SCRIPT_FILE = 7;
} }
// IDEA: Give the script execution an id to be able to track it // IDEA: Give the script execution an id to be able to track it
...@@ -90,7 +98,7 @@ message ExecuteScriptResponse { ...@@ -90,7 +98,7 @@ message ExecuteScriptResponse {
string execution_end_datetime = 9; string execution_end_datetime = 9;
// IDEA: The duration of the script execution // IDEA: The duration of the script execution
string execution_duration = 10; string execution_duration = 10;
// IDEA: Return a list of files created by the script. These files will be available for download. // IDEA: Return a list of files created by the script. These files will be available for download.
// The files will be deleted after a certain time? How should the server know about // The files will be deleted after a certain time? How should the server know about
// about these? // about these?
repeated string created_files = 11; repeated string created_files = 11;
...@@ -101,4 +109,8 @@ service ServerSideScriptingService { ...@@ -101,4 +109,8 @@ service ServerSideScriptingService {
rpc ExecuteScript(ExecuteScriptRequest) returns (ExecuteScriptResponse) {} rpc ExecuteScript(ExecuteScriptRequest) returns (ExecuteScriptResponse) {}
// IDEA: Get the status of a script execution // IDEA: Get the status of a script execution
rpc GetScriptExecutionStatus(ScriptExecutionId) returns (ExecuteScriptResponse) {} rpc GetScriptExecutionStatus(ScriptExecutionId) returns (ExecuteScriptResponse) {}
// IDEA: Delete temp files (only for admins?)
// rpc DeleteTempFiles(DeleteTempFilesRequest) returns (DeleteTempFilesResponse) {}
// IDEA: Wait for a script execution to finish
// rpc WaitForScriptExecution(ScriptExecutionId, TimeoutDuration) returns (ExecuteScriptResponse) {}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment