/** * 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 GameLift { namespace Model { /** *

Instructions on when and how to check the health of a support container in a * container fleet. These properties override any Docker health checks that are set * in the container image. For more information on container health checks, see HealthCheck * command in the Amazon Elastic Container Service API. Game server * containers don't have a health check parameter; Amazon GameLift automatically * handles health checks for these containers.

The following example * instructs the container to initiate a health check command every 60 seconds and * wait 10 seconds for it to succeed. If it fails, retry the command 3 times before * flagging the container as unhealthy. It also tells the container to wait 100 * seconds after launch before counting failed health checks.

* {"Command": [ "CMD-SHELL", "ps cax | grep "processmanager" || exit 1" ], * "Interval": 60, "Timeout": 10, "Retries": 3, "StartPeriod": 100 }

*

Part of: SupportContainerDefinition, * SupportContainerDefinitionInput

See Also:

AWS * API Reference

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

A string array that specifies the command that the container runs to * determine if it's healthy.

*/ inline const Aws::Vector& GetCommand() const{ return m_command; } inline bool CommandHasBeenSet() const { return m_commandHasBeenSet; } inline void SetCommand(const Aws::Vector& value) { m_commandHasBeenSet = true; m_command = value; } inline void SetCommand(Aws::Vector&& value) { m_commandHasBeenSet = true; m_command = std::move(value); } inline ContainerHealthCheck& WithCommand(const Aws::Vector& value) { SetCommand(value); return *this;} inline ContainerHealthCheck& WithCommand(Aws::Vector&& value) { SetCommand(std::move(value)); return *this;} inline ContainerHealthCheck& AddCommand(const Aws::String& value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; } inline ContainerHealthCheck& AddCommand(Aws::String&& value) { m_commandHasBeenSet = true; m_command.push_back(std::move(value)); return *this; } inline ContainerHealthCheck& AddCommand(const char* value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; } ///@} ///@{ /** *

The time period (in seconds) between each health check.

*/ inline int GetInterval() const{ return m_interval; } inline bool IntervalHasBeenSet() const { return m_intervalHasBeenSet; } inline void SetInterval(int value) { m_intervalHasBeenSet = true; m_interval = value; } inline ContainerHealthCheck& WithInterval(int value) { SetInterval(value); return *this;} ///@} ///@{ /** *

The number of times to retry a failed health check before flagging the * container unhealthy. The first run of the command does not count as a retry.

*/ inline int GetRetries() const{ return m_retries; } inline bool RetriesHasBeenSet() const { return m_retriesHasBeenSet; } inline void SetRetries(int value) { m_retriesHasBeenSet = true; m_retries = value; } inline ContainerHealthCheck& WithRetries(int value) { SetRetries(value); return *this;} ///@} ///@{ /** *

The optional grace period (in seconds) to give a container time to bootstrap * before the first failed health check counts toward the number of retries.

*/ inline int GetStartPeriod() const{ return m_startPeriod; } inline bool StartPeriodHasBeenSet() const { return m_startPeriodHasBeenSet; } inline void SetStartPeriod(int value) { m_startPeriodHasBeenSet = true; m_startPeriod = value; } inline ContainerHealthCheck& WithStartPeriod(int value) { SetStartPeriod(value); return *this;} ///@} ///@{ /** *

The time period (in seconds) to wait for a health check to succeed before * counting a failed health check.

*/ inline int GetTimeout() const{ return m_timeout; } inline bool TimeoutHasBeenSet() const { return m_timeoutHasBeenSet; } inline void SetTimeout(int value) { m_timeoutHasBeenSet = true; m_timeout = value; } inline ContainerHealthCheck& WithTimeout(int value) { SetTimeout(value); return *this;} ///@} private: Aws::Vector m_command; bool m_commandHasBeenSet = false; int m_interval; bool m_intervalHasBeenSet = false; int m_retries; bool m_retriesHasBeenSet = false; int m_startPeriod; bool m_startPeriodHasBeenSet = false; int m_timeout; bool m_timeoutHasBeenSet = false; }; } // namespace Model } // namespace GameLift } // namespace Aws