Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Cloud Storage - Update gcs-list-bucket-objects to support prefix and delimiter arguments. #31496

Merged
merged 14 commits into from Dec 18, 2023

Conversation

zdrouse
Copy link
Contributor

@zdrouse zdrouse commented Dec 15, 2023

Contributing to Cortex XSOAR Content

Make sure to register your contribution by filling the contribution registration form

The Pull Request will be reviewed only after the contribution registration form is filled.

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

The google cloud storage python client supports these arguments.
https://github.com/googleapis/python-storage/blob/main/samples/snippets/storage_list_files_with_prefix.py

Description

Add support prefix and delimiter support for gcs-list-bucket-objects command. This will allow users to limit blobs returned from a GCS bucket.

Must have

  • Tests
  • Documentation

added arguments for prefix and delimiter to gcs_list_bucket_objects to support limiting results returned for blobs that are in "folders"
added arguments to support updates for gcs-list-bucket-objects to include prefix and delimiter parameters
@content-bot content-bot added Contribution Thank you! Contributions are always welcome! External PR Xsoar Support Level Indicates that the contribution is for XSOAR supported pack labels Dec 15, 2023
@content-bot content-bot changed the base branch from master to contrib/zdrouse_master December 15, 2023 21:00
@content-bot
Copy link
Collaborator

Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @adi88d will know the proposed changes are ready to be reviewed.
For your convenience, here is a link to the contributions SLAs document.

@content-bot
Copy link
Collaborator

Hi @zdrouse, thanks for contributing to a Cortex XSOAR supported pack. To receive credit for your generous contribution please follow this link.

@content-bot content-bot added Community Contribution Form Filled Whether contribution form filled or not. labels Dec 15, 2023
Copy link
Contributor

@adi88d adi88d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job!
Thanks a lot for this contribution, It is highly appreciated.
I added some review comments and suggestion:

  • remove the Packs/GoogleCloudStorage/CONTRIBUTORS.json file
  • update release notes for the pack using demisto-sdk update-release-notes command
  • add to the delimiter and prefix arguments toGoogleCloudStorage/README.md

@adi88d adi88d added the pending-contributor The PR is pending the response of its creator label Dec 17, 2023
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2023

CLA assistant check
All committers have signed the CLA.

…eCloudStorage.yml

Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Copy link
Contributor Author

@zdrouse zdrouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I committed the suggestion for YAML file although I'm not sure I understand it since all the other arguments and commands already implemented don't follow it

@@ -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".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- description: Specify to limit blobs within a "folder" i.e. "folder-1/" if blob is "folder-1/file.txt".
- description: Specify to limit blobs within a "folder" i.e., "folder-1/" if blob is "folder-1/file.txt".

@@ -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. "/".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- description: Use a delimiter if you want to limit results within a specific "folder" and without any nested blobs i.e. "/".
- description: Use a delimiter if you want to limit results within a specific "folder" and without any nested blobs i.e., "/".

@@ -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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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: 421px;">Specify to limit blobs within a "folder" i.e., "folder-1/" if blob is "folder-1/file.txt".</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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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: 421px;">Use a delimiter if you want to limit results within a specific "folder" and without any nested blobs i.e., "/".</td>

Comment on lines 7 to 8
- ***delimiter***
- ***prefix***
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- ***delimiter***
- ***prefix***
- *delimiter*
- *prefix*


##### Google Cloud Storage

- Added the following arguments to the **gcs-list-bucket-objects** command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Added the following arguments to the **gcs-list-bucket-objects** command:
- Added the following arguments to the ***gcs-list-bucket-objects*** command:

@ShirleyDenkberg
Copy link
Contributor

@adi88d Doc review completed.

@adi88d adi88d merged commit 4409c9c into demisto:contrib/zdrouse_master Dec 18, 2023
14 of 21 checks passed
adi88d added a commit that referenced this pull request Dec 19, 2023
…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>
content-bot added a commit that referenced this pull request Dec 20, 2023
…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>
maimorag pushed a commit that referenced this pull request Dec 31, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! docs-approved External PR pending-contributor The PR is pending the response of its creator Xsoar Support Level Indicates that the contribution is for XSOAR supported pack
Projects
None yet
5 participants