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

Bucket Upload notification to PubSub #170

Open
RodrigoFerretti opened this issue May 3, 2022 · 1 comment
Open

Bucket Upload notification to PubSub #170

RodrigoFerretti opened this issue May 3, 2022 · 1 comment

Comments

@RodrigoFerretti
Copy link

Description

The main goal is to have any bucket upload integrated with pubsub notification. I dont know if this feature doesnt exists yet in this emulator or if I`m doing it wrong

Example

After running the local emulator with docker-compose:

version: "3"

services:
  gcs:
    container_name: gcs
    image: oittaa/gcp-storage-emulator
    ports:
      - 9023:9023
    environment:
      PORT: 9023

I then tried to run the following code whitout success:

import os
import google.cloud.storage as gcs
from google.cloud.storage.notification import BucketNotification

os.environ["STORAGE_EMULATOR_HOST"] = 'http://localhost:9023'

gcs_client: gcs.Client = gcs.Client()
gcs_client.create_bucket('bucket_name')

bucket: gcs.Bucket = gcs_client.get_bucket('bucket_name')
notification: BucketNotification = bucket.notification('topic_name', 'project_id')

notification.create(gcs_client)

It raises ConnectionError.

('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')

Any help or ideas?
Thanks!

@oittaa
Copy link
Owner

oittaa commented May 3, 2022

It doesn't exist at the moment, but pull requests are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants