This class is a simple Facade over the CloudWatch client. This class is a very small abstraction over the CloudWatch client. It allows us to change the details of how we're communicating with CloudWatch without the need to expose this in the rest of our code. It also provides a shim for us to be able to Mock to unit test the rest of the code.
More...
#include <cloudwatch_logs_facade.h>
|
std::shared_ptr< Aws::CloudWatchLogs::CloudWatchLogsClient > | cw_client_ |
|
This class is a simple Facade over the CloudWatch client. This class is a very small abstraction over the CloudWatch client. It allows us to change the details of how we're communicating with CloudWatch without the need to expose this in the rest of our code. It also provides a shim for us to be able to Mock to unit test the rest of the code.
This class expects Aws::InitAPI() to have already been called before an instance is constructed
Definition at line 38 of file cloudwatch_logs_facade.h.
◆ CloudWatchLogsFacade() [1/3]
Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade::CloudWatchLogsFacade |
( |
const Aws::Client::ClientConfiguration & |
client_config | ) |
|
◆ CloudWatchLogsFacade() [2/3]
Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade::CloudWatchLogsFacade |
( |
const std::shared_ptr< Aws::CloudWatchLogs::CloudWatchLogsClient > & |
cw_client | ) |
|
◆ ~CloudWatchLogsFacade()
virtual Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade::~CloudWatchLogsFacade |
( |
| ) |
|
|
virtualdefault |
◆ CloudWatchLogsFacade() [3/3]
Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade::CloudWatchLogsFacade |
( |
| ) |
|
|
protecteddefault |
◆ CheckLogGroupExists()
Check if a log group exists.
- Parameters
-
log_group | Name of the log group |
- Returns
- An error code that will be SUCCESS if log group is successfully found
Reimplemented in MockCloudWatchFacade.
Definition at line 195 of file cloudwatch_logs_facade.cpp.
◆ CheckLogStreamExists()
Aws::CloudWatchLogs::ROSCloudWatchLogsErrors Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade::CheckLogStreamExists |
( |
const std::string & |
log_group, |
|
|
const std::string & |
log_stream, |
|
|
Aws::CloudWatchLogs::Model::LogStream * |
log_stream_object |
|
) |
| |
|
virtual |
Check if a log stream in a log group exists.
- Parameters
-
log_group | Name of the log group |
log_stream | Name of the stream |
log_stream_object | A log stream object that contains information about the log stream |
- Returns
- An error code that will be SUCCESS if log stream is successfully found
Reimplemented in MockCloudWatchFacade.
Definition at line 274 of file cloudwatch_logs_facade.cpp.
◆ CreateLogGroup()
Creates a log group.
- Parameters
-
log_group | Name of the log group |
- Returns
- An error code that will be SUCCESS if log group is successfully created or resource already exists
Reimplemented in MockCloudWatchFacade.
Definition at line 165 of file cloudwatch_logs_facade.cpp.
◆ CreateLogStream()
Creates a log stream in the specified log group.
- Parameters
-
log_group | Name of the log group |
log_stream | Name of the stream |
- Returns
- An error code that will be SUCCESS if log stream is successfully created or resource already exists
Reimplemented in MockCloudWatchFacade.
Definition at line 245 of file cloudwatch_logs_facade.cpp.
◆ GetLogStreamToken()
Gets the next sequence token to use for sending logs to cloudwatch.
- Parameters
-
log_group | Name of the log group |
log_stream | Name of the stream |
- Returns
- An error code of SUCCESS if the specified log stream in the log group can be found and has a next sequence token (a new stream will not have a sequence token)
Reimplemented in MockCloudWatchFacade.
Definition at line 332 of file cloudwatch_logs_facade.cpp.
◆ SendLogsRequest()
◆ SendLogsToCloudWatch()
Sends a list of logs to CloudWatch.
This operation may block for a bounded amount of time to rate limit calls to the CloudWatch Logs API. It is expected that tasks dispatched to this facade occur on worker threads so that main loop program processing is not affected by this delay.
- Parameters
-
next_token | The next sequence token to use for sending logs to cloudwatch |
log_group | A reference to a string with the log group name for all the logs being posted |
log_stream | A reference to a string with the log stream name for all the logs being posted |
logs | A reference to a list of logs that you want sent to CloudWatch |
- Returns
- An error code that will be SUCCESS if all logs were sent successfully.
Definition at line 106 of file cloudwatch_logs_facade.cpp.
◆ cw_client_
std::shared_ptr<Aws::CloudWatchLogs::CloudWatchLogsClient> Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade::cw_client_ |
|
protected |
◆ last_put_time_
std::chrono::milliseconds Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade::last_put_time_ {0} |
|
private |
The documentation for this class was generated from the following files: