Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Updates to subnetwork docs, removes broken 'update' function. #30

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 11 additions & 20 deletions lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,13 @@
- An optional description of this resource. Provide this property when you create
the resource. This field can be set only at resource creation time.
required: false
gateway_address:
description:
- The gateway address for default routes to reach destination addresses outside this
subnetwork. This field can be set only at resource creation time.
required: false
ip_cidr_range:
description:
- The range of internal addresses that are owned by this subnetwork.
- Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or
192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only
IPv4 is supported.
required: false
required: true
name:
description:
- The name of the resource, provided by the client when initially creating the resource.
Expand All @@ -87,12 +82,12 @@
which means the first character must be a lowercase letter, and all following characters
must be a dash, lowercase letter, or digit, except the last character, which cannot
be a dash.
required: false
required: true
network:
description:
- The network this subnet belongs to.
- Only networks that are in the distributed mode can have subnetworks.
required: false
required: true
private_ip_google_access:
description:
- Whether the VMs in this subnet can access Google services without assigned external
Expand All @@ -101,8 +96,7 @@
type: bool
region:
description:
- URL of the region where the regional address resides.
- This field is not applicable to global addresses.
- URL of the GCP region for this subnetwork.
required: true
extends_documentation_fragment: gcp
'''
Expand Down Expand Up @@ -148,7 +142,7 @@
gateway_address:
description:
- The gateway address for default routes to reach destination addresses outside this
subnetwork. This field can be set only at resource creation time.
subnetwork.
returned: success
type: str
id:
Expand Down Expand Up @@ -188,8 +182,7 @@
type: bool
region:
description:
- URL of the region where the regional address resides.
- This field is not applicable to global addresses.
- URL of the GCP region for this subnetwork.
returned: success
type: str
'''
Expand All @@ -214,10 +207,9 @@ def main():
argument_spec=dict(
state=dict(default='present', choices=['present', 'absent'], type='str'),
description=dict(type='str'),
gateway_address=dict(type='str'),
ip_cidr_range=dict(type='str'),
name=dict(type='str'),
network=dict(type='dict'),
ip_cidr_range=dict(required=True, type='str'),
name=dict(required=True, type='str'),
network=dict(required=True, type='dict'),
private_ip_google_access=dict(type='bool'),
region=dict(required=True, type='str')
)
Expand Down Expand Up @@ -269,7 +261,6 @@ def resource_to_request(module):
request = {
u'kind': 'compute#subnetwork',
u'description': module.params.get('description'),
u'gatewayAddress': module.params.get('gateway_address'),
u'ipCidrRange': module.params.get('ip_cidr_range'),
u'name': module.params.get('name'),
u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'),
Expand Down Expand Up @@ -344,9 +335,9 @@ def response_to_hash(module, response):
return {
u'creationTimestamp': response.get(u'creationTimestamp'),
u'description': response.get(u'description'),
u'gatewayAddress': module.params.get('gateway_address'),
u'gatewayAddress': response.get(u'gatewayAddress'),
u'id': response.get(u'id'),
u'ipCidrRange': module.params.get('ip_cidr_range'),
u'ipCidrRange': response.get(u'ipCidrRange'),
u'name': response.get(u'name'),
u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'),
u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'),
Expand Down