Class CommandApiController
java.lang.Object
jp.ecuacion.util.commandapi.web.controller.CommandApiController
Provides the function to exescute specified script file.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CommandApiController
public CommandApiController()
-
-
Method Details
-
executeCommand
@GetMapping("api/public/executeScript") public Map<String,String> executeCommand(@RequestParam String scriptId, @RequestParam(required=false) String parameter) throws Exception Execute the script specified by the URL parameters.- Parameters:
scriptId- It's the key to the script file path defined inecuacion-tool-command-api.properties.
Since it's unsecure for API to be able to execute any scripts, executable scripts from API must be pre-defined.parameter- parameter given to the script. multiple parameters are able to be passed as comma-separated values.
When you pass parameters likeparameter=param1,param2, thenscript.sh param1 param2will be executed. (parameters are splitted at "," and each csv element will be an parameter.)- Throws:
Exception- Exception
-