mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 04:10:27 -07:00
Allow target to accept other resource types (#134)
Signed-off-by: Modular Magician <magic-modules@google.com> Co-authored-by: Ty Larrabee <tysen@google.com>
This commit is contained in:
parent
dd1aefed8d
commit
9d30baeec9
4 changed files with 20 additions and 21 deletions
|
@ -172,17 +172,11 @@ options:
|
||||||
type: dict
|
type: dict
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
- This field is only used for EXTERNAL load balancing.
|
- The URL of the target resource to receive the matched traffic.
|
||||||
- A reference to a TargetPool resource to receive the matched traffic.
|
- The target must live in the same region as the forwarding rule.
|
||||||
- This target must live in the same region as the forwarding rule.
|
|
||||||
- The forwarded traffic must be of a type appropriate to the target object.
|
- The forwarded traffic must be of a type appropriate to the target object.
|
||||||
- 'This field represents a link to a TargetPool resource in GCP. It 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: name-of-resource`
|
|
||||||
to a gcp_compute_target_pool task and then set this target field to "{{ name-of-resource
|
|
||||||
}}"'
|
|
||||||
required: false
|
required: false
|
||||||
type: dict
|
type: str
|
||||||
version_added: '2.7'
|
version_added: '2.7'
|
||||||
all_ports:
|
all_ports:
|
||||||
description:
|
description:
|
||||||
|
@ -423,12 +417,11 @@ subnetwork:
|
||||||
type: dict
|
type: dict
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
- This field is only used for EXTERNAL load balancing.
|
- The URL of the target resource to receive the matched traffic.
|
||||||
- A reference to a TargetPool resource to receive the matched traffic.
|
- The target must live in the same region as the forwarding rule.
|
||||||
- This target must live in the same region as the forwarding rule.
|
|
||||||
- The forwarded traffic must be of a type appropriate to the target object.
|
- The forwarded traffic must be of a type appropriate to the target object.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: str
|
||||||
allPorts:
|
allPorts:
|
||||||
description:
|
description:
|
||||||
- For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL and
|
- For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL and
|
||||||
|
@ -499,7 +492,7 @@ def main():
|
||||||
port_range=dict(type='str'),
|
port_range=dict(type='str'),
|
||||||
ports=dict(type='list', elements='str'),
|
ports=dict(type='list', elements='str'),
|
||||||
subnetwork=dict(type='dict'),
|
subnetwork=dict(type='dict'),
|
||||||
target=dict(type='dict'),
|
target=dict(type='str'),
|
||||||
all_ports=dict(type='bool'),
|
all_ports=dict(type='bool'),
|
||||||
network_tier=dict(type='str'),
|
network_tier=dict(type='str'),
|
||||||
service_label=dict(type='str'),
|
service_label=dict(type='str'),
|
||||||
|
@ -557,7 +550,7 @@ def target_update(module, request, response):
|
||||||
auth = GcpSession(module, 'compute')
|
auth = GcpSession(module, 'compute')
|
||||||
auth.post(
|
auth.post(
|
||||||
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/forwardingRules/{name}/setTarget"]).format(**module.params),
|
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/forwardingRules/{name}/setTarget"]).format(**module.params),
|
||||||
{u'target': replace_resource_dict(module.params.get(u'target', {}), 'selfLink')},
|
{u'target': module.params.get('target')},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -579,7 +572,7 @@ def resource_to_request(module):
|
||||||
u'portRange': module.params.get('port_range'),
|
u'portRange': module.params.get('port_range'),
|
||||||
u'ports': module.params.get('ports'),
|
u'ports': module.params.get('ports'),
|
||||||
u'subnetwork': replace_resource_dict(module.params.get(u'subnetwork', {}), 'selfLink'),
|
u'subnetwork': replace_resource_dict(module.params.get(u'subnetwork', {}), 'selfLink'),
|
||||||
u'target': replace_resource_dict(module.params.get(u'target', {}), 'selfLink'),
|
u'target': module.params.get('target'),
|
||||||
u'allPorts': module.params.get('all_ports'),
|
u'allPorts': module.params.get('all_ports'),
|
||||||
u'networkTier': module.params.get('network_tier'),
|
u'networkTier': module.params.get('network_tier'),
|
||||||
u'serviceLabel': module.params.get('service_label'),
|
u'serviceLabel': module.params.get('service_label'),
|
||||||
|
|
|
@ -235,12 +235,11 @@ resources:
|
||||||
type: dict
|
type: dict
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
- This field is only used for EXTERNAL load balancing.
|
- The URL of the target resource to receive the matched traffic.
|
||||||
- A reference to a TargetPool resource to receive the matched traffic.
|
- The target must live in the same region as the forwarding rule.
|
||||||
- This target must live in the same region as the forwarding rule.
|
|
||||||
- The forwarded traffic must be of a type appropriate to the target object.
|
- The forwarded traffic must be of a type appropriate to the target object.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: str
|
||||||
allPorts:
|
allPorts:
|
||||||
description:
|
description:
|
||||||
- For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL
|
- For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL
|
||||||
|
|
|
@ -66,9 +66,12 @@ options:
|
||||||
description:
|
description:
|
||||||
- A multiplier applied to the group's maximum servicing capacity (based on
|
- A multiplier applied to the group's maximum servicing capacity (based on
|
||||||
UTILIZATION, RATE or CONNECTION).
|
UTILIZATION, RATE or CONNECTION).
|
||||||
|
- Default value is 1, which means the group will serve up to 100% of its configured
|
||||||
|
capacity (depending on balancingMode).
|
||||||
- A setting of 0 means the group is completely drained, offering 0% of its
|
- A setting of 0 means the group is completely drained, offering 0% of its
|
||||||
available Capacity. Valid range is [0.0,1.0].
|
available Capacity. Valid range is [0.0,1.0].
|
||||||
required: false
|
required: false
|
||||||
|
default: '1.0'
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
|
@ -318,6 +321,8 @@ backends:
|
||||||
description:
|
description:
|
||||||
- A multiplier applied to the group's maximum servicing capacity (based on UTILIZATION,
|
- A multiplier applied to the group's maximum servicing capacity (based on UTILIZATION,
|
||||||
RATE or CONNECTION).
|
RATE or CONNECTION).
|
||||||
|
- Default value is 1, which means the group will serve up to 100% of its configured
|
||||||
|
capacity (depending on balancingMode).
|
||||||
- A setting of 0 means the group is completely drained, offering 0% of its available
|
- A setting of 0 means the group is completely drained, offering 0% of its available
|
||||||
Capacity. Valid range is [0.0,1.0].
|
Capacity. Valid range is [0.0,1.0].
|
||||||
returned: success
|
returned: success
|
||||||
|
@ -514,7 +519,7 @@ def main():
|
||||||
elements='dict',
|
elements='dict',
|
||||||
options=dict(
|
options=dict(
|
||||||
balancing_mode=dict(default='CONNECTION', type='str'),
|
balancing_mode=dict(default='CONNECTION', type='str'),
|
||||||
capacity_scaler=dict(type='str'),
|
capacity_scaler=dict(default=1.0, type='str'),
|
||||||
description=dict(type='str'),
|
description=dict(type='str'),
|
||||||
group=dict(required=True, type='str'),
|
group=dict(required=True, type='str'),
|
||||||
max_connections=dict(type='int'),
|
max_connections=dict(type='int'),
|
||||||
|
|
|
@ -133,6 +133,8 @@ resources:
|
||||||
description:
|
description:
|
||||||
- A multiplier applied to the group's maximum servicing capacity (based
|
- A multiplier applied to the group's maximum servicing capacity (based
|
||||||
on UTILIZATION, RATE or CONNECTION).
|
on UTILIZATION, RATE or CONNECTION).
|
||||||
|
- Default value is 1, which means the group will serve up to 100% of its
|
||||||
|
configured capacity (depending on balancingMode).
|
||||||
- A setting of 0 means the group is completely drained, offering 0% of its
|
- A setting of 0 means the group is completely drained, offering 0% of its
|
||||||
available Capacity. Valid range is [0.0,1.0].
|
available Capacity. Valid range is [0.0,1.0].
|
||||||
returned: success
|
returned: success
|
||||||
|
|
Loading…
Add table
Reference in a new issue