@Override public void doDeployStream(StreamDefinition streamDefinition, Map<String, String> deploymentProperties) { Map<String, String> deploymentPropertiesToUse = deploymentProperties.entrySet().stream() .filter(mapEntry -> !mapEntry.getKey().startsWith(SkipperStream.SKIPPER_KEY_PREFIX)) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); List<AppDeploymentRequest> appDeploymentRequests = this.appDeploymentRequestCreator .createRequests(streamDefinition, deploymentPropertiesToUse); DeploymentPropertiesUtils.validateDeploymentProperties(deploymentPropertiesToUse); this.appDeployerStreamDeployer.deployStream(new StreamDeploymentRequest(streamDefinition.getName(), streamDefinition.getDslText(), appDeploymentRequests, new HashMap<>())); }
/** * 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); }
@CliCommand(value = LAUNCH, help = "Launch a previously created task") public String launch( @CliOption(key = { "", "name" }, help = "the name of the task to launch", mandatory = true, optionContext = "existing-task disable-string-converter") String name, @CliOption(key = { PROPERTIES_OPTION }, help = "the properties for this launch") String properties, @CliOption(key = { PROPERTIES_FILE_OPTION }, help = "the properties for this launch (as a File)") File propertiesFile, @CliOption(key = { ARGUMENTS_OPTION }, help = "the commandline arguments for this launch") String arguments, @CliOption(key = { PLATFORM_NAME}, help = "the platform name to use for this launch", unspecifiedDefaultValue = "default") String platformName) throws IOException { int which = Assertions.atMostOneOf(PROPERTIES_OPTION, properties, PROPERTIES_FILE_OPTION, propertiesFile); Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parseDeploymentProperties(properties, propertiesFile, which); List<String> argumentsToUse = new ArrayList<String>(); if (StringUtils.hasText(arguments)) { argumentsToUse.add(arguments); } DeploymentPropertiesUtils.validateDeploymentProperties(propertiesToUse); if (StringUtils.hasText(platformName)) { propertiesToUse.put("spring.cloud.dataflow.task.platformName", platformName); } taskOperations().launch(name, propertiesToUse, argumentsToUse); return String.format("Launched task '%s'", name); }
@CliCommand(value = LAUNCH, help = "Launch a previously created task") public String launch( @CliOption(key = { "", "name" }, help = "the name of the task to launch", mandatory = true, optionContext = "existing-task disable-string-converter") String name, @CliOption(key = { PROPERTIES_OPTION }, help = "the properties for this launch", mandatory = false) String properties, @CliOption(key = { PROPERTIES_FILE_OPTION }, help = "the properties for this launch (as a File)", mandatory = false) File propertiesFile, @CliOption(key = { ARGUMENTS_OPTION }, help = "the commandline arguments for this launch", mandatory = false) String arguments) throws IOException { int which = Assertions.atMostOneOf(PROPERTIES_OPTION, properties, PROPERTIES_FILE_OPTION, propertiesFile); Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parseDeploymentProperties(properties, propertiesFile, which); List<String> argumentsToUse = new ArrayList<String>(); if (StringUtils.hasText(arguments)) { argumentsToUse.add(arguments); } DeploymentPropertiesUtils.validateDeploymentProperties(propertiesToUse); taskOperations().launch(name, propertiesToUse, argumentsToUse); return String.format("Launched task '%s'", name); }
DeploymentPropertiesUtils.validateDeploymentProperties(taskDeploymentProperties);
DeploymentPropertiesUtils.validateDeploymentProperties(taskDeploymentProperties); taskDeploymentProperties = extractAndQualifySchedulerProperties(taskDeploymentProperties); ScheduleRequest scheduleRequest = new ScheduleRequest(revisedDefinition, taskDeploymentProperties,
DeploymentPropertiesUtils.validateDeploymentProperties(taskDeploymentProperties); taskDeploymentProperties = extractAndQualifySchedulerProperties(taskDeploymentProperties); ScheduleRequest scheduleRequest = new ScheduleRequest(revisedDefinition, taskDeploymentProperties,