mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
34e6a1105c
distinctly styles deprecations for clarity gives better flexibility for redirecting logs reduces possibility of missing deprecations because warnings are ignored
43 lines
1.7 KiB
Ruby
43 lines
1.7 KiB
Ruby
module Fog
|
|
module AWS
|
|
class SimpleDB
|
|
class Real
|
|
|
|
require 'fog/aws/parsers/simpledb/select'
|
|
|
|
# Select item data from SimpleDB
|
|
#
|
|
# ==== Parameters
|
|
# * select_expression<~String> - Expression to query domain with.
|
|
# * 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.
|
|
#
|
|
# ==== Returns
|
|
# * response<~Excon::Response>:
|
|
# * body<~Hash>:
|
|
# * 'BoxUsage'<~Float>
|
|
# * 'RequestId'<~String>
|
|
# * 'Items'<~Hash> - list of attribute name/values for the items formatted as
|
|
# { 'item_name' => { 'attribute_name' => ['attribute_value'] }}
|
|
# * 'NextToken'<~String> - offset to start with if there are are more domains to list
|
|
def select(select_expression, options = {})
|
|
if options.is_a?(String)
|
|
Fog::Logger.deprecation("get_attributes with string next_token param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
|
|
options = {'NextToken' => options}
|
|
end
|
|
options['NextToken'] ||= nil
|
|
request(
|
|
'Action' => 'Select',
|
|
'ConsistentRead' => !!options['ConsistentRead'],
|
|
'NextToken' => options['NextToken'],
|
|
'SelectExpression' => select_expression,
|
|
:idempotent => true,
|
|
:parser => Fog::Parsers::AWS::SimpleDB::Select.new(@nil_string)
|
|
)
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|