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

Implement Bucket Notifications APIs #404

Merged
merged 3 commits into from
Sep 15, 2016

Conversation

donatello
Copy link
Member

Towards resolving #394

At this point it is an early preview, and it is not yet complete.

headers = {
'Content-Length': str(len(content)),
'Content-MD5': encode_to_base64(get_md5(content.encode('utf-8')))
Copy link
Member

Choose a reason for hiding this comment

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

Can you test this with 'python 3.5' - the changes related to 'utf-8' were done with this purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am using python 3.5 by default for development. It works fine. It also works in python 2.7

@harshavardhana
Copy link
Member

harshavardhana commented Sep 10, 2016

Can you add some unit-tests as well here located at tests/unit?

@donatello
Copy link
Member Author

donatello commented Sep 11, 2016

Ok at this point APIs are implemented and do appear to work in my testing (both python 3.5 and python 2.7). Up for review.

Working on unit testing.

@harshavardhana
Copy link
Member

Ok at this point APIs are implemented and do appear to work in my testing (both python 3.5 and python 2.7). Up for review.

Working on unit testing.

Will review ..

@donatello
Copy link
Member Author

Added a batch of unit tests.


{
'TopicConfigurations': [
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to decide on an appropriate place to put the in-code documentation for the structure expected by the set_bucket_notification() API and returned by get_bucket_notification() API.

The expected structure is indicated here at this point.

Copy link
Member

Choose a reason for hiding this comment

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

This is fine.

@donatello
Copy link
Member Author

Next up is documentation in API.md.

@donatello
Copy link
Member Author

Aargh. Tests fail because Windows UA does not match the ones in the unit tests. Need to figure/discuss this.

donatello and others added 2 commits September 13, 2016 18:23
* Implements set_bucket_notification(), get_bucket_notification() and
  remove_all_bucket_notifications()

* Notifications structure used for set and get APIs is currently
  documented in the xml_marshal.py file (TODO: move this to set/get
  API)?
@donatello donatello force-pushed the bucket-notifications branch 3 times, most recently from 8ea7243 to 4e96068 Compare September 14, 2016 20:01

|Param |Type |Description |
|:---|:---|:---|
|``Policy`` | _dict_ | If there is no notification configuration, an empty dictionary is returned. Otherwise it has the same structure as the argument to set_bucket_notification |
Copy link
Member

Choose a reason for hiding this comment

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

This is not Policy.. should be NotificationConfig

<a name="set_bucket_notification"></a>
### set_bucket_notification(bucket_name, notification)

Fetch the notifications configuration on a bucket.
Copy link
Member

Choose a reason for hiding this comment

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

This is incorrect Fetch the notifications configuration on a bucket is not the purpose here. We need to change this to reflect what the set_bucket_notification should be doing.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was still iterating on it. Wanted to see how it looked. Forgot it would update the PR as well. Still working on it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am going to be pushing and squashing more commits now. I will ping when its ready for review. Please wait :-)

Copy link
Member

Choose a reason for hiding this comment

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

Sure 👍

@donatello donatello force-pushed the bucket-notifications branch 6 times, most recently from c23d516 to 3297dd1 Compare September 14, 2016 22:38
@donatello
Copy link
Member Author

@harshavardhana Ready for review and perhaps merge!

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

Successfully merging this pull request may close these issues.

2 participants