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

Annotation of /FigKernelScripts/svr_status_of_RAST_job.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3