[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.1 - (view) (download) (as text)

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3