CloudWatchEventsClient Class
(QtAws::CloudWatchEvents::CloudWatchEventsClient)The CloudWatchEventsClient class provides access to the Amazon CloudWatch Events service. More...
| Header: | #include <CloudWatchEventsClient> |
| Inherits: | QtAws::Core::AwsAbstractClient |
Public Functions
| CloudWatchEventsClient(const QtAws::Core::AwsRegion::Region region = QtAws::Core::AwsRegion::InvalidRegion, QtAws::Core::AwsAbstractCredentials *credentials = NULL, QNetworkAccessManager * const manager = NULL, QObject * const parent = 0) | |
| CloudWatchEventsClient(const QUrl &endpoint, QtAws::Core::AwsAbstractCredentials *credentials = NULL, QNetworkAccessManager * const manager = NULL, QObject * const parent = 0) |
- 12 public functions inherited from QtAws::Core::AwsAbstractClient
Public Slots
| DeleteRuleResponse * | deleteRule(const DeleteRuleRequest &request) |
| DescribeEventBusResponse * | describeEventBus(const DescribeEventBusRequest &request) |
| DescribeRuleResponse * | describeRule(const DescribeRuleRequest &request) |
| DisableRuleResponse * | disableRule(const DisableRuleRequest &request) |
| EnableRuleResponse * | enableRule(const EnableRuleRequest &request) |
| ListRuleNamesByTargetResponse * | listRuleNamesByTarget(const ListRuleNamesByTargetRequest &request) |
| ListRulesResponse * | listRules(const ListRulesRequest &request) |
| ListTargetsByRuleResponse * | listTargetsByRule(const ListTargetsByRuleRequest &request) |
| PutEventsResponse * | putEvents(const PutEventsRequest &request) |
| PutPermissionResponse * | putPermission(const PutPermissionRequest &request) |
| PutRuleResponse * | putRule(const PutRuleRequest &request) |
| PutTargetsResponse * | putTargets(const PutTargetsRequest &request) |
| RemovePermissionResponse * | removePermission(const RemovePermissionRequest &request) |
| RemoveTargetsResponse * | removeTargets(const RemoveTargetsRequest &request) |
| TestEventPatternResponse * | testEventPattern(const TestEventPatternRequest &request) |
Additional Inherited Members
- 2 protected functions inherited from QtAws::Core::AwsAbstractClient
Detailed Description
The CloudWatchEventsClient class provides access to the Amazon CloudWatch Events service.
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> <ul> <li>
Automatically invoke an AWS Lambda function to update DNS entries when an event notifies you that Amazon EC2 instance enters the running
state> </li> <li>
Direct specific API records from CloudTrail to an Amazon Kinesis stream for detailed analysis of potential security or availability
risks> </li> <li>
Periodically invoke a built-in target to create a snapshot of an Amazon EBS
volume> </li> </ul>
For more information about the features of Amazon CloudWatch Events, see the <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/events">Amazon CloudWatch Events User
Member Function Documentation
CloudWatchEventsClient::CloudWatchEventsClient(const QtAws::Core::AwsRegion::Region region = QtAws::Core::AwsRegion::InvalidRegion, QtAws::Core::AwsAbstractCredentials *credentials = NULL, QNetworkAccessManager * const manager = NULL, QObject * const parent = 0)
Constructs a CloudWatchEventsClient object.
The new client object will region, credentials, and manager for network operations.
The new object will be owned by parent, if set.
CloudWatchEventsClient::CloudWatchEventsClient(const QUrl &endpoint, QtAws::Core::AwsAbstractCredentials *credentials = NULL, QNetworkAccessManager * const manager = NULL, QObject * const parent = 0)
This function overloads CloudWatchEventsClient().
This overload allows the caller to specify the specific endpoint to send requests to. Typically, it is easier to use the alternative constructor, which allows the caller to specify an AWS region instead, in which case this client will determine the correct endpoint for the given region automatically (via AwsEndpoint::getEndpoint).
See also QtAws::Core::AwsEndpoint::getEndpoint.
[slot] DeleteRuleResponse *CloudWatchEventsClient::deleteRule(const DeleteRuleRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an DeleteRuleResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Deletes the specified
rule>
You must remove all targets from a rule using <a>RemoveTargets</a> 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
[slot] DescribeEventBusResponse *CloudWatchEventsClient::describeEventBus(const DescribeEventBusRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an DescribeEventBusResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Displays the external AWS accounts that are permitted to write events to your account using your account's event bus, and the associated policy. To enable your account to receive events from other accounts, use
[slot] DescribeRuleResponse *CloudWatchEventsClient::describeRule(const DescribeRuleRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an DescribeRuleResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Describes the specified
[slot] DisableRuleResponse *CloudWatchEventsClient::disableRule(const DisableRuleRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an DisableRuleResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
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
[slot] EnableRuleResponse *CloudWatchEventsClient::enableRule(const EnableRuleRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an EnableRuleResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
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
[slot] ListRuleNamesByTargetResponse *CloudWatchEventsClient::listRuleNamesByTarget(const ListRuleNamesByTargetRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an ListRuleNamesByTargetResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
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
[slot] ListRulesResponse *CloudWatchEventsClient::listRules(const ListRulesRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an ListRulesResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Lists your Amazon CloudWatch Events rules. You can either list all the rules or you can provide a prefix to match to the rule
[slot] ListTargetsByRuleResponse *CloudWatchEventsClient::listTargetsByRule(const ListTargetsByRuleRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an ListTargetsByRuleResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Lists the targets assigned to the specified
[slot] PutEventsResponse *CloudWatchEventsClient::putEvents(const PutEventsRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an PutEventsResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Sends custom events to Amazon CloudWatch Events so that they can be matched to
[slot] PutPermissionResponse *CloudWatchEventsClient::putPermission(const PutPermissionRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an PutPermissionResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Running <code>PutPermission</code> permits the specified AWS account to put events to your account's default <i>event bus</i>. CloudWatch Events rules in your account are triggered by these events arriving to your default event bus.
</p
For another account to send events to your account, that external account must have a CloudWatch Events rule with your account's default event bus as a
target>
To enable multiple AWS accounts to put events to your default event bus, run <code>PutPermission</code> once for each of these
accounts>
The permission policy on the default event bus cannot exceed 10KB in
[slot] PutRuleResponse *CloudWatchEventsClient::putRule(const PutRuleRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an PutRuleResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Creates or updates the specified rule. Rules are enabled by default, or based on value of the state. You can disable a rule using
<a>DisableRule</a>>
If you are updating an existing rule, the rule is completely replaced with what you specify in this <code>PutRule</code> command. If you omit arguments in <code>PutRule</code>, the old values for those arguments are not kept. Instead, they are replaced with null
values>
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
[slot] PutTargetsResponse *CloudWatchEventsClient::putTargets(const PutTargetsRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an PutTargetsResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
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>
You can configure the following as targets for CloudWatch
Events> <ul> <li>
EC2
instance> </li> <li>
AWS Lambda
function> </li> <li>
Streams in Amazon Kinesis
Stream> </li> <li>
Delivery streams in Amazon Kinesis
Firehos> </li> <li>
Amazon ECS
task> </li> <li>
AWS Step Functions state
machine> </li> <li>
AWS Batch
job> </li> <li>
Pipelines in Amazon Code
Pipelin> </li> <li>
Amazon Inspector assessment
template> </li> <li>
Amazon SNS
topic> </li> <li>
Amazon SQS queues, including FIFO
queue> </li> <li>
The default event bus of another AWS
accoun> </li> </ul>
Note that creating rules with built-in targets is supported only in the AWS Management
Console>
For some target types, <code>PutTargets</code> 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 <code>KinesisParameters</code> argument. To invoke a command on multiple EC2 instances with one rule, you can use the <code>RunCommandParameters</code>
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 <code>RoleARN</code> argument in <code>PutTargets</code>. For more information, see <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/auth-and-access-control-cwe.html">Authentication and Access Control</a> in the <i>Amazon CloudWatch Events User
Guide</i>>
If another AWS account is in the same region and has granted you permission (using <code>PutPermission</code>), you can send events to that account by setting that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the <code>Arn</code> when you run <code>PutTargets</code>. If your account sends events to another account, your account is charged for each sent event. Each event sent to antoher account is charged as a custom event. The account receiving the event is not charged. For more information on pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch
Pricing</a>>
For more information about enabling cross-account events, see
<a>PutPermission</a>>
<b>Input</b>, <b>InputPath</b> and <b>InputTransformer</b> are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched
event> <ul> <li>
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)> </li> <li>
If <b>Input</b> is specified in the form of valid JSON, then the matched event is overridden with this
constant> </li> <li>
If <b>InputPath</b> is specified in the form of JSONPath (for example, <code>$.detail</code>), 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)> </li> <li>
If <b>InputTransformer</b> 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> </li> </ul>
When you specify <code>InputPath</code> or <code>InputTransformer</code>, 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, <code>FailedEntryCount</code> is non-zero in the response and each entry in <code>FailedEntries</code> provides the ID of the failed target and the error
[slot] RemovePermissionResponse *CloudWatchEventsClient::removePermission(const RemovePermissionRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an RemovePermissionResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
Revokes the permission of another AWS account to be able to put events to your default event bus. Specify the account to revoke by the <code>StatementId</code> value that you associated with the account when you granted it permission with <code>PutPermission</code>. You can find the <code>StatementId</code> by using
[slot] RemoveTargetsResponse *CloudWatchEventsClient::removeTargets(const RemoveTargetsRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an RemoveTargetsResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
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, <code>FailedEntryCount</code> is non-zero in the response and each entry in <code>FailedEntries</code> provides the ID of the failed target and the error
[slot] TestEventPatternResponse *CloudWatchEventsClient::testEventPattern(const TestEventPatternRequest &request)
Sends request to the CloudWatchEventsClient service, and returns a pointer to an TestEventPatternResponse object to track the result.
Note: The caller is to take responsbility for the resulting pointer.
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
© 2018 Paul Colby Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.