mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 12:20:27 -07:00
Add support for content-based load balancing to HealthCheck (#138)
<!-- This change is generated by MagicModules. --> /cc @rileykarson
This commit is contained in:
parent
f70dd0bed8
commit
076322412a
2 changed files with 74 additions and 40 deletions
|
@ -123,6 +123,12 @@ options:
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
required: false
|
required: false
|
||||||
default: "/"
|
default: "/"
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left empty
|
||||||
|
(the default value), any response will indicate health. The response data
|
||||||
|
can only be ASCII.
|
||||||
|
required: false
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTP health check request.
|
- The TCP port number for the HTTP health check request.
|
||||||
|
@ -159,6 +165,12 @@ options:
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
required: false
|
required: false
|
||||||
default: "/"
|
default: "/"
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left empty
|
||||||
|
(the default value), any response will indicate health. The response data
|
||||||
|
can only be ASCII.
|
||||||
|
required: false
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTPS health check request.
|
- The TCP port number for the HTTPS health check request.
|
||||||
|
@ -351,6 +363,13 @@ httpHealthCheck:
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left empty
|
||||||
|
(the default value), any response will indicate health. The response data
|
||||||
|
can only be ASCII.
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTP health check request.
|
- The TCP port number for the HTTP health check request.
|
||||||
|
@ -388,6 +407,13 @@ httpsHealthCheck:
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left empty
|
||||||
|
(the default value), any response will indicate health. The response data
|
||||||
|
can only be ASCII.
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTPS health check request.
|
- The TCP port number for the HTTPS health check request.
|
||||||
|
@ -513,6 +539,7 @@ def main():
|
||||||
http_health_check=dict(type='dict', options=dict(
|
http_health_check=dict(type='dict', options=dict(
|
||||||
host=dict(type='str'),
|
host=dict(type='str'),
|
||||||
request_path=dict(default='/', type='str'),
|
request_path=dict(default='/', type='str'),
|
||||||
|
response=dict(type='str'),
|
||||||
port=dict(type='int'),
|
port=dict(type='int'),
|
||||||
port_name=dict(type='str'),
|
port_name=dict(type='str'),
|
||||||
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
||||||
|
@ -520,6 +547,7 @@ def main():
|
||||||
https_health_check=dict(type='dict', options=dict(
|
https_health_check=dict(type='dict', options=dict(
|
||||||
host=dict(type='str'),
|
host=dict(type='str'),
|
||||||
request_path=dict(default='/', type='str'),
|
request_path=dict(default='/', type='str'),
|
||||||
|
response=dict(type='str'),
|
||||||
port=dict(type='int'),
|
port=dict(type='int'),
|
||||||
port_name=dict(type='str'),
|
port_name=dict(type='str'),
|
||||||
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
||||||
|
@ -726,28 +754,24 @@ class HealthCheckHttphealthcheck(object):
|
||||||
self.request = {}
|
self.request = {}
|
||||||
|
|
||||||
def to_request(self):
|
def to_request(self):
|
||||||
return remove_nones_from_dict(
|
return remove_nones_from_dict({
|
||||||
{
|
u'host': self.request.get('host'),
|
||||||
u'host': self.request.get('host'),
|
u'requestPath': self.request.get('request_path'),
|
||||||
u'requestPath': self.request.get('request_path'),
|
u'response': self.request.get('response'),
|
||||||
u'response': self.request.get('response'),
|
u'port': self.request.get('port'),
|
||||||
u'port': self.request.get('port'),
|
u'portName': self.request.get('port_name'),
|
||||||
u'portName': self.request.get('port_name'),
|
u'proxyHeader': self.request.get('proxy_header')
|
||||||
u'proxyHeader': self.request.get('proxy_header'),
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
def from_response(self):
|
def from_response(self):
|
||||||
return remove_nones_from_dict(
|
return remove_nones_from_dict({
|
||||||
{
|
u'host': self.request.get(u'host'),
|
||||||
u'host': self.request.get(u'host'),
|
u'requestPath': self.request.get(u'requestPath'),
|
||||||
u'requestPath': self.request.get(u'requestPath'),
|
u'response': self.request.get(u'response'),
|
||||||
u'response': self.request.get(u'response'),
|
u'port': self.request.get(u'port'),
|
||||||
u'port': self.request.get(u'port'),
|
u'portName': self.request.get(u'portName'),
|
||||||
u'portName': self.request.get(u'portName'),
|
u'proxyHeader': self.request.get(u'proxyHeader')
|
||||||
u'proxyHeader': self.request.get(u'proxyHeader'),
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class HealthCheckHttpshealthcheck(object):
|
class HealthCheckHttpshealthcheck(object):
|
||||||
|
@ -759,28 +783,24 @@ class HealthCheckHttpshealthcheck(object):
|
||||||
self.request = {}
|
self.request = {}
|
||||||
|
|
||||||
def to_request(self):
|
def to_request(self):
|
||||||
return remove_nones_from_dict(
|
return remove_nones_from_dict({
|
||||||
{
|
u'host': self.request.get('host'),
|
||||||
u'host': self.request.get('host'),
|
u'requestPath': self.request.get('request_path'),
|
||||||
u'requestPath': self.request.get('request_path'),
|
u'response': self.request.get('response'),
|
||||||
u'response': self.request.get('response'),
|
u'port': self.request.get('port'),
|
||||||
u'port': self.request.get('port'),
|
u'portName': self.request.get('port_name'),
|
||||||
u'portName': self.request.get('port_name'),
|
u'proxyHeader': self.request.get('proxy_header')
|
||||||
u'proxyHeader': self.request.get('proxy_header'),
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
def from_response(self):
|
def from_response(self):
|
||||||
return remove_nones_from_dict(
|
return remove_nones_from_dict({
|
||||||
{
|
u'host': self.request.get(u'host'),
|
||||||
u'host': self.request.get(u'host'),
|
u'requestPath': self.request.get(u'requestPath'),
|
||||||
u'requestPath': self.request.get(u'requestPath'),
|
u'response': self.request.get(u'response'),
|
||||||
u'response': self.request.get(u'response'),
|
u'port': self.request.get(u'port'),
|
||||||
u'port': self.request.get(u'port'),
|
u'portName': self.request.get(u'portName'),
|
||||||
u'portName': self.request.get(u'portName'),
|
u'proxyHeader': self.request.get(u'proxyHeader')
|
||||||
u'proxyHeader': self.request.get(u'proxyHeader'),
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class HealthCheckTcphealthcheck(object):
|
class HealthCheckTcphealthcheck(object):
|
||||||
|
|
|
@ -141,6 +141,13 @@ items:
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left
|
||||||
|
empty (the default value), any response will indicate health. The response
|
||||||
|
data can only be ASCII.
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTP health check request.
|
- The TCP port number for the HTTP health check request.
|
||||||
|
@ -178,6 +185,13 @@ items:
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left
|
||||||
|
empty (the default value), any response will indicate health. The response
|
||||||
|
data can only be ASCII.
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTPS health check request.
|
- The TCP port number for the HTTPS health check request.
|
||||||
|
|
Loading…
Add table
Reference in a new issue