/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ECS { namespace Model { /** *

One of the methods which provide a way for you to quickly identify when a * deployment has failed, and then to optionally roll back the failure to the last * working deployment.

When the alarms are generated, Amazon ECS sets the * service deployment to failed. Set the rollback parameter to have Amazon ECS to * roll back your service to the last completed deployment after a failure.

*

You can only use the DeploymentAlarms method to detect failures * when the DeploymentController is set to ECS (rolling * update).

For more information, see Rolling * update in the Amazon Elastic Container Service Developer Guide * .

See Also:

AWS * API Reference

*/ class DeploymentAlarms { public: AWS_ECS_API DeploymentAlarms(); AWS_ECS_API DeploymentAlarms(Aws::Utils::Json::JsonView jsonValue); AWS_ECS_API DeploymentAlarms& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_ECS_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline const Aws::Vector& GetAlarmNames() const{ return m_alarmNames; } /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline bool AlarmNamesHasBeenSet() const { return m_alarmNamesHasBeenSet; } /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline void SetAlarmNames(const Aws::Vector& value) { m_alarmNamesHasBeenSet = true; m_alarmNames = value; } /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline void SetAlarmNames(Aws::Vector&& value) { m_alarmNamesHasBeenSet = true; m_alarmNames = std::move(value); } /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline DeploymentAlarms& WithAlarmNames(const Aws::Vector& value) { SetAlarmNames(value); return *this;} /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline DeploymentAlarms& WithAlarmNames(Aws::Vector&& value) { SetAlarmNames(std::move(value)); return *this;} /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline DeploymentAlarms& AddAlarmNames(const Aws::String& value) { m_alarmNamesHasBeenSet = true; m_alarmNames.push_back(value); return *this; } /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline DeploymentAlarms& AddAlarmNames(Aws::String&& value) { m_alarmNamesHasBeenSet = true; m_alarmNames.push_back(std::move(value)); return *this; } /** *

One or more CloudWatch alarm names. Use a "," to separate the alarms.

*/ inline DeploymentAlarms& AddAlarmNames(const char* value) { m_alarmNamesHasBeenSet = true; m_alarmNames.push_back(value); return *this; } /** *

Determines whether to use the CloudWatch alarm option in the service * deployment process.

*/ inline bool GetEnable() const{ return m_enable; } /** *

Determines whether to use the CloudWatch alarm option in the service * deployment process.

*/ inline bool EnableHasBeenSet() const { return m_enableHasBeenSet; } /** *

Determines whether to use the CloudWatch alarm option in the service * deployment process.

*/ inline void SetEnable(bool value) { m_enableHasBeenSet = true; m_enable = value; } /** *

Determines whether to use the CloudWatch alarm option in the service * deployment process.

*/ inline DeploymentAlarms& WithEnable(bool value) { SetEnable(value); return *this;} /** *

Determines whether to configure Amazon ECS to roll back the service if a * service deployment fails. If rollback is used, when a service deployment fails, * the service is rolled back to the last deployment that completed * successfully.

*/ inline bool GetRollback() const{ return m_rollback; } /** *

Determines whether to configure Amazon ECS to roll back the service if a * service deployment fails. If rollback is used, when a service deployment fails, * the service is rolled back to the last deployment that completed * successfully.

*/ inline bool RollbackHasBeenSet() const { return m_rollbackHasBeenSet; } /** *

Determines whether to configure Amazon ECS to roll back the service if a * service deployment fails. If rollback is used, when a service deployment fails, * the service is rolled back to the last deployment that completed * successfully.

*/ inline void SetRollback(bool value) { m_rollbackHasBeenSet = true; m_rollback = value; } /** *

Determines whether to configure Amazon ECS to roll back the service if a * service deployment fails. If rollback is used, when a service deployment fails, * the service is rolled back to the last deployment that completed * successfully.

*/ inline DeploymentAlarms& WithRollback(bool value) { SetRollback(value); return *this;} private: Aws::Vector m_alarmNames; bool m_alarmNamesHasBeenSet = false; bool m_enable; bool m_enableHasBeenSet = false; bool m_rollback; bool m_rollbackHasBeenSet = false; }; } // namespace Model } // namespace ECS } // namespace Aws