This tool depends on the following Perl modules from CPAN:
Getopt::Long
Pod::Usage
Digest::SHA1
Digest::HMAC
XML::Simple
You can install them using the "cpan" command on many Linux distros:
sudo cpan Getopt::Longsudo cpan Pod::Usage
sudo cpan Digest::SHA1
sudo cpan Digest::HMAC
sudo cpan XML::Simple
This tool also depends on the Amazon::SDB modules provided by Amazon(not the one in CPAN). Amazon's modules can be found here:
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1136
Here is the How to for the above:
curl -Lo amazon-simpledb-perl-library.zip \
http://amazon-simpledb-perl-library.notlong.com
unzip amazon-simpledb-perl-library.zip
sitelib=$(perl -MConfig -le 'print $Config{sitelib}')
sudo scp -r amazon-simpledb-*-perl-library/src/Amazon $sitelib
Finally, this command line interface can be installed with:
sudo curl -Lo /usr/local/bin/simpledb http://simpledb-cli.notlong.com
sudo chmod +x /usr/local/bin/simpledb
Now to test your installation::
- Extract the amazon-simpledb-2007-11-07-perl-library.zip file into a working directory.
- Edit desired sample. For example: src/Amazon/SimpleDB/Samples/CreateDomainSample.pl
- Set AWS Access Key ID and AWS Secret Access Key
- Set request parameters. For example, find following pre-generated snippet:
- And set action with DomainName parameter:
- Run CreateDomain sample:
- You should see the output similar to the following:
- Experiment with samples. When ready, install library in the perl include path and use it.
my $AWS_ACCESS_KEY_ID = "";
my $AWS_SECRET_ACCESS_KEY = "";
use Amazon::SimpleDB::Model::CreateDomain;
# @TODO: set action. Action can be passed as Amazon::SimpleDB::Model::CreateDomain
# object or hash of parameters
# invokeCreateDomain($service, $action);
use Amazon::SimpleDB::Model::CreateDomain;
my $action = Amazon::SimpleDB::Model::CreateDomain->new;
invokeCreateDomain($service, $action->withDomainName("MyDomain"));
perl src/Amazon/SimpleDB/Samples/CreateDomainSample.pl
CreateDomainResponse
ResponseMetadata
RequestId
95cdcb68-f46c-400b-8265-8c2de2a5c475
SEE ALSO
Amazon SimpleDB (SDB)
http://www.amazon.com/SimpleDB-AWS-Service-Pricing/b/?node=342335011
Amazon SimpleDB Developer Guide
http://docs.amazonwebservices.com/AmazonSimpleDB/2007-11-07/DeveloperGui
de/
1 comment:
Saltmarch Media is organizing Great Indian Developer Summit event in Bangalore. This Summit will be a boost for the Software Developing Industries. It covers the topics like .Net, Java, SimpleDB, MongoDB, NoSQL and Richweb and has 1 day workshop at the end as well. Any one attending this event?
Register @ www.developersummit.com
Post a Comment