/** * Request the launching of an existing task definition. The name must be included in the * path. * * @param taskName the name of the existing task to be executed (required) * @param properties the runtime properties for the task, as a comma-delimited list of * key=value pairs * @param arguments the runtime commandline arguments * @return the taskExecutionId for the executed task */ @RequestMapping(value = "", method = RequestMethod.POST, params = "name") @ResponseStatus(HttpStatus.CREATED) public long launch(@RequestParam("name") String taskName, @RequestParam(required = false) String properties, @RequestParam(required = false) String arguments) { Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parse(properties); List<String> argumentsToUse = DeploymentPropertiesUtils.parseParamList(arguments, " "); return this.taskExecutionService.executeTask(taskName, propertiesToUse, argumentsToUse); }
/** * Create a schedule for an existing * {@link org.springframework.cloud.dataflow.core.TaskDefinition} name. * * @param scheduleName the name of the schedule being created. * @param taskDefinitionName the name of the existing task to be executed (required) * @param properties the runtime properties for the task, as a comma-delimited list of * key=value pairs * @param arguments the runtime commandline arguments */ @RequestMapping(value = "", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public void save(@RequestParam("scheduleName") String scheduleName, @RequestParam("taskDefinitionName") String taskDefinitionName, @RequestParam String properties, @RequestParam(required = false) List<String> arguments) { Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parse(properties); schedulerService.schedule(scheduleName, taskDefinitionName, propertiesToUse, arguments); }
/** * Request deployment of an existing stream definition. * * @param name the name of an existing stream definition (required) * @param properties the deployment properties for the stream as a comma-delimited list of key=value pairs */ @RequestMapping(value = "/{name}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public void deploy(@PathVariable("name") String name, @RequestParam(required = false) String properties) { StreamDefinition stream = this.repository.findOne(name); Assert.notNull(stream, String.format("no stream defined: %s", name)); deployStream(stream, DeploymentPropertiesUtils.parse(properties)); }
/** * Request the launching of an existing task definition. The name must be included in * the path. * * @param taskName the name of the existing task to be executed (required) * @param properties the runtime properties for the task, as a comma-delimited list of * key=value pairs * @param arguments the runtime commandline arguments * @return the taskExecutionId for the executed task */ @RequestMapping(value = "", method = RequestMethod.POST, params = "name") @ResponseStatus(HttpStatus.CREATED) public long launch(@RequestParam("name") String taskName, @RequestParam(required = false) String properties, @RequestParam(required = false) String arguments) { Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parse(properties); DeploymentPropertiesUtils.validateDeploymentProperties(propertiesToUse); List<String> argumentsToUse = DeploymentPropertiesUtils.parseParamList(arguments, " "); return this.taskService.executeTask(taskName, propertiesToUse, argumentsToUse); }
/** * Create a schedule for an existing * {@link org.springframework.cloud.dataflow.core.TaskDefinition} name. * * @param scheduleName the name of the schedule being created. * @param taskDefinitionName the name of the existing task to be executed (required) * @param properties the runtime properties for the task, as a comma-delimited list of * key=value pairs * @param arguments the runtime commandline arguments */ @RequestMapping(value = "", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public void save(@RequestParam("scheduleName") String scheduleName, @RequestParam("taskDefinitionName") String taskDefinitionName, @RequestParam String properties, @RequestParam(required = false) List<String> arguments) { Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parse(properties); schedulerService.schedule(scheduleName, taskDefinitionName, propertiesToUse, arguments); }
private Map<String, String> getPropertiesForTask(String taskName, ComposedTaskProperties properties) { Map<String, String> taskDeploymentProperties = DeploymentPropertiesUtils.parse(properties.getComposedTaskProperties()); Map<String, String> deploymentProperties = new HashMap<>(); updateDeploymentProperties(String.format("app.%s.", taskName), taskDeploymentProperties, deploymentProperties); updateDeploymentProperties(String.format("deployer.%s.", taskName), taskDeploymentProperties, deploymentProperties); return deploymentProperties; }
switch (which) { case 0: propertiesToUse = parse(deploymentProperties); break; case 1:
switch (which) { case 0: propertiesToUse = parse(deploymentProperties); break; case 1: