Debian Codegraph @

script/ecaccess-event-delete

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