You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support to allow user to set useJsonJobParameters for job relaunch via the shell.
Note: there are not tests for the shell update in this commit. This is because the current
set of tests rely on @EnableDataflowServer which does not work. But before we fix
@EnableDataflowServer we need to make sure we want to carry it forward per Issue spring-cloud#1040
Copy file name to clipboardExpand all lines: spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/JobOperations.java
+10
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,16 @@ public interface JobOperations {
42
42
*/
43
43
voidexecutionRestart(longid);
44
44
45
+
/**
46
+
* Restarts a job by id
47
+
*
48
+
* @param id job execution id
49
+
* @param useJsonJobParameters if true {@link org.springframework.batch.core.JobParameters} will be serialized to JSON.
50
+
* Default is {@code Null} which will serialize the {@link org.springframework.batch.core.JobParameters}
51
+
* to the default specified in SCDF's configuration.
Copy file name to clipboardExpand all lines: spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/JobTemplate.java
+8
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,14 @@ public void executionRestart(long id) {
Copy file name to clipboardExpand all lines: spring-cloud-dataflow-shell-core/src/main/java/org/springframework/cloud/dataflow/shell/command/JobCommands.java
+11-2
Original file line number
Diff line number
Diff line change
@@ -107,8 +107,17 @@ public Table executionList(
107
107
@ShellMethod(key = EXECUTION_RESTART, value = "Restart a failed job by jobExecutionId")
108
108
@ShellMethodAvailability("availableWithViewRole")
109
109
publicStringexecutionRestart(
110
-
@ShellOption(help = "the job execution id") longid) {
111
-
jobOperations().executionRestart(id);
110
+
@ShellOption(help = "the job executiond id") longid,
111
+
@ShellOption(value = "--useJsonJobParameters",
112
+
help = "boolean value serialize job parameter as Json. " +
113
+
"Default is null, meaning SCDF default will be used.",
0 commit comments