mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 04:10:27 -07:00
labelfingerprint is beta for resources where labels are beta
This commit is contained in:
parent
f1a96adf23
commit
5142625c7f
4 changed files with 3 additions and 61 deletions
|
@ -354,12 +354,6 @@ RETURN = '''
|
||||||
- This field is not used for internal load balancing.
|
- This field is not used for internal load balancing.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
labelFingerprint:
|
|
||||||
description:
|
|
||||||
- The fingerprint used for optimistic locking of this resource. Used internally during
|
|
||||||
updates.
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
networkTier:
|
networkTier:
|
||||||
description:
|
description:
|
||||||
- 'The networking tier used for configuring this address. This field can take the
|
- 'The networking tier used for configuring this address. This field can take the
|
||||||
|
@ -471,19 +465,6 @@ def target_update(module, request, response):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def label_fingerprint_update(module, request, response):
|
|
||||||
auth = GcpSession(module, 'compute')
|
|
||||||
auth.post(
|
|
||||||
''.join([
|
|
||||||
"https://www.googleapis.com/compute/v1/",
|
|
||||||
"projects/{project}/regions/{region}/forwardingRules/{name}/setLabels"
|
|
||||||
]).format(**module.params),
|
|
||||||
{
|
|
||||||
u'labelFingerprint': response.get('labelFingerprint')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
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))
|
||||||
|
@ -584,7 +565,6 @@ def response_to_hash(module, response):
|
||||||
u'ports': response.get(u'ports'),
|
u'ports': response.get(u'ports'),
|
||||||
u'subnetwork': response.get(u'subnetwork'),
|
u'subnetwork': response.get(u'subnetwork'),
|
||||||
u'target': response.get(u'target'),
|
u'target': response.get(u'target'),
|
||||||
u'labelFingerprint': response.get(u'labelFingerprint'),
|
|
||||||
u'networkTier': module.params.get('network_tier')
|
u'networkTier': module.params.get('network_tier')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,12 +197,6 @@ items:
|
||||||
- This field is not used for internal load balancing.
|
- This field is not used for internal load balancing.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
labelFingerprint:
|
|
||||||
description:
|
|
||||||
- The fingerprint used for optimistic locking of this resource. Used internally during
|
|
||||||
updates.
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
networkTier:
|
networkTier:
|
||||||
description:
|
description:
|
||||||
- 'The networking tier used for configuring this address. This field can take the
|
- 'The networking tier used for configuring this address. This field can take the
|
||||||
|
|
|
@ -119,12 +119,6 @@ RETURN = '''
|
||||||
be a dash.
|
be a dash.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
labelFingerprint:
|
|
||||||
description:
|
|
||||||
- The fingerprint used for optimistic locking of this resource. Used internally during
|
|
||||||
updates.
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
ipVersion:
|
ipVersion:
|
||||||
description:
|
description:
|
||||||
- The IP Version that will be used by this address. Valid options are IPV4 or IPV6.
|
- The IP Version that will be used by this address. Valid options are IPV4 or IPV6.
|
||||||
|
@ -185,7 +179,7 @@ def main():
|
||||||
if fetch:
|
if fetch:
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
if is_different(module, fetch):
|
if is_different(module, fetch):
|
||||||
update(module, self_link(module), kind, fetch)
|
update(module, self_link(module), kind)
|
||||||
fetch = fetch_resource(module, self_link(module), kind)
|
fetch = fetch_resource(module, self_link(module), kind)
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
|
@ -209,27 +203,8 @@ def create(module, link, kind):
|
||||||
return wait_for_operation(module, auth.post(link, resource_to_request(module)))
|
return wait_for_operation(module, auth.post(link, resource_to_request(module)))
|
||||||
|
|
||||||
|
|
||||||
def update(module, link, kind, fetch):
|
def update(module, link, kind):
|
||||||
update_fields(module, resource_to_request(module),
|
module.fail_json(msg="GlobalAddress cannot be edited")
|
||||||
response_to_hash(module, fetch))
|
|
||||||
return fetch_resource(module, self_link(module), kind)
|
|
||||||
|
|
||||||
|
|
||||||
def update_fields(module, request, response):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def label_fingerprint_update(module, request, response):
|
|
||||||
auth = GcpSession(module, 'compute')
|
|
||||||
auth.post(
|
|
||||||
''.join([
|
|
||||||
"https://www.googleapis.com/compute/v1/",
|
|
||||||
"projects/{project}/global/addresses/{name}/setLabels"
|
|
||||||
]).format(**module.params),
|
|
||||||
{
|
|
||||||
u'labelFingerprint': response.get('labelFingerprint')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def delete(module, link, kind):
|
def delete(module, link, kind):
|
||||||
|
@ -315,7 +290,6 @@ def response_to_hash(module, response):
|
||||||
u'description': response.get(u'description'),
|
u'description': response.get(u'description'),
|
||||||
u'id': response.get(u'id'),
|
u'id': response.get(u'id'),
|
||||||
u'name': response.get(u'name'),
|
u'name': response.get(u'name'),
|
||||||
u'labelFingerprint': response.get(u'labelFingerprint'),
|
|
||||||
u'ipVersion': response.get(u'ipVersion'),
|
u'ipVersion': response.get(u'ipVersion'),
|
||||||
u'region': response.get(u'region'),
|
u'region': response.get(u'region'),
|
||||||
u'addressType': response.get(u'addressType')
|
u'addressType': response.get(u'addressType')
|
||||||
|
|
|
@ -95,12 +95,6 @@ items:
|
||||||
be a dash.
|
be a dash.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
labelFingerprint:
|
|
||||||
description:
|
|
||||||
- The fingerprint used for optimistic locking of this resource. Used internally during
|
|
||||||
updates.
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
ipVersion:
|
ipVersion:
|
||||||
description:
|
description:
|
||||||
- The IP Version that will be used by this address. Valid options are IPV4 or IPV6.
|
- The IP Version that will be used by this address. Valid options are IPV4 or IPV6.
|
||||||
|
|
Loading…
Add table
Reference in a new issue