|
52 | 52 | 'd|engine=s' => \(my $dx_host),
|
53 | 53 | 'container_name=s' => \(my $container_name),
|
54 | 54 | 'template_name=s' => \(my $template_name),
|
| 55 | + 'branch_name=s' => \(my $branch_name), |
55 | 56 | 'container_def=s@' => \(my $container_def),
|
56 | 57 | 'container_owner=s@' => \(my $container_owners),
|
57 | 58 | 'timestamp=s' => \(my $timestamp),
|
|
142 | 143 | } elsif (lc $action eq 'refresh') {
|
143 | 144 | $jobno = $jscontainers->refreshContainer($jscontainer_ref);
|
144 | 145 | } elsif (lc $action eq 'restore') {
|
| 146 | + if (!defined($timestamp)) { |
| 147 | + print "Timestamp is required\n"; |
| 148 | + exit(1); |
| 149 | + } |
145 | 150 | my $branch_ref;
|
146 | 151 | if (defined($fromtemplate)) {
|
147 | 152 | if (!defined($template_ref)) {
|
|
150 | 155 | }
|
151 | 156 | my $branch_obj = new JS_branch_obj ( $engine_obj, $template_ref, $debug);
|
152 | 157 | $branch_ref = $branch_obj->getJSBranchByName('master');
|
153 |
| - $jobno = $jscontainers->restoreContainer($jscontainer_ref, $branch_ref->[0], $timestamp, $template_ref); |
| 158 | + $jobno = $jscontainers->restoreContainer($jscontainer_ref, $branch_ref, $timestamp, $template_ref); |
154 | 159 | } else {
|
155 |
| - my $branch_obj = new JS_branch_obj ( $engine_obj, $jscontainer_ref, $debug); |
156 |
| - $branch_ref = $branch_obj->getJSBranchByName('default'); |
157 |
| - $jobno = $jscontainers->restoreContainer($jscontainer_ref, $branch_ref->[0], $timestamp, $jscontainer_ref); |
| 160 | + if (defined($branch_name)) { |
| 161 | + my $branch_obj = new JS_branch_obj ( $engine_obj, $jscontainer_ref, $debug); |
| 162 | + $branch_ref = $branch_obj->getJSBranchByName($branch_name); |
| 163 | + } else { |
| 164 | + $branch_ref = $jscontainers->getJSActiveBranch($jscontainer_ref); |
| 165 | + } |
| 166 | + $jobno = $jscontainers->restoreContainer($jscontainer_ref, $branch_ref, $timestamp, $jscontainer_ref); |
158 | 167 | }
|
159 | 168 | } elsif (lc $action eq 'delete') {
|
160 | 169 | if (!defined($dropvdb) || ( ! ( ( lc $dropvdb eq 'yes' ) || (lc $dropvdb eq 'no' ) ) ) ) {
|
@@ -351,13 +360,14 @@ =head1 SYNOPSIS
|
351 | 360 | [-container_owner username]
|
352 | 361 | [-template_name template_name]
|
353 | 362 | [-timestamp timestamp]
|
| 363 | + [-branch_name branch_name] |
354 | 364 | [-dropvdb yes|no]
|
355 | 365 | [-dontrefresh]
|
356 | 366 | [ -help|? ] [ -debug ]
|
357 | 367 |
|
358 | 368 | =head1 DESCRIPTION
|
359 | 369 |
|
360 |
| -Run a action on the JetStream container |
| 370 | +Run a action on the JetStream container. If branch is not specified |
361 | 371 |
|
362 | 372 | =head1 ARGUMENTS
|
363 | 373 |
|
@@ -412,6 +422,9 @@ =head1 ARGUMENTS
|
412 | 422 | =item B<-template_name template_name>
|
413 | 423 | Name of container's templates
|
414 | 424 |
|
| 425 | +=item B<-branch_name branch_name> |
| 426 | +Container branch name for action - default branch name is "default" |
| 427 | +
|
415 | 428 | =back
|
416 | 429 |
|
417 | 430 | =head1 OPTIONS
|
|
0 commit comments