[Bio] / FigKernelScripts / svr_kill_RAST_job.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/svr_kill_RAST_job.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : olson 1.2 #!/usr/bin/perl
2 :    
3 :     #
4 :     # This is a SAS Component.
5 :     #
6 : olson 1.1
7 :     use RASTserver;
8 :     use strict;
9 :     use Getopt::Long;
10 :    
11 :     #
12 :     # Usage: svr_kill_RAST_job username password jobid [, jobid...]
13 :     #
14 :    
15 :     my $usage = "Usage: $0 [--verbose] username password jobid [ jobid jobid ... ]\n";
16 :    
17 :     my $verbose;
18 :     if (!GetOptions('verbose' => \$verbose))
19 :     {
20 :     die $usage;
21 :     }
22 :    
23 :     @ARGV > 2 or die $usage;
24 :    
25 :     my $username = shift;
26 :     my $password = shift;
27 :    
28 :     my @jobs = @ARGV;
29 :    
30 :     my $rast = new RASTserver($username, $password);
31 :    
32 :     my $res = $rast->kill_RAST_job( { -job => \@jobs } );
33 :    
34 :     for my $job (@jobs)
35 :     {
36 :     my $jdat = $res->{$job};
37 :     my $status = $jdat->{status};
38 :     my $err_msg = "(error message: $jdat->{error_msg})" if $status eq 'error';
39 :     print "Status from killing job $job: $status $err_msg\n";
40 :     if ($verbose)
41 :     {
42 :     print "\t$_\n" for @{$jdat->{messages}};
43 :     print "\n";
44 :     }
45 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3