diff --git a/proto/caosdb/scripting/v1alpha1/scripting.proto b/proto/caosdb/scripting/v1alpha1/scripting.proto index c606c3a40f6e3d825654531b1fe0d1071d7eafe5..8b3d85f128dd184f855f2675eb2e7a416f9c7c9b 100644 --- a/proto/caosdb/scripting/v1alpha1/scripting.proto +++ b/proto/caosdb/scripting/v1alpha1/scripting.proto @@ -34,14 +34,16 @@ message NamedArgument { message ExecuteScriptRequest { // The script to execute string script_filename = 1; - // IDEA: Whether the script should be executed asynchronously - bool is_async = 2; + // The timeout for the script execution in milliseconds + int64 timeout_ms = 2; // The positional arguments for the script repeated string positional_arguments = 3; // The named arguments for the script repeated NamedArgument named_arguments = 4; // The files to be used by the script (will be uploaded to the server) repeated string script_files = 5; + // IDEA: Whether the script should be executed asynchronously + bool run_async = 6; } enum ScriptExecutionResult { @@ -51,16 +53,22 @@ enum ScriptExecutionResult { SCRIPT_EXECUTION_RESULT_SUCCESS = 1; // The script execution failed (general/unspecified failure) SCRIPT_EXECUTION_RESULT_GENERAL_FAILURE = 2; - // The script execution was cancelled - SCRIPT_EXECUTION_RESULT_CANCELLED = 3; - // The script execution was denied due to insufficient permissionss - SCRIPT_EXECUTION_RESULT_PERMISSION_DENIED = 4; - // The script execution was denied due to a timeout - SCRIPT_EXECUTION_RESULT_TIMEOUT = 5; + // The script does not exist + SCRIPT_EXECUTION_RESULT_SCRIPT_DOES_NOT_EXIST = 3; + // The script is not executable + SCRIPT_EXECUTION_RESULT_SCRIPT_NOT_EXECUTABLE = 4; + // The script execution failed due to a script error + 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) - SCRIPT_EXECUTION_RESULT_RUNNING = 6; - // The script execution was denied due to a missing script file - SCRIPT_EXECUTION_RESULT_MISSING_SCRIPT_FILE = 7; + SCRIPT_EXECUTION_RESULT_RUNNING = 10; } // IDEA: Give the script execution an id to be able to track it @@ -90,7 +98,7 @@ message ExecuteScriptResponse { string execution_end_datetime = 9; // IDEA: The duration of the script execution 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 // about these? repeated string created_files = 11; @@ -101,4 +109,8 @@ service ServerSideScriptingService { rpc ExecuteScript(ExecuteScriptRequest) returns (ExecuteScriptResponse) {} // IDEA: Get the status of a script execution 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) {} }