Debian Codegraph @

script/ecaccess-ectrans-delete

raw
1 #!/usr/bin/perl -w
2 #
3 # ecaccess-ectrans-delete: Delete ECtrans
4 #
5 # [email protected] - 2010-10-15
6
7 use ECMWF::ECaccess;
8 use Getopt::Long;
9 use Pod::Usage;
10
11 my %opt = (
12 version => 0,
13 help => 0,
14 manual => 0,
15 retry => 0,
16 debug => 0
17 );
18
19 pod2usage( -noperldoc => 1, -exit => 1, verbose => 1 ) if !GetOptions(
20 \%opt,
21 qw(
22 version
23 help|?
24 manual
25 retry=i
26 debug
27 )
28 );
29
30 # Display version if requested
31 die ECMWF::ECaccess->VERSION . "\n" if ( $opt{version} );
32
33 my $ectransId = $ARGV[0];
34
35 pod2usage( -noperldoc => 1, -exit => 1, verbose => 1 ) if ( $opt{help} );
36 pod2usage( -noperldoc => 1, -exit => 1, verbose => 2 ) if ( $opt{manual} );
37 pod2usage( -noperldoc => 1, -exit => 1, verbose => 0, -msg => "No ectrans-id specified!\n" ) if not($ectransId);
38
39 # Create the ECaccess Controler
40 my $ecaccess = ECMWF::ECaccess->new( $opt{retry}, $opt{debug});
41
42 # Get the Token (using the Certificate in $HOME)
43 my $token = $ecaccess->getToken();
44
45 # Get the Control Channel
46 my $controlChannel = $ecaccess->getControlChannel();
47
48 # Delete the ectrans
49 $controlChannel->deleteTransfer( $token, $ectransId );
50
51 # Logout
52 END {
53 $ecaccess->releaseToken($token) if ($token);
54 }
55
56 __END__
57
58 =head1 NAME
59
60 ecaccess-ectrans-delete - Delete ECtrans
61
62 =head1 SYNOPSIS
63
64 B<ecaccess-ectrans-delete -version|-help|-manual>
65
66 B<ecaccess-ectrans-delete [-debug]> I<ectrans-id>
67
68 =head1 DESCRIPTION
69
70 Allow deleting the ECtrans transfer with the I<ectrans-id> identifier from the ECtrans Spool.
71
72 =head1 ARGUMENTS
73
74 =over 8
75
76 =item I<ectrans-id>
77
78 The identifier of the ECtrans transfer to delete.
79
80 =back
81
82 =head1 OPTIONS
83
84 =over 8
85
86 =item B<-version>
87
88 Display version number and exits.
89
90 =item B<-help>
91
92 Print a brief help message and exits.
93
94 =item B<-manual>
95
96 Prints the manual page and exits.
97
98 =item B<-retry> I<count>
99
100 Number of SSL connection retries per 5s to ECMWF. This parameter only apply to the
101 initial SSL connection initiated by the command to the ECMWF server. It does not
102 apply to all the subsequent requests made afteward as it is mainly targeting errors
103 that can happen from time to time during the SSL handshake. Default is no retry.
104
105 =item B<-debug>
106
107 Display the SOAP and SSL messages exchanged.
108
109 =back
110
111 =head1 EXAMPLES
112
113 B<ecaccess-ectrans-delete> I<124356>
114
115 Delete the ECtrans transfer with the identifier I<124356>.
116
117 =head1 SEE ALSO
118
119 B<ecaccess-ectrans-list>, B<ecaccess-ectrans-request>, B<ecaccess-ectrans-restart> and B<ecaccess>.
120
121 =cut