Class: AWS::DynamoDB::Client

Inherits:
Core::Client show all
Extended by:
Core::Client::QueryJSON
Defined in:
lib/aws/dynamo_db/client.rb

Overview

Client class for Amazon DynamoDB.

Constant Summary collapse

API_VERSION =
'2011-12-05'
REGION_US_E1 =
'dynamodb.us-east-1.amazonaws.com'
TARGET_PREFIX =
"DynamoDB_20111205."
CACHEABLE_REQUESTS =
Set[:list_tables, :describe_table]

Instance Attribute Summary

Attributes inherited from Core::Client

#config, #endpoint, #port, #service_ruby_name, #signer

Instance Method Summary collapse

Methods included from Core::Client::QueryJSON

extended, option_parsers

Methods inherited from Core::Client

#new_stub_for, #operations, #stub_for, #with_config, #with_http_handler, #with_options

Methods included from Core::Naming

#service_name, #service_ruby_name

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client.



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/aws/dynamo_db/client.rb', line 34

def initialize *args

  super

  # If the signer does not provide a session token, then we will
  # replace it with another signer that manages an AWS STS session.
  # This session will auto renew whenever it has expired and will
  # be shared across threads.
  if config.signer.session_token.nil?
    @signer = Core::SessionSigner.for(config) 
  end

end

Instance Method Details

#batch_get_item(options = {}) ⇒ Core::Response

Calls the BatchGetItem API operation.

Options:

  • :request_items - required - (Hash<String,Hash>)

    • :keys - required - (Array<Hash>)

      • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

        • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • :ss - (Array<String>) A set of strings.

        • :ns - (Array<String>) A set of numbers.

      • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

        • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • :ss - (Array<String>) A set of strings.

        • :ns - (Array<String>) A set of numbers.

    • :attributes_to_get - (Array<String>)

Response Structure:

  • Responses - (Hash<String,Hash>)

    • member - (Hash<String,Hash>)

      • S - (String)

      • N - (String)

      • SS - (Array<String>)

      • NS - (Array<String>)

    • ConsumedCapacityUnits - (Numeric)

  • UnprocessedKeys - (Hash<String,Hash>)

    • Keys - (Array<Hash>)

      • HashKeyElement - (Hash)

        • S - (String)

        • N - (String)

        • SS - (Array<String>)

        • NS - (Array<String>)

      • RangeKeyElement - (Hash)

        • S - (String)

        • N - (String)

        • SS - (Array<String>)

        • NS - (Array<String>)

    • AttributesToGet - (Array<String>)

Returns:



111
# File 'lib/aws/dynamo_db/client.rb', line 111

define_client_method :batch_get_item, 'BatchGetItem'

#batch_write_item(options = {}) ⇒ Core::Response

Calls the BatchWriteItem API operation.

Options:

  • :request_items - required - (Hash<String,Array<Hash>>) A map of table name to list-of-write-requests. Used as input to the BatchWriteItem API call

    • :put_request - (Hash)

      • :item - required - (Hash<String,Hash>) The item to put

        • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

        • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

        • :ss - (Array<String>) A set of strings.

        • :ns - (Array<String>) A set of numbers.

    • :delete_request - (Hash)

      • :key - required - (Hash) The item’s key to be delete

        • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

          • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • :ss - (Array<String>) A set of strings.

          • :ns - (Array<String>) A set of numbers.

        • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

          • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

          • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

          • :ss - (Array<String>) A set of strings.

          • :ns - (Array<String>) A set of numbers.

Response Structure:

  • Responses - (Hash<String,Hash>)

    • ConsumedCapacityUnits - (Numeric)

  • UnprocessedItems - (Hash<String,Hash>)

    • value - (Array<Hash>)

      • PutRequest - (Hash)

        • Item - (Hash<String,Hash>)

          • S - (String)

          • N - (String)

          • SS - (Array<String>)

          • NS - (Array<String>)

      • DeleteRequest - (Hash)

        • Key - (Hash)

          • HashKeyElement - (Hash)

            • S - (String)

            • N - (String)

            • SS - (Array<String>)

            • NS - (Array<String>)

          • RangeKeyElement - (Hash)

            • S - (String)

            • N - (String)

            • SS - (Array<String>)

            • NS - (Array<String>)

