mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-28 07:31:29 -07:00
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
a611202049
commit
cf599fd36f
1 changed files with 7 additions and 12 deletions
|
@ -386,12 +386,12 @@ def update(module, link, kind, fetch):
|
||||||
def update_fields(module, request, response):
|
def update_fields(module, request, response):
|
||||||
if response.get('ipCidrRange') != request.get('ipCidrRange'):
|
if response.get('ipCidrRange') != request.get('ipCidrRange'):
|
||||||
ip_cidr_range_update(module, request, response)
|
ip_cidr_range_update(module, request, response)
|
||||||
if response.get('secondaryIpRanges') != request.get('secondaryIpRanges'):
|
if response.get('secondaryIpRanges') != request.get('secondaryIpRanges') or response.get('privateIpv6GoogleAccess') != request.get(
|
||||||
|
'privateIpv6GoogleAccess'
|
||||||
|
):
|
||||||
secondary_ip_ranges_update(module, request, response)
|
secondary_ip_ranges_update(module, request, response)
|
||||||
if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'):
|
if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'):
|
||||||
private_ip_google_access_update(module, request, response)
|
private_ip_google_access_update(module, request, response)
|
||||||
if response.get('privateIpv6GoogleAccess') != request.get('privateIpv6GoogleAccess'):
|
|
||||||
private_ipv6_google_access_update(module, request, response)
|
|
||||||
|
|
||||||
|
|
||||||
def ip_cidr_range_update(module, request, response):
|
def ip_cidr_range_update(module, request, response):
|
||||||
|
@ -408,7 +408,10 @@ def secondary_ip_ranges_update(module, request, response):
|
||||||
auth = GcpSession(module, 'compute')
|
auth = GcpSession(module, 'compute')
|
||||||
auth.patch(
|
auth.patch(
|
||||||
''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params),
|
''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params),
|
||||||
{u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request()},
|
{
|
||||||
|
u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request(),
|
||||||
|
u'privateIpv6GoogleAccess': module.params.get('private_ipv6_google_access'),
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -422,14 +425,6 @@ def private_ip_google_access_update(module, request, response):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def private_ipv6_google_access_update(module, request, response):
|
|
||||||
auth = GcpSession(module, 'compute')
|
|
||||||
auth.patch(
|
|
||||||
''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params),
|
|
||||||
{u'privateIpv6GoogleAccess': module.params.get('private_ipv6_google_access')},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def delete(module, link, kind):
|
def delete(module, link, kind):
|
||||||
auth = GcpSession(module, 'compute')
|
auth = GcpSession(module, 'compute')
|
||||||
return wait_for_operation(module, auth.delete(link))
|
return wait_for_operation(module, auth.delete(link))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue