| 1 |
#!/usr/bin/perl -w |
| 2 |
# |
| 3 |
# ecaccess-cosinfo: Display ConsInfo from ECMWF |
| 4 |
# |
| 5 |
# [email protected] - 2010-10-15 |
| 6 |
|
| 7 |
use ECMWF::ECaccess; |
| 8 |
use Getopt::Long; |
| 9 |
use Pod::Usage; |
| 10 |
|
| 11 |
my %opt = ( version => 0, help => 0, manual => 0, retry => 0, debug => 0 ); |
| 12 |
|
| 13 |
pod2usage( -noperldoc => 1, -exit => 1, verbose => 1 ) if !GetOptions( |
| 14 |
\%opt, |
| 15 |
qw( |
| 16 |
version |
| 17 |
help|? |
| 18 |
manual |
| 19 |
retry=i |
| 20 |
debug |
| 21 |
) |
| 22 |
); |
| 23 |
|
| 24 |
# Display version if requested |
| 25 |
die ECMWF::ECaccess->VERSION . "\n" if ( $opt{version} ); |
| 26 |
|
| 27 |
pod2usage( -noperldoc => 1, -exit => 1, verbose => 1 ) if ( $opt{help} ); |
| 28 |
pod2usage( -noperldoc => 1, -exit => 1, verbose => 2 ) if ( $opt{manual} ); |
| 29 |
|
| 30 |
# Create the ECaccess Controler |
| 31 |
my $ecaccess = ECMWF::ECaccess->new( $opt{retry}, $opt{debug}); |
| 32 |
|
| 33 |
# Get the Token (using the Certificate in $HOME) |
| 34 |
my $token = $ecaccess->getToken(); |
| 35 |
|
| 36 |
# Get the Control Channel |
| 37 |
my $controlChannel = $ecaccess->getControlChannel(); |
| 38 |
|
| 39 |
# Display the ConsInfo |
| 40 |
print $controlChannel->getCosInfo($token)->result . "\n"; |
| 41 |
|
| 42 |
# Release the Token |
| 43 |
END { |
| 44 |
$ecaccess->releaseToken($token) if ($token); |
| 45 |
} |
| 46 |
|
| 47 |
__END__ |
| 48 |
|
| 49 |
=head1 NAME |
| 50 |
|
| 51 |
ecaccess-cosinfo - Display ConsInfo from ECMWF |
| 52 |
|
| 53 |
=head1 SYNOPSIS |
| 54 |
|
| 55 |
B<ecaccess-cosinfo -version|-help|-manual> |
| 56 |
|
| 57 |
B<ecaccess-cosinfo [-debug]> |
| 58 |
|
| 59 |
=head1 DESCRIPTION |
| 60 |
|
| 61 |
Cosinfo is the system used at ECMWF to provide computer operations |
| 62 |
system information, such as scheduled or unscheduled downtime of |
| 63 |
servers, applications or hardware. |
| 64 |
|
| 65 |
=head1 OPTIONS |
| 66 |
|
| 67 |
=over 8 |
| 68 |
|
| 69 |
=item B<-version> |
| 70 |
|
| 71 |
Display version number and exits. |
| 72 |
|
| 73 |
=item B<-help> |
| 74 |
|
| 75 |
Print a brief help message and exits. |
| 76 |
=item B<-manual> |
| 77 |
|
| 78 |
Prints the manual page and exits. |
| 79 |
|
| 80 |
=item B<-retry> I<count> |
| 81 |
|
| 82 |
Number of SSL connection retries per 5s to ECMWF. This parameter only apply to the |
| 83 |
initial SSL connection initiated by the command to the ECMWF server. It does not |
| 84 |
apply to all the subsequent requests made afteward as it is mainly targeting errors |
| 85 |
that can happen from time to time during the SSL handshake. Default is no retry. |
| 86 |
|
| 87 |
=item B<-debug> |
| 88 |
|
| 89 |
Display the SOAP and SSL messages exchanged. |
| 90 |
|
| 91 |
=back |
| 92 |
|
| 93 |
=head1 SEE ALSO |
| 94 |
|
| 95 |
B<ecaccess>. |
| 96 |
|
| 97 |
=cut |