MON=1 OSD=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -n -d
aws --endpoint-url http://localhost:8000 sns create-topic --name=fishtopic \
--attributes='{"push-endpoint": "http://localhost:10900"}'
- creaet a versioned bucket:
aws --endpoint-url http://localhost:8000 s3 mb s3://fish
aws --endpoint-url http://localhost:8000 s3api put-bucket-versioning --bucket fish --versioning-configuration Status=Enabled
aws --endpoint-url http://localhost:8000 s3api put-bucket-notification-configuration --bucket fish \
--notification-configuration='{"TopicConfigurations": [{"Id": "notif1", "TopicArn": "arn:aws:sns:default::fishtopic", "Events": []}]}'
- download a python HTTP POST server:
wget https://gist.githubusercontent.com/yuvalif/a5d08a1eca0f3a24eefd6f647a5d9e69/raw/7bc50f8a9a8bc4fbb7762ad4629b89d585474a39/server.py
- in a separate terminal run the above server:
python server.py 10900
- upload an object to the bucket:
head -c 50M </dev/urandom > myfile
aws --endpoint-url http://localhost:8000 s3 cp myfile s3://fish
aws --endpoint-url http://localhost:8000 s3 rm s3://fish/myfile
- make sure that the notification has a valid
eventTime
and the eventName
is: ObjectRemoved:DeleteMarkerCreated
- take the
versionId
field from the notification above and use it to delete the delete marker:
aws --endpoint-url http://localhost:8000 s3api delete-object --bucket fish --key myfile --version-id "<version-id>"
- make sure that the new notification has valid
eventTime
and the eventName
is: ObjectRemoved:Delete