Add default url redirect to url maps (#3379) (#209)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2020-04-24 18:47:21 -04:00 committed by GitHub
parent 282f8e3b82
commit 43e2cd9596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1036 additions and 67 deletions

View file

@ -51,13 +51,19 @@ options:
type: str type: str
default_service: default_service:
description: description:
- A reference to RegionBackendService resource if none of the hostRules match. - The full or partial URL of the defaultService resource to which traffic is directed
if none of the hostRules match. If defaultRouteAction is additionally specified,
advanced routing actions like URL Rewrites, etc. take effect prior to sending
the request to the backend. However, if defaultService is specified, defaultRouteAction
cannot contain any weightedBackendServices. Conversely, if routeAction specifies
any weightedBackendServices, service must not be specified. Only one of defaultService,
defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.
- 'This field represents a link to a RegionBackendService resource in GCP. It - 'This field represents a link to a RegionBackendService resource in GCP. It
can be specified in two ways. First, you can place a dictionary with key ''selfLink'' can be specified in two ways. First, you can place a dictionary with key ''selfLink''
and value of your resource''s selfLink Alternatively, you can add `register: and value of your resource''s selfLink Alternatively, you can add `register:
name-of-resource` to a gcp_compute_region_backend_service task and then set name-of-resource` to a gcp_compute_region_backend_service task and then set
this default_service field to "{{ name-of-resource }}"' this default_service field to "{{ name-of-resource }}"'
required: true required: false
type: dict type: dict
description: description:
description: description:
@ -1410,11 +1416,77 @@ options:
description: description:
- If set to true, any accompanying query portion of the original URL - If set to true, any accompanying query portion of the original URL
is removed prior to redirecting the request. If set to false, the is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained. The default is set query portion of the original URL is retained.
to false.
required: false required: false
default: 'false' default: 'false'
type: bool type: bool
default_url_redirect:
description:
- When none of the specified hostRules match, the request is redirected to
a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified,
defaultService or defaultRouteAction must not be set.
required: false
type: dict
suboptions:
host_redirect:
description:
- The host that will be used in the redirect response instead of the one
that was supplied in the request. The value must be between 1 and 255
characters.
required: false
type: str
https_redirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain
the same as that of the request. This must only be set for UrlMaps used
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
- The path that will be used in the redirect response instead of the one
that was supplied in the request. pathRedirect cannot be supplied together
with prefixRedirect. Supply one alone or neither. If neither is supplied,
the path of the original request will be used for the redirect. The
value must be between 1 and 1024 characters.
required: false
type: str
prefix_redirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply
one alone or neither. If neither is supplied, the path of the original
request will be used for the redirect. The value must be between 1 and
1024 characters.
required: false
type: str
redirect_response_code:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
- 'Some valid choices include: "FOUND", "MOVED_PERMANENTLY_DEFAULT", "PERMANENT_REDIRECT",
"SEE_OTHER", "TEMPORARY_REDIRECT"'
required: false
type: str
strip_query:
description:
- If set to true, any accompanying query portion of the original URL is
removed prior to redirecting the request. If set to false, the query
portion of the original URL is retained. The default is set to false.
required: false
default: 'false'
type: bool
tests: tests:
description: description:
- The list of expected URL mappings. Requests to update this UrlMap will succeed - The list of expected URL mappings. Requests to update this UrlMap will succeed
@ -1449,6 +1521,71 @@ options:
task and then set this service field to "{{ name-of-resource }}"' task and then set this service field to "{{ name-of-resource }}"'
required: true required: true
type: dict type: dict
default_url_redirect:
description:
- When none of the specified hostRules match, the request is redirected to a URL
specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
required: false
type: dict
suboptions:
host_redirect:
description:
- The host that will be used in the redirect response instead of the one that
was supplied in the request. The value must be between 1 and 255 characters.
required: false
type: str
https_redirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain the
same as that of the request. This must only be set for UrlMaps used in TargetHttpProxys.
Setting this true for TargetHttpsProxy is not permitted. The default is
set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
- The path that will be used in the redirect response instead of the one that
was supplied in the request. pathRedirect cannot be supplied together with
prefixRedirect. Supply one alone or neither. If neither is supplied, the
path of the original request will be used for the redirect. The value must
be between 1 and 1024 characters.
required: false
type: str
prefix_redirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one
alone or neither. If neither is supplied, the path of the original request
will be used for the redirect. The value must be between 1 and 1024 characters.
required: false
type: str
redirect_response_code:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values are:
- MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
- 'Some valid choices include: "FOUND", "MOVED_PERMANENTLY_DEFAULT", "PERMANENT_REDIRECT",
"SEE_OTHER", "TEMPORARY_REDIRECT"'
required: false
type: str
strip_query:
description:
- If set to true, any accompanying query portion of the original URL is removed
prior to redirecting the request. If set to false, the query portion of
the original URL is retained. The default is set to false.
required: false
default: 'false'
type: bool
region: region:
description: description:
- A reference to the region where the url map resides. - A reference to the region where the url map resides.
@ -1540,7 +1677,13 @@ creationTimestamp:
type: str type: str
defaultService: defaultService:
description: description:
- A reference to RegionBackendService resource if none of the hostRules match. - The full or partial URL of the defaultService resource to which traffic is directed
if none of the hostRules match. If defaultRouteAction is additionally specified,
advanced routing actions like URL Rewrites, etc. take effect prior to sending
the request to the backend. However, if defaultService is specified, defaultRouteAction
cannot contain any weightedBackendServices. Conversely, if routeAction specifies
any weightedBackendServices, service must not be specified. Only one of defaultService,
defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.
returned: success returned: success
type: dict type: dict
description: description:
@ -2800,10 +2943,71 @@ pathMatchers:
description: description:
- If set to true, any accompanying query portion of the original URL - If set to true, any accompanying query portion of the original URL
is removed prior to redirecting the request. If set to false, the is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained. The default is set query portion of the original URL is retained.
to false.
returned: success returned: success
type: bool type: bool
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected to a
URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the one
that was supplied in the request. The value must be between 1 and 255
characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain
the same as that of the request. This must only be set for UrlMaps used
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the one
that was supplied in the request. pathRedirect cannot be supplied together
with prefixRedirect. Supply one alone or neither. If neither is supplied,
the path of the original request will be used for the redirect. The value
must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one
alone or neither. If neither is supplied, the path of the original request
will be used for the redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL is
removed prior to redirecting the request. If set to false, the query portion
of the original URL is retained. The default is set to false.
returned: success
type: bool
tests: tests:
description: description:
- The list of expected URL mappings. Requests to update this UrlMap will succeed - The list of expected URL mappings. Requests to update this UrlMap will succeed
@ -2832,6 +3036,67 @@ tests:
be mapped to. be mapped to.
returned: success returned: success
type: dict type: dict
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected to a URL
specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the one that
was supplied in the request. The value must be between 1 and 255 characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain the
same as that of the request. This must only be set for UrlMaps used in TargetHttpProxys.
Setting this true for TargetHttpsProxy is not permitted. The default is set
to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the one that
was supplied in the request. pathRedirect cannot be supplied together with
prefixRedirect. Supply one alone or neither. If neither is supplied, the path
of the original request will be used for the redirect. The value must be between
1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one alone
or neither. If neither is supplied, the path of the original request will
be used for the redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values are:
- MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to
301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL is removed
prior to redirecting the request. If set to false, the query portion of the
original URL is retained. The default is set to false.
returned: success
type: bool
region: region:
description: description:
- A reference to the region where the url map resides. - A reference to the region where the url map resides.
@ -2865,7 +3130,7 @@ def main():
module = GcpModule( module = GcpModule(
argument_spec=dict( argument_spec=dict(
state=dict(default='present', choices=['present', 'absent'], type='str'), state=dict(default='present', choices=['present', 'absent'], type='str'),
default_service=dict(required=True, type='dict'), default_service=dict(type='dict'),
description=dict(type='str'), description=dict(type='str'),
host_rules=dict( host_rules=dict(
type='list', type='list',
@ -3154,6 +3419,17 @@ def main():
), ),
), ),
), ),
default_url_redirect=dict(
type='dict',
options=dict(
host_redirect=dict(type='str'),
https_redirect=dict(type='bool'),
path_redirect=dict(type='str'),
prefix_redirect=dict(type='str'),
redirect_response_code=dict(type='str'),
strip_query=dict(type='bool'),
),
),
), ),
), ),
tests=dict( tests=dict(
@ -3166,6 +3442,17 @@ def main():
service=dict(required=True, type='dict'), service=dict(required=True, type='dict'),
), ),
), ),
default_url_redirect=dict(
type='dict',
options=dict(
host_redirect=dict(type='str'),
https_redirect=dict(type='bool'),
path_redirect=dict(type='str'),
prefix_redirect=dict(type='str'),
redirect_response_code=dict(type='str'),
strip_query=dict(type='bool'),
),
),
region=dict(required=True, type='str'), region=dict(required=True, type='str'),
) )
) )
@ -3225,6 +3512,7 @@ def resource_to_request(module):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'pathMatchers': RegionUrlMapPathmatchersArray(module.params.get('path_matchers', []), module).to_request(), u'pathMatchers': RegionUrlMapPathmatchersArray(module.params.get('path_matchers', []), module).to_request(),
u'tests': RegionUrlMapTestsArray(module.params.get('tests', []), module).to_request(), u'tests': RegionUrlMapTestsArray(module.params.get('tests', []), module).to_request(),
u'defaultUrlRedirect': RegionUrlMapDefaulturlredirect(module.params.get('default_url_redirect', {}), module).to_request(),
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -3299,6 +3587,7 @@ def response_to_hash(module, response):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'pathMatchers': RegionUrlMapPathmatchersArray(response.get(u'pathMatchers', []), module).from_response(), u'pathMatchers': RegionUrlMapPathmatchersArray(response.get(u'pathMatchers', []), module).from_response(),
u'tests': RegionUrlMapTestsArray(response.get(u'tests', []), module).from_response(), u'tests': RegionUrlMapTestsArray(response.get(u'tests', []), module).from_response(),
u'defaultUrlRedirect': RegionUrlMapDefaulturlredirect(response.get(u'defaultUrlRedirect', {}), module).from_response(),
} }
@ -3392,6 +3681,7 @@ class RegionUrlMapPathmatchersArray(object):
u'name': item.get('name'), u'name': item.get('name'),
u'routeRules': RegionUrlMapRouterulesArray(item.get('route_rules', []), self.module).to_request(), u'routeRules': RegionUrlMapRouterulesArray(item.get('route_rules', []), self.module).to_request(),
u'pathRules': RegionUrlMapPathrulesArray(item.get('path_rules', []), self.module).to_request(), u'pathRules': RegionUrlMapPathrulesArray(item.get('path_rules', []), self.module).to_request(),
u'defaultUrlRedirect': RegionUrlMapDefaulturlredirect(item.get('default_url_redirect', {}), self.module).to_request(),
} }
) )
@ -3403,6 +3693,7 @@ class RegionUrlMapPathmatchersArray(object):
u'name': item.get(u'name'), u'name': item.get(u'name'),
u'routeRules': RegionUrlMapRouterulesArray(item.get(u'routeRules', []), self.module).from_response(), u'routeRules': RegionUrlMapRouterulesArray(item.get(u'routeRules', []), self.module).from_response(),
u'pathRules': RegionUrlMapPathrulesArray(item.get(u'pathRules', []), self.module).from_response(), u'pathRules': RegionUrlMapPathrulesArray(item.get(u'pathRules', []), self.module).from_response(),
u'defaultUrlRedirect': RegionUrlMapDefaulturlredirect(item.get(u'defaultUrlRedirect', {}), self.module).from_response(),
} }
) )
@ -4588,6 +4879,39 @@ class RegionUrlMapUrlredirect(object):
) )
class RegionUrlMapDefaulturlredirect(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get('host_redirect'),
u'httpsRedirect': self.request.get('https_redirect'),
u'pathRedirect': self.request.get('path_redirect'),
u'prefixRedirect': self.request.get('prefix_redirect'),
u'redirectResponseCode': self.request.get('redirect_response_code'),
u'stripQuery': self.request.get('strip_query'),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get(u'hostRedirect'),
u'httpsRedirect': self.request.get(u'httpsRedirect'),
u'pathRedirect': self.request.get(u'pathRedirect'),
u'prefixRedirect': self.request.get(u'prefixRedirect'),
u'redirectResponseCode': self.request.get(u'redirectResponseCode'),
u'stripQuery': self.request.get(u'stripQuery'),
}
)
class RegionUrlMapTestsArray(object): class RegionUrlMapTestsArray(object):
def __init__(self, request, module): def __init__(self, request, module):
self.module = module self.module = module
@ -4624,5 +4948,38 @@ class RegionUrlMapTestsArray(object):
) )
class RegionUrlMapDefaulturlredirect(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get('host_redirect'),
u'httpsRedirect': self.request.get('https_redirect'),
u'pathRedirect': self.request.get('path_redirect'),
u'prefixRedirect': self.request.get('prefix_redirect'),
u'redirectResponseCode': self.request.get('redirect_response_code'),
u'stripQuery': self.request.get('strip_query'),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get(u'hostRedirect'),
u'httpsRedirect': self.request.get(u'httpsRedirect'),
u'pathRedirect': self.request.get(u'pathRedirect'),
u'prefixRedirect': self.request.get(u'prefixRedirect'),
u'redirectResponseCode': self.request.get(u'redirectResponseCode'),
u'stripQuery': self.request.get(u'stripQuery'),
}
)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -125,7 +125,14 @@ resources:
type: str type: str
defaultService: defaultService:
description: description:
- A reference to RegionBackendService resource if none of the hostRules match. - The full or partial URL of the defaultService resource to which traffic is
directed if none of the hostRules match. If defaultRouteAction is additionally
specified, advanced routing actions like URL Rewrites, etc. take effect prior
to sending the request to the backend. However, if defaultService is specified,
defaultRouteAction cannot contain any weightedBackendServices. Conversely,
if routeAction specifies any weightedBackendServices, service must not be
specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService
must be set.
returned: success returned: success
type: dict type: dict
description: description:
@ -1413,10 +1420,74 @@ resources:
description: description:
- If set to true, any accompanying query portion of the original - If set to true, any accompanying query portion of the original
URL is removed prior to redirecting the request. If set to false, URL is removed prior to redirecting the request. If set to false,
the query portion of the original URL is retained. The default the query portion of the original URL is retained.
is set to false.
returned: success returned: success
type: bool type: bool
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected
to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified,
defaultService or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the
one that was supplied in the request. The value must be between 1
and 255 characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to
https. If set to false, the URL scheme of the redirected request will
remain the same as that of the request. This must only be set for
UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the
one that was supplied in the request. pathRedirect cannot be supplied
together with prefixRedirect. Supply one alone or neither. If neither
is supplied, the path of the original request will be used for the
redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the
request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply
one alone or neither. If neither is supplied, the path of the original
request will be used for the redirect. The value must be between 1
and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the
request method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the
request method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL
is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained. The default is set
to false.
returned: success
type: bool
tests: tests:
description: description:
- The list of expected URL mappings. Requests to update this UrlMap will succeed - The list of expected URL mappings. Requests to update this UrlMap will succeed
@ -1445,6 +1516,68 @@ resources:
be mapped to. be mapped to.
returned: success returned: success
type: dict type: dict
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected to a
URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the one
that was supplied in the request. The value must be between 1 and 255
characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain
the same as that of the request. This must only be set for UrlMaps used
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the one
that was supplied in the request. pathRedirect cannot be supplied together
with prefixRedirect. Supply one alone or neither. If neither is supplied,
the path of the original request will be used for the redirect. The value
must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one
alone or neither. If neither is supplied, the path of the original request
will be used for the redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL is
removed prior to redirecting the request. If set to false, the query portion
of the original URL is retained. The default is set to false.
returned: success
type: bool
region: region:
description: description:
- A reference to the region where the url map resides. - A reference to the region where the url map resides.

View file

@ -51,13 +51,13 @@ options:
type: str type: str
default_service: default_service:
description: description:
- The BackendService resource to which traffic is directed if none of the hostRules - The full or partial URL of the defaultService resource to which traffic is directed
match. If defaultRouteAction is additionally specified, advanced routing actions if none of the hostRules match. If defaultRouteAction is additionally specified,
like URL Rewrites, etc. take effect prior to sending the request to the backend. advanced routing actions like URL Rewrites, etc. take effect prior to sending
However, if defaultService is specified, defaultRouteAction cannot contain any the request to the backend. However, if defaultService is specified, defaultRouteAction
weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, cannot contain any weightedBackendServices. Conversely, if routeAction specifies
service must not be specified. Only one of defaultService, defaultUrlRedirect any weightedBackendServices, service must not be specified. Only one of defaultService,
or defaultRouteAction.weightedBackendService must be set. defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.
- 'This field represents a link to a BackendService resource in GCP. It can be - 'This field represents a link to a BackendService resource in GCP. It can be
specified in two ways. First, you can place a dictionary with key ''selfLink'' specified in two ways. First, you can place a dictionary with key ''selfLink''
and value of your resource''s selfLink Alternatively, you can add `register: and value of your resource''s selfLink Alternatively, you can add `register:
@ -189,20 +189,20 @@ options:
suboptions: suboptions:
default_service: default_service:
description: description:
- 'The BackendService resource. This will be used if none of the pathRules - 'The full or partial URL to the BackendService resource. This will be used
or routeRules defined by this PathMatcher are matched. For example, the if none of the pathRules or routeRules defined by this PathMatcher are matched.
following are all valid URLs to a BackendService resource: - U(https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backen) For example, the following are all valid URLs to a BackendService resource:
dService - compute/v1/projects/project/global/backendServices/backendService - U(https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService)
- global/backendServices/backendService If defaultRouteAction is additionally - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService
specified, advanced routing actions like URL Rewrites, etc. take effect If defaultRouteAction is additionally specified, advanced routing actions
prior to sending the request to the backend. However, if defaultService like URL Rewrites, etc. take effect prior to sending the request to the
is specified, defaultRouteAction cannot contain any weightedBackendServices. backend. However, if defaultService is specified, defaultRouteAction cannot
Conversely, if defaultRouteAction specifies any weightedBackendServices, contain any weightedBackendServices. Conversely, if defaultRouteAction specifies
defaultService must not be specified. Only one of defaultService, defaultUrlRedirect any weightedBackendServices, defaultService must not be specified.'
or defaultRouteAction.weightedBackendService must be set. Authorization - 'Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService
requires one or more of the following Google IAM permissions on the specified must be set. Authorization requires one or more of the following Google
resource default_service: - compute.backendBuckets.use - compute.backendServices.use IAM permissions on the specified resource defaultService: - compute.backendBuckets.use
.' - compute.backendServices.use .'
- 'This field represents a link to a BackendService resource in GCP. It can - 'This field represents a link to a BackendService resource in GCP. It can
be specified in two ways. First, you can place a dictionary with key ''selfLink'' be specified in two ways. First, you can place a dictionary with key ''selfLink''
and value of your resource''s selfLink Alternatively, you can add `register: and value of your resource''s selfLink Alternatively, you can add `register:
@ -1577,6 +1577,74 @@ options:
required: false required: false
default: 'false' default: 'false'
type: bool type: bool
default_url_redirect:
description:
- When none of the specified hostRules match, the request is redirected to
a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified,
defaultService or defaultRouteAction must not be set.
required: false
type: dict
version_added: '2.10'
suboptions:
host_redirect:
description:
- The host that will be used in the redirect response instead of the one
that was supplied in the request. The value must be between 1 and 255
characters.
required: false
type: str
https_redirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain
the same as that of the request. This must only be set for UrlMaps used
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
- The path that will be used in the redirect response instead of the one
that was supplied in the request. pathRedirect cannot be supplied together
with prefixRedirect. Supply one alone or neither. If neither is supplied,
the path of the original request will be used for the redirect. The
value must be between 1 and 1024 characters.
required: false
type: str
prefix_redirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply
one alone or neither. If neither is supplied, the path of the original
request will be used for the redirect. The value must be between 1 and
1024 characters.
required: false
type: str
redirect_response_code:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
- 'Some valid choices include: "FOUND", "MOVED_PERMANENTLY_DEFAULT", "PERMANENT_REDIRECT",
"SEE_OTHER", "TEMPORARY_REDIRECT"'
required: false
type: str
strip_query:
description:
- If set to true, any accompanying query portion of the original URL is
removed prior to redirecting the request. If set to false, the query
portion of the original URL is retained. The default is set to false.
required: false
default: 'false'
type: bool
tests: tests:
description: description:
- The list of expected URL mapping tests. Request to update this UrlMap will succeed - The list of expected URL mapping tests. Request to update this UrlMap will succeed
@ -1611,6 +1679,72 @@ options:
service field to "{{ name-of-resource }}"' service field to "{{ name-of-resource }}"'
required: true required: true
type: dict type: dict
default_url_redirect:
description:
- When none of the specified hostRules match, the request is redirected to a URL
specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
required: false
type: dict
version_added: '2.10'
suboptions:
host_redirect:
description:
- The host that will be used in the redirect response instead of the one that
was supplied in the request. The value must be between 1 and 255 characters.
required: false
type: str
https_redirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain the
same as that of the request. This must only be set for UrlMaps used in TargetHttpProxys.
Setting this true for TargetHttpsProxy is not permitted. The default is
set to false.
required: false
default: 'false'
type: bool
path_redirect:
description:
- The path that will be used in the redirect response instead of the one that
was supplied in the request. pathRedirect cannot be supplied together with
prefixRedirect. Supply one alone or neither. If neither is supplied, the
path of the original request will be used for the redirect. The value must
be between 1 and 1024 characters.
required: false
type: str
prefix_redirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one
alone or neither. If neither is supplied, the path of the original request
will be used for the redirect. The value must be between 1 and 1024 characters.
required: false
type: str
redirect_response_code:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values are:
- MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
- 'Some valid choices include: "FOUND", "MOVED_PERMANENTLY_DEFAULT", "PERMANENT_REDIRECT",
"SEE_OTHER", "TEMPORARY_REDIRECT"'
required: false
type: str
strip_query:
description:
- If set to true, any accompanying query portion of the original URL is removed
prior to redirecting the request. If set to false, the query portion of
the original URL is retained. The default is set to false.
required: false
default: 'false'
type: bool
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -1718,13 +1852,13 @@ creationTimestamp:
type: str type: str
defaultService: defaultService:
description: description:
- The BackendService resource to which traffic is directed if none of the hostRules - The full or partial URL of the defaultService resource to which traffic is directed
match. If defaultRouteAction is additionally specified, advanced routing actions if none of the hostRules match. If defaultRouteAction is additionally specified,
like URL Rewrites, etc. take effect prior to sending the request to the backend. advanced routing actions like URL Rewrites, etc. take effect prior to sending
However, if defaultService is specified, defaultRouteAction cannot contain any the request to the backend. However, if defaultService is specified, defaultRouteAction
weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, cannot contain any weightedBackendServices. Conversely, if routeAction specifies
service must not be specified. Only one of defaultService, defaultUrlRedirect any weightedBackendServices, service must not be specified. Only one of defaultService,
or defaultRouteAction.weightedBackendService must be set. defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.
returned: success returned: success
type: dict type: dict
description: description:
@ -1854,18 +1988,19 @@ pathMatchers:
contains: contains:
defaultService: defaultService:
description: description:
- 'The BackendService resource. This will be used if none of the pathRules or - 'The full or partial URL to the BackendService resource. This will be used
routeRules defined by this PathMatcher are matched. For example, the following if none of the pathRules or routeRules defined by this PathMatcher are matched.
are all valid URLs to a BackendService resource: - U(https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backen) For example, the following are all valid URLs to a BackendService resource:
dService - compute/v1/projects/project/global/backendServices/backendService - U(https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService)
- global/backendServices/backendService If defaultRouteAction is additionally - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService
specified, advanced routing actions like URL Rewrites, etc. take effect prior If defaultRouteAction is additionally specified, advanced routing actions
to sending the request to the backend. However, if defaultService is specified, like URL Rewrites, etc. take effect prior to sending the request to the backend.
defaultRouteAction cannot contain any weightedBackendServices. Conversely, However, if defaultService is specified, defaultRouteAction cannot contain
if defaultRouteAction specifies any weightedBackendServices, defaultService any weightedBackendServices. Conversely, if defaultRouteAction specifies any
must not be specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService weightedBackendServices, defaultService must not be specified.'
- 'Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService
must be set. Authorization requires one or more of the following Google IAM must be set. Authorization requires one or more of the following Google IAM
permissions on the specified resource default_service: - compute.backendBuckets.use permissions on the specified resource defaultService: - compute.backendBuckets.use
- compute.backendServices.use .' - compute.backendServices.use .'
returned: success returned: success
type: dict type: dict
@ -3129,6 +3264,68 @@ pathMatchers:
query portion of the original URL is retained. Defaults to false. query portion of the original URL is retained. Defaults to false.
returned: success returned: success
type: bool type: bool
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected to a
URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the one
that was supplied in the request. The value must be between 1 and 255
characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain
the same as that of the request. This must only be set for UrlMaps used
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the one
that was supplied in the request. pathRedirect cannot be supplied together
with prefixRedirect. Supply one alone or neither. If neither is supplied,
the path of the original request will be used for the redirect. The value
must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one
alone or neither. If neither is supplied, the path of the original request
will be used for the redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL is
removed prior to redirecting the request. If set to false, the query portion
of the original URL is retained. The default is set to false.
returned: success
type: bool
tests: tests:
description: description:
- The list of expected URL mapping tests. Request to update this UrlMap will succeed - The list of expected URL mapping tests. Request to update this UrlMap will succeed
@ -3157,6 +3354,67 @@ tests:
- Expected BackendService resource the given URL should be mapped to. - Expected BackendService resource the given URL should be mapped to.
returned: success returned: success
type: dict type: dict
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected to a URL
specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the one that
was supplied in the request. The value must be between 1 and 255 characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain the
same as that of the request. This must only be set for UrlMaps used in TargetHttpProxys.
Setting this true for TargetHttpsProxy is not permitted. The default is set
to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the one that
was supplied in the request. pathRedirect cannot be supplied together with
prefixRedirect. Supply one alone or neither. If neither is supplied, the path
of the original request will be used for the redirect. The value must be between
1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one alone
or neither. If neither is supplied, the path of the original request will
be used for the redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values are:
- MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to
301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL is removed
prior to redirecting the request. If set to false, the query portion of the
original URL is retained. The default is set to false.
returned: success
type: bool
''' '''
################################################################################ ################################################################################
@ -3520,6 +3778,17 @@ def main():
), ),
), ),
), ),
default_url_redirect=dict(
type='dict',
options=dict(
host_redirect=dict(type='str'),
https_redirect=dict(type='bool'),
path_redirect=dict(type='str'),
prefix_redirect=dict(type='str'),
redirect_response_code=dict(type='str'),
strip_query=dict(type='bool'),
),
),
), ),
), ),
tests=dict( tests=dict(
@ -3532,6 +3801,17 @@ def main():
service=dict(required=True, type='dict'), service=dict(required=True, type='dict'),
), ),
), ),
default_url_redirect=dict(
type='dict',
options=dict(
host_redirect=dict(type='str'),
https_redirect=dict(type='bool'),
path_redirect=dict(type='str'),
prefix_redirect=dict(type='str'),
redirect_response_code=dict(type='str'),
strip_query=dict(type='bool'),
),
),
) )
) )
@ -3591,6 +3871,7 @@ def resource_to_request(module):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'pathMatchers': UrlMapPathmatchersArray(module.params.get('path_matchers', []), module).to_request(), u'pathMatchers': UrlMapPathmatchersArray(module.params.get('path_matchers', []), module).to_request(),
u'tests': UrlMapTestsArray(module.params.get('tests', []), module).to_request(), u'tests': UrlMapTestsArray(module.params.get('tests', []), module).to_request(),
u'defaultUrlRedirect': UrlMapDefaulturlredirect(module.params.get('default_url_redirect', {}), module).to_request(),
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -3666,6 +3947,7 @@ def response_to_hash(module, response):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'pathMatchers': UrlMapPathmatchersArray(response.get(u'pathMatchers', []), module).from_response(), u'pathMatchers': UrlMapPathmatchersArray(response.get(u'pathMatchers', []), module).from_response(),
u'tests': UrlMapTestsArray(response.get(u'tests', []), module).from_response(), u'tests': UrlMapTestsArray(response.get(u'tests', []), module).from_response(),
u'defaultUrlRedirect': UrlMapDefaulturlredirect(response.get(u'defaultUrlRedirect', {}), module).from_response(),
} }
@ -3843,6 +4125,7 @@ class UrlMapPathmatchersArray(object):
u'name': item.get('name'), u'name': item.get('name'),
u'pathRules': UrlMapPathrulesArray(item.get('path_rules', []), self.module).to_request(), u'pathRules': UrlMapPathrulesArray(item.get('path_rules', []), self.module).to_request(),
u'routeRules': UrlMapRouterulesArray(item.get('route_rules', []), self.module).to_request(), u'routeRules': UrlMapRouterulesArray(item.get('route_rules', []), self.module).to_request(),
u'defaultUrlRedirect': UrlMapDefaulturlredirect(item.get('default_url_redirect', {}), self.module).to_request(),
} }
) )
@ -3855,6 +4138,7 @@ class UrlMapPathmatchersArray(object):
u'name': item.get(u'name'), u'name': item.get(u'name'),
u'pathRules': UrlMapPathrulesArray(item.get(u'pathRules', []), self.module).from_response(), u'pathRules': UrlMapPathrulesArray(item.get(u'pathRules', []), self.module).from_response(),
u'routeRules': UrlMapRouterulesArray(item.get(u'routeRules', []), self.module).from_response(), u'routeRules': UrlMapRouterulesArray(item.get(u'routeRules', []), self.module).from_response(),
u'defaultUrlRedirect': UrlMapDefaulturlredirect(item.get(u'defaultUrlRedirect', {}), self.module).from_response(),
} }
) )
@ -5103,6 +5387,39 @@ class UrlMapUrlredirect(object):
) )
class UrlMapDefaulturlredirect(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get('host_redirect'),
u'httpsRedirect': self.request.get('https_redirect'),
u'pathRedirect': self.request.get('path_redirect'),
u'prefixRedirect': self.request.get('prefix_redirect'),
u'redirectResponseCode': self.request.get('redirect_response_code'),
u'stripQuery': self.request.get('strip_query'),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get(u'hostRedirect'),
u'httpsRedirect': self.request.get(u'httpsRedirect'),
u'pathRedirect': self.request.get(u'pathRedirect'),
u'prefixRedirect': self.request.get(u'prefixRedirect'),
u'redirectResponseCode': self.request.get(u'redirectResponseCode'),
u'stripQuery': self.request.get(u'stripQuery'),
}
)
class UrlMapTestsArray(object): class UrlMapTestsArray(object):
def __init__(self, request, module): def __init__(self, request, module):
self.module = module self.module = module
@ -5139,5 +5456,38 @@ class UrlMapTestsArray(object):
) )
class UrlMapDefaulturlredirect(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get('host_redirect'),
u'httpsRedirect': self.request.get('https_redirect'),
u'pathRedirect': self.request.get('path_redirect'),
u'prefixRedirect': self.request.get('prefix_redirect'),
u'redirectResponseCode': self.request.get('redirect_response_code'),
u'stripQuery': self.request.get('strip_query'),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'hostRedirect': self.request.get(u'hostRedirect'),
u'httpsRedirect': self.request.get(u'httpsRedirect'),
u'pathRedirect': self.request.get(u'pathRedirect'),
u'prefixRedirect': self.request.get(u'prefixRedirect'),
u'redirectResponseCode': self.request.get(u'redirectResponseCode'),
u'stripQuery': self.request.get(u'stripQuery'),
}
)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -119,13 +119,14 @@ resources:
type: str type: str
defaultService: defaultService:
description: description:
- The BackendService resource to which traffic is directed if none of the hostRules - The full or partial URL of the defaultService resource to which traffic is
match. If defaultRouteAction is additionally specified, advanced routing actions directed if none of the hostRules match. If defaultRouteAction is additionally
like URL Rewrites, etc. take effect prior to sending the request to the backend. specified, advanced routing actions like URL Rewrites, etc. take effect prior
However, if defaultService is specified, defaultRouteAction cannot contain to sending the request to the backend. However, if defaultService is specified,
any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, defaultRouteAction cannot contain any weightedBackendServices. Conversely,
service must not be specified. Only one of defaultService, defaultUrlRedirect if routeAction specifies any weightedBackendServices, service must not be
or defaultRouteAction.weightedBackendService must be set. specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService
must be set.
returned: success returned: success
type: dict type: dict
description: description:
@ -256,20 +257,21 @@ resources:
contains: contains:
defaultService: defaultService:
description: description:
- 'The BackendService resource. This will be used if none of the pathRules - 'The full or partial URL to the BackendService resource. This will be
or routeRules defined by this PathMatcher are matched. For example, the used if none of the pathRules or routeRules defined by this PathMatcher
following are all valid URLs to a BackendService resource: - U(https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backen) are matched. For example, the following are all valid URLs to a BackendService
dService - compute/v1/projects/project/global/backendServices/backendService resource: - U(https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService)
- global/backendServices/backendService If defaultRouteAction is additionally - compute/v1/projects/project/global/backendServices/backendService -
global/backendServices/backendService If defaultRouteAction is additionally
specified, advanced routing actions like URL Rewrites, etc. take effect specified, advanced routing actions like URL Rewrites, etc. take effect
prior to sending the request to the backend. However, if defaultService prior to sending the request to the backend. However, if defaultService
is specified, defaultRouteAction cannot contain any weightedBackendServices. is specified, defaultRouteAction cannot contain any weightedBackendServices.
Conversely, if defaultRouteAction specifies any weightedBackendServices, Conversely, if defaultRouteAction specifies any weightedBackendServices,
defaultService must not be specified. Only one of defaultService, defaultUrlRedirect defaultService must not be specified.'
or defaultRouteAction.weightedBackendService must be set. Authorization - 'Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService
requires one or more of the following Google IAM permissions on the specified must be set. Authorization requires one or more of the following Google
resource default_service: - compute.backendBuckets.use - compute.backendServices.use IAM permissions on the specified resource defaultService: - compute.backendBuckets.use
.' - compute.backendServices.use .'
returned: success returned: success
type: dict type: dict
description: description:
@ -1562,6 +1564,71 @@ resources:
false. false.
returned: success returned: success
type: bool type: bool
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected
to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified,
defaultService or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the
one that was supplied in the request. The value must be between 1
and 255 characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to
https. If set to false, the URL scheme of the redirected request will
remain the same as that of the request. This must only be set for
UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the
one that was supplied in the request. pathRedirect cannot be supplied
together with prefixRedirect. Supply one alone or neither. If neither
is supplied, the path of the original request will be used for the
redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the
request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply
one alone or neither. If neither is supplied, the path of the original
request will be used for the redirect. The value must be between 1
and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the
request method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the
request method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL
is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained. The default is set
to false.
returned: success
type: bool
tests: tests:
description: description:
- The list of expected URL mapping tests. Request to update this UrlMap will - The list of expected URL mapping tests. Request to update this UrlMap will
@ -1590,6 +1657,68 @@ resources:
- Expected BackendService resource the given URL should be mapped to. - Expected BackendService resource the given URL should be mapped to.
returned: success returned: success
type: dict type: dict
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected to a
URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the one
that was supplied in the request. The value must be between 1 and 255
characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain
the same as that of the request. This must only be set for UrlMaps used
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the one
that was supplied in the request. pathRedirect cannot be supplied together
with prefixRedirect. Supply one alone or neither. If neither is supplied,
the path of the original request will be used for the redirect. The value
must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one
alone or neither. If neither is supplied, the path of the original request
will be used for the redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "- FOUND, which corresponds to 302."
- "- SEE_OTHER which corresponds to 303."
- "- TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "- PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL is
removed prior to redirecting the request. If set to false, the query portion
of the original URL is retained. The default is set to false.
returned: success
type: bool
''' '''
################################################################################ ################################################################################