Skip to content

Commit

Permalink
Google Cloud Storage - Update gcs-list-bucket-objects to support pref…
Browse files Browse the repository at this point in the history
…ix and delimiter arguments. (#31496) (#31537)

* Update GoogleCloudStorage.py

added arguments for prefix and delimiter to gcs_list_bucket_objects to support limiting results returned for blobs that are in "folders"

* Update GoogleCloudStorage.yml

added arguments to support updates for gcs-list-bucket-objects to include prefix and delimiter parameters

* Create CONTRIBUTORS.json

* Update GoogleCloudStorage.yml

spelling

* Update Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.yml



* added arguments to README

* fix arguments to README

* updated arguments to README

* fix argument descriptions in GoogleCloudStorage.yml

* fix yml structure

* update RN

* update docker

* doc review

---------

Co-authored-by: zdrouse <zdrouse@gmail.com>
Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Co-authored-by: adi88d <adaud@paloaltonetworks.com>
  • Loading branch information
4 people authored and maimorag committed Dec 31, 2023
1 parent d70bf3c commit 02ed6b6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
Expand Up @@ -266,8 +266,10 @@ def upload_blob(client, file_path, bucket_name, object_name):

def gcs_list_bucket_objects(client, default_bucket, args):
bucket_name = get_bucket_name(args, default_bucket)
prefix = args.get('prefix', None)
delimiter = args.get('delimiter', None)

blobs = client.list_blobs(bucket_name)
blobs = client.list_blobs(bucket_name, prefix=prefix, delimiter=delimiter)
result = [blob2dict(blob) for blob in blobs]

return_outputs(
Expand Down
Expand Up @@ -119,6 +119,10 @@ script:
- default: true
description: Name of the bucket in which to list objects. If not specified, operation will be performed on the default bucket parameter.
name: bucket_name
- description: Specify to limit blobs within a "folder" i.e., "folder-1/" if blob is "folder-1/file.txt".
name: prefix
- description: Use a delimiter if you want to limit results within a specific "folder" and without any nested blobs i.e., "/".
name: delimiter
description: Retrieves the list of objects in a bucket.
name: gcs-list-bucket-objects
outputs:
Expand Down Expand Up @@ -384,7 +388,7 @@ script:
required: true
description: Removes an entity from an object's Access Control List.
name: gcs-delete-bucket-object-policy
dockerimage: demisto/google-cloud-storage:1.0.0.68936
dockerimage: demisto/google-cloud-storage:1.0.0.83364
runonce: false
script: '-'
type: python
Expand Down
Expand Up @@ -291,6 +291,16 @@
<td style="width: 421px;">Name of the bucket in which to list objects.</td>
<td style="width: 103px;">Required</td>
</tr>
<tr>
<td style="width: 184px;">prefix</td>
<td style="width: 421px;">Specify to limit blobs within a "folder" i.e., "folder-1/" if blob is "folder-1/file.txt".</td>
<td style="width: 103px;">Optional</td>
</tr>
<tr>
<td style="width: 184px;">delimiter</td>
<td style="width: 421px;">Use a delimiter if you want to limit results within a specific "folder" and without any nested blobs i.e., "/".</td>
<td style="width: 103px;">Optional</td>
</tr>
</tbody>
</table>
<p> </p>
Expand Down Expand Up @@ -368,7 +378,7 @@
</table>
<p> </p>
<h5>Command Example</h5>
<pre>gcs-list-bucket-objects bucket_name=my-bucket</pre>
<pre>gcs-list-bucket-objects bucket_name=my-bucket prefix=some/path/ delimiter=/</pre>
<h5>Human Readable Output</h5>
<h3>Objects in bucket my-bucket</h3>
<table style="width: 750px;" border="2" cellpadding="6">
Expand Down
9 changes: 9 additions & 0 deletions Packs/GoogleCloudStorage/ReleaseNotes/1_0_12.md
@@ -0,0 +1,9 @@

#### Integrations

##### Google Cloud Storage

- Added the following arguments to the ***gcs-list-bucket-objects*** command:
- *delimiter*
- *prefix*
- Updated the Docker image to: *demisto/google-cloud-storage:1.0.0.83364*.
2 changes: 1 addition & 1 deletion Packs/GoogleCloudStorage/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Google Cloud Storage",
"description": "Google Cloud Storage is a RESTful online file storage web service for storing and accessing data on Google Cloud Platform infrastructure.",
"support": "xsoar",
"currentVersion": "1.0.11",
"currentVersion": "1.0.12",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit 02ed6b6

Please sign in to comment.