@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonCloudWatchEventsClient extends AmazonWebServiceClient implements AmazonCloudWatchEvents
Amazon CloudWatch Events helps you to respond to state changes in your AWS resources. When your resources change state they automatically send events into an event stream. You can create rules that match selected events in the stream and route them to targets to take action. You can also use rules to take action on a pre-determined schedule. For example, you can configure rules to:
For more information about Amazon CloudWatch Events features, see the Amazon CloudWatch Developer Guide.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Constructor and Description |
---|
AmazonCloudWatchEventsClient()
Deprecated.
|
AmazonCloudWatchEventsClient(AWSCredentials awsCredentials)
Deprecated.
use
AwsClientBuilder.withCredentials(AWSCredentialsProvider) for example:
AmazonCloudWatchEventsClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build(); |
AmazonCloudWatchEventsClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
|
AmazonCloudWatchEventsClient(AWSCredentialsProvider awsCredentialsProvider)
Deprecated.
|
AmazonCloudWatchEventsClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
|
AmazonCloudWatchEventsClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
|
AmazonCloudWatchEventsClient(ClientConfiguration clientConfiguration)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static AmazonCloudWatchEventsClientBuilder |
builder() |
DeleteRuleResult |
deleteRule(DeleteRuleRequest deleteRuleRequest)
Deletes a rule.
|
DescribeRuleResult |
describeRule(DescribeRuleRequest describeRuleRequest)
Describes the details of the specified rule.
|
DisableRuleResult |
disableRule(DisableRuleRequest disableRuleRequest)
Disables a rule.
|
EnableRuleResult |
enableRule(EnableRuleRequest enableRuleRequest)
Enables a 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 listRuleNamesByTargetRequest)
Lists the names of the rules that the given target is put to.
|
ListRulesResult |
listRules(ListRulesRequest listRulesRequest)
Lists the Amazon CloudWatch Events rules in your account.
|
ListTargetsByRuleResult |
listTargetsByRule(ListTargetsByRuleRequest listTargetsByRuleRequest)
Lists of targets assigned to the rule.
|
PutEventsResult |
putEvents(PutEventsRequest putEventsRequest)
Sends custom events to Amazon CloudWatch Events so that they can be matched to rules.
|
PutRuleResult |
putRule(PutRuleRequest putRuleRequest)
Creates or updates a rule.
|
PutTargetsResult |
putTargets(PutTargetsRequest putTargetsRequest)
Adds target(s) to a rule.
|
RemoveTargetsResult |
removeTargets(RemoveTargetsRequest removeTargetsRequest)
Removes target(s) from a rule so that when the rule is triggered, those targets will no longer be invoked.
|
TestEventPatternResult |
testEventPattern(TestEventPatternRequest testEventPatternRequest)
Tests whether an event pattern matches the provided event.
|
addRequestHandler, addRequestHandler, configureRegion, getEndpointPrefix, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion, shutdown
@Deprecated public AmazonCloudWatchEventsClient()
AmazonCloudWatchEventsClientBuilder.defaultClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AmazonCloudWatchEventsClient(ClientConfiguration clientConfiguration)
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling how this client connects to Amazon CloudWatch Events (ex:
proxy settings, retry counts, etc.).DefaultAWSCredentialsProviderChain
@Deprecated public AmazonCloudWatchEventsClient(AWSCredentials awsCredentials)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
for example:
AmazonCloudWatchEventsClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.@Deprecated public AmazonCloudWatchEventsClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon CloudWatch Events (ex:
proxy settings, retry counts, etc.).@Deprecated public AmazonCloudWatchEventsClient(AWSCredentialsProvider awsCredentialsProvider)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.@Deprecated public AmazonCloudWatchEventsClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon CloudWatch Events (ex:
proxy settings, retry counts, etc.).@Deprecated public AmazonCloudWatchEventsClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
and
AwsClientBuilder.withMetricsCollector(RequestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon CloudWatch Events (ex:
proxy settings, retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic static AmazonCloudWatchEventsClientBuilder builder()
public DeleteRuleResult deleteRule(DeleteRuleRequest deleteRuleRequest)
Deletes a rule. You must remove all targets from a rule using RemoveTargets before you can delete the rule.
Note: When you delete a rule, incoming events might still continue to match to the deleted rule. Please allow a short period of time for changes to take effect.
deleteRule
in interface AmazonCloudWatchEvents
deleteRuleRequest
- Container for the parameters to the DeleteRule operation.ConcurrentModificationException
- This exception occurs if there is concurrent modification on rule or target.InternalException
- This exception occurs due to unexpected causes.public DescribeRuleResult describeRule(DescribeRuleRequest describeRuleRequest)
Describes the details of the specified rule.
describeRule
in interface AmazonCloudWatchEvents
describeRuleRequest
- Container for the parameters to the DescribeRule operation.ResourceNotFoundException
- The rule does not exist.InternalException
- This exception occurs due to unexpected causes.public DisableRuleResult disableRule(DisableRuleRequest disableRuleRequest)
Disables a rule. A disabled rule won't match any events, and won't self-trigger if it has a schedule expression.
Note: When you disable a rule, incoming events might still continue to match to the disabled rule. Please allow a short period of time for changes to take effect.
disableRule
in interface AmazonCloudWatchEvents
disableRuleRequest
- Container for the parameters to the DisableRule operation.ResourceNotFoundException
- The rule does not exist.ConcurrentModificationException
- This exception occurs if there is concurrent modification on rule or target.InternalException
- This exception occurs due to unexpected causes.public EnableRuleResult enableRule(EnableRuleRequest enableRuleRequest)
Enables a rule. If the rule does not exist, the operation fails.
Note: 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
enableRuleRequest
- Container for the parameters to the EnableRule operation.ResourceNotFoundException
- The rule does not exist.ConcurrentModificationException
- This exception occurs if there is concurrent modification on rule or target.InternalException
- This exception occurs due to unexpected causes.public ListRuleNamesByTargetResult listRuleNamesByTarget(ListRuleNamesByTargetRequest listRuleNamesByTargetRequest)
Lists the names of the rules that the given target is put to. You can see which of the rules in Amazon CloudWatch Events can invoke a specific target in your account. If you have more rules in your account than the given limit, the results will be paginated. In that case, use the next token returned in the response and repeat ListRulesByTarget until the NextToken in the response is returned as null.
listRuleNamesByTarget
in interface AmazonCloudWatchEvents
listRuleNamesByTargetRequest
- Container for the parameters to the ListRuleNamesByTarget operation.InternalException
- This exception occurs due to unexpected causes.public ListRulesResult listRules(ListRulesRequest listRulesRequest)
Lists the Amazon CloudWatch Events rules in your account. You can either list all the rules or you can provide a prefix to match to the rule names. If you have more rules in your account than the given limit, the results will be paginated. In that case, use the next token returned in the response and repeat ListRules until the NextToken in the response is returned as null.
listRules
in interface AmazonCloudWatchEvents
listRulesRequest
- Container for the parameters to the ListRules operation.InternalException
- This exception occurs due to unexpected causes.public ListTargetsByRuleResult listTargetsByRule(ListTargetsByRuleRequest listTargetsByRuleRequest)
Lists of targets assigned to the rule.
listTargetsByRule
in interface AmazonCloudWatchEvents
listTargetsByRuleRequest
- Container for the parameters to the ListTargetsByRule operation.ResourceNotFoundException
- The rule does not exist.InternalException
- This exception occurs due to unexpected causes.public PutEventsResult putEvents(PutEventsRequest putEventsRequest)
Sends custom events to Amazon CloudWatch Events so that they can be matched to rules.
putEvents
in interface AmazonCloudWatchEvents
putEventsRequest
- Container for the parameters to the PutEvents operation.InternalException
- This exception occurs due to unexpected causes.public PutRuleResult putRule(PutRuleRequest putRuleRequest)
Creates or updates a rule. Rules are enabled by default, or based on value of the State parameter. You can disable a rule using DisableRule.
Note: 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 will trigger on matching events as well as on a schedule.
Note: 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
putRuleRequest
- Container for the parameters to the PutRule operation.InvalidEventPatternException
- The event pattern is invalid.LimitExceededException
- This exception occurs if you try to create more rules or add more targets to a rule than allowed by
default.ConcurrentModificationException
- This exception occurs if there is concurrent modification on rule or target.InternalException
- This exception occurs due to unexpected causes.public PutTargetsResult putTargets(PutTargetsRequest putTargetsRequest)
Adds target(s) to a rule. Targets are the resources that can be invoked when a rule is triggered. For example, AWS Lambda functions, Amazon Kinesis streams, and built-in targets. Updates the target(s) if they are already associated with the role. In other words, if there is already a target with the given target ID, then the target associated with that ID is updated.
In order to be able to make API calls against the resources you own, Amazon CloudWatch Events needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, CloudWatch Events relies on resource-based policies. For Amazon Kinesis streams, CloudWatch Events relies on IAM roles. For more information, see Permissions for Sending Events to Targets in the Amazon CloudWatch Developer Guide.
Input and InputPath are mutually-exclusive and optional parameters of a target. When a rule is triggered due to a matched event, if for a target:
Note: When you add targets to a rule, when the associated rule triggers, new or updated targets might not be immediately invoked. Please allow a short period of time for changes to take effect.
putTargets
in interface AmazonCloudWatchEvents
putTargetsRequest
- Container for the parameters to the PutTargets operation.ResourceNotFoundException
- The rule does not exist.ConcurrentModificationException
- This exception occurs if there is concurrent modification on rule or target.LimitExceededException
- This exception occurs if you try to create more rules or add more targets to a rule than allowed by
default.InternalException
- This exception occurs due to unexpected causes.public RemoveTargetsResult removeTargets(RemoveTargetsRequest removeTargetsRequest)
Removes target(s) from a rule so that when the rule is triggered, those targets will no longer be invoked.
Note: When you remove a target, when the associated rule triggers, removed targets might still continue to be invoked. Please allow a short period of time for changes to take effect.
removeTargets
in interface AmazonCloudWatchEvents
removeTargetsRequest
- Container for the parameters to the RemoveTargets operation.ResourceNotFoundException
- The rule does not exist.ConcurrentModificationException
- This exception occurs if there is concurrent modification on rule or target.InternalException
- This exception occurs due to unexpected causes.public TestEventPatternResult testEventPattern(TestEventPatternRequest testEventPatternRequest)
Tests whether an event pattern matches the provided event.
Note: 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
testEventPatternRequest
- Container for the parameters to the TestEventPattern operation.InvalidEventPatternException
- The event pattern is invalid.InternalException
- This exception occurs due to unexpected causes.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
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 the request.
getCachedResponseMetadata
in interface AmazonCloudWatchEvents
request
- The originally executed requestCopyright © 2013 Amazon Web Services, Inc. All Rights Reserved.