Debian Codegraph @

script/ecaccess-gateway-name

raw
1 #!/usr/bin/perl -w
2 #
3 # ecaccess-gateway-name: Display the name of the default ECaccess Gateway
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 # Display version if requested
24 die ECMWF::ECaccess->VERSION . "\n" if ( $opt{version} );
25
26 pod2usage( -noperldoc => 1, -exit => 1, verbose => 1 ) if ( $opt{help} );
27 pod2usage( -noperldoc => 1, -exit => 1, verbose => 2 ) if ( $opt{manual} );
28
29 # Create the ECaccess Controler
30 my $ecaccess = ECMWF::ECaccess->new( $opt{retry}, $opt{debug});
31
32 # Get the Control Channel
33 my $controlChannel = $ecaccess->getControlChannel();
34
35 # Display the Gateway Name
36 print $controlChannel->getGatewayName()->result . "\n";
37
38 __END__
39
40 =head1 NAME
41
42 ecaccess-gateway-name - Display the name of the default ECaccess Gateway
43
44 =head1 SYNOPSIS
45
46 B<ecaccess-gateway-name -version|-help|-manual>
47
48 B<ecaccess-gateway-name [-debug]>
49
50 =head1 DESCRIPTION
51
52 Display the Name of the Gateway you are connected to.
53
54 If you want to use another Gateway (e.g. a local Gateway) instead
55 of the default boaccess.ecmwf.int Gateway then you can use the
56 following environment parameters:
57
58 http_ecaccess=gateway.meteo.ms:9080
59 https_ecaccess=gateway.meteo.ms:9443
60
61 (e.g. if your local ECaccess Gateway name is "gateway.meteo.ms" and
62 you are using the default ECaccess http/s ports 9080/9443)
63
64 =head1 OPTIONS
65
66 =over 8
67
68 =item B<-version>
69
70 Display version number and exits.
71
72 =item B<-help>
73
74 Print a brief help message and exits.
75
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 EXAMPLES
94
95 B<ecaccess-gateway-name>
96
97 Display the name of the current ECaccess Gateway.
98
99 =head1 SEE ALSO
100
101 B<ecaccess-gateway-list>, B<ecaccess-gateway-connected>, B<ecaccess>.
102
103 =cut