Allow redisVersion to change, promoted some fields to GA (#4838) (#431)

* 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:
The Magician 2021-06-15 11:31:26 -07:00 committed by GitHub
parent 9eadc4b7fc
commit 71a05be3af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 131 additions and 18 deletions

View file

@ -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))