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   3154 use Moose;
  1         4  
  1         12  
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              
279             =head2 PutRule(Name => Str, [Description => Str, EventPattern => Str, RoleArn => Str, ScheduleExpression => Str, State => Str])
280              
281             Each argument is described in detail in: L<Paws::CloudWatchEvents::PutRule>
282              
283             Returns: a L<Paws::CloudWatchEvents::PutRuleResponse> instance
284              
285             Creates or updates the specified rule. Rules are enabled by default, or
286             based on value of the state. You can disable a rule using DisableRule.
287              
288             When you create or update a rule, incoming events might not immediately
289             start matching to new or updated rules. Please allow a short period of
290             time for changes to take effect.
291              
292             A rule must contain at least an EventPattern or ScheduleExpression.
293             Rules with EventPatterns are triggered when a matching event is
294             observed. Rules with ScheduleExpressions self-trigger based on the
295             given schedule. A rule can have both an EventPattern and a
296             ScheduleExpression, in which case the rule triggers on matching events
297             as well as on a schedule.
298              
299             Most services in AWS treat : or / as the same character in Amazon
300             Resource Names (ARNs). However, CloudWatch Events uses an exact match
301             in event patterns and rules. Be sure to use the correct ARN characters
302             when creating event patterns so that they match the ARN syntax in the
303             event you want to match.
304              
305              
306             =head2 PutTargets(Rule => Str, Targets => ArrayRef[L<Paws::CloudWatchEvents::Target>])
307              
308             Each argument is described in detail in: L<Paws::CloudWatchEvents::PutTargets>
309              
310             Returns: a L<Paws::CloudWatchEvents::PutTargetsResponse> instance
311              
312             Adds the specified targets to the specified rule, or updates the
313             targets if they are already associated with the rule.
314              
315             Targets are the resources that are invoked when a rule is triggered.
316              
317             You can configure the following as targets for CloudWatch Events:
318              
319             =over
320              
321             =item *
322              
323             EC2 instances
324              
325             =item *
326              
327             AWS Lambda functions
328              
329             =item *
330              
331             Streams in Amazon Kinesis Streams
332              
333             =item *
334              
335             Delivery streams in Amazon Kinesis Firehose
336              
337             =item *
338              
339             Amazon ECS tasks
340              
341             =item *
342              
343             AWS Step Functions state machines
344              
345             =item *
346              
347             Amazon SNS topics
348              
349             =item *
350              
351             Amazon SQS queues
352              
353             =back
354              
355             Note that creating rules with built-in targets is supported only in the
356             AWS Management Console.
357              
358             For some target types, C<PutTargets> provides target-specific
359             parameters. If the target is an Amazon Kinesis stream, you can
360             optionally specify which shard the event goes to by using the
361             C<KinesisParameters> argument. To invoke a command on multiple EC2
362             instances with one rule, you can use the C<RunCommandParameters> field.
363              
364             To be able to make API calls against the resources that you own, Amazon
365             CloudWatch Events needs the appropriate permissions. For AWS Lambda and
366             Amazon SNS resources, CloudWatch Events relies on resource-based
367             policies. For EC2 instances, Amazon Kinesis streams, and AWS Step
368             Functions state machines, CloudWatch Events relies on IAM roles that
369             you specify in the C<RoleARN> argument in C<PutTargets>. For more
370             information, see Authentication and Access Control in the I<Amazon
371             CloudWatch Events User Guide>.
372              
373             If another AWS account is in the same region and has granted you
374             permission (using C<PutPermission>), you can set that account's event
375             bus as a target of the rules in your account. To send the matched
376             events to the other account, specify that account's event bus as the
377             C<Arn> when you run C<PutTargets>. For more information about enabling
378             cross-account events, see PutPermission.
379              
380             B<Input>, B<InputPath> and B<InputTransformer> are mutually exclusive
381             and optional parameters of a target. When a rule is triggered due to a
382             matched event:
383              
384             =over
385              
386             =item *
387              
388             If none of the following arguments are specified for a target, then the
389             entire event is passed to the target in JSON form (unless the target is
390             Amazon EC2 Run Command or Amazon ECS task, in which case nothing from
391             the event is passed to the target).
392              
393             =item *
394              
395             If B<Input> is specified in the form of valid JSON, then the matched
396             event is overridden with this constant.
397              
398             =item *
399              
400             If B<InputPath> is specified in the form of JSONPath (for example,
401             C<$.detail>), then only the part of the event specified in the path is
402             passed to the target (for example, only the detail part of the event is
403             passed).
404              
405             =item *
406              
407             If B<InputTransformer> is specified, then one or more specified
408             JSONPaths are extracted from the event and used as values in a template
409             that you specify as the input to the target.
410              
411             =back
412              
413             When you specify C<Input>, C<InputPath>, or C<InputTransformer>, you
414             must use JSON dot notation, not bracket notation.
415              
416             When you add targets to a rule and the associated rule triggers soon
417             after, new or updated targets might not be immediately invoked. Please
418             allow a short period of time for changes to take effect.
419              
420             This action can partially fail if too many requests are made at the
421             same time. If that happens, C<FailedEntryCount> is non-zero in the
422             response and each entry in C<FailedEntries> provides the ID of the
423             failed target and the error code.
424              
425              
426             =head2 RemovePermission(StatementId => Str)
427              
428             Each argument is described in detail in: L<Paws::CloudWatchEvents::RemovePermission>
429              
430             Returns: nothing
431              
432             Revokes the permission of another AWS account to be able to put events
433             to your default event bus. Specify the account to revoke by the
434             C<StatementId> value that you associated with the account when you
435             granted it permission with C<PutPermission>. You can find the
436             C<StatementId> by using DescribeEventBus.
437              
438              
439             =head2 RemoveTargets(Ids => ArrayRef[Str|Undef], Rule => Str)
440              
441             Each argument is described in detail in: L<Paws::CloudWatchEvents::RemoveTargets>
442              
443             Returns: a L<Paws::CloudWatchEvents::RemoveTargetsResponse> instance
444              
445             Removes the specified targets from the specified rule. When the rule is
446             triggered, those targets are no longer be invoked.
447              
448             When you remove a target, when the associated rule triggers, removed
449             targets might continue to be invoked. Please allow a short period of
450             time for changes to take effect.
451              
452             This action can partially fail if too many requests are made at the
453             same time. If that happens, C<FailedEntryCount> is non-zero in the
454             response and each entry in C<FailedEntries> provides the ID of the
455             failed target and the error code.
456              
457              
458             =head2 TestEventPattern(Event => Str, EventPattern => Str)
459              
460             Each argument is described in detail in: L<Paws::CloudWatchEvents::TestEventPattern>
461              
462             Returns: a L<Paws::CloudWatchEvents::TestEventPatternResponse> instance
463              
464             Tests whether the specified event pattern matches the provided event.
465              
466             Most services in AWS treat : or / as the same character in Amazon
467             Resource Names (ARNs). However, CloudWatch Events uses an exact match
468             in event patterns and rules. Be sure to use the correct ARN characters
469             when creating event patterns so that they match the ARN syntax in the
470             event you want to match.
471              
472              
473              
474              
475             =head1 PAGINATORS
476              
477             Paginator methods are helpers that repetively call methods that return partial results
478              
479              
480              
481              
482             =head1 SEE ALSO
483              
484             This service class forms part of L<Paws>
485              
486             =head1 BUGS and CONTRIBUTIONS
487              
488             The source code is located here: https://github.com/pplu/aws-sdk-perl
489              
490             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
491              
492             =cut
493