Returns:



189
# File 'lib/aws/dynamo_db/client.rb', line 189

define_client_method :batch_write_item, 'BatchWriteItem'

#create_table(options = {}) ⇒ Core::Response

Calls the CreateTable API operation.

Options:

  • :table_name - required - (String) The name of the table you want to create. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :key_schema - required - (Hash)

    • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

      • :attribute_name - required - (String) The AttributeName of the KeySchemaElement.

      • :attribute_type - required - (String) The AttributeType of the KeySchemaElement which can be a String or a Number.

    • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

      • :attribute_name - required - (String) The AttributeName of the KeySchemaElement.

      • :attribute_type - required - (String) The AttributeType of the KeySchemaElement which can be a String or a Number.

  • :provisioned_throughput - required - (Hash)

    • :read_capacity_units - required - (Integer) ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.

    • :write_capacity_units - required - (Integer) WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.

Response Structure:

  • TableDescription - (Hash)

    • TableName - (String)

    • KeySchema - (Hash)

      • HashKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

      • RangeKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

    • TableStatus - (String)

    • CreationDateTime - (Time)

    • ProvisionedThroughput - (Hash)

      • LastIncreaseDateTime - (Time)

      • LastDecreaseDateTime - (Time)

      • ReadCapacityUnits - (Integer)

      • WriteCapacityUnits - (Integer)

    • TableSizeBytes - (Integer)

    • ItemCount - (Integer)

Returns:



250
# File 'lib/aws/dynamo_db/client.rb', line 250

define_client_method :create_table, 'CreateTable'

#delete_item(options = {}) ⇒ Core::Response

Calls the DeleteItem API operation.

Options:

  • :table_name - required - (String) The name of the table in which you want to delete an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :key - required - (Hash)

    • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

  • :expected - (Hash<String,Hash>)

    • :value - (Hash) Specify whether or not a value already exists and has a specific content for the attribute name-value pair.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :exists - (Boolean) Specify whether or not a value already exists for the attribute name-value pair.

  • :return_values - (String)

Response Structure:

  • Attributes - (Hash<String,Hash>)

    • S - (String)

    • N - (String)

    • SS - (Array<String>)

    • NS - (Array<String>)

  • ConsumedCapacityUnits - (Numeric)

Returns:



315
# File 'lib/aws/dynamo_db/client.rb', line 315

define_client_method :delete_item, 'DeleteItem'

#delete_table(options = {}) ⇒ Core::Response

Calls the DeleteTable API operation.

Options:

  • :table_name - required - (String) The name of the table you want to delete. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Response Structure:

  • TableDescription - (Hash)

    • TableName - (String)

    • KeySchema - (Hash)

      • HashKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

      • RangeKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

    • TableStatus - (String)

    • CreationDateTime - (Time)

    • ProvisionedThroughput - (Hash)

      • LastIncreaseDateTime - (Time)

      • LastDecreaseDateTime - (Time)

      • ReadCapacityUnits - (Integer)

      • WriteCapacityUnits - (Integer)

    • TableSizeBytes - (Integer)

    • ItemCount - (Integer)

Returns:



349
# File 'lib/aws/dynamo_db/client.rb', line 349

define_client_method :delete_table, 'DeleteTable'

#describe_table(options = {}) ⇒ Core::Response

Calls the DescribeTable API operation.

Options:

  • :table_name - required - (String) The name of the table you want to describe. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Response Structure:

  • Table - (Hash)

    • TableName - (String)

    • KeySchema - (Hash)

      • HashKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

      • RangeKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

    • TableStatus - (String)

    • CreationDateTime - (Time)

    • ProvisionedThroughput - (Hash)

      • LastIncreaseDateTime - (Time)

      • LastDecreaseDateTime - (Time)

      • ReadCapacityUnits - (Integer)

      • WriteCapacityUnits - (Integer)

    • TableSizeBytes - (Integer)

    • ItemCount - (Integer)

Returns:



