diff --git a/lib/ansible/modules/cloud/google/gcp_container_cluster.py b/lib/ansible/modules/cloud/google/gcp_container_cluster.py index 9d4b0b93cdc..a8e34eef93f 100644 --- a/lib/ansible/modules/cloud/google/gcp_container_cluster.py +++ b/lib/ansible/modules/cloud/google/gcp_container_cluster.py @@ -1174,7 +1174,7 @@ def response_to_hash(module, response): def async_op_url(module, extra_data=None): if extra_data is None: extra_data = {} - url = "https://container.googleapis.com/v1/projects/{project}/zones/{zone}/operations/{op_id}" + url = "https://container.googleapis.com/v1/projects/{project}/locations/{location}/operations/{op_id}" combined = extra_data.copy() combined.update(module.params) return url.format(**combined) diff --git a/lib/ansible/modules/cloud/google/gcp_container_node_pool.py b/lib/ansible/modules/cloud/google/gcp_container_node_pool.py index ea0cd20809e..4dee9654282 100644 --- a/lib/ansible/modules/cloud/google/gcp_container_node_pool.py +++ b/lib/ansible/modules/cloud/google/gcp_container_node_pool.py @@ -705,12 +705,12 @@ def self_link(module): 'cluster': replace_resource_dict(module.params['cluster'], 'name'), 'name': module.params['name'], } - return "https://container.googleapis.com/v1/projects/{project}/zones/{location}/clusters/{cluster}/nodePools/{name}".format(**res) + return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{name}".format(**res) def collection(module): res = {'project': module.params['project'], 'location': module.params['location'], 'cluster': replace_resource_dict(module.params['cluster'], 'name')} - return "https://container.googleapis.com/v1/projects/{project}/zones/{location}/clusters/{cluster}/nodePools".format(**res) + return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters/{cluster}/nodePools".format(**res) def return_if_object(module, response, allow_not_found=False): @@ -773,7 +773,7 @@ def response_to_hash(module, response): def async_op_url(module, extra_data=None): if extra_data is None: extra_data = {} - url = "https://container.googleapis.com/v1/projects/{project}/zones/{zone}/operations/{op_id}" + url = "https://container.googleapis.com/v1/projects/{project}/locations/{location}/operations/{op_id}" combined = extra_data.copy() combined.update(module.params) return url.format(**combined) diff --git a/lib/ansible/modules/cloud/google/gcp_container_node_pool_facts.py b/lib/ansible/modules/cloud/google/gcp_container_node_pool_facts.py index c3ab387c951..c04aa3fd575 100644 --- a/lib/ansible/modules/cloud/google/gcp_container_node_pool_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_container_node_pool_facts.py @@ -376,7 +376,7 @@ def main(): def collection(module): res = {'project': module.params['project'], 'location': module.params['location'], 'cluster': replace_resource_dict(module.params['cluster'], 'name')} - return "https://container.googleapis.com/v1/projects/{project}/zones/{location}/clusters/{cluster}/nodePools".format(**res) + return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters/{cluster}/nodePools".format(**res) def fetch_list(module, link): diff --git a/test/integration/targets/gcp_container_cluster/tasks/main.yml b/test/integration/targets/gcp_container_cluster/tasks/main.yml index ebf2fa5c932..d494a38face 100644 --- a/test/integration/targets/gcp_container_cluster/tasks/main.yml +++ b/test/integration/targets/gcp_container_cluster/tasks/main.yml @@ -61,7 +61,7 @@ - name: verify that command succeeded assert: that: - - "'my-cluster' in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'my-cluster' in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: create a cluster that already exists gcp_container_cluster: @@ -116,7 +116,7 @@ - name: verify that command succeeded assert: that: - - "'my-cluster' not in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'my-cluster' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: delete a cluster that does not exist gcp_container_cluster: diff --git a/test/integration/targets/gcp_container_node_pool/tasks/main.yml b/test/integration/targets/gcp_container_node_pool/tasks/main.yml index 3d41089b8f7..9432233ebce 100644 --- a/test/integration/targets/gcp_container_node_pool/tasks/main.yml +++ b/test/integration/targets/gcp_container_node_pool/tasks/main.yml @@ -62,7 +62,7 @@ - name: verify that command succeeded assert: that: - - "'my-pool' in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'my-pool' in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: create a node pool that already exists gcp_container_node_pool: @@ -108,7 +108,7 @@ - name: verify that command succeeded assert: that: - - "'my-pool' not in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'my-pool' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: delete a node pool that does not exist gcp_container_node_pool: diff --git a/test/integration/targets/gcp_dns_resource_record_set/tasks/main.yml b/test/integration/targets/gcp_dns_resource_record_set/tasks/main.yml index 55a56e05ae6..9128d5a7bdb 100644 --- a/test/integration/targets/gcp_dns_resource_record_set/tasks/main.yml +++ b/test/integration/targets/gcp_dns_resource_record_set/tasks/main.yml @@ -68,7 +68,7 @@ - name: verify that command succeeded assert: that: - - "'www.testzone-4.com.'in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'www.testzone-4.com.'in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: create a resource record set that already exists gcp_dns_resource_record_set: @@ -121,7 +121,7 @@ - name: verify that command succeeded assert: that: - - "'www.testzone-4.com.'not in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'www.testzone-4.com.'not in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: delete a resource record set that does not exist gcp_dns_resource_record_set: diff --git a/test/integration/targets/gcp_pubsub_subscription/tasks/main.yml b/test/integration/targets/gcp_pubsub_subscription/tasks/main.yml index 8a05e2a46fd..19baea9a6e8 100644 --- a/test/integration/targets/gcp_pubsub_subscription/tasks/main.yml +++ b/test/integration/targets/gcp_pubsub_subscription/tasks/main.yml @@ -56,7 +56,7 @@ - name: verify that command succeeded assert: that: - - "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "\"{{resource_name}}\" in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: create a subscription that already exists gcp_pubsub_subscription: @@ -98,7 +98,7 @@ - name: verify that command succeeded assert: that: - - "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "\"{{resource_name}}\" not in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: delete a subscription that does not exist gcp_pubsub_subscription: diff --git a/test/integration/targets/gcp_pubsub_topic/tasks/main.yml b/test/integration/targets/gcp_pubsub_topic/tasks/main.yml index 0d3bda08157..83167361cc1 100644 --- a/test/integration/targets/gcp_pubsub_topic/tasks/main.yml +++ b/test/integration/targets/gcp_pubsub_topic/tasks/main.yml @@ -44,7 +44,7 @@ - name: verify that command succeeded assert: that: - - "'test-topic1' in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'test-topic1' in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: create a topic that already exists gcp_pubsub_topic: @@ -82,7 +82,7 @@ - name: verify that command succeeded assert: that: - - "'test-topic1' not in \"{{ results['items'] | map(attribute='name') | list }}\"" + - "'test-topic1' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" # ---------------------------------------------------------------------------- - name: delete a topic that does not exist gcp_pubsub_topic: