Skip to content
Snippets Groups Projects

Add server-side scripting to gRPC API

Open Joscha Schmiedt requested to merge f-sss4grpc into dev
1 file
+ 18
18
Compare changes
  • Side-by-side
  • Inline
  • cb3eaa6b
    To clarify that the ServerSide API is only available on the server side, we should add "ServerSide" to the names of the scripting API. This will make it clear that the API is not available on the client side.
@@ -33,7 +33,7 @@ message NamedArgument {
string value = 2;
}
message ExecuteScriptRequest {
message ExecuteServerSideScriptRequest {
// The script to execute
string script_filename = 1;
// The timeout for the script execution in milliseconds
@@ -50,44 +50,44 @@ message ExecuteScriptRequest {
bool run_async = 7;
}
enum ScriptExecutionResult {
enum ServerSideScriptExecutionResult {
// The result of the script execution is unspecified
SCRIPT_EXECUTION_RESULT_UNSPECIFIED = 0;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_UNSPECIFIED = 0;
// The script execution was successful
SCRIPT_EXECUTION_RESULT_SUCCESS = 1;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_SUCCESS = 1;
// The script execution failed (general/unspecified failure)
SCRIPT_EXECUTION_RESULT_GENERAL_FAILURE = 2;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_GENERAL_FAILURE = 2;
// The script does not exist
SCRIPT_EXECUTION_RESULT_SCRIPT_DOES_NOT_EXIST = 3;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_SCRIPT_DOES_NOT_EXIST = 3;
// The script is not executable
SCRIPT_EXECUTION_RESULT_SCRIPT_NOT_EXECUTABLE = 4;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_SCRIPT_NOT_EXECUTABLE = 4;
// The script execution failed due to a script error
SCRIPT_EXECUTION_RESULT_SCRIPT_ERROR = 5;
SERVER_SIDE_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;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_SCRIPT_SETUP_ERROR = 6;
// The script execution timed out
SCRIPT_EXECUTION_RESULT_SCRIPT_TIMEOUT = 7;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_SCRIPT_TIMEOUT = 7;
// The script execution was cancelled for another reason
SCRIPT_EXECUTION_RESULT_CANCELLED = 8;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_CANCELLED = 8;
// The script execution was denied due to insufficient permissions
SCRIPT_EXECUTION_RESULT_PERMISSION_DENIED = 9;
SERVER_SIDE_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 = 10;
SERVER_SIDE_SCRIPT_EXECUTION_RESULT_RUNNING = 10;
}
// IDEA: Give the script execution an id to be able to track it
message ScriptExecutionId {
message ServerSideScriptExecutionId {
// Id of the script execution
string script_execution_id = 1;
}
message ExecuteScriptResponse {
message ExecuteServerSideScriptResponse {
// Id of the script execution
ScriptExecutionId script_execution_id = 1;
ServerSideScriptExecutionId script_execution_id = 1;
// The script to execute
string script_filename = 2;
// The result of the script execution
ScriptExecutionResult result = 3;
ServerSideScriptExecutionResult result = 3;
// Script return code
int32 return_code = 4;
// The standard output of the script
@@ -104,5 +104,5 @@ message ExecuteScriptResponse {
service ServerSideScriptingService {
// Executes a script on the server side
rpc ExecuteScript(ExecuteScriptRequest) returns (ExecuteScriptResponse) {}
rpc ExecuteServerSideScript(ExecuteServerSideScriptRequest) returns (ExecuteServerSideScriptResponse) {}
}
Loading