[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.3 - (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 : olson 1.3 my $use_test_server = 0;
19 :     if (!GetOptions('verbose' => \$verbose,
20 :     'test' => \$use_test_server))
21 : olson 1.1 {
22 :     die $usage;
23 :     }
24 :    
25 :     @ARGV > 2 or die $usage;
26 :    
27 :     my $username = shift;
28 :     my $password = shift;
29 :    
30 :     my @jobs = @ARGV;
31 :    
32 : olson 1.3 my $rast = new RASTserver($username, $password, { -test => $use_test_server } );
33 : olson 1.1
34 :     my $res = $rast->kill_RAST_job( { -job => \@jobs } );
35 :    
36 :     for my $job (@jobs)
37 :     {
38 :     my $jdat = $res->{$job};
39 :     my $status = $jdat->{status};
40 :     my $err_msg = "(error message: $jdat->{error_msg})" if $status eq 'error';
41 :     print "Status from killing job $job: $status $err_msg\n";
42 :     if ($verbose)
43 :     {
44 :     print "\t$_\n" for @{$jdat->{messages}};
45 :     print "\n";
46 :     }
47 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3