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
3 changes: 3 additions & 0 deletions Packs/GoogleCloudStorage/CONTRIBUTORS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"Zachary Rouse"
]
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
category: IT Services

Check failure on line 1 in Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.yml

View workflow job for this annotation

GitHub Actions / pre-commit

Validation Error BA102

File Integrations/GoogleCloudStorage/GoogleCloudStorage.yml is not supported in the validate command. The validate command supports: Integrations, Scripts, Playbooks, Incident fields, Incident types, Indicator fields, Indicator types, Objects fields, Object types, Object modules, Images, Release notes, Layouts, Jobs, Wizards, Descriptions And Modeling Rules.

Check failure on line 1 in Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.yml

View workflow job for this annotation

GitHub Actions / pre-commit

Validation Error BA102

File Integrations/GoogleCloudStorage/GoogleCloudStorage.yml is not supported in the validate command. The validate command supports: Integrations, Scripts, Playbooks, Incident fields, Incident types, Indicator fields, Indicator types, Objects fields, Object types, Object modules, Images, Release notes, Layouts, Jobs, Wizards, Descriptions And Modeling Rules.
commonfields:
id: Google Cloud Storage
version: -1
Expand Down Expand Up @@ -116,6 +116,11 @@
description: Deletes a bucket.
name: gcs-delete-bucket
- arguments:
defaultValue: None
description: use a delimiter if you want to limit results within a specific "folder", default is None
name: delimiter
description: specify to limit blobs within a "folder" i.e. "folder-1/" if blob is "folder-1/file.txt"
name: prefix
zdrouse marked this conversation as resolved.
Show resolved Hide resolved
- 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
Expand Down