aws-sdk 1.8.5 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +1 -0
- data/README.rdoc +8 -0
- data/lib/aws-sdk.rb +39 -35
- data/lib/aws/api_config/CloudFront-2012-07-01.yml +2398 -0
- data/lib/aws/api_config/DirectConnect-2012-10-25.yml +475 -0
- data/lib/aws/api_config/DynamoDB-2011-12-05.yml +8 -0
- data/lib/aws/api_config/DynamoDB-2012-08-10.yml +1516 -0
- data/lib/aws/api_config/OpsWorks-2013-02-18.yml +2 -2
- data/lib/aws/auto_scaling.rb +44 -44
- data/lib/aws/auto_scaling/activity.rb +1 -1
- data/lib/aws/auto_scaling/activity_collection.rb +14 -15
- data/lib/aws/auto_scaling/client.rb +277 -277
- data/lib/aws/auto_scaling/config.rb +1 -1
- data/lib/aws/auto_scaling/group.rb +35 -36
- data/lib/aws/auto_scaling/group_collection.rb +10 -10
- data/lib/aws/auto_scaling/group_options.rb +19 -19
- data/lib/aws/auto_scaling/instance.rb +27 -27
- data/lib/aws/auto_scaling/instance_collection.rb +10 -10
- data/lib/aws/auto_scaling/launch_configuration.rb +3 -3
- data/lib/aws/auto_scaling/launch_configuration_collection.rb +1 -1
- data/lib/aws/auto_scaling/notification_configuration.rb +2 -2
- data/lib/aws/auto_scaling/notification_configuration_collection.rb +37 -38
- data/lib/aws/auto_scaling/scaling_policy.rb +3 -3
- data/lib/aws/auto_scaling/scaling_policy_collection.rb +6 -6
- data/lib/aws/auto_scaling/scaling_policy_options.rb +8 -7
- data/lib/aws/auto_scaling/scheduled_action.rb +3 -3
- data/lib/aws/auto_scaling/scheduled_action_collection.rb +28 -28
- data/lib/aws/auto_scaling/tag_collection.rb +30 -28
- data/lib/aws/cloud_formation.rb +95 -94
- data/lib/aws/cloud_formation/client.rb +136 -133
- data/lib/aws/cloud_formation/config.rb +1 -1
- data/lib/aws/cloud_formation/stack.rb +37 -37
- data/lib/aws/cloud_formation/stack_collection.rb +28 -27
- data/lib/aws/cloud_formation/stack_event.rb +9 -11
- data/lib/aws/cloud_formation/stack_output.rb +1 -1
- data/lib/aws/cloud_formation/stack_resource.rb +6 -6
- data/lib/aws/cloud_formation/stack_resource_collection.rb +11 -12
- data/lib/aws/cloud_formation/stack_resource_summary_collection.rb +11 -11
- data/lib/aws/cloud_formation/stack_summary_collection.rb +39 -39
- data/lib/aws/cloud_front.rb +21 -21
- data/lib/aws/cloud_front/client.rb +853 -652
- data/lib/aws/cloud_front/request.rb +3 -0
- data/lib/aws/cloud_search.rb +22 -22
- data/lib/aws/cloud_search/client.rb +322 -315
- data/lib/aws/cloud_search/config.rb +1 -1
- data/lib/aws/cloud_watch.rb +39 -39
- data/lib/aws/cloud_watch/alarm.rb +55 -37
- data/lib/aws/cloud_watch/alarm_collection.rb +18 -18
- data/lib/aws/cloud_watch/alarm_history_item_collection.rb +2 -2
- data/lib/aws/cloud_watch/client.rb +360 -146
- data/lib/aws/cloud_watch/config.rb +1 -1
- data/lib/aws/cloud_watch/metric.rb +15 -15
- data/lib/aws/cloud_watch/metric_alarm_collection.rb +17 -17
- data/lib/aws/cloud_watch/metric_collection.rb +16 -16
- data/lib/aws/cloud_watch/metric_statistics.rb +11 -11
- data/lib/aws/core.rb +243 -225
- data/lib/aws/core/async_handle.rb +13 -13
- data/lib/aws/core/cacheable.rb +14 -15
- data/lib/aws/core/client.rb +40 -15
- data/lib/aws/core/collection.rb +42 -46
- data/lib/aws/core/collection/with_limit_and_next_token.rb +1 -1
- data/lib/aws/core/collection/with_next_token.rb +1 -1
- data/lib/aws/core/configuration.rb +97 -133
- data/lib/aws/core/credential_providers.rb +16 -16
- data/lib/aws/core/data.rb +23 -23
- data/lib/aws/core/http/connection_pool.rb +348 -0
- data/lib/aws/core/http/net_http_handler.rb +17 -26
- data/lib/aws/core/http/patch.rb +102 -0
- data/lib/aws/core/http/request.rb +13 -19
- data/lib/aws/core/http/response.rb +2 -2
- data/lib/aws/core/lazy_error_classes.rb +17 -17
- data/lib/aws/core/log_formatter.rb +70 -104
- data/lib/aws/core/options/json_serializer.rb +1 -1
- data/lib/aws/core/options/validator.rb +4 -4
- data/lib/aws/core/page_result.rb +8 -8
- data/lib/aws/core/policy.rb +49 -49
- data/lib/aws/core/region.rb +72 -0
- data/lib/aws/core/region_collection.rb +106 -0
- data/lib/aws/core/resource.rb +5 -5
- data/lib/aws/core/response.rb +20 -17
- data/lib/aws/core/rest_request_builder.rb +4 -4
- data/lib/aws/core/service_interface.rb +24 -2
- data/lib/aws/core/signature/version_3.rb +2 -2
- data/lib/aws/core/uri_escape.rb +1 -1
- data/lib/aws/core/xml/frame_stack.rb +1 -1
- data/lib/aws/core/xml/grammar.rb +3 -4
- data/lib/aws/core/xml/sax_handlers/libxml.rb +2 -2
- data/lib/aws/core/xml/sax_handlers/nokogiri.rb +3 -3
- data/lib/aws/core/xml/sax_handlers/rexml.rb +5 -5
- data/lib/aws/core/xml/stub.rb +9 -9
- data/lib/aws/data_pipeline.rb +21 -21
- data/lib/aws/data_pipeline/client.rb +189 -133
- data/lib/aws/data_pipeline/config.rb +1 -1
- data/lib/aws/direct_connect.rb +74 -0
- data/lib/aws/direct_connect/client.rb +253 -0
- data/lib/aws/direct_connect/config.rb +18 -0
- data/lib/aws/direct_connect/errors.rb +22 -0
- data/lib/aws/direct_connect/request.rb +27 -0
- data/lib/aws/dynamo_db.rb +71 -69
- data/lib/aws/dynamo_db/attribute_collection.rb +53 -58
- data/lib/aws/dynamo_db/batch_get.rb +23 -23
- data/lib/aws/dynamo_db/batch_write.rb +43 -43
- data/lib/aws/dynamo_db/binary.rb +9 -9
- data/lib/aws/dynamo_db/client.rb +494 -509
- data/lib/aws/dynamo_db/client_base.rb +91 -0
- data/lib/aws/dynamo_db/client_v2.rb +825 -0
- data/lib/aws/dynamo_db/config.rb +1 -1
- data/lib/aws/dynamo_db/item.rb +10 -10
- data/lib/aws/dynamo_db/item_collection.rb +75 -75
- data/lib/aws/dynamo_db/table.rb +85 -85
- data/lib/aws/dynamo_db/table_collection.rb +13 -13
- data/lib/aws/ec2.rb +132 -142
- data/lib/aws/ec2/attachment.rb +31 -36
- data/lib/aws/ec2/attachment_collection.rb +1 -1
- data/lib/aws/ec2/availability_zone.rb +4 -4
- data/lib/aws/ec2/client.rb +2272 -2125
- data/lib/aws/ec2/config.rb +1 -1
- data/lib/aws/ec2/customer_gateway.rb +6 -6
- data/lib/aws/ec2/customer_gateway_collection.rb +6 -6
- data/lib/aws/ec2/dhcp_options.rb +3 -3
- data/lib/aws/ec2/dhcp_options_collection.rb +10 -10
- data/lib/aws/ec2/elastic_ip.rb +15 -15
- data/lib/aws/ec2/elastic_ip_collection.rb +11 -15
- data/lib/aws/ec2/export_task.rb +4 -4
- data/lib/aws/ec2/export_task_collection.rb +11 -11
- data/lib/aws/ec2/filtered_collection.rb +6 -8
- data/lib/aws/ec2/image.rb +46 -40
- data/lib/aws/ec2/image_collection.rb +44 -52
- data/lib/aws/ec2/instance.rb +64 -62
- data/lib/aws/ec2/instance_collection.rb +47 -50
- data/lib/aws/ec2/internet_gateway.rb +6 -6
- data/lib/aws/ec2/internet_gateway/attachment.rb +13 -13
- data/lib/aws/ec2/internet_gateway_collection.rb +3 -3
- data/lib/aws/ec2/key_pair.rb +3 -3
- data/lib/aws/ec2/key_pair_collection.rb +12 -12
- data/lib/aws/ec2/network_acl.rb +39 -39
- data/lib/aws/ec2/network_acl/association.rb +2 -2
- data/lib/aws/ec2/network_acl/entry.rb +22 -22
- data/lib/aws/ec2/network_acl_collection.rb +2 -2
- data/lib/aws/ec2/network_interface.rb +13 -4
- data/lib/aws/ec2/network_interface/attachment.rb +3 -3
- data/lib/aws/ec2/network_interface_collection.rb +5 -5
- data/lib/aws/ec2/permission_collection.rb +1 -1
- data/lib/aws/ec2/region.rb +6 -6
- data/lib/aws/ec2/region_collection.rb +1 -1
- data/lib/aws/ec2/reserved_instances_collection.rb +2 -2
- data/lib/aws/ec2/reserved_instances_offering_collection.rb +2 -2
- data/lib/aws/ec2/resource_tag_collection.rb +5 -5
- data/lib/aws/ec2/route_table.rb +14 -14
- data/lib/aws/ec2/route_table/association.rb +22 -22
- data/lib/aws/ec2/route_table/route.rb +8 -8
- data/lib/aws/ec2/route_table_collection.rb +3 -3
- data/lib/aws/ec2/security_group.rb +39 -41
- data/lib/aws/ec2/security_group_collection.rb +19 -21
- data/lib/aws/ec2/snapshot.rb +3 -3
- data/lib/aws/ec2/snapshot_collection.rb +11 -12
- data/lib/aws/ec2/subnet.rb +2 -2
- data/lib/aws/ec2/subnet_collection.rb +17 -17
- data/lib/aws/ec2/tag_collection.rb +1 -1
- data/lib/aws/ec2/tagged_collection.rb +7 -7
- data/lib/aws/ec2/tagged_item.rb +10 -10
- data/lib/aws/ec2/volume.rb +16 -16
- data/lib/aws/ec2/volume_collection.rb +9 -12
- data/lib/aws/ec2/vpc.rb +6 -6
- data/lib/aws/ec2/vpc_collection.rb +10 -10
- data/lib/aws/ec2/vpn_connection.rb +4 -4
- data/lib/aws/ec2/vpn_connection/telemetry.rb +1 -1
- data/lib/aws/ec2/vpn_connection_collection.rb +6 -6
- data/lib/aws/ec2/vpn_gateway.rb +2 -2
- data/lib/aws/ec2/vpn_gateway_collection.rb +5 -5
- data/lib/aws/elastic_beanstalk.rb +12 -12
- data/lib/aws/elastic_beanstalk/client.rb +376 -368
- data/lib/aws/elastic_beanstalk/config.rb +1 -1
- data/lib/aws/elastic_transcoder.rb +5 -5
- data/lib/aws/elastic_transcoder/client.rb +283 -283
- data/lib/aws/elastic_transcoder/config.rb +1 -1
- data/lib/aws/elasticache.rb +12 -12
- data/lib/aws/elasticache/client.rb +484 -479
- data/lib/aws/elasticache/config.rb +1 -1
- data/lib/aws/elb.rb +23 -23
- data/lib/aws/elb/availability_zone_collection.rb +34 -34
- data/lib/aws/elb/backend_server_policy_collection.rb +24 -24
- data/lib/aws/elb/client.rb +153 -153
- data/lib/aws/elb/config.rb +1 -1
- data/lib/aws/elb/errors.rb +1 -1
- data/lib/aws/elb/instance_collection.rb +20 -25
- data/lib/aws/elb/listener.rb +3 -3
- data/lib/aws/elb/listener_collection.rb +8 -8
- data/lib/aws/elb/load_balancer.rb +15 -16
- data/lib/aws/elb/load_balancer_collection.rb +36 -24
- data/lib/aws/elb/load_balancer_policy.rb +1 -1
- data/lib/aws/elb/load_balancer_policy_collection.rb +5 -5
- data/lib/aws/emr.rb +28 -26
- data/lib/aws/emr/client.rb +165 -149
- data/lib/aws/emr/config.rb +1 -1
- data/lib/aws/emr/instance_group.rb +1 -1
- data/lib/aws/emr/instance_group_collection.rb +1 -1
- data/lib/aws/emr/job_flow.rb +27 -26
- data/lib/aws/emr/job_flow_collection.rb +34 -34
- data/lib/aws/errors.rb +7 -7
- data/lib/aws/glacier.rb +21 -21
- data/lib/aws/glacier/archive_collection.rb +2 -2
- data/lib/aws/glacier/client.rb +139 -140
- data/lib/aws/glacier/config.rb +1 -1
- data/lib/aws/glacier/vault.rb +2 -2
- data/lib/aws/glacier/vault_collection.rb +1 -1
- data/lib/aws/iam.rb +133 -144
- data/lib/aws/iam/access_key.rb +17 -17
- data/lib/aws/iam/access_key_collection.rb +22 -22
- data/lib/aws/iam/account_alias_collection.rb +2 -2
- data/lib/aws/iam/client.rb +429 -420
- data/lib/aws/iam/collection.rb +1 -1
- data/lib/aws/iam/config.rb +2 -2
- data/lib/aws/iam/group.rb +8 -8
- data/lib/aws/iam/group_collection.rb +16 -16
- data/lib/aws/iam/group_policy_collection.rb +6 -6
- data/lib/aws/iam/group_user_collection.rb +3 -3
- data/lib/aws/iam/mfa_device.rb +1 -1
- data/lib/aws/iam/mfa_device_collection.rb +9 -9
- data/lib/aws/iam/policy_collection.rb +4 -4
- data/lib/aws/iam/resource.rb +2 -2
- data/lib/aws/iam/server_certificate.rb +1 -1
- data/lib/aws/iam/server_certificate_collection.rb +15 -15
- data/lib/aws/iam/signing_certificate.rb +29 -29
- data/lib/aws/iam/signing_certificate_collection.rb +23 -23
- data/lib/aws/iam/user.rb +33 -38
- data/lib/aws/iam/user_collection.rb +27 -27
- data/lib/aws/iam/user_group_collection.rb +3 -3
- data/lib/aws/iam/user_policy_collection.rb +6 -6
- data/lib/aws/iam/virtual_mfa_device.rb +12 -12
- data/lib/aws/iam/virtual_mfa_device_collection.rb +4 -4
- data/lib/aws/import_export.rb +22 -21
- data/lib/aws/import_export/client.rb +47 -43
- data/lib/aws/ops_works.rb +5 -5
- data/lib/aws/ops_works/client.rb +484 -438
- data/lib/aws/ops_works/config.rb +1 -1
- data/lib/aws/rails.rb +34 -34
- data/lib/aws/rds.rb +18 -18
- data/lib/aws/rds/client.rb +1286 -1277
- data/lib/aws/rds/config.rb +1 -1
- data/lib/aws/rds/db_instance.rb +15 -4
- data/lib/aws/rds/db_snapshot.rb +1 -1
- data/lib/aws/record.rb +50 -24
- data/lib/aws/record/abstract_base.rb +52 -60
- data/lib/aws/record/attributes.rb +79 -79
- data/lib/aws/record/conversion.rb +1 -1
- data/lib/aws/record/dirty_tracking.rb +69 -67
- data/lib/aws/record/errors.rb +21 -21
- data/lib/aws/record/exceptions.rb +2 -2
- data/lib/aws/record/hash_model.rb +20 -21
- data/lib/aws/record/hash_model/attributes.rb +13 -15
- data/lib/aws/record/hash_model/finder_methods.rb +46 -46
- data/lib/aws/record/hash_model/scope.rb +31 -31
- data/lib/aws/record/model.rb +136 -136
- data/lib/aws/record/model/attributes.rb +57 -59
- data/lib/aws/record/model/finder_methods.rb +67 -67
- data/lib/aws/record/model/scope.rb +48 -49
- data/lib/aws/record/naming.rb +1 -1
- data/lib/aws/record/scope.rb +23 -19
- data/lib/aws/record/validations.rb +253 -271
- data/lib/aws/record/validator.rb +3 -3
- data/lib/aws/record/validators/acceptance.rb +1 -3
- data/lib/aws/record/validators/block.rb +1 -3
- data/lib/aws/record/validators/confirmation.rb +1 -3
- data/lib/aws/record/validators/count.rb +2 -4
- data/lib/aws/record/validators/exclusion.rb +2 -4
- data/lib/aws/record/validators/format.rb +2 -4
- data/lib/aws/record/validators/inclusion.rb +1 -3
- data/lib/aws/record/validators/length.rb +5 -7
- data/lib/aws/record/validators/method.rb +1 -3
- data/lib/aws/record/validators/numericality.rb +6 -8
- data/lib/aws/record/validators/presence.rb +1 -3
- data/lib/aws/redshift.rb +14 -14
- data/lib/aws/redshift/client.rb +596 -592
- data/lib/aws/redshift/config.rb +1 -1
- data/lib/aws/route_53.rb +30 -30
- data/lib/aws/route_53/change_batch.rb +7 -7
- data/lib/aws/route_53/client.rb +188 -152
- data/lib/aws/route_53/hosted_zone.rb +4 -4
- data/lib/aws/route_53/hosted_zone_collection.rb +7 -7
- data/lib/aws/route_53/resource_record_set.rb +10 -10
- data/lib/aws/route_53/resource_record_set_collection.rb +6 -6
- data/lib/aws/s3.rb +79 -79
- data/lib/aws/s3/access_control_list.rb +44 -36
- data/lib/aws/s3/acl_options.rb +51 -51
- data/lib/aws/s3/bucket.rb +146 -146
- data/lib/aws/s3/bucket_collection.rb +21 -21
- data/lib/aws/s3/bucket_lifecycle_configuration.rb +81 -82
- data/lib/aws/s3/bucket_tag_collection.rb +4 -2
- data/lib/aws/s3/cipher_io.rb +5 -4
- data/lib/aws/s3/client.rb +89 -84
- data/lib/aws/s3/client/xml.rb +1 -1
- data/lib/aws/s3/config.rb +7 -1
- data/lib/aws/s3/cors_rule.rb +2 -0
- data/lib/aws/s3/cors_rule_collection.rb +42 -40
- data/lib/aws/s3/data_options.rb +16 -11
- data/lib/aws/s3/encryption_utils.rb +2 -2
- data/lib/aws/s3/errors.rb +7 -7
- data/lib/aws/s3/multipart_upload.rb +30 -33
- data/lib/aws/s3/multipart_upload_collection.rb +8 -6
- data/lib/aws/s3/object_collection.rb +35 -35
- data/lib/aws/s3/object_metadata.rb +6 -6
- data/lib/aws/s3/object_version.rb +4 -4
- data/lib/aws/s3/object_version_collection.rb +15 -15
- data/lib/aws/s3/policy.rb +2 -2
- data/lib/aws/s3/prefixed_collection.rb +9 -5
- data/lib/aws/s3/presigned_post.rb +39 -37
- data/lib/aws/s3/request.rb +11 -11
- data/lib/aws/s3/s3_object.rb +210 -200
- data/lib/aws/s3/tree.rb +25 -27
- data/lib/aws/s3/tree/child_collection.rb +3 -3
- data/lib/aws/s3/tree/leaf_node.rb +2 -2
- data/lib/aws/s3/tree/parent.rb +1 -1
- data/lib/aws/s3/website_configuration.rb +13 -13
- data/lib/aws/simple_db.rb +83 -83
- data/lib/aws/simple_db/attribute.rb +9 -7
- data/lib/aws/simple_db/attribute_collection.rb +22 -13
- data/lib/aws/simple_db/client.rb +107 -107
- data/lib/aws/simple_db/config.rb +7 -1
- data/lib/aws/simple_db/consistent_read_option.rb +5 -5
- data/lib/aws/simple_db/domain.rb +4 -2
- data/lib/aws/simple_db/domain_collection.rb +4 -4
- data/lib/aws/simple_db/domain_metadata.rb +5 -5
- data/lib/aws/simple_db/errors.rb +9 -9
- data/lib/aws/simple_db/item.rb +5 -5
- data/lib/aws/simple_db/item_collection.rb +83 -81
- data/lib/aws/simple_db/item_data.rb +4 -4
- data/lib/aws/simple_db/put_attributes.rb +3 -3
- data/lib/aws/simple_email_service.rb +140 -140
- data/lib/aws/simple_email_service/client.rb +82 -76
- data/lib/aws/simple_email_service/config.rb +1 -2
- data/lib/aws/simple_email_service/email_address_collection.rb +3 -3
- data/lib/aws/simple_email_service/identity.rb +8 -8
- data/lib/aws/simple_email_service/quotas.rb +8 -6
- data/lib/aws/simple_workflow.rb +106 -106
- data/lib/aws/simple_workflow/activity_task.rb +15 -22
- data/lib/aws/simple_workflow/activity_task_collection.rb +15 -15
- data/lib/aws/simple_workflow/activity_type.rb +23 -23
- data/lib/aws/simple_workflow/activity_type_collection.rb +23 -23
- data/lib/aws/simple_workflow/client.rb +1004 -956
- data/lib/aws/simple_workflow/config.rb +1 -1
- data/lib/aws/simple_workflow/count.rb +5 -5
- data/lib/aws/simple_workflow/decision_task.rb +129 -129
- data/lib/aws/simple_workflow/decision_task_collection.rb +59 -59
- data/lib/aws/simple_workflow/domain.rb +11 -11
- data/lib/aws/simple_workflow/domain_collection.rb +26 -26
- data/lib/aws/simple_workflow/history_event.rb +32 -32
- data/lib/aws/simple_workflow/history_event_collection.rb +3 -3
- data/lib/aws/simple_workflow/option_formatters.rb +5 -5
- data/lib/aws/simple_workflow/request.rb +1 -1
- data/lib/aws/simple_workflow/resource.rb +1 -1
- data/lib/aws/simple_workflow/type.rb +8 -8
- data/lib/aws/simple_workflow/type_collection.rb +15 -15
- data/lib/aws/simple_workflow/workflow_execution.rb +70 -72
- data/lib/aws/simple_workflow/workflow_execution_collection.rb +130 -130
- data/lib/aws/simple_workflow/workflow_type.rb +27 -25
- data/lib/aws/simple_workflow/workflow_type_collection.rb +20 -20
- data/lib/aws/sns.rb +25 -25
- data/lib/aws/sns/client.rb +55 -55
- data/lib/aws/sns/config.rb +1 -1
- data/lib/aws/sns/policy.rb +1 -1
- data/lib/aws/sns/subscription.rb +7 -7
- data/lib/aws/sns/subscription_collection.rb +5 -5
- data/lib/aws/sns/topic.rb +49 -49
- data/lib/aws/sns/topic_collection.rb +2 -2
- data/lib/aws/sns/topic_subscription_collection.rb +5 -5
- data/lib/aws/sqs.rb +20 -20
- data/lib/aws/sqs/client.rb +78 -78
- data/lib/aws/sqs/config.rb +1 -1
- data/lib/aws/sqs/errors.rb +12 -12
- data/lib/aws/sqs/queue.rb +66 -67
- data/lib/aws/sqs/queue_collection.rb +16 -8
- data/lib/aws/sqs/received_message.rb +7 -6
- data/lib/aws/storage_gateway.rb +21 -21
- data/lib/aws/storage_gateway/client.rb +269 -202
- data/lib/aws/storage_gateway/config.rb +1 -1
- data/lib/aws/sts.rb +10 -8
- data/lib/aws/sts/client.rb +35 -35
- data/lib/aws/sts/session.rb +3 -3
- data/lib/aws/version.rb +1 -2
- metadata +23 -21
- data/lib/aws/core/autoloader.rb +0 -64
- data/lib/net/http/connection_pool.rb +0 -226
- data/lib/net/http/connection_pool/connection.rb +0 -189
- data/lib/net/http/connection_pool/session.rb +0 -126
@@ -80,9 +80,9 @@ module AWS
|
|
80
80
|
# Behaves like Hash#each; yields each attribute as a name/value
|
81
81
|
# pair.
|
82
82
|
#
|
83
|
-
#
|
83
|
+
# attributes.each { |(name, value)| puts "#{name} = #{value}" }
|
84
84
|
#
|
85
|
-
#
|
85
|
+
# attributes.each { |name, value| puts "#{name} = #{value}" }
|
86
86
|
#
|
87
87
|
# @param (see #to_hash)
|
88
88
|
#
|
@@ -164,17 +164,16 @@ module AWS
|
|
164
164
|
# attribute is a number, the original value is incremented by
|
165
165
|
# the numeric value provided to this method. For example:
|
166
166
|
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
# # "age" => 4 }
|
167
|
+
# item = table.items.put(
|
168
|
+
# :id => "abc123",
|
169
|
+
# :colors => ["red", "white"],
|
170
|
+
# :age => 3
|
171
|
+
# )
|
172
|
+
# item.attributes.add(
|
173
|
+
# { :colors => ["muave"],
|
174
|
+
# :age => 1 },
|
175
|
+
# :return => :updated_new
|
176
|
+
# ) # => { "colors" => Set["red", "white", "mauve"], "age" => 4 }
|
178
177
|
#
|
179
178
|
# @param [Hash] attributes The attribute values to add. The
|
180
179
|
# keys of the hash may be strings or symbols. The values may
|
@@ -309,20 +308,20 @@ module AWS
|
|
309
308
|
# sequence, and it also allows you to group different kinds of
|
310
309
|
# updates into an atomic operation.
|
311
310
|
#
|
312
|
-
#
|
311
|
+
# item.attributes.update do |u|
|
313
312
|
#
|
314
|
-
#
|
315
|
-
#
|
313
|
+
# # add 12 to the (numeric) value of "views"
|
314
|
+
# u.add(:views => 12)
|
316
315
|
#
|
317
|
-
#
|
318
|
-
#
|
316
|
+
# # delete attributes
|
317
|
+
# u.delete(:foo, :bar)
|
319
318
|
#
|
320
|
-
#
|
321
|
-
#
|
319
|
+
# # delete values out of a set attribute
|
320
|
+
# u.delete(:colors => ["red", "blue"])
|
322
321
|
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
#
|
322
|
+
# # replace values
|
323
|
+
# u.set(:title => "More Automobiles")
|
324
|
+
# end
|
326
325
|
#
|
327
326
|
# @param [Hash] options Options for updating the item.
|
328
327
|
#
|
@@ -330,47 +329,43 @@ module AWS
|
|
330
329
|
# The operation will fail unless the item exists and has the
|
331
330
|
# attributes in the value for this option. For example:
|
332
331
|
#
|
333
|
-
#
|
334
|
-
#
|
335
|
-
#
|
336
|
-
#
|
337
|
-
#
|
332
|
+
# # throws DynamoDB::Errors::ConditionalCheckFailedException
|
333
|
+
# # unless the item has "color" set to "red"
|
334
|
+
# item.attributes.update(:if => { :color => "red" }) do |u|
|
335
|
+
# # ...
|
336
|
+
# end
|
338
337
|
#
|
339
338
|
# @option options [String, Symbol, Array] :unless_exists A name
|
340
339
|
# or collection of attribute names; if the item already exists
|
341
340
|
# and has a value for any of these attributes, this method
|
342
341
|
# will raise
|
343
|
-
#
|
342
|
+
# `DynamoDB::Errors::ConditionalCheckFailedException`. For example:
|
344
343
|
#
|
345
|
-
#
|
346
|
-
#
|
347
|
-
#
|
344
|
+
# item.attributes.update(:unless_exists => :color) do |u|
|
345
|
+
# # ...
|
346
|
+
# end
|
348
347
|
#
|
349
|
-
# @option options [Symbol] :return (
|
348
|
+
# @option options [Symbol] :return (`:none`) Changes the return
|
350
349
|
# value of the method. Valid values:
|
351
350
|
#
|
352
|
-
#
|
353
|
-
#
|
354
|
-
#
|
355
|
-
#
|
356
|
-
#
|
357
|
-
#
|
358
|
-
#
|
359
|
-
#
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
366
|
-
#
|
367
|
-
#
|
368
|
-
#
|
369
|
-
#
|
370
|
-
# were deleted.
|
371
|
-
#
|
372
|
-
# [+:all_new+] Returns a hash containing the new values of all
|
373
|
-
# of the attributes.
|
351
|
+
# * `:none` - Return `nil`
|
352
|
+
# * `:all_old` - Returns a hash containing all of the original
|
353
|
+
# values of the attributes before the update, or
|
354
|
+
# `nil` if the item did not exist at the time of
|
355
|
+
# the update.
|
356
|
+
# * `:updated_old` - Returns a hash containing the original
|
357
|
+
# values of the attributes that were modified
|
358
|
+
# as part of this operation. This includes
|
359
|
+
# attributes that were deleted, and
|
360
|
+
# set-valued attributes whose member values
|
361
|
+
# were deleted.
|
362
|
+
# * `:updated_new` - Returns a hash containing the new values of
|
363
|
+
# the attributes that were modified as part
|
364
|
+
# of this operation. This includes
|
365
|
+
# set-valued attributes whose member values
|
366
|
+
# were deleted.
|
367
|
+
# * `:all_new` - Returns a hash containing the new values of all
|
368
|
+
# of the attributes.
|
374
369
|
#
|
375
370
|
# @yieldparam [UpdateBuilder] builder A handle for describing
|
376
371
|
# the update.
|
@@ -379,7 +374,7 @@ module AWS
|
|
379
374
|
# single operation. This method will raise an ArgumentError
|
380
375
|
# if multiple updates are described for a single attribute.
|
381
376
|
#
|
382
|
-
# @return [nil] See the documentation for the
|
377
|
+
# @return [nil] See the documentation for the `:return` option
|
383
378
|
# above.
|
384
379
|
def update(options = {})
|
385
380
|
builder = UpdateBuilder.new
|
@@ -393,7 +388,7 @@ module AWS
|
|
393
388
|
# @param [Array<String, Symbol>] attributes The names of the
|
394
389
|
# attributes to retrieve. The last argument may be a hash of
|
395
390
|
# options for retrieving attributes from the item. Currently
|
396
|
-
# the only supported option is
|
391
|
+
# the only supported option is `:consistent_read`; If set to
|
397
392
|
# true, then a consistent read is issued, otherwise an
|
398
393
|
# eventually consistent read is used.
|
399
394
|
#
|
@@ -401,7 +396,7 @@ module AWS
|
|
401
396
|
# value of the attribute at that index in the argument list.
|
402
397
|
# Values may be Strings, BigDecimals, Sets of Strings or Sets
|
403
398
|
# or BigDecimals. If a requested attribute does not exist,
|
404
|
-
# the corresponding member of the output array will be
|
399
|
+
# the corresponding member of the output array will be `nil`.
|
405
400
|
def values_at(*attributes)
|
406
401
|
options = {}
|
407
402
|
options = attributes.pop if attributes.last.kind_of?(Hash)
|
@@ -38,33 +38,33 @@ module AWS
|
|
38
38
|
#
|
39
39
|
# @param [Symbol, String, Array<String>] attributes The list of attributes
|
40
40
|
# to fetch. If you want to load *ALL* attributes for the named items,
|
41
|
-
# then pass the symbol
|
41
|
+
# then pass the symbol `:all`.
|
42
42
|
#
|
43
|
-
#
|
44
|
-
#
|
43
|
+
# # get all attributes
|
44
|
+
# batch_get.table('mytable', :all, items)
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
46
|
+
# # get one attribute for each item
|
47
|
+
# batch_get.table('mytable', ['name'], items)
|
48
48
|
#
|
49
|
-
#
|
50
|
-
#
|
49
|
+
# # get a list of attributes for each item
|
50
|
+
# batch_get.table('mytable', ['name', 'size'], items)
|
51
51
|
#
|
52
52
|
# @param [Array<Item,Array>] items One or more items to fetch attributes
|
53
53
|
# for. Each attribute should be one of the following:
|
54
54
|
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
55
|
+
# * an {Item} object
|
56
|
+
# * a hash key value
|
57
|
+
# * a hash key value and a range key value
|
58
58
|
#
|
59
59
|
# You must provide both the hash key and range key values if the table
|
60
60
|
# schema has both.
|
61
61
|
#
|
62
|
-
#
|
62
|
+
# batch_get.table('mytable', :all, [%w(hk1 rk1), %w(hk1 rk2), ...])
|
63
63
|
#
|
64
64
|
# @param [Hash] options
|
65
65
|
#
|
66
|
-
# @option options [Boolean] :consistent_read (false) When
|
67
|
-
# are read from this table with consistent reads. When
|
66
|
+
# @option options [Boolean] :consistent_read (false) When `true`, items
|
67
|
+
# are read from this table with consistent reads. When `false`, reads
|
68
68
|
# are eventually consistent.
|
69
69
|
#
|
70
70
|
# @return [nil]
|
@@ -88,8 +88,8 @@ module AWS
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
|
92
|
-
|
91
|
+
# ensure we don't receive 2 different lists of attributes for
|
92
|
+
# the same table
|
93
93
|
|
94
94
|
if
|
95
95
|
@request_items.has_key?(table) and
|
@@ -101,7 +101,7 @@ module AWS
|
|
101
101
|
raise ArgumentError, msg
|
102
102
|
end
|
103
103
|
|
104
|
-
|
104
|
+
# merge attributes and items with the request items
|
105
105
|
|
106
106
|
@request_items[table] ||= { :keys => [] }
|
107
107
|
@request_items[table][:attributes_to_get] = attributes if attributes
|
@@ -118,16 +118,16 @@ module AWS
|
|
118
118
|
#
|
119
119
|
# @param [Symbol, String, Array<String>] attributes The list of attributes
|
120
120
|
# to fetch. If you want to load *ALL* attributes for the named items,
|
121
|
-
# then pass the symbol
|
121
|
+
# then pass the symbol `:all`.
|
122
122
|
#
|
123
|
-
#
|
124
|
-
#
|
123
|
+
# # get all attributes
|
124
|
+
# batch_get.table('mytable', :all, items)
|
125
125
|
#
|
126
|
-
#
|
127
|
-
#
|
126
|
+
# # get one attribute for each item
|
127
|
+
# batch_get.table('mytable', ['name'], items)
|
128
128
|
#
|
129
|
-
#
|
130
|
-
#
|
129
|
+
# # get a list of attributes for each item
|
130
|
+
# batch_get.table('mytable', ['name', 'size'], items)
|
131
131
|
#
|
132
132
|
# @param [Item] items One or more {Item} objects to fetch attributes
|
133
133
|
# for. These items may come from any number of different tables.
|
@@ -25,25 +25,25 @@ module AWS
|
|
25
25
|
|
26
26
|
# Adds one or more items to the batch write operation.
|
27
27
|
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
28
|
+
# # adding one item at a time to the batch
|
29
|
+
# batch = AWS::DynamoDB::BatchWrite.new
|
30
|
+
# batch.put('table-name', :id => 'id1', :color => 'red')
|
31
|
+
# batch.put('table-name', :id => 'id2', :color => 'blue')
|
32
|
+
# batch.process!
|
33
|
+
#
|
34
|
+
# # adding multiple items to a batch
|
35
|
+
# batch = AWS::DynamoDB::BatchWrite.new
|
36
|
+
# batch.put('table-name', [
|
37
|
+
# { :id => 'id1', :color => 'red' },
|
38
|
+
# { :id => 'id2', :color => 'blue' },
|
39
|
+
# { :id => 'id3', :color => 'green' },
|
40
|
+
# ])
|
41
|
+
# batch.process!
|
42
42
|
#
|
43
43
|
# @param [Table,String] table A {Table} object or table name string.
|
44
44
|
#
|
45
45
|
# @param [Array<Hash>] items A list of item attributes to put.
|
46
|
-
# The hash must contain the table hash key element and range key
|
46
|
+
# The hash must contain the table hash key element and range key
|
47
47
|
# element (if one is defined).
|
48
48
|
#
|
49
49
|
# @return [nil]
|
@@ -55,28 +55,28 @@ module AWS
|
|
55
55
|
|
56
56
|
# Adds one or more items to the batch to delete.
|
57
57
|
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
58
|
+
# # for a table w/out a range key
|
59
|
+
# batch = AWS::DynamoDB::BatchWrite.new
|
60
|
+
# batch.delete('table-name', %w(hk1 hk2))
|
61
|
+
# batch.process!
|
62
62
|
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
63
|
+
# # for a table with a range key
|
64
|
+
# batch = AWS::DynamoDB::BatchWrite.new
|
65
|
+
# batch.delete('table-name', [['hk1', 'rk2'], ['hk1', 'rk2']]])
|
66
|
+
# batch.process!
|
67
67
|
#
|
68
68
|
# @param [Table,String] table A {Table} object or table name string.
|
69
69
|
#
|
70
|
-
# @param [Array<String>,Array<Array>] items A list of item keys to
|
70
|
+
# @param [Array<String>,Array<Array>] items A list of item keys to
|
71
71
|
# delete. For tables without a range key, items should be an array
|
72
72
|
# of hash key strings.
|
73
73
|
#
|
74
|
-
#
|
74
|
+
# batch.delete('table-name', ['hk1', 'hk2', 'hk3'])
|
75
75
|
#
|
76
|
-
# For tables with a range key, items should be an array of
|
76
|
+
# For tables with a range key, items should be an array of
|
77
77
|
# hash key and range key pairs.
|
78
78
|
#
|
79
|
-
#
|
79
|
+
# batch.delete('table-name', [['hk1', 'rk1'], ['hk1', 'rk2']])
|
80
80
|
#
|
81
81
|
# @return [nil]
|
82
82
|
#
|
@@ -95,27 +95,27 @@ module AWS
|
|
95
95
|
# @option options [Array<Hash>] :put An array of items to put. Each item
|
96
96
|
# should be an array of attribute hashes.
|
97
97
|
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
98
|
+
# # add 3 items to the batch
|
99
|
+
# batch.write(table, :put => [
|
100
|
+
# { :id => 'abc', :color => 'red', :count => 2 },
|
101
|
+
# { :id => 'mno', :color => 'blue', :count => 3 },
|
102
|
+
# { :id => 'xyz', :color => 'green', :count => 5 },
|
103
|
+
# ])
|
104
104
|
#
|
105
105
|
# @option options [Array<String>,Array<Array>] :delete A list of item keys
|
106
106
|
# to delete. For tables without a range key, items should be an array
|
107
107
|
# of hash key strings.
|
108
108
|
#
|
109
|
-
#
|
109
|
+
# batch.write('table-name', :delete => ['hk1', 'hk2', 'hk3'])
|
110
110
|
#
|
111
|
-
# For tables with a range key, items should be an array of
|
111
|
+
# For tables with a range key, items should be an array of
|
112
112
|
# hash key and range key pairs.
|
113
113
|
#
|
114
|
-
#
|
114
|
+
# batch.write('table-name', :delete => [['hk1', 'rk1'], ['hk1', 'rk2']])
|
115
115
|
#
|
116
116
|
def write table, options = {}
|
117
117
|
|
118
|
-
items = table_items(table)
|
118
|
+
items = table_items(table)
|
119
119
|
|
120
120
|
if put = options[:put]
|
121
121
|
put.each do |attributes|
|
@@ -198,7 +198,7 @@ module AWS
|
|
198
198
|
|
199
199
|
item = request.values.first
|
200
200
|
|
201
|
-
request_items[table] <<
|
201
|
+
request_items[table] <<
|
202
202
|
case request.keys.first
|
203
203
|
when 'PutRequest' then convert_put_item(item['Item'])
|
204
204
|
when 'DeleteRequest' then convert_delete_item(item['Key'])
|
@@ -213,13 +213,13 @@ module AWS
|
|
213
213
|
end
|
214
214
|
|
215
215
|
def convert_put_item item
|
216
|
-
|
216
|
+
|
217
217
|
attributes = {}
|
218
218
|
item.each_pair do |name,value|
|
219
219
|
attributes[name] = str2sym(value)
|
220
220
|
end
|
221
|
-
|
222
|
-
{ :put_request => { :item => attributes }}
|
221
|
+
|
222
|
+
{ :put_request => { :item => attributes }}
|
223
223
|
|
224
224
|
end
|
225
225
|
|
@@ -227,7 +227,7 @@ module AWS
|
|
227
227
|
|
228
228
|
key = {}
|
229
229
|
key[:hash_key_element] = str2sym(item['HashKeyElement'])
|
230
|
-
key[:range_key_element] = str2sym(item['RangeKeyElement']) if
|
230
|
+
key[:range_key_element] = str2sym(item['RangeKeyElement']) if
|
231
231
|
item['RangeKeyElement']
|
232
232
|
|
233
233
|
{ :delete_request => { :key => key}}
|
@@ -242,7 +242,7 @@ module AWS
|
|
242
242
|
when "N" then { :n => value }
|
243
243
|
when "SS" then { :ss => value }
|
244
244
|
when "NS" then { :ns => value }
|
245
|
-
else
|
245
|
+
else
|
246
246
|
raise "unhandled key type: #{type.inspect}"
|
247
247
|
end
|
248
248
|
end
|
data/lib/aws/dynamo_db/binary.rb
CHANGED
@@ -18,16 +18,16 @@ module AWS
|
|
18
18
|
# to store as a binary attribute. This can reduce the size
|
19
19
|
# of larger attributes to save on storage costs.
|
20
20
|
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
21
|
+
# table = AWS::DynamoDB.new.tables['data-table']
|
22
|
+
# table.hash_key = { 'id' => :string }
|
23
|
+
# table.range_key = { 'position' => :number }
|
24
24
|
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
25
|
+
# # put an item with a binary data attribute
|
26
|
+
# table.items.create(
|
27
|
+
# 'id' => 'abc',
|
28
|
+
# 'position' => 5,
|
29
|
+
# 'data' => AWS::DynamoDB::Binary.new('abc')
|
30
|
+
# )
|
31
31
|
#
|
32
32
|
class Binary < String; end
|
33
33
|
|
data/lib/aws/dynamo_db/client.rb
CHANGED
@@ -11,487 +11,497 @@
|
|
11
11
|
# ANY KIND, either express or implied. See the License for the specific
|
12
12
|
# language governing permissions and limitations under the License.
|
13
13
|
|
14
|
-
require 'zlib'
|
15
|
-
|
16
14
|
module AWS
|
17
15
|
class DynamoDB
|
18
16
|
|
19
17
|
# Client class for Amazon DynamoDB.
|
20
|
-
class Client <
|
21
|
-
|
22
|
-
# @private
|
23
|
-
REGION_US_E1 = 'dynamodb.us-east-1.amazonaws.com'
|
24
|
-
|
25
|
-
# @private
|
26
|
-
CACHEABLE_REQUESTS = Set[:list_tables, :describe_table]
|
18
|
+
class Client < ClientBase
|
27
19
|
|
28
20
|
# client methods #
|
29
21
|
|
30
22
|
# @!method batch_get_item(options = {})
|
31
23
|
# Calls the BatchGetItem API operation.
|
32
24
|
# @param [Hash] options
|
33
|
-
# *
|
34
|
-
# *
|
35
|
-
# *
|
25
|
+
# * `:request_items` - *required* - (Hash<String,Hash>)
|
26
|
+
# * `:keys` - *required* - (Array<Hash>)
|
27
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element is
|
36
28
|
# treated as the primary key, and can be a string or a number.
|
37
29
|
# Single attribute primary keys have one index value. The value
|
38
30
|
# can be String, Number, StringSet, NumberSet.
|
39
|
-
# *
|
31
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary
|
40
32
|
# encoding. The maximum size is limited by the size of the
|
41
33
|
# primary key (1024 bytes as a range part of a key or 2048
|
42
34
|
# bytes as a single part hash key) or the item size (64k).
|
43
|
-
# *
|
35
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
44
36
|
# decimals and integers. A number can have up to 38 digits
|
45
37
|
# precision and can be between 10^-128 to 10^+126.
|
46
|
-
# *
|
38
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
47
39
|
# bytes.
|
48
|
-
# *
|
49
|
-
# *
|
50
|
-
# *
|
51
|
-
# *
|
40
|
+
# * `:ss` - (Array<String>) A set of strings.
|
41
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
42
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
43
|
+
# * `:range_key_element` - (Hash) A range key element is treated as
|
52
44
|
# a secondary key (used in conjunction with the primary key), and
|
53
45
|
# can be a string or a number, and is only used for
|
54
46
|
# hash-and-range primary keys. The value can be String, Number,
|
55
47
|
# StringSet, NumberSet.
|
56
|
-
# *
|
48
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary
|
57
49
|
# encoding. The maximum size is limited by the size of the
|
58
50
|
# primary key (1024 bytes as a range part of a key or 2048
|
59
51
|
# bytes as a single part hash key) or the item size (64k).
|
60
|
-
# *
|
52
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
61
53
|
# decimals and integers. A number can have up to 38 digits
|
62
54
|
# precision and can be between 10^-128 to 10^+126.
|
63
|
-
# *
|
55
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
64
56
|
# bytes.
|
65
|
-
# *
|
66
|
-
# *
|
67
|
-
# *
|
68
|
-
# *
|
69
|
-
# *
|
57
|
+
# * `:ss` - (Array<String>) A set of strings.
|
58
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
59
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
60
|
+
# * `:attributes_to_get` - (Array<String>)
|
61
|
+
# * `:consistent_read` - (Boolean)
|
70
62
|
# @return [Core::Response]
|
71
63
|
# The #data method of the response object returns
|
72
64
|
# a hash with the following structure:
|
73
|
-
# *
|
74
|
-
# *
|
75
|
-
# *
|
76
|
-
# *
|
77
|
-
# *
|
78
|
-
# *
|
79
|
-
# *
|
80
|
-
# *
|
81
|
-
# *
|
82
|
-
# *
|
83
|
-
# *
|
84
|
-
# *
|
85
|
-
# *
|
86
|
-
# *
|
87
|
-
# *
|
88
|
-
# *
|
89
|
-
# *
|
90
|
-
# *
|
91
|
-
# *
|
92
|
-
# *
|
93
|
-
# *
|
94
|
-
# *
|
95
|
-
# *
|
96
|
-
# *
|
97
|
-
# *
|
98
|
-
# *
|
99
|
-
# *
|
65
|
+
# * `Responses` - (Hash<String,Hash>)
|
66
|
+
# * `member` - (Hash<String,Hash>)
|
67
|
+
# * `S` - (String)
|
68
|
+
# * `N` - (String)
|
69
|
+
# * `B` - (String)
|
70
|
+
# * `SS` - (Array<String>)
|
71
|
+
# * `NS` - (Array<String>)
|
72
|
+
# * `BS` - (Array<Blob>)
|
73
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
74
|
+
# * `UnprocessedKeys` - (Hash<String,Hash>)
|
75
|
+
# * `Keys` - (Array<Hash>)
|
76
|
+
# * `HashKeyElement` - (Hash)
|
77
|
+
# * `S` - (String)
|
78
|
+
# * `N` - (String)
|
79
|
+
# * `B` - (String)
|
80
|
+
# * `SS` - (Array<String>)
|
81
|
+
# * `NS` - (Array<String>)
|
82
|
+
# * `BS` - (Array<Blob>)
|
83
|
+
# * `RangeKeyElement` - (Hash)
|
84
|
+
# * `S` - (String)
|
85
|
+
# * `N` - (String)
|
86
|
+
# * `B` - (String)
|
87
|
+
# * `SS` - (Array<String>)
|
88
|
+
# * `NS` - (Array<String>)
|
89
|
+
# * `BS` - (Array<Blob>)
|
90
|
+
# * `AttributesToGet` - (Array<String>)
|
91
|
+
# * `ConsistentRead` - (Boolean)
|
100
92
|
|
101
93
|
# @!method batch_write_item(options = {})
|
102
94
|
# Calls the BatchWriteItem API operation.
|
103
95
|
# @param [Hash] options
|
104
|
-
# *
|
96
|
+
# * `:request_items` - *required* - (Hash<String,Array<Hash>>) A map of
|
105
97
|
# table name to list-of-write-requests. Used as input to the
|
106
98
|
# BatchWriteItem API call
|
107
|
-
# *
|
108
|
-
# *
|
109
|
-
# *
|
99
|
+
# * `:put_request` - (Hash)
|
100
|
+
# * `:item` - *required* - (Hash<String,Hash>) The item to put
|
101
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary
|
110
102
|
# encoding. The maximum size is limited by the size of the
|
111
103
|
# primary key (1024 bytes as a range part of a key or 2048
|
112
104
|
# bytes as a single part hash key) or the item size (64k).
|
113
|
-
# *
|
105
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
114
106
|
# decimals and integers. A number can have up to 38 digits
|
115
107
|
# precision and can be between 10^-128 to 10^+126.
|
116
|
-
# *
|
108
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
117
109
|
# bytes.
|
118
|
-
# *
|
119
|
-
# *
|
120
|
-
# *
|
121
|
-
# *
|
122
|
-
# *
|
123
|
-
# *
|
110
|
+
# * `:ss` - (Array<String>) A set of strings.
|
111
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
112
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
113
|
+
# * `:delete_request` - (Hash)
|
114
|
+
# * `:key` - *required* - (Hash) The item's key to be delete
|
115
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element
|
124
116
|
# is treated as the primary key, and can be a string or a
|
125
117
|
# number. Single attribute primary keys have one index value.
|
126
118
|
# The value can be String, Number, StringSet, NumberSet.
|
127
|
-
# *
|
119
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary
|
128
120
|
# encoding. The maximum size is limited by the size of the
|
129
121
|
# primary key (1024 bytes as a range part of a key or 2048
|
130
122
|
# bytes as a single part hash key) or the item size (64k).
|
131
|
-
# *
|
123
|
+
# * `:n` - (String) Numbers are positive or negative
|
132
124
|
# exact-value decimals and integers. A number can have up to
|
133
125
|
# 38 digits precision and can be between 10^-128 to 10^+126.
|
134
|
-
# *
|
126
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
135
127
|
# bytes.
|
136
|
-
# *
|
137
|
-
# *
|
138
|
-
# *
|
139
|
-
# *
|
128
|
+
# * `:ss` - (Array<String>) A set of strings.
|
129
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
130
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
131
|
+
# * `:range_key_element` - (Hash) A range key element is treated
|
140
132
|
# as a secondary key (used in conjunction with the primary
|
141
133
|
# key), and can be a string or a number, and is only used for
|
142
134
|
# hash-and-range primary keys. The value can be String, Number,
|
143
135
|
# StringSet, NumberSet.
|
144
|
-
# *
|
136
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary
|
145
137
|
# encoding. The maximum size is limited by the size of the
|
146
138
|
# primary key (1024 bytes as a range part of a key or 2048
|
147
139
|
# bytes as a single part hash key) or the item size (64k).
|
148
|
-
# *
|
140
|
+
# * `:n` - (String) Numbers are positive or negative
|
149
141
|
# exact-value decimals and integers. A number can have up to
|
150
142
|
# 38 digits precision and can be between 10^-128 to 10^+126.
|
151
|
-
# *
|
143
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
152
144
|
# bytes.
|
153
|
-
# *
|
154
|
-
# *
|
155
|
-
# *
|
145
|
+
# * `:ss` - (Array<String>) A set of strings.
|
146
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
147
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
156
148
|
# @return [Core::Response]
|
157
149
|
# The #data method of the response object returns
|
158
150
|
# a hash with the following structure:
|
159
|
-
# *
|
160
|
-
# *
|
161
|
-
# *
|
162
|
-
# *
|
163
|
-
# *
|
164
|
-
# *
|
165
|
-
# *
|
166
|
-
# *
|
167
|
-
# *
|
168
|
-
# *
|
169
|
-
# *
|
170
|
-
# *
|
171
|
-
# *
|
172
|
-
# *
|
173
|
-
# *
|
174
|
-
# *
|
175
|
-
# *
|
176
|
-
# *
|
177
|
-
# *
|
178
|
-
# *
|
179
|
-
# *
|
180
|
-
# *
|
181
|
-
# *
|
182
|
-
# *
|
183
|
-
# *
|
184
|
-
# *
|
185
|
-
# *
|
186
|
-
# *
|
151
|
+
# * `Responses` - (Hash<String,Hash>)
|
152
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
153
|
+
# * `UnprocessedItems` - (Hash<String,Hash>)
|
154
|
+
# * `value` - (Array<Hash>)
|
155
|
+
# * `PutRequest` - (Hash)
|
156
|
+
# * `Item` - (Hash<String,Hash>)
|
157
|
+
# * `S` - (String)
|
158
|
+
# * `N` - (String)
|
159
|
+
# * `B` - (String)
|
160
|
+
# * `SS` - (Array<String>)
|
161
|
+
# * `NS` - (Array<String>)
|
162
|
+
# * `BS` - (Array<Blob>)
|
163
|
+
# * `DeleteRequest` - (Hash)
|
164
|
+
# * `Key` - (Hash)
|
165
|
+
# * `HashKeyElement` - (Hash)
|
166
|
+
# * `S` - (String)
|
167
|
+
# * `N` - (String)
|
168
|
+
# * `B` - (String)
|
169
|
+
# * `SS` - (Array<String>)
|
170
|
+
# * `NS` - (Array<String>)
|
171
|
+
# * `BS` - (Array<Blob>)
|
172
|
+
# * `RangeKeyElement` - (Hash)
|
173
|
+
# * `S` - (String)
|
174
|
+
# * `N` - (String)
|
175
|
+
# * `B` - (String)
|
176
|
+
# * `SS` - (Array<String>)
|
177
|
+
# * `NS` - (Array<String>)
|
178
|
+
# * `BS` - (Array<Blob>)
|
187
179
|
|
188
180
|
# @!method create_table(options = {})
|
189
181
|
# Calls the CreateTable API operation.
|
190
182
|
# @param [Hash] options
|
191
|
-
# *
|
183
|
+
# * `:table_name` - *required* - (String) The name of the table you
|
192
184
|
# want to create. Allowed characters are a-z, A-Z, 0-9, _
|
193
185
|
# (underscore), - (hyphen) and . (period).
|
194
|
-
# *
|
195
|
-
# *
|
186
|
+
# * `:key_schema` - *required* - (Hash)
|
187
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element is
|
196
188
|
# treated as the primary key, and can be a string or a number.
|
197
189
|
# Single attribute primary keys have one index value. The value can
|
198
190
|
# be String, Number, StringSet, NumberSet.
|
199
|
-
# *
|
191
|
+
# * `:attribute_name` - *required* - (String) The AttributeName of
|
200
192
|
# the KeySchemaElement.
|
201
|
-
# *
|
202
|
-
# the KeySchemaElement which can be a String or a Number.
|
203
|
-
#
|
193
|
+
# * `:attribute_type` - *required* - (String) The AttributeType of
|
194
|
+
# the KeySchemaElement which can be a String or a Number. Valid
|
195
|
+
# values include:
|
196
|
+
# * `S`
|
197
|
+
# * `N`
|
198
|
+
# * `B`
|
199
|
+
# * `:range_key_element` - (Hash) A range key element is treated as a
|
204
200
|
# secondary key (used in conjunction with the primary key), and can
|
205
201
|
# be a string or a number, and is only used for hash-and-range
|
206
202
|
# primary keys. The value can be String, Number, StringSet,
|
207
203
|
# NumberSet.
|
208
|
-
# *
|
204
|
+
# * `:attribute_name` - *required* - (String) The AttributeName of
|
209
205
|
# the KeySchemaElement.
|
210
|
-
# *
|
211
|
-
# the KeySchemaElement which can be a String or a Number.
|
212
|
-
#
|
213
|
-
#
|
206
|
+
# * `:attribute_type` - *required* - (String) The AttributeType of
|
207
|
+
# the KeySchemaElement which can be a String or a Number. Valid
|
208
|
+
# values include:
|
209
|
+
# * `S`
|
210
|
+
# * `N`
|
211
|
+
# * `B`
|
212
|
+
# * `:provisioned_throughput` - *required* - (Hash)
|
213
|
+
# * `:read_capacity_units` - *required* - (Integer) ReadCapacityUnits
|
214
214
|
# are in terms of strictly consistent reads, assuming items of 1k.
|
215
215
|
# 2k items require twice the ReadCapacityUnits.
|
216
216
|
# Eventually-consistent reads only require half the
|
217
217
|
# ReadCapacityUnits of stirctly consistent reads.
|
218
|
-
# *
|
218
|
+
# * `:write_capacity_units` - *required* - (Integer)
|
219
219
|
# WriteCapacityUnits are in terms of strictly consistent reads,
|
220
220
|
# assuming items of 1k. 2k items require twice the
|
221
221
|
# WriteCapacityUnits.
|
222
222
|
# @return [Core::Response]
|
223
223
|
# The #data method of the response object returns
|
224
224
|
# a hash with the following structure:
|
225
|
-
# *
|
226
|
-
# *
|
227
|
-
# *
|
228
|
-
# *
|
229
|
-
# *
|
230
|
-
# *
|
231
|
-
# *
|
232
|
-
# *
|
233
|
-
# *
|
234
|
-
# *
|
235
|
-
# *
|
236
|
-
# *
|
237
|
-
# *
|
238
|
-
# *
|
239
|
-
# *
|
240
|
-
# *
|
241
|
-
# *
|
242
|
-
# *
|
225
|
+
# * `TableDescription` - (Hash)
|
226
|
+
# * `TableName` - (String)
|
227
|
+
# * `KeySchema` - (Hash)
|
228
|
+
# * `HashKeyElement` - (Hash)
|
229
|
+
# * `AttributeName` - (String)
|
230
|
+
# * `AttributeType` - (String)
|
231
|
+
# * `RangeKeyElement` - (Hash)
|
232
|
+
# * `AttributeName` - (String)
|
233
|
+
# * `AttributeType` - (String)
|
234
|
+
# * `TableStatus` - (String)
|
235
|
+
# * `CreationDateTime` - (Time)
|
236
|
+
# * `ProvisionedThroughput` - (Hash)
|
237
|
+
# * `LastIncreaseDateTime` - (Time)
|
238
|
+
# * `LastDecreaseDateTime` - (Time)
|
239
|
+
# * `ReadCapacityUnits` - (Integer)
|
240
|
+
# * `WriteCapacityUnits` - (Integer)
|
241
|
+
# * `TableSizeBytes` - (Integer)
|
242
|
+
# * `ItemCount` - (Integer)
|
243
243
|
|
244
244
|
# @!method delete_item(options = {})
|
245
245
|
# Calls the DeleteItem API operation.
|
246
246
|
# @param [Hash] options
|
247
|
-
# *
|
247
|
+
# * `:table_name` - *required* - (String) The name of the table in
|
248
248
|
# which you want to delete an item. Allowed characters are a-z, A-Z,
|
249
249
|
# 0-9, _ (underscore), - (hyphen) and . (period).
|
250
|
-
# *
|
251
|
-
# *
|
250
|
+
# * `:key` - *required* - (Hash)
|
251
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element is
|
252
252
|
# treated as the primary key, and can be a string or a number.
|
253
253
|
# Single attribute primary keys have one index value. The value can
|
254
254
|
# be String, Number, StringSet, NumberSet.
|
255
|
-
# *
|
255
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
256
256
|
# The maximum size is limited by the size of the primary key
|
257
257
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
258
258
|
# part hash key) or the item size (64k).
|
259
|
-
# *
|
259
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
260
260
|
# decimals and integers. A number can have up to 38 digits
|
261
261
|
# precision and can be between 10^-128 to 10^+126.
|
262
|
-
# *
|
262
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
263
263
|
# bytes.
|
264
|
-
# *
|
265
|
-
# *
|
266
|
-
# *
|
267
|
-
# *
|
264
|
+
# * `:ss` - (Array<String>) A set of strings.
|
265
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
266
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
267
|
+
# * `:range_key_element` - (Hash) A range key element is treated as a
|
268
268
|
# secondary key (used in conjunction with the primary key), and can
|
269
269
|
# be a string or a number, and is only used for hash-and-range
|
270
270
|
# primary keys. The value can be String, Number, StringSet,
|
271
271
|
# NumberSet.
|
272
|
-
# *
|
272
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
273
273
|
# The maximum size is limited by the size of the primary key
|
274
274
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
275
275
|
# part hash key) or the item size (64k).
|
276
|
-
# *
|
276
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
277
277
|
# decimals and integers. A number can have up to 38 digits
|
278
278
|
# precision and can be between 10^-128 to 10^+126.
|
279
|
-
# *
|
279
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
280
280
|
# bytes.
|
281
|
-
# *
|
282
|
-
# *
|
283
|
-
# *
|
284
|
-
# *
|
285
|
-
# *
|
281
|
+
# * `:ss` - (Array<String>) A set of strings.
|
282
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
283
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
284
|
+
# * `:expected` - (Hash<String,Hash>)
|
285
|
+
# * `:value` - (Hash) Specify whether or not a value already exists
|
286
286
|
# and has a specific content for the attribute name-value pair.
|
287
|
-
# *
|
287
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
288
288
|
# The maximum size is limited by the size of the primary key
|
289
289
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
290
290
|
# part hash key) or the item size (64k).
|
291
|
-
# *
|
291
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
292
292
|
# decimals and integers. A number can have up to 38 digits
|
293
293
|
# precision and can be between 10^-128 to 10^+126.
|
294
|
-
# *
|
294
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
295
295
|
# bytes.
|
296
|
-
# *
|
297
|
-
# *
|
298
|
-
# *
|
299
|
-
# *
|
296
|
+
# * `:ss` - (Array<String>) A set of strings.
|
297
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
298
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
299
|
+
# * `:exists` - (Boolean) Specify whether or not a value already
|
300
300
|
# exists for the attribute name-value pair.
|
301
|
-
# *
|
301
|
+
# * `:return_values` - (String) Valid values include:
|
302
|
+
# * `NONE`
|
303
|
+
# * `ALL_OLD`
|
304
|
+
# * `UPDATED_OLD`
|
305
|
+
# * `ALL_NEW`
|
306
|
+
# * `UPDATED_NEW`
|
302
307
|
# @return [Core::Response]
|
303
308
|
# The #data method of the response object returns
|
304
309
|
# a hash with the following structure:
|
305
|
-
# *
|
306
|
-
# *
|
307
|
-
# *
|
308
|
-
# *
|
309
|
-
# *
|
310
|
-
# *
|
311
|
-
# *
|
312
|
-
# *
|
310
|
+
# * `Attributes` - (Hash<String,Hash>)
|
311
|
+
# * `S` - (String)
|
312
|
+
# * `N` - (String)
|
313
|
+
# * `B` - (String)
|
314
|
+
# * `SS` - (Array<String>)
|
315
|
+
# * `NS` - (Array<String>)
|
316
|
+
# * `BS` - (Array<Blob>)
|
317
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
313
318
|
|
314
319
|
# @!method delete_table(options = {})
|
315
320
|
# Calls the DeleteTable API operation.
|
316
321
|
# @param [Hash] options
|
317
|
-
# *
|
322
|
+
# * `:table_name` - *required* - (String) The name of the table you
|
318
323
|
# want to delete. Allowed characters are a-z, A-Z, 0-9, _
|
319
324
|
# (underscore), - (hyphen) and . (period).
|
320
325
|
# @return [Core::Response]
|
321
326
|
# The #data method of the response object returns
|
322
327
|
# a hash with the following structure:
|
323
|
-
# *
|
324
|
-
# *
|
325
|
-
# *
|
326
|
-
# *
|
327
|
-
# *
|
328
|
-
# *
|
329
|
-
# *
|
330
|
-
# *
|
331
|
-
# *
|
332
|
-
# *
|
333
|
-
# *
|
334
|
-
# *
|
335
|
-
# *
|
336
|
-
# *
|
337
|
-
# *
|
338
|
-
# *
|
339
|
-
# *
|
340
|
-
# *
|
328
|
+
# * `TableDescription` - (Hash)
|
329
|
+
# * `TableName` - (String)
|
330
|
+
# * `KeySchema` - (Hash)
|
331
|
+
# * `HashKeyElement` - (Hash)
|
332
|
+
# * `AttributeName` - (String)
|
333
|
+
# * `AttributeType` - (String)
|
334
|
+
# * `RangeKeyElement` - (Hash)
|
335
|
+
# * `AttributeName` - (String)
|
336
|
+
# * `AttributeType` - (String)
|
337
|
+
# * `TableStatus` - (String)
|
338
|
+
# * `CreationDateTime` - (Time)
|
339
|
+
# * `ProvisionedThroughput` - (Hash)
|
340
|
+
# * `LastIncreaseDateTime` - (Time)
|
341
|
+
# * `LastDecreaseDateTime` - (Time)
|
342
|
+
# * `ReadCapacityUnits` - (Integer)
|
343
|
+
# * `WriteCapacityUnits` - (Integer)
|
344
|
+
# * `TableSizeBytes` - (Integer)
|
345
|
+
# * `ItemCount` - (Integer)
|
341
346
|
|
342
347
|
# @!method describe_table(options = {})
|
343
348
|
# Calls the DescribeTable API operation.
|
344
349
|
# @param [Hash] options
|
345
|
-
# *
|
350
|
+
# * `:table_name` - *required* - (String) The name of the table you
|
346
351
|
# want to describe. Allowed characters are a-z, A-Z, 0-9, _
|
347
352
|
# (underscore), - (hyphen) and . (period).
|
348
353
|
# @return [Core::Response]
|
349
354
|
# The #data method of the response object returns
|
350
355
|
# a hash with the following structure:
|
351
|
-
# *
|
352
|
-
# *
|
353
|
-
# *
|
354
|
-
# *
|
355
|
-
# *
|
356
|
-
# *
|
357
|
-
# *
|
358
|
-
# *
|
359
|
-
# *
|
360
|
-
# *
|
361
|
-
# *
|
362
|
-
# *
|
363
|
-
# *
|
364
|
-
# *
|
365
|
-
# *
|
366
|
-
# *
|
367
|
-
# *
|
368
|
-
# *
|
356
|
+
# * `Table` - (Hash)
|
357
|
+
# * `TableName` - (String)
|
358
|
+
# * `KeySchema` - (Hash)
|
359
|
+
# * `HashKeyElement` - (Hash)
|
360
|
+
# * `AttributeName` - (String)
|
361
|
+
# * `AttributeType` - (String)
|
362
|
+
# * `RangeKeyElement` - (Hash)
|
363
|
+
# * `AttributeName` - (String)
|
364
|
+
# * `AttributeType` - (String)
|
365
|
+
# * `TableStatus` - (String)
|
366
|
+
# * `CreationDateTime` - (Time)
|
367
|
+
# * `ProvisionedThroughput` - (Hash)
|
368
|
+
# * `LastIncreaseDateTime` - (Time)
|
369
|
+
# * `LastDecreaseDateTime` - (Time)
|
370
|
+
# * `ReadCapacityUnits` - (Integer)
|
371
|
+
# * `WriteCapacityUnits` - (Integer)
|
372
|
+
# * `TableSizeBytes` - (Integer)
|
373
|
+
# * `ItemCount` - (Integer)
|
369
374
|
|
370
375
|
# @!method get_item(options = {})
|
371
376
|
# Calls the GetItem API operation.
|
372
377
|
# @param [Hash] options
|
373
|
-
# *
|
378
|
+
# * `:table_name` - *required* - (String) The name of the table in
|
374
379
|
# which you want to get an item. Allowed characters are a-z, A-Z,
|
375
380
|
# 0-9, _ (underscore), - (hyphen) and . (period).
|
376
|
-
# *
|
377
|
-
# *
|
381
|
+
# * `:key` - *required* - (Hash)
|
382
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element is
|
378
383
|
# treated as the primary key, and can be a string or a number.
|
379
384
|
# Single attribute primary keys have one index value. The value can
|
380
385
|
# be String, Number, StringSet, NumberSet.
|
381
|
-
# *
|
386
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
382
387
|
# The maximum size is limited by the size of the primary key
|
383
388
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
384
389
|
# part hash key) or the item size (64k).
|
385
|
-
# *
|
390
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
386
391
|
# decimals and integers. A number can have up to 38 digits
|
387
392
|
# precision and can be between 10^-128 to 10^+126.
|
388
|
-
# *
|
393
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
389
394
|
# bytes.
|
390
|
-
# *
|
391
|
-
# *
|
392
|
-
# *
|
393
|
-
# *
|
395
|
+
# * `:ss` - (Array<String>) A set of strings.
|
396
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
397
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
398
|
+
# * `:range_key_element` - (Hash) A range key element is treated as a
|
394
399
|
# secondary key (used in conjunction with the primary key), and can
|
395
400
|
# be a string or a number, and is only used for hash-and-range
|
396
401
|
# primary keys. The value can be String, Number, StringSet,
|
397
402
|
# NumberSet.
|
398
|
-
# *
|
403
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
399
404
|
# The maximum size is limited by the size of the primary key
|
400
405
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
401
406
|
# part hash key) or the item size (64k).
|
402
|
-
# *
|
407
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
403
408
|
# decimals and integers. A number can have up to 38 digits
|
404
409
|
# precision and can be between 10^-128 to 10^+126.
|
405
|
-
# *
|
410
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
406
411
|
# bytes.
|
407
|
-
# *
|
408
|
-
# *
|
409
|
-
# *
|
410
|
-
# *
|
411
|
-
# *
|
412
|
+
# * `:ss` - (Array<String>) A set of strings.
|
413
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
414
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
415
|
+
# * `:attributes_to_get` - (Array<String>)
|
416
|
+
# * `:consistent_read` - (Boolean)
|
412
417
|
# @return [Core::Response]
|
413
418
|
# The #data method of the response object returns
|
414
419
|
# a hash with the following structure:
|
415
|
-
# *
|
416
|
-
# *
|
417
|
-
# *
|
418
|
-
# *
|
419
|
-
# *
|
420
|
-
# *
|
421
|
-
# *
|
422
|
-
# *
|
420
|
+
# * `Item` - (Hash<String,Hash>)
|
421
|
+
# * `S` - (String)
|
422
|
+
# * `N` - (String)
|
423
|
+
# * `B` - (String)
|
424
|
+
# * `SS` - (Array<String>)
|
425
|
+
# * `NS` - (Array<String>)
|
426
|
+
# * `BS` - (Array<Blob>)
|
427
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
423
428
|
|
424
429
|
# @!method list_tables(options = {})
|
425
430
|
# Calls the ListTables API operation.
|
426
431
|
# @param [Hash] options
|
427
|
-
# *
|
432
|
+
# * `:exclusive_start_table_name` - (String) The name of the table that
|
428
433
|
# starts the list. If you already ran a ListTables operation and
|
429
434
|
# recieved a LastEvaluatedTableName value in the response, use that
|
430
435
|
# value here to continue the list.
|
431
|
-
# *
|
436
|
+
# * `:limit` - (Integer)
|
432
437
|
# @return [Core::Response]
|
433
438
|
# The #data method of the response object returns
|
434
439
|
# a hash with the following structure:
|
435
|
-
# *
|
436
|
-
# *
|
440
|
+
# * `TableNames` - (Array<String>)
|
441
|
+
# * `LastEvaluatedTableName` - (String)
|
437
442
|
|
438
443
|
# @!method put_item(options = {})
|
439
444
|
# Calls the PutItem API operation.
|
440
445
|
# @param [Hash] options
|
441
|
-
# *
|
446
|
+
# * `:table_name` - *required* - (String) The name of the table in
|
442
447
|
# which you want to put an item. Allowed characters are a-z, A-Z,
|
443
448
|
# 0-9, _ (underscore), - (hyphen) and . (period).
|
444
|
-
# *
|
445
|
-
# *
|
449
|
+
# * `:item` - *required* - (Hash<String,Hash>)
|
450
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
446
451
|
# The maximum size is limited by the size of the primary key (1024
|
447
452
|
# bytes as a range part of a key or 2048 bytes as a single part
|
448
453
|
# hash key) or the item size (64k).
|
449
|
-
# *
|
454
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
450
455
|
# decimals and integers. A number can have up to 38 digits
|
451
456
|
# precision and can be between 10^-128 to 10^+126.
|
452
|
-
# *
|
457
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
453
458
|
# bytes.
|
454
|
-
# *
|
455
|
-
# *
|
456
|
-
# *
|
457
|
-
# *
|
458
|
-
# *
|
459
|
+
# * `:ss` - (Array<String>) A set of strings.
|
460
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
461
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
462
|
+
# * `:expected` - (Hash<String,Hash>)
|
463
|
+
# * `:value` - (Hash) Specify whether or not a value already exists
|
459
464
|
# and has a specific content for the attribute name-value pair.
|
460
|
-
# *
|
465
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
461
466
|
# The maximum size is limited by the size of the primary key
|
462
467
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
463
468
|
# part hash key) or the item size (64k).
|
464
|
-
# *
|
469
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
465
470
|
# decimals and integers. A number can have up to 38 digits
|
466
471
|
# precision and can be between 10^-128 to 10^+126.
|
467
|
-
# *
|
472
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
468
473
|
# bytes.
|
469
|
-
# *
|
470
|
-
# *
|
471
|
-
# *
|
472
|
-
# *
|
474
|
+
# * `:ss` - (Array<String>) A set of strings.
|
475
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
476
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
477
|
+
# * `:exists` - (Boolean) Specify whether or not a value already
|
473
478
|
# exists for the attribute name-value pair.
|
474
|
-
# *
|
479
|
+
# * `:return_values` - (String) Valid values include:
|
480
|
+
# * `NONE`
|
481
|
+
# * `ALL_OLD`
|
482
|
+
# * `UPDATED_OLD`
|
483
|
+
# * `ALL_NEW`
|
484
|
+
# * `UPDATED_NEW`
|
475
485
|
# @return [Core::Response]
|
476
486
|
# The #data method of the response object returns
|
477
487
|
# a hash with the following structure:
|
478
|
-
# *
|
479
|
-
# *
|
480
|
-
# *
|
481
|
-
# *
|
482
|
-
# *
|
483
|
-
# *
|
484
|
-
# *
|
485
|
-
# *
|
488
|
+
# * `Attributes` - (Hash<String,Hash>)
|
489
|
+
# * `S` - (String)
|
490
|
+
# * `N` - (String)
|
491
|
+
# * `B` - (String)
|
492
|
+
# * `SS` - (Array<String>)
|
493
|
+
# * `NS` - (Array<String>)
|
494
|
+
# * `BS` - (Array<Blob>)
|
495
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
486
496
|
|
487
497
|
# @!method query(options = {})
|
488
498
|
# Calls the Query API operation.
|
489
499
|
# @param [Hash] options
|
490
|
-
# *
|
500
|
+
# * `:table_name` - *required* - (String) The name of the table in
|
491
501
|
# which you want to query. Allowed characters are a-z, A-Z, 0-9, _
|
492
502
|
# (underscore), - (hyphen) and . (period).
|
493
|
-
# *
|
494
|
-
# *
|
503
|
+
# * `:attributes_to_get` - (Array<String>)
|
504
|
+
# * `:limit` - (Integer) The maximum number of items to return. If
|
495
505
|
# Amazon DynamoDB hits this limit while querying the table, it stops
|
496
506
|
# the query and returns the matching values up to the limit, and a
|
497
507
|
# LastEvaluatedKey to apply in a subsequent operation to continue the
|
@@ -499,122 +509,136 @@ module AWS
|
|
499
509
|
# DynamoDB hits this limit, it stops the query and returns the
|
500
510
|
# matching values, and a LastEvaluatedKey to apply in a subsequent
|
501
511
|
# operation to continue the query.
|
502
|
-
# *
|
503
|
-
# *
|
512
|
+
# * `:consistent_read` - (Boolean)
|
513
|
+
# * `:count` - (Boolean) If set to `true` , Amazon DynamoDB returns a
|
504
514
|
# total number of items that match the query parameters, instead of a
|
505
515
|
# list of the matching items and their attributes. Do not set Count
|
506
|
-
# to
|
516
|
+
# to `true` while providing a list of AttributesToGet, otherwise
|
507
517
|
# Amazon DynamoDB returns a validation error.
|
508
|
-
# *
|
518
|
+
# * `:hash_key_value` - *required* - (Hash) Attribute value of the hash
|
509
519
|
# component of the composite primary key.
|
510
|
-
# *
|
520
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
511
521
|
# The maximum size is limited by the size of the primary key (1024
|
512
522
|
# bytes as a range part of a key or 2048 bytes as a single part
|
513
523
|
# hash key) or the item size (64k).
|
514
|
-
# *
|
524
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
515
525
|
# decimals and integers. A number can have up to 38 digits
|
516
526
|
# precision and can be between 10^-128 to 10^+126.
|
517
|
-
# *
|
527
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
518
528
|
# bytes.
|
519
|
-
# *
|
520
|
-
# *
|
521
|
-
# *
|
522
|
-
# *
|
529
|
+
# * `:ss` - (Array<String>) A set of strings.
|
530
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
531
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
532
|
+
# * `:range_key_condition` - (Hash) A container for the attribute
|
523
533
|
# values and comparison operators to use for the query.
|
524
|
-
# *
|
525
|
-
# *
|
534
|
+
# * `:attribute_value_list` - (Array<Hash>)
|
535
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
526
536
|
# The maximum size is limited by the size of the primary key
|
527
537
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
528
538
|
# part hash key) or the item size (64k).
|
529
|
-
# *
|
539
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
530
540
|
# decimals and integers. A number can have up to 38 digits
|
531
541
|
# precision and can be between 10^-128 to 10^+126.
|
532
|
-
# *
|
542
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
533
543
|
# bytes.
|
534
|
-
# *
|
535
|
-
# *
|
536
|
-
# *
|
537
|
-
# *
|
538
|
-
#
|
544
|
+
# * `:ss` - (Array<String>) A set of strings.
|
545
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
546
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
547
|
+
# * `:comparison_operator` - *required* - (String) Valid values
|
548
|
+
# include:
|
549
|
+
# * `EQ`
|
550
|
+
# * `NE`
|
551
|
+
# * `IN`
|
552
|
+
# * `LE`
|
553
|
+
# * `LT`
|
554
|
+
# * `GE`
|
555
|
+
# * `GT`
|
556
|
+
# * `BETWEEN`
|
557
|
+
# * `NOT_NULL`
|
558
|
+
# * `NULL`
|
559
|
+
# * `CONTAINS`
|
560
|
+
# * `NOT_CONTAINS`
|
561
|
+
# * `BEGINS_WITH`
|
562
|
+
# * `:scan_index_forward` - (Boolean) Specifies forward or backward
|
539
563
|
# traversal of the index. Amazon DynamoDB returns results reflecting
|
540
|
-
# the requested order, determined by the range key. Default is
|
564
|
+
# the requested order, determined by the range key. Default is `true`
|
541
565
|
# (forward).
|
542
|
-
# *
|
566
|
+
# * `:exclusive_start_key` - (Hash) Primary key of the item from which
|
543
567
|
# to continue an earlier query. An earlier query might provide this
|
544
568
|
# value as the LastEvaluatedKey if that query operation was
|
545
569
|
# interrupted before completing the query; either because of the
|
546
570
|
# result set size or the Limit parameter. The LastEvaluatedKey can be
|
547
571
|
# passed back in a new query request to continue the operation from
|
548
572
|
# that point.
|
549
|
-
# *
|
573
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element is
|
550
574
|
# treated as the primary key, and can be a string or a number.
|
551
575
|
# Single attribute primary keys have one index value. The value can
|
552
576
|
# be String, Number, StringSet, NumberSet.
|
553
|
-
# *
|
577
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
554
578
|
# The maximum size is limited by the size of the primary key
|
555
579
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
556
580
|
# part hash key) or the item size (64k).
|
557
|
-
# *
|
581
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
558
582
|
# decimals and integers. A number can have up to 38 digits
|
559
583
|
# precision and can be between 10^-128 to 10^+126.
|
560
|
-
# *
|
584
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
561
585
|
# bytes.
|
562
|
-
# *
|
563
|
-
# *
|
564
|
-
# *
|
565
|
-
# *
|
586
|
+
# * `:ss` - (Array<String>) A set of strings.
|
587
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
588
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
589
|
+
# * `:range_key_element` - (Hash) A range key element is treated as a
|
566
590
|
# secondary key (used in conjunction with the primary key), and can
|
567
591
|
# be a string or a number, and is only used for hash-and-range
|
568
592
|
# primary keys. The value can be String, Number, StringSet,
|
569
593
|
# NumberSet.
|
570
|
-
# *
|
594
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
571
595
|
# The maximum size is limited by the size of the primary key
|
572
596
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
573
597
|
# part hash key) or the item size (64k).
|
574
|
-
# *
|
598
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
575
599
|
# decimals and integers. A number can have up to 38 digits
|
576
600
|
# precision and can be between 10^-128 to 10^+126.
|
577
|
-
# *
|
601
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
578
602
|
# bytes.
|
579
|
-
# *
|
580
|
-
# *
|
581
|
-
# *
|
603
|
+
# * `:ss` - (Array<String>) A set of strings.
|
604
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
605
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
582
606
|
# @return [Core::Response]
|
583
607
|
# The #data method of the response object returns
|
584
608
|
# a hash with the following structure:
|
585
|
-
# *
|
586
|
-
# *
|
587
|
-
# *
|
588
|
-
# *
|
589
|
-
# *
|
590
|
-
# *
|
591
|
-
# *
|
592
|
-
# *
|
593
|
-
# *
|
594
|
-
# *
|
595
|
-
# *
|
596
|
-
# *
|
597
|
-
# *
|
598
|
-
# *
|
599
|
-
# *
|
600
|
-
# *
|
601
|
-
# *
|
602
|
-
# *
|
603
|
-
# *
|
604
|
-
# *
|
605
|
-
# *
|
606
|
-
# *
|
607
|
-
# *
|
608
|
-
# *
|
609
|
+
# * `member` - (Hash<String,Hash>)
|
610
|
+
# * `S` - (String)
|
611
|
+
# * `N` - (String)
|
612
|
+
# * `B` - (String)
|
613
|
+
# * `SS` - (Array<String>)
|
614
|
+
# * `NS` - (Array<String>)
|
615
|
+
# * `BS` - (Array<Blob>)
|
616
|
+
# * `Count` - (Integer)
|
617
|
+
# * `LastEvaluatedKey` - (Hash)
|
618
|
+
# * `HashKeyElement` - (Hash)
|
619
|
+
# * `S` - (String)
|
620
|
+
# * `N` - (String)
|
621
|
+
# * `B` - (String)
|
622
|
+
# * `SS` - (Array<String>)
|
623
|
+
# * `NS` - (Array<String>)
|
624
|
+
# * `BS` - (Array<Blob>)
|
625
|
+
# * `RangeKeyElement` - (Hash)
|
626
|
+
# * `S` - (String)
|
627
|
+
# * `N` - (String)
|
628
|
+
# * `B` - (String)
|
629
|
+
# * `SS` - (Array<String>)
|
630
|
+
# * `NS` - (Array<String>)
|
631
|
+
# * `BS` - (Array<Blob>)
|
632
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
609
633
|
|
610
634
|
# @!method scan(options = {})
|
611
635
|
# Calls the Scan API operation.
|
612
636
|
# @param [Hash] options
|
613
|
-
# *
|
637
|
+
# * `:table_name` - *required* - (String) The name of the table in
|
614
638
|
# which you want to scan. Allowed characters are a-z, A-Z, 0-9, _
|
615
639
|
# (underscore), - (hyphen) and . (period).
|
616
|
-
# *
|
617
|
-
# *
|
640
|
+
# * `:attributes_to_get` - (Array<String>)
|
641
|
+
# * `:limit` - (Integer) The maximum number of items to return. If
|
618
642
|
# Amazon DynamoDB hits this limit while scanning the table, it stops
|
619
643
|
# the scan and returns the matching values up to the limit, and a
|
620
644
|
# LastEvaluatedKey to apply in a subsequent operation to continue the
|
@@ -622,283 +646,244 @@ module AWS
|
|
622
646
|
# DynamoDB hits this limit, it stops the scan and returns the
|
623
647
|
# matching values up to the limit, and a LastEvaluatedKey to apply in
|
624
648
|
# a subsequent operation to continue the scan.
|
625
|
-
# *
|
649
|
+
# * `:count` - (Boolean) If set to `true` , Amazon DynamoDB returns a
|
626
650
|
# total number of items for the Scan operation, even if the operation
|
627
651
|
# has no matching items for the assigned filter. Do not set Count to
|
628
|
-
#
|
652
|
+
# `true` while providing a list of AttributesToGet, otherwise Amazon
|
629
653
|
# DynamoDB returns a validation error.
|
630
|
-
# *
|
654
|
+
# * `:scan_filter` - (Hash<String,Hash>) Evaluates the scan results and
|
631
655
|
# returns only the desired values.
|
632
|
-
# *
|
633
|
-
# *
|
656
|
+
# * `:attribute_value_list` - (Array<Hash>)
|
657
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
634
658
|
# The maximum size is limited by the size of the primary key
|
635
659
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
636
660
|
# part hash key) or the item size (64k).
|
637
|
-
# *
|
661
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
638
662
|
# decimals and integers. A number can have up to 38 digits
|
639
663
|
# precision and can be between 10^-128 to 10^+126.
|
640
|
-
# *
|
664
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
641
665
|
# bytes.
|
642
|
-
# *
|
643
|
-
# *
|
644
|
-
# *
|
645
|
-
# *
|
646
|
-
#
|
666
|
+
# * `:ss` - (Array<String>) A set of strings.
|
667
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
668
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
669
|
+
# * `:comparison_operator` - *required* - (String) Valid values
|
670
|
+
# include:
|
671
|
+
# * `EQ`
|
672
|
+
# * `NE`
|
673
|
+
# * `IN`
|
674
|
+
# * `LE`
|
675
|
+
# * `LT`
|
676
|
+
# * `GE`
|
677
|
+
# * `GT`
|
678
|
+
# * `BETWEEN`
|
679
|
+
# * `NOT_NULL`
|
680
|
+
# * `NULL`
|
681
|
+
# * `CONTAINS`
|
682
|
+
# * `NOT_CONTAINS`
|
683
|
+
# * `BEGINS_WITH`
|
684
|
+
# * `:exclusive_start_key` - (Hash) Primary key of the item from which
|
647
685
|
# to continue an earlier scan. An earlier scan might provide this
|
648
686
|
# value if that scan operation was interrupted before scanning the
|
649
687
|
# entire table; either because of the result set size or the Limit
|
650
688
|
# parameter. The LastEvaluatedKey can be passed back in a new scan
|
651
689
|
# request to continue the operation from that point.
|
652
|
-
# *
|
690
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element is
|
653
691
|
# treated as the primary key, and can be a string or a number.
|
654
692
|
# Single attribute primary keys have one index value. The value can
|
655
693
|
# be String, Number, StringSet, NumberSet.
|
656
|
-
# *
|
694
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
657
695
|
# The maximum size is limited by the size of the primary key
|
658
696
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
659
697
|
# part hash key) or the item size (64k).
|
660
|
-
# *
|
698
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
661
699
|
# decimals and integers. A number can have up to 38 digits
|
662
700
|
# precision and can be between 10^-128 to 10^+126.
|
663
|
-
# *
|
701
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
664
702
|
# bytes.
|
665
|
-
# *
|
666
|
-
# *
|
667
|
-
# *
|
668
|
-
# *
|
703
|
+
# * `:ss` - (Array<String>) A set of strings.
|
704
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
705
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
706
|
+
# * `:range_key_element` - (Hash) A range key element is treated as a
|
669
707
|
# secondary key (used in conjunction with the primary key), and can
|
670
708
|
# be a string or a number, and is only used for hash-and-range
|
671
709
|
# primary keys. The value can be String, Number, StringSet,
|
672
710
|
# NumberSet.
|
673
|
-
# *
|
711
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
674
712
|
# The maximum size is limited by the size of the primary key
|
675
713
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
676
714
|
# part hash key) or the item size (64k).
|
677
|
-
# *
|
715
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
678
716
|
# decimals and integers. A number can have up to 38 digits
|
679
717
|
# precision and can be between 10^-128 to 10^+126.
|
680
|
-
# *
|
718
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
681
719
|
# bytes.
|
682
|
-
# *
|
683
|
-
# *
|
684
|
-
# *
|
720
|
+
# * `:ss` - (Array<String>) A set of strings.
|
721
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
722
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
685
723
|
# @return [Core::Response]
|
686
724
|
# The #data method of the response object returns
|
687
725
|
# a hash with the following structure:
|
688
|
-
# *
|
689
|
-
# *
|
690
|
-
# *
|
691
|
-
# *
|
692
|
-
# *
|
693
|
-
# *
|
694
|
-
# *
|
695
|
-
# *
|
696
|
-
# *
|
697
|
-
# *
|
698
|
-
# *
|
699
|
-
# *
|
700
|
-
# *
|
701
|
-
# *
|
702
|
-
# *
|
703
|
-
# *
|
704
|
-
# *
|
705
|
-
# *
|
706
|
-
# *
|
707
|
-
# *
|
708
|
-
# *
|
709
|
-
# *
|
710
|
-
# *
|
711
|
-
# *
|
712
|
-
# *
|
726
|
+
# * `member` - (Hash<String,Hash>)
|
727
|
+
# * `S` - (String)
|
728
|
+
# * `N` - (String)
|
729
|
+
# * `B` - (String)
|
730
|
+
# * `SS` - (Array<String>)
|
731
|
+
# * `NS` - (Array<String>)
|
732
|
+
# * `BS` - (Array<Blob>)
|
733
|
+
# * `Count` - (Integer)
|
734
|
+
# * `ScannedCount` - (Integer)
|
735
|
+
# * `LastEvaluatedKey` - (Hash)
|
736
|
+
# * `HashKeyElement` - (Hash)
|
737
|
+
# * `S` - (String)
|
738
|
+
# * `N` - (String)
|
739
|
+
# * `B` - (String)
|
740
|
+
# * `SS` - (Array<String>)
|
741
|
+
# * `NS` - (Array<String>)
|
742
|
+
# * `BS` - (Array<Blob>)
|
743
|
+
# * `RangeKeyElement` - (Hash)
|
744
|
+
# * `S` - (String)
|
745
|
+
# * `N` - (String)
|
746
|
+
# * `B` - (String)
|
747
|
+
# * `SS` - (Array<String>)
|
748
|
+
# * `NS` - (Array<String>)
|
749
|
+
# * `BS` - (Array<Blob>)
|
750
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
713
751
|
|
714
752
|
# @!method update_item(options = {})
|
715
753
|
# Calls the UpdateItem API operation.
|
716
754
|
# @param [Hash] options
|
717
|
-
# *
|
755
|
+
# * `:table_name` - *required* - (String) The name of the table in
|
718
756
|
# which you want to update an item. Allowed characters are a-z, A-Z,
|
719
757
|
# 0-9, _ (underscore), - (hyphen) and . (period).
|
720
|
-
# *
|
721
|
-
# *
|
758
|
+
# * `:key` - *required* - (Hash)
|
759
|
+
# * `:hash_key_element` - *required* - (Hash) A hash key element is
|
722
760
|
# treated as the primary key, and can be a string or a number.
|
723
761
|
# Single attribute primary keys have one index value. The value can
|
724
762
|
# be String, Number, StringSet, NumberSet.
|
725
|
-
# *
|
763
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
726
764
|
# The maximum size is limited by the size of the primary key
|
727
765
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
728
766
|
# part hash key) or the item size (64k).
|
729
|
-
# *
|
767
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
730
768
|
# decimals and integers. A number can have up to 38 digits
|
731
769
|
# precision and can be between 10^-128 to 10^+126.
|
732
|
-
# *
|
770
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
733
771
|
# bytes.
|
734
|
-
# *
|
735
|
-
# *
|
736
|
-
# *
|
737
|
-
# *
|
772
|
+
# * `:ss` - (Array<String>) A set of strings.
|
773
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
774
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
775
|
+
# * `:range_key_element` - (Hash) A range key element is treated as a
|
738
776
|
# secondary key (used in conjunction with the primary key), and can
|
739
777
|
# be a string or a number, and is only used for hash-and-range
|
740
778
|
# primary keys. The value can be String, Number, StringSet,
|
741
779
|
# NumberSet.
|
742
|
-
# *
|
780
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
743
781
|
# The maximum size is limited by the size of the primary key
|
744
782
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
745
783
|
# part hash key) or the item size (64k).
|
746
|
-
# *
|
784
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
747
785
|
# decimals and integers. A number can have up to 38 digits
|
748
786
|
# precision and can be between 10^-128 to 10^+126.
|
749
|
-
# *
|
787
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
750
788
|
# bytes.
|
751
|
-
# *
|
752
|
-
# *
|
753
|
-
# *
|
754
|
-
# *
|
755
|
-
# *
|
756
|
-
# *
|
789
|
+
# * `:ss` - (Array<String>) A set of strings.
|
790
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
791
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
792
|
+
# * `:attribute_updates` - *required* - (Hash<String,Hash>)
|
793
|
+
# * `:value` - (Hash)
|
794
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
757
795
|
# The maximum size is limited by the size of the primary key
|
758
796
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
759
797
|
# part hash key) or the item size (64k).
|
760
|
-
# *
|
798
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
761
799
|
# decimals and integers. A number can have up to 38 digits
|
762
800
|
# precision and can be between 10^-128 to 10^+126.
|
763
|
-
# *
|
801
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
764
802
|
# bytes.
|
765
|
-
# *
|
766
|
-
# *
|
767
|
-
# *
|
768
|
-
# *
|
769
|
-
#
|
770
|
-
#
|
803
|
+
# * `:ss` - (Array<String>) A set of strings.
|
804
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
805
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
806
|
+
# * `:action` - (String) Valid values include:
|
807
|
+
# * `ADD`
|
808
|
+
# * `PUT`
|
809
|
+
# * `DELETE`
|
810
|
+
# * `:expected` - (Hash<String,Hash>)
|
811
|
+
# * `:value` - (Hash) Specify whether or not a value already exists
|
771
812
|
# and has a specific content for the attribute name-value pair.
|
772
|
-
# *
|
813
|
+
# * `:s` - (String) Strings are Unicode with UTF-8 binary encoding.
|
773
814
|
# The maximum size is limited by the size of the primary key
|
774
815
|
# (1024 bytes as a range part of a key or 2048 bytes as a single
|
775
816
|
# part hash key) or the item size (64k).
|
776
|
-
# *
|
817
|
+
# * `:n` - (String) Numbers are positive or negative exact-value
|
777
818
|
# decimals and integers. A number can have up to 38 digits
|
778
819
|
# precision and can be between 10^-128 to 10^+126.
|
779
|
-
# *
|
820
|
+
# * `:b` - (String) Binary attributes are sequences of unsigned
|
780
821
|
# bytes.
|
781
|
-
# *
|
782
|
-
# *
|
783
|
-
# *
|
784
|
-
# *
|
822
|
+
# * `:ss` - (Array<String>) A set of strings.
|
823
|
+
# * `:ns` - (Array<String>) A set of numbers.
|
824
|
+
# * `:bs` - (Array<String>) A set of binary attributes.
|
825
|
+
# * `:exists` - (Boolean) Specify whether or not a value already
|
785
826
|
# exists for the attribute name-value pair.
|
786
|
-
# *
|
827
|
+
# * `:return_values` - (String) Valid values include:
|
828
|
+
# * `NONE`
|
829
|
+
# * `ALL_OLD`
|
830
|
+
# * `UPDATED_OLD`
|
831
|
+
# * `ALL_NEW`
|
832
|
+
# * `UPDATED_NEW`
|
787
833
|
# @return [Core::Response]
|
788
834
|
# The #data method of the response object returns
|
789
835
|
# a hash with the following structure:
|
790
|
-
# *
|
791
|
-
# *
|
792
|
-
# *
|
793
|
-
# *
|
794
|
-
# *
|
795
|
-
# *
|
796
|
-
# *
|
797
|
-
# *
|
836
|
+
# * `Attributes` - (Hash<String,Hash>)
|
837
|
+
# * `S` - (String)
|
838
|
+
# * `N` - (String)
|
839
|
+
# * `B` - (String)
|
840
|
+
# * `SS` - (Array<String>)
|
841
|
+
# * `NS` - (Array<String>)
|
842
|
+
# * `BS` - (Array<Blob>)
|
843
|
+
# * `ConsumedCapacityUnits` - (Numeric)
|
798
844
|
|
799
845
|
# @!method update_table(options = {})
|
800
846
|
# Calls the UpdateTable API operation.
|
801
847
|
# @param [Hash] options
|
802
|
-
# *
|
848
|
+
# * `:table_name` - *required* - (String) The name of the table you
|
803
849
|
# want to update. Allowed characters are a-z, A-Z, 0-9, _
|
804
850
|
# (underscore), - (hyphen) and . (period).
|
805
|
-
# *
|
806
|
-
# *
|
851
|
+
# * `:provisioned_throughput` - *required* - (Hash)
|
852
|
+
# * `:read_capacity_units` - *required* - (Integer) ReadCapacityUnits
|
807
853
|
# are in terms of strictly consistent reads, assuming items of 1k.
|
808
854
|
# 2k items require twice the ReadCapacityUnits.
|
809
855
|
# Eventually-consistent reads only require half the
|
810
856
|
# ReadCapacityUnits of stirctly consistent reads.
|
811
|
-
# *
|
857
|
+
# * `:write_capacity_units` - *required* - (Integer)
|
812
858
|
# WriteCapacityUnits are in terms of strictly consistent reads,
|
813
859
|
# assuming items of 1k. 2k items require twice the
|
814
860
|
# WriteCapacityUnits.
|
815
861
|
# @return [Core::Response]
|
816
862
|
# The #data method of the response object returns
|
817
863
|
# a hash with the following structure:
|
818
|
-
# *
|
819
|
-
# *
|
820
|
-
# *
|
821
|
-
# *
|
822
|
-
# *
|
823
|
-
# *
|
824
|
-
# *
|
825
|
-
# *
|
826
|
-
# *
|
827
|
-
# *
|
828
|
-
# *
|
829
|
-
# *
|
830
|
-
# *
|
831
|
-
# *
|
832
|
-
# *
|
833
|
-
# *
|
834
|
-
# *
|
835
|
-
# *
|
864
|
+
# * `TableDescription` - (Hash)
|
865
|
+
# * `TableName` - (String)
|
866
|
+
# * `KeySchema` - (Hash)
|
867
|
+
# * `HashKeyElement` - (Hash)
|
868
|
+
# * `AttributeName` - (String)
|
869
|
+
# * `AttributeType` - (String)
|
870
|
+
# * `RangeKeyElement` - (Hash)
|
871
|
+
# * `AttributeName` - (String)
|
872
|
+
# * `AttributeType` - (String)
|
873
|
+
# * `TableStatus` - (String)
|
874
|
+
# * `CreationDateTime` - (Time)
|
875
|
+
# * `ProvisionedThroughput` - (Hash)
|
876
|
+
# * `LastIncreaseDateTime` - (Time)
|
877
|
+
# * `LastDecreaseDateTime` - (Time)
|
878
|
+
# * `ReadCapacityUnits` - (Integer)
|
879
|
+
# * `WriteCapacityUnits` - (Integer)
|
880
|
+
# * `TableSizeBytes` - (Integer)
|
881
|
+
# * `ItemCount` - (Integer)
|
836
882
|
|
837
883
|
# end client methods #
|
838
884
|
|
839
885
|
define_client_methods('2011-12-05')
|
840
886
|
|
841
|
-
protected
|
842
|
-
|
843
|
-
def extract_error_details response
|
844
|
-
if response.http_response.status == 413
|
845
|
-
['RequestEntityTooLarge', 'Request entity too large']
|
846
|
-
elsif crc32_is_valid?(response) == false
|
847
|
-
['CRC32CheckFailed', 'CRC32 integrity check failed']
|
848
|
-
else
|
849
|
-
super
|
850
|
-
end
|
851
|
-
end
|
852
|
-
|
853
|
-
def retryable_error? response
|
854
|
-
case response.error
|
855
|
-
when Errors::ProvisionedThroughputExceededException
|
856
|
-
config.dynamo_db_retry_throughput_errors?
|
857
|
-
when Errors::CRC32CheckFailed
|
858
|
-
true
|
859
|
-
else
|
860
|
-
super
|
861
|
-
end
|
862
|
-
end
|
863
|
-
|
864
|
-
def sleep_durations response
|
865
|
-
|
866
|
-
retry_count =
|
867
|
-
if expired_credentials?(response)
|
868
|
-
config.max_retries == 0 ? 0 : 1
|
869
|
-
else
|
870
|
-
config.max_retries { 10 }
|
871
|
-
end
|
872
|
-
|
873
|
-
# given a retry_count of 10, the sleep durations will look like:
|
874
|
-
# 0, 50, 100, 200, 400, 800, 1600, 3200, 6400, 12800 (milliseconds)
|
875
|
-
(0...retry_count).map do |n|
|
876
|
-
if n == 0
|
877
|
-
0
|
878
|
-
else
|
879
|
-
50 * (2 ** (n - 1)) / 1000.0
|
880
|
-
end
|
881
|
-
end
|
882
|
-
|
883
|
-
end
|
884
|
-
|
885
|
-
private
|
886
|
-
|
887
|
-
# @return [Boolean] whether the CRC32 response header matches the body.
|
888
|
-
# @return [nil] if no CRC32 header is present or we are not verifying CRC32
|
889
|
-
def crc32_is_valid? response
|
890
|
-
return nil unless config.dynamo_db_crc32
|
891
|
-
if crcs = response.http_response.headers['x-amz-crc32']
|
892
|
-
crcs[0].to_i == calculate_crc32(response)
|
893
|
-
else
|
894
|
-
nil
|
895
|
-
end
|
896
|
-
end
|
897
|
-
|
898
|
-
def calculate_crc32 response
|
899
|
-
Zlib.crc32(response.http_response.body)
|
900
|
-
end
|
901
|
-
|
902
887
|
end
|
903
888
|
end
|
904
889
|
end
|