383
# File 'lib/aws/dynamo_db/client.rb', line 383

define_client_method :describe_table, 'DescribeTable'

#get_item(options = {}) ⇒ Core::Response

Calls the GetItem API operation.

Options:

  • :table_name - required - (String) The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :key - required - (Hash)

    • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

  • :attributes_to_get - (Array<String>)

  • :consistent_read - (Boolean)

Response Structure:

  • Item - (Hash<String,Hash>)

    • S - (String)

    • N - (String)

    • SS - (Array<String>)

    • NS - (Array<String>)

  • ConsumedCapacityUnits - (Numeric)

Returns:



435
# File 'lib/aws/dynamo_db/client.rb', line 435

define_client_method :get_item, 'GetItem'

#list_tables(options = {}) ⇒ Core::Response

Calls the ListTables API operation.

Options:

  • :exclusive_start_table_name - (String) The name of the table that starts the list. If you already ran a ListTables operation and recieved a LastEvaluatedTableName value in the response, use that value here to continue the list.

  • :limit - (Integer)

Response Structure:

  • TableNames - (Array<String>)

  • LastEvaluatedTableName - (String)

Returns:



455
# File 'lib/aws/dynamo_db/client.rb', line 455

define_client_method :list_tables, 'ListTables'

#put_item(options = {}) ⇒ Core::Response

Calls the PutItem API operation.

Options:

  • :table_name - required - (String) The name of the table in which you want to put an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :item - required - (Hash<String,Hash>)

    • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

    • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

    • :ss - (Array<String>) A set of strings.

    • :ns - (Array<String>) A set of numbers.

  • :expected - (Hash<String,Hash>)

    • :value - (Hash) Specify whether or not a value already exists and has a specific content for the attribute name-value pair.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :exists - (Boolean) Specify whether or not a value already exists for the attribute name-value pair.

  • :return_values - (String)

Response Structure:

  • Attributes - (Hash<String,Hash>)

    • S - (String)

    • N - (String)

    • SS - (Array<String>)

    • NS - (Array<String>)

  • ConsumedCapacityUnits - (Numeric)

Returns:



502
# File 'lib/aws/dynamo_db/client.rb', line 502

define_client_method :put_item, 'PutItem'

#query(options = {}) ⇒ Core::Response

Calls the Query API operation.

Options:

  • :table_name - required - (String) The name of the table in which you want to query. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :attributes_to_get - (Array<String>)

  • :limit - (Integer) The maximum number of items to return. If Amazon DynamoDB hits this limit while querying the table, it stops the query and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the query. Also, if the result set size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the query and returns the matching values, and a LastEvaluatedKey to apply in a subsequent operation to continue the query.

  • :consistent_read - (Boolean)

  • :count - (Boolean) If set to true , Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.

  • :hash_key_value - required - (Hash) Attribute value of the hash component of the composite primary key.

    • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

    • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

    • :ss - (Array<String>) A set of strings.

    • :ns - (Array<String>) A set of numbers.

  • :range_key_condition - (Hash) A container for the attribute values and comparison operators to use for the query.

    • :attribute_value_list - (Array<Hash>)

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :comparison_operator - required - (String)

  • :scan_index_forward - (Boolean) Specifies forward or backward traversal of the index. Amazon DynamoDB returns results reflecting the requested order, determined by the range key. Default is true (forward).

  • :exclusive_start_key - (Hash) Primary key of the item from which to continue an earlier query. An earlier query might provide this value as the LastEvaluatedKey if that query operation was interrupted before completing the query; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new query request to continue the operation from that point.

    • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

Response Structure:

  • member - (Hash<String,Hash>)

    • S - (String)

    • N - (String)

    • SS - (Array<String>)

    • NS - (Array<String>)

  • Count - (Integer)

  • LastEvaluatedKey - (Hash)

    • HashKeyElement - (Hash)

      • S - (String)

      • N - (String)

      • SS - (Array<String>)

      • NS - (Array<String>)

    • RangeKeyElement - (Hash)

      • S - (String)

      • N - (String)

      • SS - (Array<String>)

      • NS - (Array<String>)

  • ConsumedCapacityUnits - (Numeric)

