@CliCommand(value = STREAM_DEPLOY, help = "Deploy a previously created stream using Skipper") public String deployStream( @CliOption(key = { "", "name" }, help = "the name of the stream to deploy", mandatory = true, optionContext = "existing-stream disable-string-converter") String name, @CliOption(key = { PROPERTIES_OPTION }, help = "the properties for this deployment") String deploymentProperties, @CliOption(key = { PROPERTIES_FILE_OPTION }, help = "the properties for this deployment (as a File)") File propertiesFile, @CliOption(key = "packageVersion", help = "the package version of the package to deploy. Default is 1.0.0", unspecifiedDefaultValue = "1.0.0") String packageVersion, @CliOption(key = "platformName", help = "the name of the target platform to deploy to") String platformName, @CliOption(key = "repoName", help = "the name of the local repository to upload the package to") String repoName) throws IOException { int which = Assertions.atMostOneOf(PROPERTIES_OPTION, deploymentProperties, PROPERTIES_FILE_OPTION, propertiesFile); Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parseDeploymentProperties(deploymentProperties, propertiesFile, which); propertiesToUse.put(SkipperStream.SKIPPER_PACKAGE_NAME, name); Assert.isTrue(StringUtils.hasText(packageVersion), "Package version must be set."); propertiesToUse.put(SkipperStream.SKIPPER_PACKAGE_VERSION, packageVersion); if (StringUtils.hasText(platformName)) { propertiesToUse.put(SkipperStream.SKIPPER_PLATFORM_NAME, platformName); } if (StringUtils.hasText(repoName)) { propertiesToUse.put(SkipperStream.SKIPPER_REPO_NAME, repoName); } streamOperations().deploy(name, propertiesToUse); return String.format("Deployment request has been sent for stream '%s'", name); }
@CliCommand(value = STREAM_SKIPPER_DEPLOY, help = "Deploy a previously created stream using Skipper") public String deployStream( @CliOption(key = { "", "name" }, help = "the name of the stream to deploy", mandatory = true, optionContext = "existing-stream disable-string-converter") String name, @CliOption(key = { PROPERTIES_OPTION }, help = "the properties for this deployment") String deploymentProperties, @CliOption(key = { PROPERTIES_FILE_OPTION }, help = "the properties for this deployment (as a File)") File propertiesFile, @CliOption(key = "packageVersion", help = "the package version of the package to deploy. Default is 1.0.0" + "when using Skipper", unspecifiedDefaultValue = "1.0.0") String packageVersion, @CliOption(key = "platformName", help = "the name of the target platform to deploy when using Skipper") String platformName, @CliOption(key = "repoName", help = "the name of the local repository to upload the package when using " + "Skipper") String repoName) throws IOException { int which = Assertions.atMostOneOf(PROPERTIES_OPTION, deploymentProperties, PROPERTIES_FILE_OPTION, propertiesFile); Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parseDeploymentProperties(deploymentProperties, propertiesFile, which); propertiesToUse.put(SkipperStream.SKIPPER_PACKAGE_NAME, name); Assert.isTrue(StringUtils.hasText(packageVersion), "Package version must be set when using Skipper."); propertiesToUse.put(SkipperStream.SKIPPER_PACKAGE_VERSION, packageVersion); if (StringUtils.hasText(platformName)) { propertiesToUse.put(SkipperStream.SKIPPER_PLATFORM_NAME, platformName); } if (StringUtils.hasText(repoName)) { propertiesToUse.put(SkipperStream.SKIPPER_REPO_NAME, repoName); } streamOperations().deploy(name, propertiesToUse); return String.format("Deployment request has been sent for stream '%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") 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); }
@CliCommand(value = DEPLOY_STREAM, help = "Deploy a previously created stream") public String deployStream( @CliOption(key = { "", "name" }, help = "the name of the stream to deploy", mandatory = true, optionContext = "existing-stream disable-string-converter") String name, @CliOption(key = { PROPERTIES_OPTION }, help = "the properties for this deployment") String deploymentProperties, @CliOption(key = { PROPERTIES_FILE_OPTION }, help = "the properties for this deployment (as a File)") File propertiesFile) throws IOException { int which = Assertions.atMostOneOf(PROPERTIES_OPTION, deploymentProperties, PROPERTIES_FILE_OPTION, propertiesFile); Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parseDeploymentProperties(deploymentProperties, propertiesFile, which); streamOperations().deploy(name, propertiesToUse); return String.format("Deployment request has been sent for stream '%s'\n", name); } }
Assert.isTrue(force, "App names can be used only when the stream update is forced."); Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parseDeploymentProperties(properties, propertiesFile, which);
Assert.isTrue(force, "App names can be used only when the stream update is forced."); Map<String, String> propertiesToUse = DeploymentPropertiesUtils.parseDeploymentProperties(properties, propertiesFile, which);