uskudnik / amazon-glacier-cmd-interface

Command line interface for Amazon Glacier
MIT License
375 stars 103 forks source link

SNS support #104

Closed uskudnik closed 11 years ago

uskudnik commented 11 years ago

Hey guys,

I need a bit of feedback on SNS support/API.

Current implementation: https://github.com/uskudnik/amazon-glacier-cmd-interface/commit/8b922f27f380c69ea6d9cd74c81589d3670ba37c

From usage standpoint:

Enable

glaciercmd sns enable (maybe rename to init): adds

[SNS]
topic=aws-glacier-notifications

to your configuration file. By default all vaults are subscribed to this one topic if you run sync command. However, you can also add vaults and specify for which vaults you would like notifications.

We also have sections, which make config file look like this:

[SNS]
topic=aws-glacier-notifications

[SNS:topicname1]
vaults=vault1,vault2,...

[SNS:topicname2]
vaults=vault2, vault3,...

Sync

glaciercmd sns sync

Goes through file - if sections are present it subscribes all the specified vaults to appropriate topics ("topic-topicname1").

Subscribe

I have subscribe mostly programmed for old version (where there was per-vault notifications - not very practical since by default you can only have 100 topics), so it should be in a few days that we also have:

glaciedcmd sns subscribe protocol endpoint [topicname1 [topicname2, ...]]

where protocol is either http, https, email or sms and endpoint appropriate target (email/http address, phone number).

Looks good? Feedback?

echamberlain commented 11 years ago

Can you explain how this feature is used? What must one do to pre-configure SNS?

uskudnik commented 11 years ago

You should give your AWS account that is accessing glacier permissions for creating topics and subscribing and I think that should be it for non-tool related things. Then add [SNS] to your configuration file and or run glacier sns enable and it should work.

uskudnik commented 11 years ago

Usage and CLI API changed a bit; full description and code