2010-03-14 23:11:43 -04:00
module Fog
module AWS
2010-09-03 04:11:45 -04:00
class SimpleDB
2010-03-14 23:11:43 -04:00
class Real
2010-02-02 01:53:18 -05:00
2010-06-12 18:31:17 -04:00
require 'fog/aws/parsers/simpledb/select'
2010-02-02 01:53:18 -05:00
# Select item data from SimpleDB
#
# ==== Parameters
# * select_expression<~String> - Expression to query domain with.
2011-07-08 17:43:25 -04:00
# * options<~Hash>:
# * ConsistentRead<~Boolean> - When set to true, ensures most recent data is returned. Defaults to false.
# * NextToken<~String> - Offset token to start list, defaults to nil.
2010-02-02 01:53:18 -05:00
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'BoxUsage'<~Float>
# * 'RequestId'<~String>
2014-02-19 07:30:59 -05:00
# * 'Items'<~Hash> - list of attribute name/values for the items formatted as
2010-02-02 01:53:18 -05:00
# { 'item_name' => { 'attribute_name' => ['attribute_value'] }}
# * 'NextToken'<~String> - offset to start with if there are are more domains to list
2011-07-08 17:43:25 -04:00
def select ( select_expression , options = { } )
if options . is_a? ( String )
2011-10-19 15:49:34 -04:00
Fog :: Logger . deprecation ( " get_attributes with string next_token param is deprecated, use 'AttributeName' => attributes) instead [light_black]( #{ caller . first } )[/] " )
2011-07-08 17:43:25 -04:00
options = { 'NextToken' = > options }
end
options [ 'NextToken' ] || = nil
2010-03-16 00:58:57 -04:00
request (
'Action' = > 'Select' ,
2011-07-08 17:43:25 -04:00
'ConsistentRead' = > ! ! options [ 'ConsistentRead' ] ,
'NextToken' = > options [ 'NextToken' ] ,
2010-03-16 00:58:57 -04:00
'SelectExpression' = > select_expression ,
2011-01-03 21:55:24 -05:00
:idempotent = > true ,
2010-03-16 00:58:57 -04:00
:parser = > Fog :: Parsers :: AWS :: SimpleDB :: Select . new ( @nil_string )
)
2010-02-02 01:53:18 -05:00
end
2009-07-13 22:14:59 -04:00
end
end
end
end