Skip to content

cloudscale-ch/s3-notifications-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

S3 Notification Example

The object storage we offer at cloudscale.ch is based on Ceph and it supports notifications with HTTP/S, Kafka, and AMQP.

See Ceph documentation:

This gist demonstrates the feature with a minimal Python script that can be run using uv.

With uv at the ready, store notification.py locally, then run as follows:

# Configure your credentials
export S3_ENDPOINT="objects.lpg.cloudscale.ch"
export S3_ACCESS_KEY="..."
export S3_SECRET_KEY="..."

# ⚠️ The bucket may not exist yet and is deleted at the end of the script!
export S3_BUCKET="$(uuidgen)"

# Run the script
./notifications --push-endpoint <http/https-url>

If you do not have an HTTP/S endpoint at the ready, you can trivially create a test-endpoint by using a launching a Debian 13 instance on our cloud, and run the following on it:

sudo apt install -y podman
sudo podman run --rm -it -p 80:8080 docker.io/mendhak/http-https-echo

As you run the script above, with the public IP of your instance, you should see the logged webhook requests.

About

A minimal example demonstrating S3 notifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages