Code Monkey home page Code Monkey logo

aws_sdb_bare's Introduction

aws_sdb_bare

AwsSdb Bare is a ruby gem intended to provide a basic modular interface to use the SimpleDB service provided by Amazon.

Concept

The aim of the project is to not commit to any http handling strategy and to not enforce any response parsing solution by default.

The idea behind this project is to provide a basic layer on top of which more high level libraries can be built.

The library provides XML response parsing through Hpricot or Nokogiri to run the test against a specific parser

rake nokogiri test

Or

rake hpricot test

Project sources

the project is hosted on github github.com/hungryblank/aws_sdb_bare

blog posts explaining the usage can be found on assertbuggy.blogspot.com

Support and bug tracking

issues can be posted on github github.com/hungryblank/aws_sdb_bare forking and patch proposal throguh github are encouraged

Installation

sudo gem install hungryblank-aws_sdb_bare -s http://gems.github.com

Usage - Requests

The most basic primitive is the request, as a sample here’s how a ListDomains request is generated

require 'rubygems'
require 'aws_sdb_bare'

ENV['AMAZON_ACCESS_KEY_ID'] = 'your_amazon_access_key'
ENV['AMAZON_SECRET_ACCESS_KEY'] = 'your_amazon_secret'

#create the request object
request = AwsSdb::Request::Base.new('GET', 'Action' => 'ListDomains')

#using curl we can send the request as http get and print out the xml
#response with the domains under your account
puts `curl #{request.uri}`

The gem provides classes to create directly all the requests listed in Amazon’s 2007 11 07 specs so you can do

request = AwsSdb::Request::ListDomains.new

Instead of using the Base class like the previous example.

Please refer to the gem rdocs and to the amazon documentation to see a list of all the available requests and their parameters

Usage - Responses

To parse a response you simply call AwsSdb::Response.parse(xml_doc) example:

require 'open-uri'
require 'aws_sdb_bare'
#the following line could require nokogiri instead
require 'hpricot'

request = AwsSdb::Request::ListDomains.new
xml_response = open request.uri
response = AwsSdb::Response.parse(xml_response)
puts response.domains
puts response.metadata.box_usage

Documentation

Rdoc are available at rdoc.elastastic.com/aws_sdb_bare

Copyright © 2009 Paolo Negri. See LICENSE for details.

aws_sdb_bare's People

Contributors

gorsuch avatar hungryblank avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.