File Coverage

blib/lib/Paws/CloudTrail.pm
Criterion Covered Total %
statement 13 71 18.3
branch 0 4 0.0
condition n/a
subroutine 5 22 22.7
pod 15 20 75.0
total 33 117 28.2


line stmt bran cond sub pod time code
1             package Paws::CloudTrail;
2 1     1   1211 use Moose;
  1     2   3  
  1         7  
  2         1835  
  2         4  
  2         14  
3 4     4 0 13 sub service { 'cloudtrail' }
4 0     0 0 0 sub version { '2013-11-01' }
5 0     0 0 0 sub target_prefix { 'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101' }
6 0     0 0 0 sub json_version { "1.1" }
7             has max_attempts => (is => 'ro', isa => 'Int', default => 5);
8             has retry => (is => 'ro', isa => 'HashRef', default => sub {
9             { base => 'rand', type => 'exponential', growth_factor => 2 }
10             });
11             has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [
12             ] });
13              
14             with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::JsonCaller', 'Paws::Net::JsonResponse';
15              
16            
17             sub AddTags {
18 0     0 1 0 my $self = shift;
19 0         0 my $call_object = $self->new_with_coercions('Paws::CloudTrail::AddTags', @_);
20 0         0 return $self->caller->do_call($self, $call_object);
21             }
22             sub CreateTrail {
23 0     0 1 0 my $self = shift;
24 0         0 my $call_object = $self->new_with_coercions('Paws::CloudTrail::CreateTrail', @_);
25 0         0 return $self->caller->do_call($self, $call_object);
26             }
27             sub DeleteTrail {
28 0     0 1 0 my $self = shift;
29 0         0 my $call_object = $self->new_with_coercions('Paws::CloudTrail::DeleteTrail', @_);
30 0         0 return $self->caller->do_call($self, $call_object);
31             }
32             sub DescribeTrails {
33 0     0 1 0 my $self = shift;
34 0         0 my $call_object = $self->new_with_coercions('Paws::CloudTrail::DescribeTrails', @_);
35 0         0 return $self->caller->do_call($self, $call_object);
36             }
37             sub GetEventSelectors {
38 0     0 1 0 my $self = shift;
39 0         0 my $call_object = $self->new_with_coercions('Paws::CloudTrail::GetEventSelectors', @_);
40 0         0 return $self->caller->do_call($self, $call_object);
41             }
42             sub GetTrailStatus {
43 1     1 1 262 my $self = shift;
44 1         7 my $call_object = $self->new_with_coercions('Paws::CloudTrail::GetTrailStatus', @_);
45 1         447 return $self->caller->do_call($self, $call_object);
46             }
47             sub ListPublicKeys {
48 0     0 1 0 my $self = shift;
49 0         0 my $call_object = $self->new_with_coercions('Paws::CloudTrail::ListPublicKeys', @_);
50 0         0 return $self->caller->do_call($self, $call_object);
51             }
52             sub ListTags {
53 0     0 1 0 my $self = shift;
54 0         0 my $call_object = $self->new_with_coercions('Paws::CloudTrail::ListTags', @_);
55 0         0 return $self->caller->do_call($self, $call_object);
56             }
57             sub LookupEvents {
58 1     1 1 351 my $self = shift;
59 1         7 my $call_object = $self->new_with_coercions('Paws::CloudTrail::LookupEvents', @_);
60 1         716 return $self->caller->do_call($self, $call_object);
61             }
62             sub PutEventSelectors {
63 0     0 1   my $self = shift;
64 0           my $call_object = $self->new_with_coercions('Paws::CloudTrail::PutEventSelectors', @_);
65 0           return $self->caller->do_call($self, $call_object);
66             }
67             sub RemoveTags {
68 0     0 1   my $self = shift;
69 0           my $call_object = $self->new_with_coercions('Paws::CloudTrail::RemoveTags', @_);
70 0           return $self->caller->do_call($self, $call_object);
71             }
72             sub StartLogging {
73 0     0 1   my $self = shift;
74 0           my $call_object = $self->new_with_coercions('Paws::CloudTrail::StartLogging', @_);
75 0           return $self->caller->do_call($self, $call_object);
76             }
77             sub StopLogging {
78 0     0 1   my $self = shift;
79 0           my $call_object = $self->new_with_coercions('Paws::CloudTrail::StopLogging', @_);
80 0           return $self->caller->do_call($self, $call_object);
81             }
82             sub UpdateTrail {
83 0     0 1   my $self = shift;
84 0           my $call_object = $self->new_with_coercions('Paws::CloudTrail::UpdateTrail', @_);
85 0           return $self->caller->do_call($self, $call_object);
86             }
87            
88             sub LookupAllEvents {
89 0     0 1   my $self = shift;
90              
91 0 0         my $callback = shift @_ if (ref($_[0]) eq 'CODE');
92 0           my $result = $self->LookupEvents(@_);
93 0           my $next_result = $result;
94              
95 0 0         if (not defined $callback) {
96 0           while ($next_result->NextToken) {
97 0           $next_result = $self->LookupEvents(@_, NextToken => $next_result->NextToken);
98 0           push @{ $result->Events }, @{ $next_result->Events };
  0            
  0            
99             }
100 0           return $result;
101             } else {
102 0           while ($result->NextToken) {
103 0           $callback->($_ => 'Events') foreach (@{ $result->Events });
  0            
104 0           $result = $self->LookupEvents(@_, NextToken => $result->NextToken);
105             }
106 0           $callback->($_ => 'Events') foreach (@{ $result->Events });
  0            
107             }
108              
109             return undef
110 0           }
111              
112              
113 0     0 0   sub operations { qw/AddTags CreateTrail DeleteTrail DescribeTrails GetEventSelectors GetTrailStatus ListPublicKeys ListTags LookupEvents PutEventSelectors RemoveTags StartLogging StopLogging UpdateTrail / }
114              
115             1;
116              
117             ### main pod documentation begin ###
118              
119             =head1 NAME
120              
121             Paws::CloudTrail - Perl Interface to AWS AWS CloudTrail
122              
123             =head1 SYNOPSIS
124              
125             use Paws;
126              
127             my $obj = Paws->service('CloudTrail');
128             my $res = $obj->Method(
129             Arg1 => $val1,
130             Arg2 => [ 'V1', 'V2' ],
131             # if Arg3 is an object, the HashRef will be used as arguments to the constructor
132             # of the arguments type
133             Arg3 => { Att1 => 'Val1' },
134             # if Arg4 is an array of objects, the HashRefs will be passed as arguments to
135             # the constructor of the arguments type
136             Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
137             );
138              
139             =head1 DESCRIPTION
140              
141             AWS CloudTrail
142              
143             This is the CloudTrail API Reference. It provides descriptions of
144             actions, data types, common parameters, and common errors for
145             CloudTrail.
146              
147             CloudTrail is a web service that records AWS API calls for your AWS
148             account and delivers log files to an Amazon S3 bucket. The recorded
149             information includes the identity of the user, the start time of the
150             AWS API call, the source IP address, the request parameters, and the
151             response elements returned by the service.
152              
153             As an alternative to the API, you can use one of the AWS SDKs, which
154             consist of libraries and sample code for various programming languages
155             and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide
156             a convenient way to create programmatic access to AWSCloudTrail. For
157             example, the SDKs take care of cryptographically signing requests,
158             managing errors, and retrying requests automatically. For information
159             about the AWS SDKs, including how to download and install them, see the
160             Tools for Amazon Web Services page.
161              
162             See the AWS CloudTrail User Guide for information about the data that
163             is included with each AWS API call listed in the log files.
164              
165             =head1 METHODS
166              
167             =head2 AddTags(ResourceId => Str, [TagsList => ArrayRef[L<Paws::CloudTrail::Tag>]])
168              
169             Each argument is described in detail in: L<Paws::CloudTrail::AddTags>
170              
171             Returns: a L<Paws::CloudTrail::AddTagsResponse> instance
172              
173             Adds one or more tags to a trail, up to a limit of 50. Tags must be
174             unique per trail. Overwrites an existing tag's value when a new value
175             is specified for an existing tag key. If you specify a key without a
176             value, the tag will be created with the specified key and a value of
177             null. You can tag a trail that applies to all regions only from the
178             region in which the trail was created (that is, from its home region).
179              
180              
181             =head2 CreateTrail(Name => Str, S3BucketName => Str, [CloudWatchLogsLogGroupArn => Str, CloudWatchLogsRoleArn => Str, EnableLogFileValidation => Bool, IncludeGlobalServiceEvents => Bool, IsMultiRegionTrail => Bool, KmsKeyId => Str, S3KeyPrefix => Str, SnsTopicName => Str])
182              
183             Each argument is described in detail in: L<Paws::CloudTrail::CreateTrail>
184              
185             Returns: a L<Paws::CloudTrail::CreateTrailResponse> instance
186              
187             Creates a trail that specifies the settings for delivery of log data to
188             an Amazon S3 bucket. A maximum of five trails can exist in a region,
189             irrespective of the region in which they were created.
190              
191              
192             =head2 DeleteTrail(Name => Str)
193              
194             Each argument is described in detail in: L<Paws::CloudTrail::DeleteTrail>
195              
196             Returns: a L<Paws::CloudTrail::DeleteTrailResponse> instance
197              
198             Deletes a trail. This operation must be called from the region in which
199             the trail was created. C<DeleteTrail> cannot be called on the shadow
200             trails (replicated trails in other regions) of a trail that is enabled
201             in all regions.
202              
203              
204             =head2 DescribeTrails([IncludeShadowTrails => Bool, TrailNameList => ArrayRef[Str|Undef]])
205              
206             Each argument is described in detail in: L<Paws::CloudTrail::DescribeTrails>
207              
208             Returns: a L<Paws::CloudTrail::DescribeTrailsResponse> instance
209              
210             Retrieves settings for the trail associated with the current region for
211             your account.
212              
213              
214             =head2 GetEventSelectors(TrailName => Str)
215              
216             Each argument is described in detail in: L<Paws::CloudTrail::GetEventSelectors>
217              
218             Returns: a L<Paws::CloudTrail::GetEventSelectorsResponse> instance
219              
220             Describes the settings for the event selectors that you configured for
221             your trail. The information returned for your event selectors includes
222             the following:
223              
224             =over
225              
226             =item *
227              
228             The S3 objects that you are logging for data events.
229              
230             =item *
231              
232             If your event selector includes management events.
233              
234             =item *
235              
236             If your event selector includes read-only events, write-only events, or
237             all.
238              
239             =back
240              
241             For more information, see Logging Data and Management Events for Trails
242             in the I<AWS CloudTrail User Guide>.
243              
244              
245             =head2 GetTrailStatus(Name => Str)
246              
247             Each argument is described in detail in: L<Paws::CloudTrail::GetTrailStatus>
248              
249             Returns: a L<Paws::CloudTrail::GetTrailStatusResponse> instance
250              
251             Returns a JSON-formatted list of information about the specified trail.
252             Fields include information on delivery errors, Amazon SNS and Amazon S3
253             errors, and start and stop logging times for each trail. This operation
254             returns trail status from a single region. To return trail status from
255             all regions, you must call the operation on each region.
256              
257              
258             =head2 ListPublicKeys([EndTime => Str, NextToken => Str, StartTime => Str])
259              
260             Each argument is described in detail in: L<Paws::CloudTrail::ListPublicKeys>
261              
262             Returns: a L<Paws::CloudTrail::ListPublicKeysResponse> instance
263              
264             Returns all public keys whose private keys were used to sign the digest
265             files within the specified time range. The public key is needed to
266             validate digest files that were signed with its corresponding private
267             key.
268              
269             CloudTrail uses different private/public key pairs per region. Each
270             digest file is signed with a private key unique to its region.
271             Therefore, when you validate a digest file from a particular region,
272             you must look in the same region for its corresponding public key.
273              
274              
275             =head2 ListTags(ResourceIdList => ArrayRef[Str|Undef], [NextToken => Str])
276              
277             Each argument is described in detail in: L<Paws::CloudTrail::ListTags>
278              
279             Returns: a L<Paws::CloudTrail::ListTagsResponse> instance
280              
281             Lists the tags for the trail in the current region.
282              
283              
284             =head2 LookupEvents([EndTime => Str, LookupAttributes => ArrayRef[L<Paws::CloudTrail::LookupAttribute>], MaxResults => Int, NextToken => Str, StartTime => Str])
285              
286             Each argument is described in detail in: L<Paws::CloudTrail::LookupEvents>
287              
288             Returns: a L<Paws::CloudTrail::LookupEventsResponse> instance
289              
290             Looks up API activity events captured by CloudTrail that create,
291             update, or delete resources in your account. Events for a region can be
292             looked up for the times in which you had CloudTrail turned on in that
293             region during the last seven days. Lookup supports the following
294             attributes:
295              
296             =over
297              
298             =item *
299              
300             Event ID
301              
302             =item *
303              
304             Event name
305              
306             =item *
307              
308             Event source
309              
310             =item *
311              
312             Resource name
313              
314             =item *
315              
316             Resource type
317              
318             =item *
319              
320             User name
321              
322             =back
323              
324             All attributes are optional. The default number of results returned is
325             10, with a maximum of 50 possible. The response includes a token that
326             you can use to get the next page of results.
327              
328             The rate of lookup requests is limited to one per second per account.
329             If this limit is exceeded, a throttling error occurs.
330              
331             Events that occurred during the selected time range will not be
332             available for lookup if CloudTrail logging was not enabled when the
333             events occurred.
334              
335              
336             =head2 PutEventSelectors(EventSelectors => ArrayRef[L<Paws::CloudTrail::EventSelector>], TrailName => Str)
337              
338             Each argument is described in detail in: L<Paws::CloudTrail::PutEventSelectors>
339              
340             Returns: a L<Paws::CloudTrail::PutEventSelectorsResponse> instance
341              
342             Configures an event selector for your trail. Use event selectors to
343             specify whether you want your trail to log management and/or data
344             events. When an event occurs in your account, CloudTrail evaluates the
345             event selectors in all trails. For each trail, if the event matches any
346             event selector, the trail processes and logs the event. If the event
347             doesn't match any event selector, the trail doesn't log the event.
348              
349             Example
350              
351             =over
352              
353             =item 1.
354              
355             You create an event selector for a trail and specify that you want
356             write-only events.
357              
358             =item 2.
359              
360             The EC2 C<GetConsoleOutput> and C<RunInstances> API operations occur in
361             your account.
362              
363             =item 3.
364              
365             CloudTrail evaluates whether the events match your event selectors.
366              
367             =item 4.
368              
369             The C<RunInstances> is a write-only event and it matches your event
370             selector. The trail logs the event.
371              
372             =item 5.
373              
374             The C<GetConsoleOutput> is a read-only event but it doesn't match your
375             event selector. The trail doesn't log the event.
376              
377             =back
378              
379             The C<PutEventSelectors> operation must be called from the region in
380             which the trail was created; otherwise, an
381             C<InvalidHomeRegionException> is thrown.
382              
383             You can configure up to five event selectors for each trail. For more
384             information, see Logging Data and Management Events for Trails in the
385             I<AWS CloudTrail User Guide>.
386              
387              
388             =head2 RemoveTags(ResourceId => Str, [TagsList => ArrayRef[L<Paws::CloudTrail::Tag>]])
389              
390             Each argument is described in detail in: L<Paws::CloudTrail::RemoveTags>
391              
392             Returns: a L<Paws::CloudTrail::RemoveTagsResponse> instance
393              
394             Removes the specified tags from a trail.
395              
396              
397             =head2 StartLogging(Name => Str)
398              
399             Each argument is described in detail in: L<Paws::CloudTrail::StartLogging>
400              
401             Returns: a L<Paws::CloudTrail::StartLoggingResponse> instance
402              
403             Starts the recording of AWS API calls and log file delivery for a
404             trail. For a trail that is enabled in all regions, this operation must
405             be called from the region in which the trail was created. This
406             operation cannot be called on the shadow trails (replicated trails in
407             other regions) of a trail that is enabled in all regions.
408              
409              
410             =head2 StopLogging(Name => Str)
411              
412             Each argument is described in detail in: L<Paws::CloudTrail::StopLogging>
413              
414             Returns: a L<Paws::CloudTrail::StopLoggingResponse> instance
415              
416             Suspends the recording of AWS API calls and log file delivery for the
417             specified trail. Under most circumstances, there is no need to use this
418             action. You can update a trail without stopping it first. This action
419             is the only way to stop recording. For a trail enabled in all regions,
420             this operation must be called from the region in which the trail was
421             created, or an C<InvalidHomeRegionException> will occur. This operation
422             cannot be called on the shadow trails (replicated trails in other
423             regions) of a trail enabled in all regions.
424              
425              
426             =head2 UpdateTrail(Name => Str, [CloudWatchLogsLogGroupArn => Str, CloudWatchLogsRoleArn => Str, EnableLogFileValidation => Bool, IncludeGlobalServiceEvents => Bool, IsMultiRegionTrail => Bool, KmsKeyId => Str, S3BucketName => Str, S3KeyPrefix => Str, SnsTopicName => Str])
427              
428             Each argument is described in detail in: L<Paws::CloudTrail::UpdateTrail>
429              
430             Returns: a L<Paws::CloudTrail::UpdateTrailResponse> instance
431              
432             Updates the settings that specify delivery of log files. Changes to a
433             trail do not require stopping the CloudTrail service. Use this action
434             to designate an existing bucket for log delivery. If the existing
435             bucket has previously been a target for CloudTrail log files, an IAM
436             policy exists for the bucket. C<UpdateTrail> must be called from the
437             region in which the trail was created; otherwise, an
438             C<InvalidHomeRegionException> is thrown.
439              
440              
441              
442              
443             =head1 PAGINATORS
444              
445             Paginator methods are helpers that repetively call methods that return partial results
446              
447             =head2 LookupAllEvents(sub { },[EndTime => Str, LookupAttributes => ArrayRef[L<Paws::CloudTrail::LookupAttribute>], MaxResults => Int, NextToken => Str, StartTime => Str])
448              
449             =head2 LookupAllEvents([EndTime => Str, LookupAttributes => ArrayRef[L<Paws::CloudTrail::LookupAttribute>], MaxResults => Int, NextToken => Str, StartTime => Str])
450              
451              
452             If passed a sub as first parameter, it will call the sub for each element found in :
453              
454             - Events, passing the object as the first parameter, and the string 'Events' as the second parameter
455              
456             If not, it will return a a L<Paws::CloudTrail::LookupEventsResponse> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
457              
458              
459              
460              
461              
462             =head1 SEE ALSO
463              
464             This service class forms part of L<Paws>
465              
466             =head1 BUGS and CONTRIBUTIONS
467              
468             The source code is located here: https://github.com/pplu/aws-sdk-perl
469              
470             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
471              
472             =cut
473