File Coverage

blib/lib/Paws/CloudWatchEvents.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Paws::CloudWatchEvents;
2 1     1   1866 use Moose;
  1         2  
  1         7  
3             sub service { 'events' }
4             sub version { '2015-10-07' }
5             sub target_prefix { 'AWSEvents' }
6             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 DeleteRule {
18             my $self = shift;
19             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::DeleteRule', @_);
20             return $self->caller->do_call($self, $call_object);
21             }
22             sub DescribeEventBus {
23             my $self = shift;
24             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::DescribeEventBus', @_);
25             return $self->caller->do_call($self, $call_object);
26             }
27             sub DescribeRule {
28             my $self = shift;
29             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::DescribeRule', @_);
30             return $self->caller->do_call($self, $call_object);
31             }
32             sub DisableRule {
33             my $self = shift;
34             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::DisableRule', @_);
35             return $self->caller->do_call($self, $call_object);
36             }
37             sub EnableRule {
38             my $self = shift;
39             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::EnableRule', @_);
40             return $self->caller->do_call($self, $call_object);
41             }
42             sub ListRuleNamesByTarget {
43             my $self = shift;
44             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::ListRuleNamesByTarget', @_);
45             return $self->caller->do_call($self, $call_object);
46             }
47             sub ListRules {
48             my $self = shift;
49             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::ListRules', @_);
50             return $self->caller->do_call($self, $call_object);
51             }
52             sub ListTargetsByRule {
53             my $self = shift;
54             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::ListTargetsByRule', @_);
55             return $self->caller->do_call($self, $call_object);
56             }
57             sub PutEvents {
58             my $self = shift;
59             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::PutEvents', @_);
60             return $self->caller->do_call($self, $call_object);
61             }
62             sub PutPermission {
63             my $self = shift;
64             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::PutPermission', @_);
65             return $self->caller->do_call($self, $call_object);
66             }
67             sub PutRule {
68             my $self = shift;
69             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::PutRule', @_);
70             return $self->caller->do_call($self, $call_object);
71             }
72             sub PutTargets {
73             my $self = shift;
74             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::PutTargets', @_);
75             return $self->caller->do_call($self, $call_object);
76             }
77             sub RemovePermission {
78             my $self = shift;
79             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::RemovePermission', @_);
80             return $self->caller->do_call($self, $call_object);
81             }
82             sub RemoveTargets {
83             my $self = shift;
84             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::RemoveTargets', @_);
85             return $self->caller->do_call($self, $call_object);
86             }
87             sub TestEventPattern {
88             my $self = shift;
89             my $call_object = $self->new_with_coercions('Paws::CloudWatchEvents::TestEventPattern', @_);
90             return $self->caller->do_call($self, $call_object);
91             }
92            
93              
94              
95             sub operations { qw/DeleteRule DescribeEventBus DescribeRule DisableRule EnableRule ListRuleNamesByTarget ListRules ListTargetsByRule PutEvents PutPermission PutRule PutTargets RemovePermission RemoveTargets TestEventPattern / }
96              
97             1;
98              
99             ### main pod documentation begin ###
100              
101             =head1 NAME
102              
103             Paws::CloudWatchEvents - Perl Interface to AWS Amazon CloudWatch Events
104              
105             =head1 SYNOPSIS
106              
107             use Paws;
108              
109             my $obj = Paws->service('CloudWatchEvents');
110             my $res = $obj->Method(
111             Arg1 => $val1,
112             Arg2 => [ 'V1', 'V2' ],
113             # if Arg3 is an object, the HashRef will be used as arguments to the constructor
114             # of the arguments type
115             Arg3 => { Att1 => 'Val1' },
116             # if Arg4 is an array of objects, the HashRefs will be passed as arguments to
117             # the constructor of the arguments type
118             Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
119             );
120              
121             =head1 DESCRIPTION
122              
123             Amazon CloudWatch Events helps you to respond to state changes in your
124             AWS resources. When your resources change state, they automatically
125             send events into an event stream. You can create rules that match
126             selected events in the stream and route them to targets to take action.
127             You can also use rules to take action on a pre-determined schedule. For
128             example, you can configure rules to:
129              
130             =over
131              
132             =item *
133              
134             Automatically invoke an AWS Lambda function to update DNS entries when
135             an event notifies you that Amazon EC2 instance enters the running
136             state.
137              
138             =item *
139              
140             Direct specific API records from CloudTrail to an Amazon Kinesis stream
141             for detailed analysis of potential security or availability risks.
142              
143             =item *
144              
145             Periodically invoke a built-in target to create a snapshot of an Amazon
146             EBS volume.
147              
148             =back
149              
150             For more information about the features of Amazon CloudWatch Events,
151             see the Amazon CloudWatch Events User Guide.
152              
153             =head1 METHODS
154              
155             =head2 DeleteRule(Name => Str)
156              
157             Each argument is described in detail in: L<Paws::CloudWatchEvents::DeleteRule>
158              
159             Returns: nothing
160              
161             Deletes the specified rule.
162              
163             You must remove all targets from a rule using RemoveTargets before you
164             can delete the rule.
165              
166             When you delete a rule, incoming events might continue to match to the
167             deleted rule. Please allow a short period of time for changes to take
168             effect.
169              
170              
171             =head2 DescribeEventBus()
172              
173             Each argument is described in detail in: L<Paws::CloudWatchEvents::DescribeEventBus>
174              
175             Returns: a L<Paws::CloudWatchEvents::DescribeEventBusResponse> instance
176              
177             Displays the external AWS accounts that are permitted to write events
178             to your account using your account's event bus, and the associated
179             policy. To enable your account to receive events from other accounts,
180             use PutPermission.
181              
182              
183             =head2 DescribeRule(Name => Str)
184              
185             Each argument is described in detail in: L<Paws::CloudWatchEvents::DescribeRule>
186              
187             Returns: a L<Paws::CloudWatchEvents::DescribeRuleResponse> instance
188              
189             Describes the specified rule.
190              
191              
192             =head2 DisableRule(Name => Str)
193              
194             Each argument is described in detail in: L<Paws::CloudWatchEvents::DisableRule>
195              
196             Returns: nothing
197              
198             Disables the specified rule. A disabled rule won't match any events,
199             and won't self-trigger if it has a schedule expression.
200              
201             When you disable a rule, incoming events might continue to match to the
202             disabled rule. Please allow a short period of time for changes to take
203             effect.
204              
205              
206             =head2 EnableRule(Name => Str)
207              
208             Each argument is described in detail in: L<Paws::CloudWatchEvents::EnableRule>
209              
210             Returns: nothing
211              
212             Enables the specified rule. If the rule does not exist, the operation
213             fails.
214              
215             When you enable a rule, incoming events might not immediately start
216             matching to a newly enabled rule. Please allow a short period of time
217             for changes to take effect.
218              
219              
220             =head2 ListRuleNamesByTarget(TargetArn => Str, [Limit => Int, NextToken => Str])
221              
222             Each argument is described in detail in: L<Paws::CloudWatchEvents::ListRuleNamesByTarget>
223              
224             Returns: a L<Paws::CloudWatchEvents::ListRuleNamesByTargetResponse> instance
225              
226             Lists the rules for the specified target. You can see which of the
227             rules in Amazon CloudWatch Events can invoke a specific target in your
228             account.
229              
230              
231             =head2 ListRules([Limit => Int, NamePrefix => Str, NextToken => Str])
232              
233             Each argument is described in detail in: L<Paws::CloudWatchEvents::ListRules>
234              
235             Returns: a L<Paws::CloudWatchEvents::ListRulesResponse> instance
236              
237             Lists your Amazon CloudWatch Events rules. You can either list all the
238             rules or you can provide a prefix to match to the rule names.
239              
240              
241             =head2 ListTargetsByRule(Rule => Str, [Limit => Int, NextToken => Str])
242              
243             Each argument is described in detail in: L<Paws::CloudWatchEvents::ListTargetsByRule>
244              
245             Returns: a L<Paws::CloudWatchEvents::ListTargetsByRuleResponse> instance
246              
247             Lists the targets assigned to the specified rule.
248              
249              
250             =head2 PutEvents(Entries => ArrayRef[L<Paws::CloudWatchEvents::PutEventsRequestEntry>])
251              
252             Each argument is described in detail in: L<Paws::CloudWatchEvents::PutEvents>
253              
254             Returns: a L<Paws::CloudWatchEvents::PutEventsResponse> instance
255              
256             Sends custom events to Amazon CloudWatch Events so that they can be
257             matched to rules.
258              
259              
260             =head2 PutPermission(Action => Str, Principal => Str, StatementId => Str)
261              
262             Each argument is described in detail in: L<Paws::CloudWatchEvents::PutPermission>
263              
264             Returns: nothing
265              
266             Running C<PutPermission> permits the specified AWS account to put
267             events to your account's default I<event bus>. CloudWatch Events rules
268             in your account are triggered by these events arriving to your default
269             event bus.
270              
271             For another account to send events to your account, that external
272             account must have a CloudWatch Events rule with your account's default
273             event bus as a target.
274              
275             To enable multiple AWS accounts to put events to your default event
276             bus, run C<PutPermission> once for each of these accounts.
277              
278             The permission policy on the default event bus cannot exceed 10KB in
279             size.
280              
281              
282             =head2 PutRule(Name => Str, [Description => Str, EventPattern => Str, RoleArn => Str, ScheduleExpression => Str, State => Str])
283              
284             Each argument is described in detail in: L<Paws::CloudWatchEvents::PutRule>
285              
286             Returns: a L<Paws::CloudWatchEvents::PutRuleResponse> instance
287              
288             Creates or updates the specified rule. Rules are enabled by default, or
289             based on value of the state. You can disable a rule using DisableRule.
290              
291             When you create or update a rule, incoming events might not immediately
292             start matching to new or updated rules. Please allow a short period of
293             time for changes to take effect.
294              
295             A rule must contain at least an EventPattern or ScheduleExpression.
296             Rules with EventPatterns are triggered when a matching event is
297             observed. Rules with ScheduleExpressions self-trigger based on the
298             given schedule. A rule can have both an EventPattern and a
299             ScheduleExpression, in which case the rule triggers on matching events
300             as well as on a schedule.
301              
302             Most services in AWS treat : or / as the same character in Amazon
303             Resource Names (ARNs). However, CloudWatch Events uses an exact match
304             in event patterns and rules. Be sure to use the correct ARN characters
305             when creating event patterns so that they match the ARN syntax in the
306             event you want to match.
307              
308              
309             =head2 PutTargets(Rule => Str, Targets => ArrayRef[L<Paws::CloudWatchEvents::Target>])
310              
311             Each argument is described in detail in: L<Paws::CloudWatchEvents::PutTargets>
312              
313             Returns: a L<Paws::CloudWatchEvents::PutTargetsResponse> instance
314              
315             Adds the specified targets to the specified rule, or updates the
316             targets if they are already associated with the rule.
317              
318             Targets are the resources that are invoked when a rule is triggered.
319              
320             You can configure the following as targets for CloudWatch Events:
321              
322             =over
323              
324             =item *
325              
326             EC2 instances
327              
328             =item *
329              
330             AWS Lambda functions
331              
332             =item *
333              
334             Streams in Amazon Kinesis Streams
335              
336             =item *
337              
338             Delivery streams in Amazon Kinesis Firehose
339              
340             =item *
341              
342             Amazon ECS tasks
343              
344             =item *
345              
346             AWS Step Functions state machines
347              
348             =item *
349              
350             Pipelines in Amazon Code Pipeline
351              
352             =item *
353              
354             Amazon Inspector assessment templates
355              
356             =item *
357              
358             Amazon SNS topics
359              
360             =item *
361              
362             Amazon SQS queues
363              
364             =item *
365              
366             The default event bus of another AWS account
367              
368             =back
369              
370             Note that creating rules with built-in targets is supported only in the
371             AWS Management Console.
372              
373             For some target types, C<PutTargets> provides target-specific
374             parameters. If the target is an Amazon Kinesis stream, you can
375             optionally specify which shard the event goes to by using the
376             C<KinesisParameters> argument. To invoke a command on multiple EC2
377             instances with one rule, you can use the C<RunCommandParameters> field.
378              
379             To be able to make API calls against the resources that you own, Amazon
380             CloudWatch Events needs the appropriate permissions. For AWS Lambda and
381             Amazon SNS resources, CloudWatch Events relies on resource-based
382             policies. For EC2 instances, Amazon Kinesis streams, and AWS Step
383             Functions state machines, CloudWatch Events relies on IAM roles that
384             you specify in the C<RoleARN> argument in C<PutTargets>. For more
385             information, see Authentication and Access Control in the I<Amazon
386             CloudWatch Events User Guide>.
387              
388             If another AWS account is in the same region and has granted you
389             permission (using C<PutPermission>), you can send events to that
390             account by setting that account's event bus as a target of the rules in
391             your account. To send the matched events to the other account, specify
392             that account's event bus as the C<Arn> when you run C<PutTargets>. If
393             your account sends events to another account, your account is charged
394             for each sent event. Each event sent to antoher account is charged as a
395             custom event. The account receiving the event is not charged. For more
396             information on pricing, see Amazon CloudWatch Pricing.
397              
398             For more information about enabling cross-account events, see
399             PutPermission.
400              
401             B<Input>, B<InputPath> and B<InputTransformer> are mutually exclusive
402             and optional parameters of a target. When a rule is triggered due to a
403             matched event:
404              
405             =over
406              
407             =item *
408              
409             If none of the following arguments are specified for a target, then the
410             entire event is passed to the target in JSON form (unless the target is
411             Amazon EC2 Run Command or Amazon ECS task, in which case nothing from
412             the event is passed to the target).
413              
414             =item *
415              
416             If B<Input> is specified in the form of valid JSON, then the matched
417             event is overridden with this constant.
418              
419             =item *
420              
421             If B<InputPath> is specified in the form of JSONPath (for example,
422             C<$.detail>), then only the part of the event specified in the path is
423             passed to the target (for example, only the detail part of the event is
424             passed).
425              
426             =item *
427              
428             If B<InputTransformer> is specified, then one or more specified
429             JSONPaths are extracted from the event and used as values in a template
430             that you specify as the input to the target.
431              
432             =back
433              
434             When you specify C<Input>, C<InputPath>, or C<InputTransformer>, you
435             must use JSON dot notation, not bracket notation.
436              
437             When you add targets to a rule and the associated rule triggers soon
438             after, new or updated targets might not be immediately invoked. Please
439             allow a short period of time for changes to take effect.
440              
441             This action can partially fail if too many requests are made at the
442             same time. If that happens, C<FailedEntryCount> is non-zero in the
443             response and each entry in C<FailedEntries> provides the ID of the
444             failed target and the error code.
445              
446              
447             =head2 RemovePermission(StatementId => Str)
448              
449             Each argument is described in detail in: L<Paws::CloudWatchEvents::RemovePermission>
450              
451             Returns: nothing
452              
453             Revokes the permission of another AWS account to be able to put events
454             to your default event bus. Specify the account to revoke by the
455             C<StatementId> value that you associated with the account when you
456             granted it permission with C<PutPermission>. You can find the
457             C<StatementId> by using DescribeEventBus.
458              
459              
460             =head2 RemoveTargets(Ids => ArrayRef[Str|Undef], Rule => Str)
461              
462             Each argument is described in detail in: L<Paws::CloudWatchEvents::RemoveTargets>
463              
464             Returns: a L<Paws::CloudWatchEvents::RemoveTargetsResponse> instance
465              
466             Removes the specified targets from the specified rule. When the rule is
467             triggered, those targets are no longer be invoked.
468              
469             When you remove a target, when the associated rule triggers, removed
470             targets might continue to be invoked. Please allow a short period of
471             time for changes to take effect.
472              
473             This action can partially fail if too many requests are made at the
474             same time. If that happens, C<FailedEntryCount> is non-zero in the
475             response and each entry in C<FailedEntries> provides the ID of the
476             failed target and the error code.
477              
478              
479             =head2 TestEventPattern(Event => Str, EventPattern => Str)
480              
481             Each argument is described in detail in: L<Paws::CloudWatchEvents::TestEventPattern>
482              
483             Returns: a L<Paws::CloudWatchEvents::TestEventPatternResponse> instance
484              
485             Tests whether the specified event pattern matches the provided event.
486              
487             Most services in AWS treat : or / as the same character in Amazon
488             Resource Names (ARNs). However, CloudWatch Events uses an exact match
489             in event patterns and rules. Be sure to use the correct ARN characters
490             when creating event patterns so that they match the ARN syntax in the
491             event you want to match.
492              
493              
494              
495              
496             =head1 PAGINATORS
497              
498             Paginator methods are helpers that repetively call methods that return partial results
499              
500              
501              
502              
503             =head1 SEE ALSO
504              
505             This service class forms part of L<Paws>
506              
507             =head1 BUGS and CONTRIBUTIONS
508              
509             The source code is located here: https://github.com/pplu/aws-sdk-perl
510              
511             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
512              
513             =cut
514