diff --git a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py index 95b286beb787..6a3e3f9a5e7c 100644 --- a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py +++ b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py @@ -4416,46 +4416,47 @@ def aggregated_list_instances_ip(args: Dict[str, Any]) -> CommandResults: project = raw.split('/')[-1] else: raise ValueError("Unable to find project of the asset") - else: - raise ValueError("Unable to find asset with IP address. If you are using an organization service account, \ - please make sure the default_search_scope integration parameter is set.") - output = [] - data_res = [] + output = [] + data_res = [] - request_comp = get_compute().instances().aggregatedList( - project=project, - ) - while request_comp: - response_comp = request_comp.execute() - if 'items' in response_comp.keys(): - for _, instances_scoped_list in response_comp['items'].items(): - if 'warning' not in instances_scoped_list.keys(): - for inst in instances_scoped_list.get('instances', []): - for interface in inst.get('networkInterfaces', []): - for config in interface.get('accessConfigs', []): - # only add if 'natIP' (public IP) matches. - if config.get('natIP') == ip: - output.append(inst) - data_res_item = { - 'id': inst.get('id'), - 'name': inst.get('name'), - 'machineType': inst.get('machineType'), - 'zone': inst.get('zone'), - } - data_res.append(data_res_item) - - request_comp = get_compute().instances().aggregatedList_next( - previous_request=request_comp, previous_response=response_comp + request_comp = get_compute().instances().aggregatedList( + project=project, ) + while request_comp: + response_comp = request_comp.execute() + if 'items' in response_comp.keys(): + for _, instances_scoped_list in response_comp['items'].items(): + if 'warning' not in instances_scoped_list.keys(): + for inst in instances_scoped_list.get('instances', []): + for interface in inst.get('networkInterfaces', []): + for config in interface.get('accessConfigs', []): + # only add if 'natIP' (public IP) matches. + if config.get('natIP') == ip: + output.append(inst) + data_res_item = { + 'id': inst.get('id'), + 'name': inst.get('name'), + 'machineType': inst.get('machineType'), + 'zone': inst.get('zone'), + } + data_res.append(data_res_item) + + request_comp = get_compute().instances().aggregatedList_next( + previous_request=request_comp, previous_response=response_comp + ) - return CommandResults( - readable_output=tableToMarkdown('Google Cloud Compute Instances', data_res, removeNull=True), - raw_response=response_comp, - outputs_prefix='GoogleCloudCompute.Instances', - outputs_key_field='id', - outputs=output - ) + return CommandResults( + readable_output=tableToMarkdown('Google Cloud Compute Instances', data_res, removeNull=True), + raw_response=response_comp, + outputs_prefix='GoogleCloudCompute.Instances', + outputs_key_field='id', + outputs=output + ) + else: + return CommandResults( + readable_output='Unable to find asset with IP address. If you are using an organization service account,' + 'please make sure the default_search_scope integration parameter is set.') def add_networks_tag(args: Dict[str, Any]) -> CommandResults: diff --git a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml index 65b1c5f3c043..788b82f6b864 100644 --- a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml +++ b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml @@ -8418,7 +8418,7 @@ script: - contextPath: GoogleCloudCompute.Instances.kind description: '] Type of the resource. Always compute#instance for instances.' type: string - dockerimage: demisto/googleapi-python3:1.0.0.64077 + dockerimage: demisto/googleapi-python3:1.0.0.65068 script: '' subtype: python3 type: python diff --git a/Packs/GoogleCloudCompute/ReleaseNotes/1_1_4.md b/Packs/GoogleCloudCompute/ReleaseNotes/1_1_4.md new file mode 100644 index 000000000000..8b11c648288b --- /dev/null +++ b/Packs/GoogleCloudCompute/ReleaseNotes/1_1_4.md @@ -0,0 +1,7 @@ + +#### Integrations + +##### Google Cloud Compute + +- Updated the docker image to: **demisto/googleapi-python3:1.0.0.65068**. +- Updated the **!gcp-compute-aggregated-list-instances-by-ip** command to return a message when no Virtual Machines are found, instead of an error. diff --git a/Packs/GoogleCloudCompute/pack_metadata.json b/Packs/GoogleCloudCompute/pack_metadata.json index eddcb55b7bef..32c4e2312df6 100644 --- a/Packs/GoogleCloudCompute/pack_metadata.json +++ b/Packs/GoogleCloudCompute/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Google Cloud Compute", "description": "Google Compute Engine delivers virtual machines running in Google's innovative data centers and worldwide fiber network. Compute Engine's tooling and workflow support enable scaling from single instances to global, load-balanced cloud computing.", "support": "xsoar", - "currentVersion": "1.1.3", + "currentVersion": "1.1.4", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",