mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-24 20:01:24 -07:00
* Allow redisVersion to change, promoted some fields to GA * allow updating properties if update method is defined at the field level * upgrade post url * fix current resources to not reference url * add support for forceNew if version is shrinking * don't send request if not updating anything.. request fails if update mask is empty.. also add more tests * fix spelling mistake * fix rake issues * remove transcription mode... forces new on change Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
9eadc4b7fc
commit
71a05be3af
3 changed files with 131 additions and 18 deletions
|
@ -1416,7 +1416,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
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)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -1440,25 +1440,11 @@ def create(module, link, kind):
|
|||
return wait_for_operation(module, auth.post(link, resource_to_request(module)))
|
||||
|
||||
|
||||
def update(module, link, kind, fetch):
|
||||
update_fields(module, resource_to_request(module), response_to_hash(module, fetch))
|
||||
def update(module, link, kind):
|
||||
auth = GcpSession(module, 'compute')
|
||||
return wait_for_operation(module, auth.put(link, resource_to_request(module)))
|
||||
|
||||
|
||||
def update_fields(module, request, response):
|
||||
if response.get('securityPolicy') != request.get('securityPolicy'):
|
||||
security_policy_update(module, request, response)
|
||||
|
||||
|
||||
def security_policy_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
auth.post(
|
||||
''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/backendServices/{name}/setSecurityPolicy"]).format(**module.params),
|
||||
{u'securityPolicy': module.params.get('security_policy')},
|
||||
)
|
||||
|
||||
|
||||
def delete(module, link, kind):
|
||||
auth = GcpSession(module, 'compute')
|
||||
return wait_for_operation(module, auth.delete(link))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue