File size: 11,663 Bytes
7791ca1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/logs/CloudWatchLogs_EXPORTS.h>
#include <aws/logs/CloudWatchLogsRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/logs/model/EvaluationFrequency.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>
namespace Aws
{
namespace CloudWatchLogs
{
namespace Model
{
/**
*/
class CreateLogAnomalyDetectorRequest : public CloudWatchLogsRequest
{
public:
AWS_CLOUDWATCHLOGS_API CreateLogAnomalyDetectorRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "CreateLogAnomalyDetector"; }
AWS_CLOUDWATCHLOGS_API Aws::String SerializePayload() const override;
AWS_CLOUDWATCHLOGS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
///@{
/**
* <p>An array containing the ARN of the log group that this anomaly detector will
* watch. You can specify only one log group ARN.</p>
*/
inline const Aws::Vector<Aws::String>& GetLogGroupArnList() const{ return m_logGroupArnList; }
inline bool LogGroupArnListHasBeenSet() const { return m_logGroupArnListHasBeenSet; }
inline void SetLogGroupArnList(const Aws::Vector<Aws::String>& value) { m_logGroupArnListHasBeenSet = true; m_logGroupArnList = value; }
inline void SetLogGroupArnList(Aws::Vector<Aws::String>&& value) { m_logGroupArnListHasBeenSet = true; m_logGroupArnList = std::move(value); }
inline CreateLogAnomalyDetectorRequest& WithLogGroupArnList(const Aws::Vector<Aws::String>& value) { SetLogGroupArnList(value); return *this;}
inline CreateLogAnomalyDetectorRequest& WithLogGroupArnList(Aws::Vector<Aws::String>&& value) { SetLogGroupArnList(std::move(value)); return *this;}
inline CreateLogAnomalyDetectorRequest& AddLogGroupArnList(const Aws::String& value) { m_logGroupArnListHasBeenSet = true; m_logGroupArnList.push_back(value); return *this; }
inline CreateLogAnomalyDetectorRequest& AddLogGroupArnList(Aws::String&& value) { m_logGroupArnListHasBeenSet = true; m_logGroupArnList.push_back(std::move(value)); return *this; }
inline CreateLogAnomalyDetectorRequest& AddLogGroupArnList(const char* value) { m_logGroupArnListHasBeenSet = true; m_logGroupArnList.push_back(value); return *this; }
///@}
///@{
/**
* <p>A name for this anomaly detector.</p>
*/
inline const Aws::String& GetDetectorName() const{ return m_detectorName; }
inline bool DetectorNameHasBeenSet() const { return m_detectorNameHasBeenSet; }
inline void SetDetectorName(const Aws::String& value) { m_detectorNameHasBeenSet = true; m_detectorName = value; }
inline void SetDetectorName(Aws::String&& value) { m_detectorNameHasBeenSet = true; m_detectorName = std::move(value); }
inline void SetDetectorName(const char* value) { m_detectorNameHasBeenSet = true; m_detectorName.assign(value); }
inline CreateLogAnomalyDetectorRequest& WithDetectorName(const Aws::String& value) { SetDetectorName(value); return *this;}
inline CreateLogAnomalyDetectorRequest& WithDetectorName(Aws::String&& value) { SetDetectorName(std::move(value)); return *this;}
inline CreateLogAnomalyDetectorRequest& WithDetectorName(const char* value) { SetDetectorName(value); return *this;}
///@}
///@{
/**
* <p>Specifies how often the anomaly detector is to run and look for anomalies.
* Set this value according to the frequency that the log group receives new logs.
* For example, if the log group receives new log events every 10 minutes, then 15
* minutes might be a good setting for <code>evaluationFrequency</code> .</p>
*/
inline const EvaluationFrequency& GetEvaluationFrequency() const{ return m_evaluationFrequency; }
inline bool EvaluationFrequencyHasBeenSet() const { return m_evaluationFrequencyHasBeenSet; }
inline void SetEvaluationFrequency(const EvaluationFrequency& value) { m_evaluationFrequencyHasBeenSet = true; m_evaluationFrequency = value; }
inline void SetEvaluationFrequency(EvaluationFrequency&& value) { m_evaluationFrequencyHasBeenSet = true; m_evaluationFrequency = std::move(value); }
inline CreateLogAnomalyDetectorRequest& WithEvaluationFrequency(const EvaluationFrequency& value) { SetEvaluationFrequency(value); return *this;}
inline CreateLogAnomalyDetectorRequest& WithEvaluationFrequency(EvaluationFrequency&& value) { SetEvaluationFrequency(std::move(value)); return *this;}
///@}
///@{
/**
* <p>You can use this parameter to limit the anomaly detection model to examine
* only log events that match the pattern you specify here. For more information,
* see <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html">Filter
* and Pattern Syntax</a>.</p>
*/
inline const Aws::String& GetFilterPattern() const{ return m_filterPattern; }
inline bool FilterPatternHasBeenSet() const { return m_filterPatternHasBeenSet; }
inline void SetFilterPattern(const Aws::String& value) { m_filterPatternHasBeenSet = true; m_filterPattern = value; }
inline void SetFilterPattern(Aws::String&& value) { m_filterPatternHasBeenSet = true; m_filterPattern = std::move(value); }
inline void SetFilterPattern(const char* value) { m_filterPatternHasBeenSet = true; m_filterPattern.assign(value); }
inline CreateLogAnomalyDetectorRequest& WithFilterPattern(const Aws::String& value) { SetFilterPattern(value); return *this;}
inline CreateLogAnomalyDetectorRequest& WithFilterPattern(Aws::String&& value) { SetFilterPattern(std::move(value)); return *this;}
inline CreateLogAnomalyDetectorRequest& WithFilterPattern(const char* value) { SetFilterPattern(value); return *this;}
///@}
///@{
/**
* <p>Optionally assigns a KMS key to secure this anomaly detector and its
* findings. If a key is assigned, the anomalies found and the model used by this
* detector are encrypted at rest with the key. If a key is assigned to an anomaly
* detector, a user must have permissions for both this key and for the anomaly
* detector to retrieve information about the anomalies that it finds.</p> <p>For
* more information about using a KMS key and to see the required IAM policy, see
* <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html">Use
* a KMS key with an anomaly detector</a>.</p>
*/
inline const Aws::String& GetKmsKeyId() const{ return m_kmsKeyId; }
inline bool KmsKeyIdHasBeenSet() const { return m_kmsKeyIdHasBeenSet; }
inline void SetKmsKeyId(const Aws::String& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = value; }
inline void SetKmsKeyId(Aws::String&& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = std::move(value); }
inline void SetKmsKeyId(const char* value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId.assign(value); }
inline CreateLogAnomalyDetectorRequest& WithKmsKeyId(const Aws::String& value) { SetKmsKeyId(value); return *this;}
inline CreateLogAnomalyDetectorRequest& WithKmsKeyId(Aws::String&& value) { SetKmsKeyId(std::move(value)); return *this;}
inline CreateLogAnomalyDetectorRequest& WithKmsKeyId(const char* value) { SetKmsKeyId(value); return *this;}
///@}
///@{
/**
* <p>The number of days to have visibility on an anomaly. After this time period
* has elapsed for an anomaly, it will be automatically baselined and the anomaly
* detector will treat new occurrences of a similar anomaly as normal. Therefore,
* if you do not correct the cause of an anomaly during the time period specified
* in <code>anomalyVisibilityTime</code>, it will be considered normal going
* forward and will not be detected as an anomaly.</p>
*/
inline long long GetAnomalyVisibilityTime() const{ return m_anomalyVisibilityTime; }
inline bool AnomalyVisibilityTimeHasBeenSet() const { return m_anomalyVisibilityTimeHasBeenSet; }
inline void SetAnomalyVisibilityTime(long long value) { m_anomalyVisibilityTimeHasBeenSet = true; m_anomalyVisibilityTime = value; }
inline CreateLogAnomalyDetectorRequest& WithAnomalyVisibilityTime(long long value) { SetAnomalyVisibilityTime(value); return *this;}
///@}
///@{
/**
* <p>An optional list of key-value pairs to associate with the resource.</p>
* <p>For more information about tagging, see <a
* href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging
* Amazon Web Services resources</a> </p>
*/
inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; }
inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tagsHasBeenSet = true; m_tags = value; }
inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }
inline CreateLogAnomalyDetectorRequest& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;}
inline CreateLogAnomalyDetectorRequest& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;}
inline CreateLogAnomalyDetectorRequest& AddTags(const Aws::String& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }
inline CreateLogAnomalyDetectorRequest& AddTags(Aws::String&& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }
inline CreateLogAnomalyDetectorRequest& AddTags(const Aws::String& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }
inline CreateLogAnomalyDetectorRequest& AddTags(Aws::String&& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), std::move(value)); return *this; }
inline CreateLogAnomalyDetectorRequest& AddTags(const char* key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }
inline CreateLogAnomalyDetectorRequest& AddTags(Aws::String&& key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }
inline CreateLogAnomalyDetectorRequest& AddTags(const char* key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }
///@}
private:
Aws::Vector<Aws::String> m_logGroupArnList;
bool m_logGroupArnListHasBeenSet = false;
Aws::String m_detectorName;
bool m_detectorNameHasBeenSet = false;
EvaluationFrequency m_evaluationFrequency;
bool m_evaluationFrequencyHasBeenSet = false;
Aws::String m_filterPattern;
bool m_filterPatternHasBeenSet = false;
Aws::String m_kmsKeyId;
bool m_kmsKeyIdHasBeenSet = false;
long long m_anomalyVisibilityTime;
bool m_anomalyVisibilityTimeHasBeenSet = false;
Aws::Map<Aws::String, Aws::String> m_tags;
bool m_tagsHasBeenSet = false;
};
} // namespace Model
} // namespace CloudWatchLogs
} // namespace Aws
|