/** * 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 Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace ElasticLoadBalancing { namespace Model { /** *

Information about a health check.

See Also:

AWS * API Reference

*/ class HealthCheck { public: AWS_ELASTICLOADBALANCING_API HealthCheck(); AWS_ELASTICLOADBALANCING_API HealthCheck(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_ELASTICLOADBALANCING_API HealthCheck& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_ELASTICLOADBALANCING_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_ELASTICLOADBALANCING_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline const Aws::String& GetTarget() const{ return m_target; } /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline bool TargetHasBeenSet() const { return m_targetHasBeenSet; } /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline void SetTarget(const Aws::String& value) { m_targetHasBeenSet = true; m_target = value; } /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline void SetTarget(Aws::String&& value) { m_targetHasBeenSet = true; m_target = std::move(value); } /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline void SetTarget(const char* value) { m_targetHasBeenSet = true; m_target.assign(value); } /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline HealthCheck& WithTarget(const Aws::String& value) { SetTarget(value); return *this;} /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline HealthCheck& WithTarget(Aws::String&& value) { SetTarget(std::move(value)); return *this;} /** *

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. * The range of valid ports is one (1) through 65535.

TCP is the default, * specified as a TCP: port pair, for example "TCP:5000". In this case, a health * check simply attempts to open a TCP connection to the instance on the specified * port. Failure to connect within the configured timeout is considered * unhealthy.

SSL is also specified as SSL: port pair, for example, * SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. * HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example * "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to * the instance on the given port and path. Any answer other than "200 OK" within * the timeout period is considered unhealthy.

The total length of the HTTP * ping target must be 1024 16-bit Unicode characters or less.

*/ inline HealthCheck& WithTarget(const char* value) { SetTarget(value); return *this;} /** *

The approximate interval, in seconds, between health checks of an individual * instance.

*/ inline int GetInterval() const{ return m_interval; } /** *

The approximate interval, in seconds, between health checks of an individual * instance.

*/ inline bool IntervalHasBeenSet() const { return m_intervalHasBeenSet; } /** *

The approximate interval, in seconds, between health checks of an individual * instance.

*/ inline void SetInterval(int value) { m_intervalHasBeenSet = true; m_interval = value; } /** *

The approximate interval, in seconds, between health checks of an individual * instance.

*/ inline HealthCheck& WithInterval(int value) { SetInterval(value); return *this;} /** *

The amount of time, in seconds, during which no response means a failed * health check.

This value must be less than the Interval * value.

*/ inline int GetTimeout() const{ return m_timeout; } /** *

The amount of time, in seconds, during which no response means a failed * health check.

This value must be less than the Interval * value.

*/ inline bool TimeoutHasBeenSet() const { return m_timeoutHasBeenSet; } /** *

The amount of time, in seconds, during which no response means a failed * health check.

This value must be less than the Interval * value.

*/ inline void SetTimeout(int value) { m_timeoutHasBeenSet = true; m_timeout = value; } /** *

The amount of time, in seconds, during which no response means a failed * health check.

This value must be less than the Interval * value.

*/ inline HealthCheck& WithTimeout(int value) { SetTimeout(value); return *this;} /** *

The number of consecutive health check failures required before moving the * instance to the Unhealthy state.

*/ inline int GetUnhealthyThreshold() const{ return m_unhealthyThreshold; } /** *

The number of consecutive health check failures required before moving the * instance to the Unhealthy state.

*/ inline bool UnhealthyThresholdHasBeenSet() const { return m_unhealthyThresholdHasBeenSet; } /** *

The number of consecutive health check failures required before moving the * instance to the Unhealthy state.

*/ inline void SetUnhealthyThreshold(int value) { m_unhealthyThresholdHasBeenSet = true; m_unhealthyThreshold = value; } /** *

The number of consecutive health check failures required before moving the * instance to the Unhealthy state.

*/ inline HealthCheck& WithUnhealthyThreshold(int value) { SetUnhealthyThreshold(value); return *this;} /** *

The number of consecutive health checks successes required before moving the * instance to the Healthy state.

*/ inline int GetHealthyThreshold() const{ return m_healthyThreshold; } /** *

The number of consecutive health checks successes required before moving the * instance to the Healthy state.

*/ inline bool HealthyThresholdHasBeenSet() const { return m_healthyThresholdHasBeenSet; } /** *

The number of consecutive health checks successes required before moving the * instance to the Healthy state.

*/ inline void SetHealthyThreshold(int value) { m_healthyThresholdHasBeenSet = true; m_healthyThreshold = value; } /** *

The number of consecutive health checks successes required before moving the * instance to the Healthy state.

*/ inline HealthCheck& WithHealthyThreshold(int value) { SetHealthyThreshold(value); return *this;} private: Aws::String m_target; bool m_targetHasBeenSet = false; int m_interval; bool m_intervalHasBeenSet = false; int m_timeout; bool m_timeoutHasBeenSet = false; int m_unhealthyThreshold; bool m_unhealthyThresholdHasBeenSet = false; int m_healthyThreshold; bool m_healthyThresholdHasBeenSet = false; }; } // namespace Model } // namespace ElasticLoadBalancing } // namespace Aws