Returns:



612
# File 'lib/aws/dynamo_db/client.rb', line 612

define_client_method :query, 'Query'

#scan(options = {}) ⇒ Core::Response

Calls the Scan API operation.

Options:

  • :table_name - required - (String) The name of the table in which you want to scan. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :attributes_to_get - (Array<String>)

  • :limit - (Integer) The maximum number of items to return. If Amazon DynamoDB hits this limit while scanning the table, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan. Also, if the scanned data set size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan.

  • :count - (Boolean) If set to true , Amazon DynamoDB returns a total number of items for the Scan operation, even if the operation has no matching items for the assigned filter. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.

  • :scan_filter - (Hash<String,Hash>) Evaluates the scan results and returns only the desired values.

    • :attribute_value_list - (Array<Hash>)

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :comparison_operator - required - (String)

  • :exclusive_start_key - (Hash) Primary key of the item from which to continue an earlier scan. An earlier scan might provide this value if that scan operation was interrupted before scanning the entire table; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new scan request to continue the operation from that point.

    • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

Response Structure:

  • member - (Hash<String,Hash>)

    • S - (String)

    • N - (String)

    • SS - (Array<String>)

    • NS - (Array<String>)

  • Count - (Integer)

  • ScannedCount - (Integer)

  • LastEvaluatedKey - (Hash)

    • HashKeyElement - (Hash)

      • S - (String)

      • N - (String)

      • SS - (Array<String>)

      • NS - (Array<String>)

    • RangeKeyElement - (Hash)

      • S - (String)

      • N - (String)

      • SS - (Array<String>)

      • NS - (Array<String>)

  • ConsumedCapacityUnits - (Numeric)

Returns:



707
# File 'lib/aws/dynamo_db/client.rb', line 707

define_client_method :scan, 'Scan'

#update_item(options = {}) ⇒ Core::Response

Calls the UpdateItem API operation.

Options:

  • :table_name - required - (String) The name of the table in which you want to update an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :key - required - (Hash)

    • :hash_key_element - required - (Hash) A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :range_key_element - (Hash) A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

  • :attribute_updates - required - (Hash<String,Hash>)

    • :value - (Hash)

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :action - (String)

  • :expected - (Hash<String,Hash>)

    • :value - (Hash) Specify whether or not a value already exists and has a specific content for the attribute name-value pair.

      • :s - (String) Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).

      • :n - (String) Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.

      • :ss - (Array<String>) A set of strings.

      • :ns - (Array<String>) A set of numbers.

    • :exists - (Boolean) Specify whether or not a value already exists for the attribute name-value pair.

  • :return_values - (String)

Response Structure:

  • Attributes - (Hash<String,Hash>)

    • S - (String)

    • N - (String)

    • SS - (Array<String>)

    • NS - (Array<String>)

  • ConsumedCapacityUnits - (Numeric)

Returns:



784
# File 'lib/aws/dynamo_db/client.rb', line 784

define_client_method :update_item, 'UpdateItem'

#update_table(options = {}) ⇒ Core::Response

Calls the UpdateTable API operation.

Options:

  • :table_name - required - (String) The name of the table you want to update. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

  • :provisioned_throughput - required - (Hash)

    • :read_capacity_units - required - (Integer) ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.

    • :write_capacity_units - required - (Integer) WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.

Response Structure:

  • TableDescription - (Hash)

    • TableName - (String)

    • KeySchema - (Hash)

      • HashKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

      • RangeKeyElement - (Hash)

        • AttributeName - (String)

        • AttributeType - (String)

    • TableStatus - (String)

    • CreationDateTime - (Time)

    • ProvisionedThroughput - (Hash)

      • LastIncreaseDateTime - (Time)

      • LastDecreaseDateTime - (Time)

      • ReadCapacityUnits - (Integer)

      • WriteCapacityUnits - (Integer)

    • TableSizeBytes - (Integer)

    • ItemCount - (Integer)

Returns:



827
# File 'lib/aws/dynamo_db/client.rb', line 827

define_client_method :update_table, 'UpdateTable'