fog-aws 0.7.6 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/Gemfile +1 -0
  4. data/lib/fog/aws/compute.rb +1 -1
  5. data/lib/fog/aws/iam/paged_collection.rb +4 -2
  6. data/lib/fog/aws/models/compute/server.rb +0 -1
  7. data/lib/fog/aws/models/elasticache/cluster.rb +2 -1
  8. data/lib/fog/aws/models/iam/roles.rb +11 -14
  9. data/lib/fog/aws/models/rds/server.rb +2 -1
  10. data/lib/fog/aws/models/storage/directory.rb +1 -1
  11. data/lib/fog/aws/parsers/elasticache/cache_cluster_parser.rb +29 -4
  12. data/lib/fog/aws/parsers/storage/get_bucket_lifecycle.rb +30 -0
  13. data/lib/fog/aws/requests/compute/describe_instances.rb +1 -1
  14. data/lib/fog/aws/requests/compute/start_instances.rb +1 -0
  15. data/lib/fog/aws/requests/compute/stop_instances.rb +1 -0
  16. data/lib/fog/aws/requests/dynamodb/batch_get_item.rb +8 -11
  17. data/lib/fog/aws/requests/dynamodb/batch_write_item.rb +11 -9
  18. data/lib/fog/aws/requests/dynamodb/create_table.rb +9 -14
  19. data/lib/fog/aws/requests/dynamodb/delete_item.rb +5 -15
  20. data/lib/fog/aws/requests/dynamodb/delete_table.rb +4 -8
  21. data/lib/fog/aws/requests/dynamodb/describe_table.rb +7 -8
  22. data/lib/fog/aws/requests/dynamodb/get_item.rb +9 -7
  23. data/lib/fog/aws/requests/dynamodb/list_tables.rb +4 -1
  24. data/lib/fog/aws/requests/dynamodb/put_item.rb +6 -10
  25. data/lib/fog/aws/requests/dynamodb/query.rb +14 -6
  26. data/lib/fog/aws/requests/dynamodb/scan.rb +6 -6
  27. data/lib/fog/aws/requests/dynamodb/update_item.rb +22 -20
  28. data/lib/fog/aws/requests/dynamodb/update_table.rb +6 -7
  29. data/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +1 -0
  30. data/lib/fog/aws/requests/iam/create_role.rb +1 -1
  31. data/lib/fog/aws/requests/iam/get_role.rb +5 -2
  32. data/lib/fog/aws/requests/iam/list_roles.rb +50 -16
  33. data/lib/fog/aws/requests/rds/modify_db_instance.rb +53 -54
  34. data/lib/fog/aws/requests/storage/get_object.rb +5 -3
  35. data/lib/fog/aws/requests/storage/put_bucket_lifecycle.rb +28 -5
  36. data/lib/fog/aws/requests/storage/put_object.rb +4 -0
  37. data/lib/fog/aws/storage.rb +3 -0
  38. data/lib/fog/aws/sts.rb +4 -3
  39. data/lib/fog/aws/version.rb +1 -1
  40. data/tests/models/compute/server_tests.rb +11 -0
  41. data/tests/models/iam/roles_tests.rb +12 -4
  42. data/tests/models/storage/directory_tests.rb +4 -0
  43. data/tests/requests/compute/instance_tests.rb +44 -2
  44. data/tests/requests/dynamodb/item_tests.rb +2 -2
  45. data/tests/requests/storage/bucket_tests.rb +5 -0
  46. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: daae4cd317d3b006fd8a5673438f8714d1dbc701
4
- data.tar.gz: 9e9fb35e71f5f20eb329ed20c7fc610bbc999b34
3
+ metadata.gz: 58d538460f3f7fdf4b55f6ff22436610834d5d2f
4
+ data.tar.gz: e2d865117e046119af32d8c22a2db4918678dddb
5
5
  SHA512:
6
- metadata.gz: 5edb10c809ca8d5b5e98ea65a9ee58a810bb13312cbb28c1358d4b2caa4104a1f9fab5cba1f310d480e3c9cc8911c398a6dbc107cf85d9fb5ed9d3479b92dacf
7
- data.tar.gz: bf3b096a51f49366306adfb75a99699ee354ca2890b8ff2ef781bdce50d4516bcce633bb6d50fafe23899749a3c7fdb532d7e1ac4a6c298ec964885ed82fedfa
6
+ metadata.gz: 5d141b55a36a590acfd0cd3b403a94c35c227c3e8cf09533c9ad9bd3ceee63ba972bba16c334b28d454ae4562026fb6585a24bf274befd7f42560261b384e05a
7
+ data.tar.gz: 74adabc3b6a46cbb973809e4567f6c4a0f2780f381cb336fe9dd35cca02ea92d36996d9f331e40c46ddb8ae117d7eeb730f7598c1f41b999707bc4b4c61da0c2
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.7.6](https://github.com/fog/fog-aws/tree/v0.7.6) (2015-08-26)
4
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v0.7.5...v0.7.6)
5
+
6
+ **Closed issues:**
7
+
8
+ - mock directories.create destroys existing directory [\#172](https://github.com/fog/fog-aws/issues/172)
9
+
10
+ **Merged pull requests:**
11
+
12
+ - Add GovCloud region name to validation set. [\#175](https://github.com/fog/fog-aws/pull/175) ([triplepoint](https://github.com/triplepoint))
13
+ - Mocked put\_bucket no longer clobbers existing bucket [\#174](https://github.com/fog/fog-aws/pull/174) ([jgr](https://github.com/jgr))
14
+
3
15
  ## [v0.7.5](https://github.com/fog/fog-aws/tree/v0.7.5) (2015-08-24)
4
16
  [Full Changelog](https://github.com/fog/fog-aws/compare/v0.7.4...v0.7.5)
5
17
 
data/Gemfile CHANGED
@@ -5,5 +5,6 @@ gemspec
5
5
 
6
6
  group :test, :default do
7
7
  gem 'pry-nav'
8
+ gem 'mime-types', '~> 2.6', '>= 2.6.2'
8
9
  end
9
10
  gem "codeclimate-test-reporter", group: :test, require: nil
@@ -415,7 +415,7 @@ module Fog
415
415
  tag_filters[key.gsub('tag:', '')] = filters.delete(key) if /^tag:/ =~ key
416
416
  end
417
417
  for tag_key, tag_value in tag_filters
418
- resources = resources.select{|r| tag_value == tag_set_fetcher[r][tag_key]}
418
+ resources = resources.select{|r| [tag_value].flatten.include? tag_set_fetcher[r][tag_key]}
419
419
  end
420
420
 
421
421
  resources
@@ -13,7 +13,9 @@ module Fog
13
13
  to_a.each(*args, &block)
14
14
  end
15
15
 
16
- def each
16
+ def each(options={})
17
+ limit = options[:limit] || 100
18
+
17
19
  if !block_given?
18
20
  self
19
21
  else
@@ -23,7 +25,7 @@ module Fog
23
25
 
24
26
  while subset.truncated
25
27
  subset.
26
- all(:marker => subset.marker, :limit => 1000).
28
+ all(:marker => subset.marker, :limit => limit).
27
29
  each_entry { |f| yield f }
28
30
  end
29
31
 
@@ -205,7 +205,6 @@ module Fog
205
205
 
206
206
  def setup(credentials = {})
207
207
  requires :ssh_ip_address, :username
208
- require 'net/ssh'
209
208
 
210
209
  commands = [
211
210
  %{mkdir .ssh},
@@ -18,7 +18,8 @@ module Fog
18
18
  attribute :parameter_group, :aliases => 'CacheParameterGroup'
19
19
  attribute :pending_values, :aliases => 'PendingModifiedValues'
20
20
  attribute :create_time, :aliases => 'CacheClusterCreateTime', :type => :timestamp
21
- attribute :security_groups, :aliases => 'CacheSecurityGroups', :type => :array
21
+ attribute :cache_security_groups, :aliases => 'CacheSecurityGroups', :type => :array
22
+ attribute :security_groups, :aliases => 'SecurityGroups', :type => :array
22
23
  attribute :notification_config, :aliases => 'NotificationConfiguration'
23
24
  attribute :cache_subnet_group_name, :aliases => 'CacheSubnetGroupName'
24
25
  attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array
@@ -3,31 +3,28 @@ require 'fog/aws/models/iam/role'
3
3
  module Fog
4
4
  module AWS
5
5
  class IAM
6
- class Roles < Fog::Collection
6
+ class Roles < Fog::AWS::IAM::PagedCollection
7
+
7
8
  model Fog::AWS::IAM::Role
8
9
 
9
- def initialize(attributes = {})
10
- super
11
- end
10
+ def all(options={})
11
+ body = service.list_roles(page_params(options)).body
12
12
 
13
- def all
14
- data = service.list_roles.body['Roles']
15
- load(data)
13
+ merge_attributes(body)
14
+ load(body["Roles"])
16
15
  end
17
16
 
18
17
  def get(identity)
19
- role = nil
20
- begin
21
- role = service.roles.new( service.get_role( identity ).data[:body]["Role"] )
22
- rescue Excon::Errors::NotFound, Fog::AWS::IAM::NotFound # ignore not found error
23
- end
24
- role
18
+ new(service.get_role(identity).body["Role"])
19
+ rescue Excon::Errors::NotFound, Fog::AWS::IAM::NotFound
20
+ nil
25
21
  end
26
22
 
27
23
  def new(attributes = {})
28
- if not attributes.key?(:assume_role_policy_document)
24
+ unless attributes.key?(:assume_role_policy_document)
29
25
  attributes[:assume_role_policy_document] = Fog::AWS::IAM::EC2_ASSUME_ROLE_POLICY.to_s
30
26
  end
27
+
31
28
  super
32
29
  end
33
30
  end
@@ -131,8 +131,8 @@ module Fog
131
131
  'DBSubnetGroupName' => db_subnet_group_name,
132
132
  'Engine' => engine,
133
133
  'EngineVersion' => engine_version,
134
- 'StorageEncrypted' => storage_encrypted,
135
134
  'Iops' => iops,
135
+ 'KmsKeyId' => kms_key_id,
136
136
  'LicenseModel' => license_model,
137
137
  'MasterUserPassword' => password || attributes['MasterUserPassword'],
138
138
  'MasterUsername' => master_username,
@@ -141,6 +141,7 @@ module Fog
141
141
  'PreferredBackupWindow' => preferred_backup_window,
142
142
  'PreferredMaintenanceWindow' => preferred_maintenance_window,
143
143
  'PubliclyAccessible' => publicly_accessible,
144
+ 'StorageEncrypted' => storage_encrypted,
144
145
  'StorageType' => storage_type,
145
146
  'VpcSecurityGroups' => vpc_security_groups,
146
147
  }
@@ -31,7 +31,7 @@ module Fog
31
31
  end
32
32
 
33
33
  def location
34
- @location ||= (bucket_location || self.service.region)
34
+ @location ||= (bucket_location || AWS::DEFAULT_REGION)
35
35
  end
36
36
 
37
37
  # NOTE: you can't change the region once the bucket is created
@@ -15,17 +15,26 @@ module Fog
15
15
  'CacheSecurityGroups' => [],
16
16
  'CacheNodes' => [],
17
17
  'CacheParameterGroup' => {},
18
- 'ConfigurationEndpoint' => {}
18
+ 'ConfigurationEndpoint' => {},
19
+ 'SecurityGroups' => []
19
20
  }
20
21
  end
21
22
 
22
23
  def start_element(name, attrs = [])
23
24
  super
24
25
  case name
25
- when 'CacheSecurityGroup'; then @security_group = {}
26
+ when 'CacheSecurityGroup'; then @cache_security_group = {}
26
27
  when 'CacheNode'; then @cache_node = {}
27
28
  when 'PendingModifiedValues'; then @pending_values = {}
28
29
  when 'ConfigurationEndpoint'; then @configuration_endpoint = {}
30
+ when 'SecurityGroups'
31
+ @in_security_groups = true
32
+ @security_group_members = []
33
+ when 'member'
34
+ if @in_security_groups
35
+ @in_security_group_member = true
36
+ @security_group_member = {}
37
+ end
29
38
  end
30
39
  end
31
40
 
@@ -50,11 +59,17 @@ module Fog
50
59
  when 'CacheClusterCreateTime'
51
60
  @cache_cluster[name] = DateTime.parse(value)
52
61
  when 'CacheSecurityGroup'
53
- @cache_cluster["#{name}s"] << @security_group unless @security_group.empty?
62
+ @cache_cluster["#{name}s"] << @cache_security_group unless @cache_security_group.empty?
54
63
  when 'ConfigurationEndpoint'
55
64
  @cache_cluster['ConfigurationEndpoint'] = @configuration_endpoint
56
- when 'CacheSecurityGroupName', 'Status', 'CacheSubnetGroupName'
65
+ when 'CacheSecurityGroupName', 'CacheSubnetGroupName'
57
66
  @cache_cluster[name] = value
67
+ when 'Status'
68
+ if @in_security_group_member
69
+ @security_group_member[name] = value
70
+ else
71
+ @cache_cluster[name] = value
72
+ end
58
73
  when 'CacheNode'
59
74
  @cache_cluster["#{name}s"] << @cache_node unless @cache_node.empty?
60
75
  @cache_node = nil
@@ -78,6 +93,16 @@ module Fog
78
93
  end
79
94
  when 'CacheNodeIdsToReboots', 'CacheParameterGroupName', 'ParameterApplyStatus'
80
95
  @cache_cluster['CacheParameterGroup'][name] = value
96
+ when 'SecurityGroups'
97
+ @in_security_groups = false
98
+ @cache_cluster['SecurityGroups'] = @security_group_members
99
+ when 'SecurityGroupId'
100
+ @security_group_member[name] = value if @in_security_group_member
101
+ when 'member'
102
+ if @in_security_groups
103
+ @in_security_group_member = false
104
+ @security_group_members << @security_group_member
105
+ end
81
106
  else
82
107
  super
83
108
  end
@@ -5,7 +5,9 @@ module Fog
5
5
  class GetBucketLifecycle < Fog::Parsers::Base
6
6
  def reset
7
7
  @expiration = {}
8
+ @version_expiration = {}
8
9
  @transition = {}
10
+ @version_transition = {}
9
11
  @rule = {}
10
12
  @response = { 'Rules' => [] }
11
13
  end
@@ -17,6 +19,10 @@ module Fog
17
19
  @in_expiration = true
18
20
  when 'Transition'
19
21
  @in_transition = true
22
+ when 'NoncurrentVersionExpiration'
23
+ @in_version_expiration = true
24
+ when 'NoncurrentVersionTransition'
25
+ @in_version_transition = true
20
26
  end
21
27
  end
22
28
 
@@ -32,6 +38,17 @@ module Fog
32
38
  @in_expiration = false
33
39
  @expiration = {}
34
40
  end
41
+ elsif @in_version_expiration
42
+ case name
43
+ when 'NoncurrentDays'
44
+ @version_expiration[name] = value.to_i
45
+ when 'Date'
46
+ @version_expiration[name] = value
47
+ when 'NoncurrentVersionExpiration'
48
+ @rule['NoncurrentVersionExpiration'] = @version_expiration
49
+ @in_version_expiration = false
50
+ @version_expiration = {}
51
+ end
35
52
  elsif @in_transition
36
53
  case name
37
54
  when 'StorageClass',
@@ -45,6 +62,19 @@ module Fog
45
62
  @in_transition = false
46
63
  @transition = {}
47
64
  end
65
+ elsif @in_version_transition
66
+ case name
67
+ when 'StorageClass',
68
+ @version_transition['StorageClass'] = value
69
+ when 'Date'
70
+ @version_transition[name] = value
71
+ when 'NoncurrentDays'
72
+ @version_transition[name] = value.to_i
73
+ when 'NoncurrentVersionTransition'
74
+ @rule['NoncurrentVersionTransition'] = @transition
75
+ @in_version_transition = false
76
+ @version_transition = {}
77
+ end
48
78
  else
49
79
  case name
50
80
  when 'ID', 'Prefix'
@@ -199,7 +199,7 @@ module Fog
199
199
  when 'rebooting'
200
200
  instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
201
201
  when 'stopping'
202
- instance['instanceState'] = { 'code' => 0, 'name' => 'stopping' }
202
+ instance['instanceState'] = { 'code' => 0, 'name' => 'stopped' }
203
203
  instance['stateReason'] = { 'code' => 0 }
204
204
  when 'shutting-down'
205
205
  if Time.now - self.data[:deleted_at][instance['instanceId']] >= Fog::Mock.delay * 2
@@ -41,6 +41,7 @@ module Fog
41
41
  response.status = 200
42
42
 
43
43
  response.body = {
44
+ 'requestId' => Fog::AWS::Mock.request_id,
44
45
  'instancesSet' => instance_set.reduce([]) do |ia, instance|
45
46
  ia << {'currentState' => { 'code' => 0, 'name' => 'pending' },
46
47
  'previousState' => instance['instanceState'],
@@ -42,6 +42,7 @@ module Fog
42
42
  response.status = 200
43
43
 
44
44
  response.body = {
45
+ 'requestId' => Fog::AWS::Mock.request_id,
45
46
  'instancesSet' => instance_set.reduce([]) do |ia, instance|
46
47
  instance['classicLinkSecurityGroups'] = nil
47
48
  instance['classicLinkVpcId'] = nil
@@ -8,22 +8,19 @@ module Fog
8
8
  # * 'request_items'<~Hash>:
9
9
  # * 'table_name'<~Hash>:
10
10
  # * 'Keys'<~Array>: array of keys
11
- # * 'HashKeyElement'<~Hash>: info for primary key
12
- # * 'AttributeType'<~String> - type of attribute
13
- # * 'AttributeName'<~String> - name of attribute
14
- # * 'RangeKeyElement'<~Hash>: optional, info for range key
15
- # * 'AttributeType'<~String> - type of attribute
16
- # * 'AttributeName'<~String> - name of attribute
17
- # * 'AttributesToGet'<~Array> - optional attributes to return, defaults to all
18
11
  #
19
12
  # ==== Returns
20
13
  # * response<~Excon::Response>:
21
14
  # * body<~Hash>:
22
15
  # * 'Responses'<~Hash>:
23
- # * 'table_name'<~Hash>:
24
- # * 'Items'<~Array> - Matching items
25
- # * 'ConsumedCapacityUnits'<~Float> - Capacity units used in read
16
+ # * 'table_name'<~Array> - array of all elements
26
17
  # * 'UnprocessedKeys':<~Hash> - tables and keys in excess of per request limit, pass this to subsequent batch get for pseudo-pagination
18
+ # * 'ConsumedCapacity':<~Hash>:
19
+ # * 'TableName'<~String> - the name of the table
20
+ # * 'CapacityUnits'<~Float> - Capacity units used in read
21
+ #
22
+ # See DynamoDB Documentation: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchGetItem.html
23
+ #
27
24
  def batch_get_item(request_items)
28
25
  body = {
29
26
  'RequestItems' => request_items
@@ -31,7 +28,7 @@ module Fog
31
28
 
32
29
  request(
33
30
  :body => Fog::JSON.encode(body),
34
- :headers => {'x-amz-target' => 'DynamoDB_20111205.BatchGetItem'},
31
+ :headers => {'x-amz-target' => 'DynamoDB_20120810.BatchGetItem'},
35
32
  :idempotent => true
36
33
  )
37
34
  end
@@ -7,16 +7,18 @@ module Fog
7
7
  batch_write_item(request_items)
8
8
  end
9
9
 
10
- #request_items has form:
11
- #{"table_name"=>
10
+ # request_items has form:
11
+ #
12
+ # {"table_name"=>
12
13
  # [{"PutRequest"=>
13
14
  # {"Item"=>
14
- # {"hash_key"=>{"N"=>"99"},
15
- # "range_key"=>{"N"=>"99"},
16
- # "attribute"=>{"S"=>"hi"}
17
- # }}}, ... ]}
18
- # For more information:
19
- # http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_BatchWriteItems.html
15
+ # {"hi" => {"N" => 99}}
16
+ # }
17
+ # }]
18
+ # }
19
+ #
20
+ # See DynamoDB Documentation: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_BatchWriteItems.html
21
+ #
20
22
  def batch_write_item(request_items)
21
23
  body = {
22
24
  'RequestItems' => request_items
@@ -24,7 +26,7 @@ module Fog
24
26
 
25
27
  request(
26
28
  :body => Fog::JSON.encode(body),
27
- :headers => {'x-amz-target' => 'DynamoDB_20111205.BatchWriteItem'}
29
+ :headers => {'x-amz-target' => 'DynamoDB_20120810.BatchWriteItem'}
28
30
  )
29
31
  end
30
32
  end
@@ -6,14 +6,10 @@ module Fog
6
6
  #
7
7
  # ==== Parameters
8
8
  # * 'table_name'<~String> - name of table to create
9
- # * 'key_schema'<~Hash>:
10
- # * 'HashKeyElement'<~Hash>: info for primary key
9
+ # * 'key_schema'<~Array>:
11
10
  # * 'AttributeName'<~String> - name of attribute
12
- # * 'AttributeType'<~String> - type of attribute, in %w{N NS S SS} for number, number set, string, string set
13
- # * 'RangeKeyElement'<~Hash>: optional, info for range key
14
- # * 'AttributeName'<~String> - name of attribute
15
- # * 'AttributeType'<~String> - type of attribute, in %w{N NS S SS} for number, number set, string, string set
16
- # * 'provisioned_throughput'<~Hash>:
11
+ # * 'KeyType'<~String> - type of attribute, in %w{N NS S SS} for number, number set, string, string set
12
+ # * 'ProvisionedThroughput'<~Hash>:
17
13
  # * 'ReadCapacityUnits'<~Integer> - read capacity for table, in 5..10000
18
14
  # * 'WriteCapacityUnits'<~Integer> - write capacity for table, in 5..10000
19
15
  #
@@ -22,18 +18,17 @@ module Fog
22
18
  # * body<~Hash>:
23
19
  # * 'TableDescription'<~Hash>
24
20
  # * 'CreationDateTime'<~Float> - Unix epoch time of table creation
25
- # * 'KeySchema'<~Hash> - schema for table
26
- # * 'HashKeyElement'<~Hash>: info for primary key
27
- # * 'AttributeName'<~String> - name of attribute
28
- # * 'AttributeType'<~String> - type of attribute, in %w{N NS S SS} for number, number set, string, string set
29
- # * 'RangeKeyElement'<~Hash>: optional, info for range key
21
+ # * 'KeySchema'<~Array> - schema for table
30
22
  # * 'AttributeName'<~String> - name of attribute
31
- # * 'AttributeType'<~String> - type of attribute, in %w{N NS S SS} for number, number set, string, string set
23
+ # * 'KeyType'<~String> - type of attribute, in %w{N NS S SS} for number, number set, string, string set
32
24
  # * 'ProvisionedThroughput'<~Hash>:
33
25
  # * 'ReadCapacityUnits'<~Integer> - read capacity for table, in 5..10000
34
26
  # * 'WriteCapacityUnits'<~Integer> - write capacity for table, in 5..10000
35
27
  # * 'TableName'<~String> - name of table
36
28
  # * 'TableStatus'<~String> - status of table
29
+ #
30
+ # See DynamoDB Documentation: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html
31
+ #
37
32
  def create_table(table_name, key_schema, provisioned_throughput)
38
33
  body = {
39
34
  'KeySchema' => key_schema,
@@ -43,7 +38,7 @@ module Fog
43
38
 
44
39
  request(
45
40
  :body => Fog::JSON.encode(body),
46
- :headers => {'x-amz-target' => 'DynamoDB_20111205.CreateTable'},
41
+ :headers => {'x-amz-target' => 'DynamoDB_20120810.CreateTable'},
47
42
  :idempotent => true
48
43
  )
49
44
  end
@@ -6,25 +6,15 @@ module Fog
6
6
  #
7
7
  # ==== Parameters
8
8
  # * 'table_name'<~String> - name of table for item
9
- # * 'key'<~Hash>:
10
- # * 'HashKeyElement'<~Hash>: info for primary key
11
- # * 'AttributeName'<~String> - name of attribute
12
- # * 'AttributeType'<~String> - type of attribute
13
- # * 'RangeKeyElement'<~Hash>: optional, info for range key
14
- # * 'AttributeName'<~String> - name of attribute
15
- # * 'AttributeType'<~String> - type of attribute
16
- # * 'options'<~Hash>:
17
- # * 'Expected'<~Hash>: data to check against
18
- # * 'AttributeName'<~String> - name of attribute
19
- # * 'Value'<~Hash> - a value to check for the value of
20
- # or
21
- # * 'Exists'<~Boolean> - set as false to only allow update if attribute doesn't exist
22
- # * 'ReturnValues'<~String> - data to return in %w{ALL_NEW ALL_OLD NONE UPDATED_NEW UPDATED_OLD}, defaults to NONE
9
+ # * 'key'<~Hash> - hash of attributes
23
10
  #
24
11
  # ==== Returns
25
12
  # * response<~Excon::Response>:
26
13
  # * body<~Hash>:
27
14
  # varies based on ReturnValues param, see: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_UpdateItem.html
15
+ #
16
+ # See DynamoDB Documentation: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html
17
+ #
28
18
  def delete_item(table_name, key, options = {})
29
19
  body = {
30
20
  'Key' => key,
@@ -33,7 +23,7 @@ module Fog
33
23
 
34
24
  request(
35
25
  :body => Fog::JSON.encode(body),
36
- :headers => {'x-amz-target' => 'DynamoDB_20111205.DeleteItem'},
26
+ :headers => {'x-amz-target' => 'DynamoDB_20120810.DeleteItem'},
37
27
  :idempotent => true
38
28
  )
39
29
  end