Sha256: f1ccbea650fcd6cf78b853a4406ade20a54609e6456def57f025cfc468ff705b

Contents?: true

Size: 1.97 KB

Versions: 21

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

21 entries across 21 versions & 5 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/aws/requests/dynamodb/scan.rb
fog-aws-0.1.0 lib/fog/aws/requests/dynamodb/scan.rb
fog-aws-0.0.8 lib/fog/aws/requests/dynamodb/scan.rb
fog-aws-0.0.7 lib/fog/aws/requests/dynamodb/scan.rb
fog-aws-0.0.6 lib/fog/aws/requests/dynamodb/scan.rb
fog-aws-0.0.5 lib/fog/aws/requests/dynamodb/scan.rb
fog-1.26.0 lib/fog/aws/requests/dynamodb/scan.rb
fog-1.25.0 lib/fog/aws/requests/dynamodb/scan.rb
nsidc-fog-1.24.1 lib/fog/aws/requests/dynamodb/scan.rb
fog-1.24.0 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.11 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.10 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.9 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.8 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.7 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.6 lib/fog/aws/requests/dynamodb/scan.rb
fog-1.23.0 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.4 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.3 lib/fog/aws/requests/dynamodb/scan.rb
ns-fog-1.22.2 lib/fog/aws/requests/dynamodb/scan.rb