AWS SDK for C++

AWS SDK for C++ Version 1.11.754

Loading...
Searching...
No Matches
ScalingPolicy.h
1
6#pragma once
7#include <aws/autoscaling/AutoScaling_EXPORTS.h>
8#include <aws/autoscaling/model/Alarm.h>
9#include <aws/autoscaling/model/PredictiveScalingConfiguration.h>
10#include <aws/autoscaling/model/StepAdjustment.h>
11#include <aws/autoscaling/model/TargetTrackingConfiguration.h>
12#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
13#include <aws/core/utils/memory/stl/AWSString.h>
14#include <aws/core/utils/memory/stl/AWSVector.h>
15
16#include <utility>
17
18namespace Aws {
19namespace Utils {
20namespace Xml {
21class XmlNode;
22} // namespace Xml
23} // namespace Utils
24namespace AutoScaling {
25namespace Model {
26
33 public:
34 AWS_AUTOSCALING_API ScalingPolicy() = default;
35 AWS_AUTOSCALING_API ScalingPolicy(const Aws::Utils::Xml::XmlNode& xmlNode);
36 AWS_AUTOSCALING_API ScalingPolicy& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
37
38 AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
39 AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
40
42
45 inline const Aws::String& GetAutoScalingGroupName() const { return m_autoScalingGroupName; }
46 inline bool AutoScalingGroupNameHasBeenSet() const { return m_autoScalingGroupNameHasBeenSet; }
47 template <typename AutoScalingGroupNameT = Aws::String>
48 void SetAutoScalingGroupName(AutoScalingGroupNameT&& value) {
49 m_autoScalingGroupNameHasBeenSet = true;
50 m_autoScalingGroupName = std::forward<AutoScalingGroupNameT>(value);
51 }
52 template <typename AutoScalingGroupNameT = Aws::String>
53 ScalingPolicy& WithAutoScalingGroupName(AutoScalingGroupNameT&& value) {
54 SetAutoScalingGroupName(std::forward<AutoScalingGroupNameT>(value));
55 return *this;
56 }
58
60
63 inline const Aws::String& GetPolicyName() const { return m_policyName; }
64 inline bool PolicyNameHasBeenSet() const { return m_policyNameHasBeenSet; }
65 template <typename PolicyNameT = Aws::String>
66 void SetPolicyName(PolicyNameT&& value) {
67 m_policyNameHasBeenSet = true;
68 m_policyName = std::forward<PolicyNameT>(value);
69 }
70 template <typename PolicyNameT = Aws::String>
71 ScalingPolicy& WithPolicyName(PolicyNameT&& value) {
72 SetPolicyName(std::forward<PolicyNameT>(value));
73 return *this;
74 }
76
78
81 inline const Aws::String& GetPolicyARN() const { return m_policyARN; }
82 inline bool PolicyARNHasBeenSet() const { return m_policyARNHasBeenSet; }
83 template <typename PolicyARNT = Aws::String>
84 void SetPolicyARN(PolicyARNT&& value) {
85 m_policyARNHasBeenSet = true;
86 m_policyARN = std::forward<PolicyARNT>(value);
87 }
88 template <typename PolicyARNT = Aws::String>
89 ScalingPolicy& WithPolicyARN(PolicyARNT&& value) {
90 SetPolicyARN(std::forward<PolicyARNT>(value));
91 return *this;
92 }
94
96
107 inline const Aws::String& GetPolicyType() const { return m_policyType; }
108 inline bool PolicyTypeHasBeenSet() const { return m_policyTypeHasBeenSet; }
109 template <typename PolicyTypeT = Aws::String>
110 void SetPolicyType(PolicyTypeT&& value) {
111 m_policyTypeHasBeenSet = true;
112 m_policyType = std::forward<PolicyTypeT>(value);
113 }
114 template <typename PolicyTypeT = Aws::String>
115 ScalingPolicy& WithPolicyType(PolicyTypeT&& value) {
116 SetPolicyType(std::forward<PolicyTypeT>(value));
117 return *this;
118 }
120
122
127 inline const Aws::String& GetAdjustmentType() const { return m_adjustmentType; }
128 inline bool AdjustmentTypeHasBeenSet() const { return m_adjustmentTypeHasBeenSet; }
129 template <typename AdjustmentTypeT = Aws::String>
130 void SetAdjustmentType(AdjustmentTypeT&& value) {
131 m_adjustmentTypeHasBeenSet = true;
132 m_adjustmentType = std::forward<AdjustmentTypeT>(value);
133 }
134 template <typename AdjustmentTypeT = Aws::String>
135 ScalingPolicy& WithAdjustmentType(AdjustmentTypeT&& value) {
136 SetAdjustmentType(std::forward<AdjustmentTypeT>(value));
137 return *this;
138 }
140
142
146 inline int GetMinAdjustmentStep() const { return m_minAdjustmentStep; }
147 inline bool MinAdjustmentStepHasBeenSet() const { return m_minAdjustmentStepHasBeenSet; }
148 inline void SetMinAdjustmentStep(int value) {
149 m_minAdjustmentStepHasBeenSet = true;
150 m_minAdjustmentStep = value;
151 }
154 return *this;
155 }
157
159
163 inline int GetMinAdjustmentMagnitude() const { return m_minAdjustmentMagnitude; }
164 inline bool MinAdjustmentMagnitudeHasBeenSet() const { return m_minAdjustmentMagnitudeHasBeenSet; }
165 inline void SetMinAdjustmentMagnitude(int value) {
166 m_minAdjustmentMagnitudeHasBeenSet = true;
167 m_minAdjustmentMagnitude = value;
168 }
171 return *this;
172 }
174
176
181 inline int GetScalingAdjustment() const { return m_scalingAdjustment; }
182 inline bool ScalingAdjustmentHasBeenSet() const { return m_scalingAdjustmentHasBeenSet; }
183 inline void SetScalingAdjustment(int value) {
184 m_scalingAdjustmentHasBeenSet = true;
185 m_scalingAdjustment = value;
186 }
189 return *this;
190 }
192
194
197 inline int GetCooldown() const { return m_cooldown; }
198 inline bool CooldownHasBeenSet() const { return m_cooldownHasBeenSet; }
199 inline void SetCooldown(int value) {
200 m_cooldownHasBeenSet = true;
201 m_cooldown = value;
202 }
203 inline ScalingPolicy& WithCooldown(int value) {
204 SetCooldown(value);
205 return *this;
206 }
208
210
214 inline const Aws::Vector<StepAdjustment>& GetStepAdjustments() const { return m_stepAdjustments; }
215 inline bool StepAdjustmentsHasBeenSet() const { return m_stepAdjustmentsHasBeenSet; }
216 template <typename StepAdjustmentsT = Aws::Vector<StepAdjustment>>
217 void SetStepAdjustments(StepAdjustmentsT&& value) {
218 m_stepAdjustmentsHasBeenSet = true;
219 m_stepAdjustments = std::forward<StepAdjustmentsT>(value);
220 }
221 template <typename StepAdjustmentsT = Aws::Vector<StepAdjustment>>
222 ScalingPolicy& WithStepAdjustments(StepAdjustmentsT&& value) {
223 SetStepAdjustments(std::forward<StepAdjustmentsT>(value));
224 return *this;
225 }
226 template <typename StepAdjustmentsT = StepAdjustment>
227 ScalingPolicy& AddStepAdjustments(StepAdjustmentsT&& value) {
228 m_stepAdjustmentsHasBeenSet = true;
229 m_stepAdjustments.emplace_back(std::forward<StepAdjustmentsT>(value));
230 return *this;
231 }
233
235
239 inline const Aws::String& GetMetricAggregationType() const { return m_metricAggregationType; }
240 inline bool MetricAggregationTypeHasBeenSet() const { return m_metricAggregationTypeHasBeenSet; }
241 template <typename MetricAggregationTypeT = Aws::String>
242 void SetMetricAggregationType(MetricAggregationTypeT&& value) {
243 m_metricAggregationTypeHasBeenSet = true;
244 m_metricAggregationType = std::forward<MetricAggregationTypeT>(value);
245 }
246 template <typename MetricAggregationTypeT = Aws::String>
247 ScalingPolicy& WithMetricAggregationType(MetricAggregationTypeT&& value) {
248 SetMetricAggregationType(std::forward<MetricAggregationTypeT>(value));
249 return *this;
250 }
252
254
258 inline int GetEstimatedInstanceWarmup() const { return m_estimatedInstanceWarmup; }
259 inline bool EstimatedInstanceWarmupHasBeenSet() const { return m_estimatedInstanceWarmupHasBeenSet; }
260 inline void SetEstimatedInstanceWarmup(int value) {
261 m_estimatedInstanceWarmupHasBeenSet = true;
262 m_estimatedInstanceWarmup = value;
263 }
266 return *this;
267 }
269
271
274 inline const Aws::Vector<Alarm>& GetAlarms() const { return m_alarms; }
275 inline bool AlarmsHasBeenSet() const { return m_alarmsHasBeenSet; }
276 template <typename AlarmsT = Aws::Vector<Alarm>>
277 void SetAlarms(AlarmsT&& value) {
278 m_alarmsHasBeenSet = true;
279 m_alarms = std::forward<AlarmsT>(value);
280 }
281 template <typename AlarmsT = Aws::Vector<Alarm>>
282 ScalingPolicy& WithAlarms(AlarmsT&& value) {
283 SetAlarms(std::forward<AlarmsT>(value));
284 return *this;
285 }
286 template <typename AlarmsT = Alarm>
287 ScalingPolicy& AddAlarms(AlarmsT&& value) {
288 m_alarmsHasBeenSet = true;
289 m_alarms.emplace_back(std::forward<AlarmsT>(value));
290 return *this;
291 }
293
295
298 inline const TargetTrackingConfiguration& GetTargetTrackingConfiguration() const { return m_targetTrackingConfiguration; }
299 inline bool TargetTrackingConfigurationHasBeenSet() const { return m_targetTrackingConfigurationHasBeenSet; }
300 template <typename TargetTrackingConfigurationT = TargetTrackingConfiguration>
301 void SetTargetTrackingConfiguration(TargetTrackingConfigurationT&& value) {
302 m_targetTrackingConfigurationHasBeenSet = true;
303 m_targetTrackingConfiguration = std::forward<TargetTrackingConfigurationT>(value);
304 }
305 template <typename TargetTrackingConfigurationT = TargetTrackingConfiguration>
306 ScalingPolicy& WithTargetTrackingConfiguration(TargetTrackingConfigurationT&& value) {
307 SetTargetTrackingConfiguration(std::forward<TargetTrackingConfigurationT>(value));
308 return *this;
309 }
311
313
317 inline bool GetEnabled() const { return m_enabled; }
318 inline bool EnabledHasBeenSet() const { return m_enabledHasBeenSet; }
319 inline void SetEnabled(bool value) {
320 m_enabledHasBeenSet = true;
321 m_enabled = value;
322 }
323 inline ScalingPolicy& WithEnabled(bool value) {
324 SetEnabled(value);
325 return *this;
326 }
328
330
333 inline const PredictiveScalingConfiguration& GetPredictiveScalingConfiguration() const { return m_predictiveScalingConfiguration; }
334 inline bool PredictiveScalingConfigurationHasBeenSet() const { return m_predictiveScalingConfigurationHasBeenSet; }
335 template <typename PredictiveScalingConfigurationT = PredictiveScalingConfiguration>
336 void SetPredictiveScalingConfiguration(PredictiveScalingConfigurationT&& value) {
337 m_predictiveScalingConfigurationHasBeenSet = true;
338 m_predictiveScalingConfiguration = std::forward<PredictiveScalingConfigurationT>(value);
339 }
340 template <typename PredictiveScalingConfigurationT = PredictiveScalingConfiguration>
341 ScalingPolicy& WithPredictiveScalingConfiguration(PredictiveScalingConfigurationT&& value) {
342 SetPredictiveScalingConfiguration(std::forward<PredictiveScalingConfigurationT>(value));
343 return *this;
344 }
346 private:
347 Aws::String m_autoScalingGroupName;
348
349 Aws::String m_policyName;
350
351 Aws::String m_policyARN;
352
353 Aws::String m_policyType;
354
355 Aws::String m_adjustmentType;
356
357 int m_minAdjustmentStep{0};
358
359 int m_minAdjustmentMagnitude{0};
360
361 int m_scalingAdjustment{0};
362
363 int m_cooldown{0};
364
365 Aws::Vector<StepAdjustment> m_stepAdjustments;
366
367 Aws::String m_metricAggregationType;
368
369 int m_estimatedInstanceWarmup{0};
370
371 Aws::Vector<Alarm> m_alarms;
372
373 TargetTrackingConfiguration m_targetTrackingConfiguration;
374
375 bool m_enabled{false};
376
377 PredictiveScalingConfiguration m_predictiveScalingConfiguration;
378 bool m_autoScalingGroupNameHasBeenSet = false;
379 bool m_policyNameHasBeenSet = false;
380 bool m_policyARNHasBeenSet = false;
381 bool m_policyTypeHasBeenSet = false;
382 bool m_adjustmentTypeHasBeenSet = false;
383 bool m_minAdjustmentStepHasBeenSet = false;
384 bool m_minAdjustmentMagnitudeHasBeenSet = false;
385 bool m_scalingAdjustmentHasBeenSet = false;
386 bool m_cooldownHasBeenSet = false;
387 bool m_stepAdjustmentsHasBeenSet = false;
388 bool m_metricAggregationTypeHasBeenSet = false;
389 bool m_estimatedInstanceWarmupHasBeenSet = false;
390 bool m_alarmsHasBeenSet = false;
391 bool m_targetTrackingConfigurationHasBeenSet = false;
392 bool m_enabledHasBeenSet = false;
393 bool m_predictiveScalingConfigurationHasBeenSet = false;
394};
395
396} // namespace Model
397} // namespace AutoScaling
398} // namespace Aws
const Aws::Vector< Alarm > & GetAlarms() const
void SetAdjustmentType(AdjustmentTypeT &&value)
ScalingPolicy & WithEnabled(bool value)
void SetStepAdjustments(StepAdjustmentsT &&value)
void SetPolicyType(PolicyTypeT &&value)
const PredictiveScalingConfiguration & GetPredictiveScalingConfiguration() const
const Aws::String & GetPolicyName() const
AWS_AUTOSCALING_API ScalingPolicy()=default
ScalingPolicy & WithScalingAdjustment(int value)
ScalingPolicy & WithEstimatedInstanceWarmup(int value)
AWS_AUTOSCALING_API void OutputToStream(Aws::OStream &oStream, const char *location) const
AWS_AUTOSCALING_API void OutputToStream(Aws::OStream &ostream, const char *location, unsigned index, const char *locationValue) const
AWS_AUTOSCALING_API ScalingPolicy & operator=(const Aws::Utils::Xml::XmlNode &xmlNode)
ScalingPolicy & WithMinAdjustmentStep(int value)
void SetAutoScalingGroupName(AutoScalingGroupNameT &&value)
const Aws::String & GetPolicyARN() const
const Aws::Vector< StepAdjustment > & GetStepAdjustments() const
ScalingPolicy & WithPredictiveScalingConfiguration(PredictiveScalingConfigurationT &&value)
ScalingPolicy & WithAdjustmentType(AdjustmentTypeT &&value)
ScalingPolicy & AddAlarms(AlarmsT &&value)
ScalingPolicy & WithPolicyType(PolicyTypeT &&value)
ScalingPolicy & WithPolicyARN(PolicyARNT &&value)
void SetPolicyARN(PolicyARNT &&value)
ScalingPolicy & WithMetricAggregationType(MetricAggregationTypeT &&value)
ScalingPolicy & WithMinAdjustmentMagnitude(int value)
const Aws::String & GetPolicyType() const
ScalingPolicy & WithCooldown(int value)
const Aws::String & GetMetricAggregationType() const
ScalingPolicy & WithAlarms(AlarmsT &&value)
AWS_AUTOSCALING_API ScalingPolicy(const Aws::Utils::Xml::XmlNode &xmlNode)
void SetPredictiveScalingConfiguration(PredictiveScalingConfigurationT &&value)
ScalingPolicy & AddStepAdjustments(StepAdjustmentsT &&value)
ScalingPolicy & WithTargetTrackingConfiguration(TargetTrackingConfigurationT &&value)
const Aws::String & GetAutoScalingGroupName() const
ScalingPolicy & WithPolicyName(PolicyNameT &&value)
void SetPolicyName(PolicyNameT &&value)
void SetMetricAggregationType(MetricAggregationTypeT &&value)
const Aws::String & GetAdjustmentType() const
ScalingPolicy & WithStepAdjustments(StepAdjustmentsT &&value)
void SetTargetTrackingConfiguration(TargetTrackingConfigurationT &&value)
const TargetTrackingConfiguration & GetTargetTrackingConfiguration() const
ScalingPolicy & WithAutoScalingGroupName(AutoScalingGroupNameT &&value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
std::basic_ostream< char, std::char_traits< char > > OStream