@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AbstractAmazonCloudWatchEvents extends Object implements AmazonCloudWatchEvents
AmazonCloudWatchEvents
. Convenient method forms pass through to the corresponding
overload that takes a request object, which throws an UnsupportedOperationException
.ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
DeleteRuleResult |
deleteRule(DeleteRuleRequest request)
Deletes the specified rule.
|
DescribeRuleResult |
describeRule(DescribeRuleRequest request)
Describes the specified rule.
|
DisableRuleResult |
disableRule(DisableRuleRequest request)
Disables the specified rule.
|
EnableRuleResult |
enableRule(EnableRuleRequest request)
Enables the specified rule.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful request, typically used for debugging issues
where a service isn't acting as expected.
|
ListRuleNamesByTargetResult |
listRuleNamesByTarget(ListRuleNamesByTargetRequest request)
Lists the rules for the specified target.
|
ListRulesResult |
listRules(ListRulesRequest request)
Lists your Amazon CloudWatch Events rules.
|
ListTargetsByRuleResult |
listTargetsByRule(ListTargetsByRuleRequest request)
Lists the targets assigned to the specified rule.
|
PutEventsResult |
putEvents(PutEventsRequest request)
Sends custom events to Amazon CloudWatch Events so that they can be matched to rules.
|
PutRuleResult |
putRule(PutRuleRequest request)
Creates or updates the specified rule.
|
PutTargetsResult |
putTargets(PutTargetsRequest request)
Adds the specified targets to the specified rule, or updates the targets if they are already associated with the
rule.
|
RemoveTargetsResult |
removeTargets(RemoveTargetsRequest request)
Removes the specified targets from the specified rule.
|
void |
setEndpoint(String endpoint)
Overrides the default endpoint for this client ("events.us-east-1.amazonaws.com").
|
void |
setRegion(Region region)
An alternative to
AmazonCloudWatchEvents.setEndpoint(String) , sets the regional endpoint for this
client's service calls. |
void |
shutdown()
Shuts down this client object, releasing any resources that might be held open.
|
TestEventPatternResult |
testEventPattern(TestEventPatternRequest request)
Tests whether the specified event pattern matches the provided event.
|
public void setEndpoint(String endpoint)
AmazonCloudWatchEvents
Callers can pass in just the endpoint (ex: "events.us-east-1.amazonaws.com") or a full URL, including the
protocol (ex: "events.us-east-1.amazonaws.com"). If the protocol is not specified here, the default protocol from
this client's ClientConfiguration
will be used, which by default is HTTPS.
For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912
This method is not threadsafe. An endpoint should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
setEndpoint
in interface AmazonCloudWatchEvents
endpoint
- The endpoint (ex: "events.us-east-1.amazonaws.com") or a full URL, including the protocol (ex:
"events.us-east-1.amazonaws.com") of the region specific AWS endpoint this client will communicate with.public void setRegion(Region region)
AmazonCloudWatchEvents
AmazonCloudWatchEvents.setEndpoint(String)
, sets the regional endpoint for this
client's service calls. Callers can use this method to control which AWS region they want to work with.
By default, all service endpoints in all regions use the https protocol. To use http instead, specify it in the
ClientConfiguration
supplied at construction.
This method is not threadsafe. A region should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
setRegion
in interface AmazonCloudWatchEvents
region
- The region this client will communicate with. See Region.getRegion(com.amazonaws.regions.Regions)
for accessing a given region. Must not be null and must be a region where the service is available.Region.getRegion(com.amazonaws.regions.Regions)
,
Region.createClient(Class, com.amazonaws.auth.AWSCredentialsProvider, ClientConfiguration)
,
Region.isServiceSupported(String)
public DeleteRuleResult deleteRule(DeleteRuleRequest request)
AmazonCloudWatchEvents
Deletes the specified rule.
You must remove all targets from a rule using RemoveTargets before you can delete the rule.
When you delete a rule, incoming events might continue to match to the deleted rule. Please allow a short period of time for changes to take effect.
deleteRule
in interface AmazonCloudWatchEvents
public DescribeRuleResult describeRule(DescribeRuleRequest request)
AmazonCloudWatchEvents
Describes the specified rule.
describeRule
in interface AmazonCloudWatchEvents
public DisableRuleResult disableRule(DisableRuleRequest request)
AmazonCloudWatchEvents
Disables the specified rule. A disabled rule won't match any events, and won't self-trigger if it has a schedule expression.
When you disable a rule, incoming events might continue to match to the disabled rule. Please allow a short period of time for changes to take effect.
disableRule
in interface AmazonCloudWatchEvents
public EnableRuleResult enableRule(EnableRuleRequest request)
AmazonCloudWatchEvents
Enables the specified rule. If the rule does not exist, the operation fails.
When you enable a rule, incoming events might not immediately start matching to a newly enabled rule. Please allow a short period of time for changes to take effect.
enableRule
in interface AmazonCloudWatchEvents
public ListRuleNamesByTargetResult listRuleNamesByTarget(ListRuleNamesByTargetRequest request)
AmazonCloudWatchEvents
Lists the rules for the specified target. You can see which of the rules in Amazon CloudWatch Events can invoke a specific target in your account.
listRuleNamesByTarget
in interface AmazonCloudWatchEvents
public ListRulesResult listRules(ListRulesRequest request)
AmazonCloudWatchEvents
Lists your Amazon CloudWatch Events rules. You can either list all the rules or you can provide a prefix to match to the rule names.
listRules
in interface AmazonCloudWatchEvents
public ListTargetsByRuleResult listTargetsByRule(ListTargetsByRuleRequest request)
AmazonCloudWatchEvents
Lists the targets assigned to the specified rule.
listTargetsByRule
in interface AmazonCloudWatchEvents
public PutEventsResult putEvents(PutEventsRequest request)
AmazonCloudWatchEvents
Sends custom events to Amazon CloudWatch Events so that they can be matched to rules.
putEvents
in interface AmazonCloudWatchEvents
public PutRuleResult putRule(PutRuleRequest request)
AmazonCloudWatchEvents
Creates or updates the specified rule. Rules are enabled by default, or based on value of the state. You can disable a rule using DisableRule.
When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Please allow a short period of time for changes to take effect.
A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule triggers on matching events as well as on a schedule.
Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.
putRule
in interface AmazonCloudWatchEvents
public PutTargetsResult putTargets(PutTargetsRequest request)
AmazonCloudWatchEvents
Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
Targets are the resources that are invoked when a rule is triggered. Example targets include EC2 instances, AWS Lambda functions, Amazon Kinesis streams, Amazon ECS tasks, AWS Step Functions state machines, and built-in targets. Note that creating rules with built-in targets is supported only in the AWS Management Console.
For some target types, PutTargets
provides target-specific parameters. If the target is an Amazon
Kinesis stream, you can optionally specify which shard the event goes to by using the
KinesisParameters
argument. To invoke a command on multiple EC2 instances with one rule, you can use
the RunCommandParameters
field.
To be able to make API calls against the resources that you own, Amazon CloudWatch Events needs the appropriate
permissions. For AWS Lambda and Amazon SNS resources, CloudWatch Events relies on resource-based policies. For
EC2 instances, Amazon Kinesis streams, and AWS Step Functions state machines, CloudWatch Events relies on IAM
roles that you specify in the RoleARN
argument in PutTarget
. For more information, see
Authentication and Access Control in the Amazon CloudWatch Events User Guide.
Input, InputPath and InputTransformer are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event:
If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON form (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target).
If Input is specified in the form of valid JSON, then the matched event is overridden with this constant.
If InputPath is specified in the form of JSONPath (for example, $.detail
), then only the part
of the event specified in the path is passed to the target (for example, only the detail part of the event is
passed).
If InputTransformer is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target.
When you specify Input
, InputPath
, or InputTransformer
, you must use JSON
dot notation, not bracket notation.
When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Please allow a short period of time for changes to take effect.
This action can partially fail if too many requests are made at the same time. If that happens,
FailedEntryCount
is non-zero in the response and each entry in FailedEntries
provides
the ID of the failed target and the error code.
putTargets
in interface AmazonCloudWatchEvents
public RemoveTargetsResult removeTargets(RemoveTargetsRequest request)
AmazonCloudWatchEvents
Removes the specified targets from the specified rule. When the rule is triggered, those targets are no longer be invoked.
When you remove a target, when the associated rule triggers, removed targets might continue to be invoked. Please allow a short period of time for changes to take effect.
This action can partially fail if too many requests are made at the same time. If that happens,
FailedEntryCount
is non-zero in the response and each entry in FailedEntries
provides
the ID of the failed target and the error code.
removeTargets
in interface AmazonCloudWatchEvents
public TestEventPatternResult testEventPattern(TestEventPatternRequest request)
AmazonCloudWatchEvents
Tests whether the specified event pattern matches the provided event.
Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.
testEventPattern
in interface AmazonCloudWatchEvents
public void shutdown()
AmazonCloudWatchEvents
shutdown
in interface AmazonCloudWatchEvents
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
AmazonCloudWatchEvents
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing a request.
getCachedResponseMetadata
in interface AmazonCloudWatchEvents
request
- The originally executed request.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.