Class CommandApiController

java.lang.Object
jp.ecuacion.util.commandapi.web.controller.CommandApiController

@RestController public class CommandApiController extends Object
Provides the function to exescute specified script file.
  • 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 in ecuacion-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 like parameter=param1,param2, then script.sh param1 param2 will be executed. (parameters are splitted at "," and each csv element will be an parameter.)
      Throws:
      Exception - Exception