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

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3