Sha256: 31e11cdd9914f5012a7db794dc9ead212c889d2a37ab08b6fd5c9ef8bc764352

Contents?: true

Size: 1.97 KB

Versions: 79

Compression:

Stored size: 1.97 KB

Contents

module Fog
  module AWS
    class DynamoDB
      class Real

        # Scan DynamoDB items
        #
        # ==== Parameters
        # * 'table_name'<~String> - name of table to query
        # * options<~Hash>:
        #   * 'AttributesToGet'<~Array> - Array of attributes to get for each item, defaults to all
        #   * 'ConsistentRead'<~Boolean> - Whether to wait for consistency, defaults to false
        #   * 'Count'<~Boolean> - If true, returns only a count of such items rather than items themselves, defaults to false
        #   * 'Limit'<~Integer> - limit of total items to return
        #   * 'ScanFilter'<~Hash>: value to compare against
        #     * attribute_name<~Hash>:
        #       * 'AttributeValueList'<~Hash>: one or more values to compare against
        #       * 'ComparisonOperator'<~String>: comparison operator to use with attribute value list, in %w{BETWEEN BEGINS_WITH EQ LE LT GE GT}
        #   * 'ScanIndexForward'<~Boolean>: Whether to scan from start or end of index, defaults to start
        #   * 'ExclusiveStartKey'<~Hash>: Key to start listing from, can be taken from LastEvaluatedKey in response
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ConsumedCapacityUnits'<~Integer> - number of capacity units used for scan
        #     * 'Count'<~Integer> - number of items in response
        #     * 'Items'<~Array> - array of items returned
        #     * 'LastEvaluatedKey'<~Hash> - last key scanned, can be passed to ExclusiveStartKey for pagination
        #     * 'ScannedCount'<~Integer> - number of items scanned before applying filters
        def scan(table_name, options = {})
          body = {
            'TableName'     => table_name
          }.merge(options)

          request(
            :body     => Fog::JSON.encode(body),
            :headers  => {'x-amz-target' => 'DynamoDB_20111205.Scan'},
            :idempotent => true
          )
        end

      end
    end
  end
end

Version data entries

79 entries across 79 versions & 12 rubygems

Version Path
fog-1.22.0 lib/fog/aws/requests/dynamodb/scan.rb
fog-1.21.0 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/dynamodb/scan.rb
fog-1.20.0 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/dynamodb/scan.rb
fog-1.19.0 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/dynamodb/scan.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/dynamodb/scan.rb