fog 1.12.1 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. data/.travis.yml +1 -1
  2. data/Gemfile +5 -0
  3. data/Rakefile +14 -4
  4. data/bin/fog +22 -0
  5. data/changelog.txt +262 -0
  6. data/fog.gemspec +8 -4
  7. data/lib/fog/aws.rb +11 -0
  8. data/lib/fog/aws/auto_scaling.rb +15 -18
  9. data/lib/fog/aws/beanstalk.rb +8 -10
  10. data/lib/fog/aws/cloud_formation.rb +9 -12
  11. data/lib/fog/aws/compute.rb +8 -10
  12. data/lib/fog/aws/credential_fetcher.rb +6 -6
  13. data/lib/fog/aws/elasticache.rb +13 -17
  14. data/lib/fog/aws/elb.rb +29 -31
  15. data/lib/fog/aws/iam.rb +10 -13
  16. data/lib/fog/aws/models/auto_scaling/group.rb +6 -3
  17. data/lib/fog/aws/models/compute/spot_request.rb +1 -11
  18. data/lib/fog/aws/models/rds/log_file.rb +26 -0
  19. data/lib/fog/aws/models/rds/log_files.rb +50 -0
  20. data/lib/fog/aws/models/rds/server.rb +3 -1
  21. data/lib/fog/aws/models/rds/snapshot.rb +1 -0
  22. data/lib/fog/aws/models/rds/snapshots.rb +20 -13
  23. data/lib/fog/aws/parsers/rds/db_parser.rb +1 -1
  24. data/lib/fog/aws/parsers/rds/describe_db_log_files.rb +44 -0
  25. data/lib/fog/aws/parsers/rds/download_db_logfile_portion.rb +26 -0
  26. data/lib/fog/aws/parsers/ses/verify_domain_identity.rb +26 -0
  27. data/lib/fog/aws/parsers/storage/complete_multipart_upload.rb +1 -1
  28. data/lib/fog/aws/parsers/sts/assume_role.rb +30 -0
  29. data/lib/fog/aws/rds.rb +27 -14
  30. data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +8 -0
  31. data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +8 -1
  32. data/lib/fog/aws/requests/compute/create_volume.rb +3 -3
  33. data/lib/fog/aws/requests/rds/create_db_instance.rb +3 -1
  34. data/lib/fog/aws/requests/rds/describe_db_log_files.rb +67 -0
  35. data/lib/fog/aws/requests/rds/download_db_logfile_portion.rb +63 -0
  36. data/lib/fog/aws/requests/ses/send_raw_email.rb +1 -1
  37. data/lib/fog/aws/requests/ses/verify_domain_identity.rb +30 -0
  38. data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +6 -2
  39. data/lib/fog/aws/requests/storage/get_object.rb +1 -1
  40. data/lib/fog/aws/requests/sts/assume_role.rb +46 -0
  41. data/lib/fog/aws/ses.rb +26 -9
  42. data/lib/fog/aws/storage.rb +2 -1
  43. data/lib/fog/aws/sts.rb +31 -21
  44. data/lib/fog/bin.rb +0 -1
  45. data/lib/fog/bin/openstack.rb +5 -0
  46. data/lib/fog/brightbox/compute.rb +20 -212
  47. data/lib/fog/brightbox/compute/shared.rb +232 -0
  48. data/lib/fog/brightbox/models/compute/collaboration.rb +43 -0
  49. data/lib/fog/brightbox/models/compute/collaborations.rb +23 -0
  50. data/lib/fog/brightbox/models/compute/user_collaboration.rb +29 -0
  51. data/lib/fog/brightbox/models/compute/user_collaborations.rb +23 -0
  52. data/lib/fog/brightbox/requests/compute/accept_user_collaboration.rb +21 -0
  53. data/lib/fog/brightbox/requests/compute/create_collaboration.rb +23 -0
  54. data/lib/fog/brightbox/requests/compute/delete_collaboration.rb +28 -0
  55. data/lib/fog/brightbox/requests/compute/delete_user_collaboration.rb +28 -0
  56. data/lib/fog/brightbox/requests/compute/destroy_user_collaboration.rb +21 -0
  57. data/lib/fog/brightbox/requests/compute/get_collaboration.rb +21 -0
  58. data/lib/fog/brightbox/requests/compute/get_user_collaboration.rb +21 -0
  59. data/lib/fog/brightbox/requests/compute/list_collaborations.rb +19 -0
  60. data/lib/fog/brightbox/requests/compute/list_user_collaborations.rb +19 -0
  61. data/lib/fog/brightbox/requests/compute/reject_user_collaboration.rb +21 -0
  62. data/lib/fog/brightbox/requests/compute/resend_collaboration.rb +21 -0
  63. data/lib/fog/cloudsigma/docs/getting_started.md +59 -0
  64. data/lib/fog/core.rb +7 -2
  65. data/lib/fog/core/connection.rb +62 -29
  66. data/lib/fog/core/deprecated/connection.rb +24 -0
  67. data/lib/fog/core/parser.rb +1 -1
  68. data/lib/fog/digitalocean/examples/getting_started.md +1 -1
  69. data/lib/fog/digitalocean/models/compute/server.rb +2 -2
  70. data/lib/fog/google/compute.rb +31 -7
  71. data/lib/fog/google/models/compute/disk.rb +80 -0
  72. data/lib/fog/google/models/compute/disks.rb +28 -0
  73. data/lib/fog/google/models/compute/image.rb +36 -0
  74. data/lib/fog/google/models/compute/server.rb +46 -33
  75. data/lib/fog/google/models/compute/servers.rb +15 -8
  76. data/lib/fog/google/requests/compute/delete_server.rb +5 -2
  77. data/lib/fog/google/requests/compute/get_disk.rb +3 -0
  78. data/lib/fog/google/requests/compute/get_server.rb +7 -1
  79. data/lib/fog/google/requests/compute/insert_disk.rb +8 -2
  80. data/lib/fog/google/requests/compute/insert_server.rb +51 -22
  81. data/lib/fog/google/requests/compute/list_machine_types.rb +3 -2
  82. data/lib/fog/google/requests/storage/get_object.rb +1 -1
  83. data/lib/fog/hp/requests/storage/get_object.rb +1 -1
  84. data/lib/fog/hp/storage.rb +26 -9
  85. data/lib/fog/ibm/requests/compute/create_instance.rb +20 -15
  86. data/lib/fog/internet_archive/requests/storage/get_object.rb +1 -1
  87. data/lib/fog/{core/json.rb → json.rb} +13 -2
  88. data/lib/fog/metering.rb +25 -0
  89. data/lib/fog/openstack.rb +1 -0
  90. data/lib/fog/openstack/metering.rb +215 -0
  91. data/lib/fog/openstack/models/compute/flavors.rb +2 -2
  92. data/lib/fog/openstack/models/compute/metadata.rb +1 -1
  93. data/lib/fog/openstack/models/compute/server.rb +5 -2
  94. data/lib/fog/openstack/models/image/images.rb +1 -1
  95. data/lib/fog/openstack/models/metering/meter.rb +0 -0
  96. data/lib/fog/openstack/models/metering/meters.rb +0 -0
  97. data/lib/fog/openstack/models/metering/resource.rb +24 -0
  98. data/lib/fog/openstack/models/metering/resources.rb +25 -0
  99. data/lib/fog/openstack/models/volume/volume.rb +3 -1
  100. data/lib/fog/openstack/models/volume/volumes.rb +2 -1
  101. data/lib/fog/openstack/network.rb +1 -1
  102. data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
  103. data/lib/fog/openstack/requests/compute/create_server.rb +19 -1
  104. data/lib/fog/openstack/requests/compute/detach_volume.rb +2 -1
  105. data/lib/fog/openstack/requests/compute/list_flavors_detail.rb +4 -3
  106. data/lib/fog/openstack/requests/compute/list_security_groups.rb +1 -1
  107. data/lib/fog/openstack/requests/identity/create_tenant.rb +2 -2
  108. data/lib/fog/openstack/requests/metering/get_resource.rb +32 -0
  109. data/lib/fog/openstack/requests/metering/get_samples.rb +55 -0
  110. data/lib/fog/openstack/requests/metering/get_statistics.rb +56 -0
  111. data/lib/fog/openstack/requests/metering/list_meters.rb +50 -0
  112. data/lib/fog/openstack/requests/metering/list_resources.rb +32 -0
  113. data/lib/fog/openstack/requests/volume/create_volume.rb +4 -2
  114. data/lib/fog/rackspace.rb +16 -1
  115. data/lib/fog/rackspace/block_storage.rb +13 -28
  116. data/lib/fog/rackspace/cdn.rb +10 -24
  117. data/lib/fog/rackspace/compute.rb +17 -45
  118. data/lib/fog/rackspace/compute_v2.rb +13 -33
  119. data/lib/fog/rackspace/databases.rb +13 -29
  120. data/lib/fog/rackspace/dns.rb +27 -23
  121. data/lib/fog/rackspace/identity.rb +10 -26
  122. data/lib/fog/rackspace/load_balancers.rb +13 -29
  123. data/lib/fog/rackspace/mock_data.rb +3 -3
  124. data/lib/fog/rackspace/models/compute/server.rb +1 -1
  125. data/lib/fog/rackspace/models/dns/zones.rb +34 -21
  126. data/lib/fog/rackspace/models/identity/users.rb +2 -2
  127. data/lib/fog/rackspace/models/storage/file.rb +1 -0
  128. data/lib/fog/rackspace/requests/dns/list_domains.rb +2 -2
  129. data/lib/fog/rackspace/requests/storage/delete_multiple_objects.rb +75 -0
  130. data/lib/fog/rackspace/requests/storage/delete_static_large_object.rb +50 -0
  131. data/lib/fog/rackspace/requests/storage/get_object.rb +3 -1
  132. data/lib/fog/rackspace/requests/storage/put_dynamic_obj_manifest.rb +44 -0
  133. data/lib/fog/rackspace/requests/storage/put_object_manifest.rb +3 -30
  134. data/lib/fog/rackspace/requests/storage/put_static_obj_manifest.rb +60 -0
  135. data/lib/fog/rackspace/service.rb +43 -1
  136. data/lib/fog/rackspace/storage.rb +25 -43
  137. data/lib/fog/riakcs/provisioning.rb +2 -1
  138. data/lib/fog/riakcs/usage.rb +2 -1
  139. data/lib/fog/vcloud/requests/compute/configure_vm_cpus.rb +1 -1
  140. data/lib/fog/vcloud/requests/compute/configure_vm_memory.rb +1 -1
  141. data/lib/fog/version.rb +1 -1
  142. data/lib/fog/vsphere/requests/compute/get_folder.rb +1 -1
  143. data/lib/fog/xenserver/compute.rb +2 -0
  144. data/lib/fog/xenserver/models/compute/server.rb +9 -7
  145. data/lib/fog/xenserver/requests/compute/snapshot_revert.rb +22 -0
  146. data/lib/fog/xenserver/requests/compute/snapshot_server.rb +22 -0
  147. data/lib/fog/xml.rb +21 -0
  148. data/lib/fog/xml/sax_parser_connection.rb +43 -0
  149. data/lib/tasks/changelog_task.rb +1 -0
  150. data/tests/aws/models/auto_scaling/groups_test.rb +22 -0
  151. data/tests/aws/requests/compute/volume_tests.rb +3 -3
  152. data/tests/aws/requests/rds/helper.rb +14 -0
  153. data/tests/aws/requests/rds/log_file_tests.rb +19 -0
  154. data/tests/aws/requests/ses/verified_domain_identity_tests.rb +16 -0
  155. data/tests/aws/requests/sts/assume_role_tests.rb +19 -0
  156. data/tests/brightbox/requests/compute/collaboration_tests.rb +41 -0
  157. data/tests/brightbox/requests/compute/helper.rb +46 -2
  158. data/tests/brightbox/requests/compute/user_collaboration_tests.rb +67 -0
  159. data/tests/core/connection_tests.rb +26 -0
  160. data/tests/helper.rb +13 -0
  161. data/tests/openstack/requests/metering/meter_tests.rb +52 -0
  162. data/tests/openstack/requests/metering/resource_tests.rb +19 -0
  163. data/tests/openvz/helper.rb +14 -8
  164. data/tests/rackspace/block_storage_tests.rb +9 -0
  165. data/tests/rackspace/compute_tests.rb +9 -0
  166. data/tests/rackspace/compute_v2_tests.rb +9 -0
  167. data/tests/rackspace/databases_tests.rb +9 -0
  168. data/tests/rackspace/dns_tests.rb +20 -0
  169. data/tests/rackspace/helper.rb +12 -1
  170. data/tests/rackspace/identity_tests.rb +25 -0
  171. data/tests/rackspace/load_balancer_tests.rb +10 -0
  172. data/tests/rackspace/models/block_storage/volume_tests.rb +2 -2
  173. data/tests/rackspace/models/compute_v2/metadata_tests.rb +2 -2
  174. data/tests/rackspace/models/compute_v2/server_tests.rb +22 -21
  175. data/tests/rackspace/models/dns/zones_tests.rb +19 -5
  176. data/tests/rackspace/models/storage/file_tests.rb +22 -6
  177. data/tests/rackspace/rackspace_tests.rb +35 -0
  178. data/tests/rackspace/requests/block_storage/snapshot_tests.rb +2 -3
  179. data/tests/rackspace/requests/block_storage/volume_type_tests.rb +4 -11
  180. data/tests/rackspace/requests/compute_v2/address_tests.rb +1 -1
  181. data/tests/rackspace/requests/compute_v2/attachment_tests.rb +8 -9
  182. data/tests/rackspace/requests/compute_v2/flavor_tests.rb +1 -1
  183. data/tests/rackspace/requests/compute_v2/metadata_tests.rb +4 -4
  184. data/tests/rackspace/requests/databases/database_tests.rb +23 -20
  185. data/tests/rackspace/requests/databases/user_tests.rb +6 -6
  186. data/tests/rackspace/requests/identity/user_tests.rb +4 -1
  187. data/tests/rackspace/requests/load_balancers/usage_tests.rb +4 -2
  188. data/tests/rackspace/requests/storage/large_object_tests.rb +303 -59
  189. data/tests/rackspace/requests/storage/object_tests.rb +73 -18
  190. data/tests/rackspace/service_tests.rb +83 -0
  191. data/tests/rackspace/storage_tests.rb +9 -0
  192. data/tests/xenserver/models/compute/server_tests.rb +11 -1
  193. metadata +89 -19
  194. data/tests/core/user_agent_tests.rb +0 -6
@@ -47,7 +47,7 @@ module Fog
47
47
  'DBInstanceStatus', 'DBInstanceIdentifier', 'EngineVersion',
48
48
  'PreferredBackupWindow', 'PreferredMaintenanceWindow',
49
49
  'AvailabilityZone', 'MasterUsername', 'DBName', 'LicenseModel',
50
- 'DBSubnetGroupName'
50
+ 'DBSubnetGroupName', 'PubliclyAccessible'
51
51
  @db_instance[name] = value
52
52
  when 'MultiAZ', 'AutoMinorVersionUpgrade'
53
53
  if value == 'false'
@@ -0,0 +1,44 @@
1
+ module Fog
2
+ module Parsers
3
+ module AWS
4
+ module RDS
5
+
6
+ class DescribeDBLogFiles < Fog::Parsers::Base
7
+
8
+ attr_reader :rds_id
9
+
10
+ def initialize(rds_id)
11
+ @rds_id = rds_id
12
+ super()
13
+ end
14
+
15
+ def reset
16
+ @response = { 'DescribeDBLogFilesResult' => {'DBLogFiles' => []}, 'ResponseMetadata' => {} }
17
+ fresh_log_file
18
+ end
19
+
20
+ def fresh_log_file
21
+ @db_log_file = {'DBInstanceIdentifier' => @rds_id}
22
+ end
23
+
24
+ def start_element(name, attrs = [])
25
+ super
26
+ end
27
+
28
+ def end_element(name)
29
+ case name
30
+ when 'LastWritten' then @db_log_file[name] = Time.at(value.to_i / 1000)
31
+ when 'LogFileName' then @db_log_file[name] = value
32
+ when 'Size' then @db_log_file[name] = value.to_i
33
+ when 'DescribeDBLogFilesDetails'
34
+ @response['DescribeDBLogFilesResult']['DBLogFiles'] << @db_log_file
35
+ fresh_log_file
36
+ when 'Marker' then @response['DescribeDBLogFilesResult'][name] = value
37
+ when 'RequestId' then @response['ResponseMetadata'][name] = value
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,26 @@
1
+ module Fog
2
+ module Parsers
3
+ module AWS
4
+ module RDS
5
+
6
+ class DownloadDBLogFilePortion < Fog::Parsers::Base
7
+
8
+ def reset
9
+ @response = { 'DownloadDBLogFilePortionResult' => {}, 'ResponseMetadata' => {} }
10
+ end
11
+
12
+ def start_element(name, attrs = [])
13
+ super
14
+ end
15
+
16
+ def end_element(name)
17
+ key = (name == 'RequestId') ? 'ResponseMetadata' : 'DownloadDBLogFilePortionResult'
18
+ @response[key][name] = value
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module Fog
2
+ module Parsers
3
+ module AWS
4
+ module SES
5
+
6
+ class VerifyDomainIdentity < Fog::Parsers::Base
7
+
8
+ def reset
9
+ @response = { 'ResponseMetadata' => {} }
10
+ end
11
+
12
+ def end_element(name)
13
+ case name
14
+ when 'VerificationToken'
15
+ @response[name] = value
16
+ when 'RequestId'
17
+ @response['ResponseMetadata'][name] = value
18
+ end
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -11,7 +11,7 @@ module Fog
11
11
 
12
12
  def end_element(name)
13
13
  case name
14
- when 'Bucket', 'ETag', 'Key', 'Location'
14
+ when 'Bucket', 'ETag', 'Key', 'Location', 'Code', 'Message'
15
15
  @response[name] = value
16
16
  end
17
17
  end
@@ -0,0 +1,30 @@
1
+ module Fog
2
+ module Parsers
3
+ module AWS
4
+ module STS
5
+
6
+ class AssumeRole < Fog::Parsers::Base
7
+
8
+ def reset
9
+ @response = {}
10
+ end
11
+
12
+ def end_element(name)
13
+ case name
14
+ when 'SessionToken', 'SecretAccessKey', 'Expiration', 'AccessKeyId'
15
+ @response[name] = @value.strip
16
+ when 'Arn', 'AssumedRoleId'
17
+ @response[name] = @value.strip
18
+ when 'PackedPolicySize'
19
+ @response[name] = @value
20
+ when 'RequestId'
21
+ @response[name] = @value
22
+ end
23
+ end
24
+
25
+ end
26
+
27
+ end
28
+ end
29
+ end
30
+ end
@@ -10,7 +10,7 @@ module Fog
10
10
  class AuthorizationAlreadyExists < Fog::Errors::Error; end
11
11
 
12
12
  requires :aws_access_key_id, :aws_secret_access_key
13
- recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at
13
+ recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :version
14
14
 
15
15
  request_path 'fog/aws/requests/rds'
16
16
  request :describe_events
@@ -51,11 +51,16 @@ module Fog
51
51
  request :describe_db_subnet_groups
52
52
  # TODO: :delete_db_subnet_group, :modify_db_subnet_group
53
53
 
54
+ request :describe_db_log_files
55
+ request :download_db_logfile_portion
56
+
54
57
  model_path 'fog/aws/models/rds'
55
58
  model :server
56
59
  collection :servers
60
+
57
61
  model :snapshot
58
62
  collection :snapshots
63
+
59
64
  model :parameter_group
60
65
  collection :parameter_groups
61
66
 
@@ -68,6 +73,9 @@ module Fog
68
73
  model :subnet_group
69
74
  collection :subnet_groups
70
75
 
76
+ model :log_file
77
+ collection :log_files
78
+
71
79
  class Mock
72
80
 
73
81
  def self.data
@@ -155,6 +163,7 @@ module Fog
155
163
  @port = options[:port] || 443
156
164
  @scheme = options[:scheme] || 'https'
157
165
  @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
166
+ @version = options[:version] || '2012-09-17' #'2011-04-01'
158
167
  end
159
168
 
160
169
  def owner_id
@@ -191,12 +200,12 @@ module Fog
191
200
  :host => @host,
192
201
  :path => @path,
193
202
  :port => @port,
194
- :version => '2012-09-17' #'2011-04-01'
203
+ :version => @version
195
204
  }
196
205
  )
197
206
 
198
207
  begin
199
- response = @connection.request({
208
+ @connection.request({
200
209
  :body => body,
201
210
  :expects => 200,
202
211
  :headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
@@ -206,23 +215,27 @@ module Fog
206
215
  :parser => parser
207
216
  })
208
217
  rescue Excon::Errors::HTTPStatusError => error
209
- if match = error.response.body.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)
210
- case match[1].split('.').last
211
- when 'DBInstanceNotFound', 'DBParameterGroupNotFound', 'DBSnapshotNotFound', 'DBSecurityGroupNotFound'
212
- raise Fog::AWS::RDS::NotFound.slurp(error, match[2])
213
- when 'DBParameterGroupAlreadyExists'
214
- raise Fog::AWS::RDS::IdentifierTaken.slurp(error, match[2])
215
- when 'AuthorizationAlreadyExists'
216
- raise Fog::AWS::RDS::AuthorizationAlreadyExists.slurp(error, match[2])
218
+ match = Fog::AWS::Errors.match_error(error)
219
+ if match.empty?
220
+ case error.message
221
+ when 'Not Found'
222
+ raise Fog::AWS::RDS::NotFound.slurp(error, 'RDS Instance not found')
217
223
  else
218
224
  raise
219
225
  end
220
226
  else
221
- raise
227
+ raise case match[:code]
228
+ when 'DBInstanceNotFound', 'DBParameterGroupNotFound', 'DBSnapshotNotFound', 'DBSecurityGroupNotFound'
229
+ Fog::AWS::RDS::NotFound.slurp(error, match[:message])
230
+ when 'DBParameterGroupAlreadyExists'
231
+ Fog::AWS::RDS::IdentifierTaken.slurp(error, match[:message])
232
+ when 'AuthorizationAlreadyExists'
233
+ Fog::AWS::RDS::AuthorizationAlreadyExists.slurp(error, match[:message])
234
+ else
235
+ Fog::AWS::RDS::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
236
+ end
222
237
  end
223
238
  end
224
-
225
- response
226
239
  end
227
240
 
228
241
  end
@@ -63,6 +63,9 @@ module Fog
63
63
  # ==== See Also
64
64
  # http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_CreateAutoScalingGroup.html
65
65
  #
66
+
67
+ ExpectedOptions[:create_auto_scaling_group] = %w[DefaultCooldown DesiredCapacity HealthCheckGracePeriod HealthCheckType LoadBalancerNames PlacementGroup Tags TerminationPolicies VPCZoneIdentifier]
68
+
66
69
  def create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {})
67
70
  options.merge!(AWS.indexed_param('AvailabilityZones.member.%d', [*availability_zones]))
68
71
  options.delete('AvailabilityZones')
@@ -94,6 +97,11 @@ module Fog
94
97
  class Mock
95
98
 
96
99
  def create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {})
100
+ unexpected_options = options.keys - ExpectedOptions[:create_auto_scaling_group]
101
+ unless unexpected_options.empty?
102
+ raise Fog::AWS::AutoScaling::ValidationError.new("Options #{unexpected_options.join(',')} should not be included in request")
103
+ end
104
+
97
105
  if self.data[:auto_scaling_groups].has_key?(auto_scaling_group_name)
98
106
  raise Fog::AWS::AutoScaling::IdentifierTaken.new("AutoScalingGroup by this name already exists - A group with the name #{auto_scaling_group_name} already exists")
99
107
  end
@@ -1,7 +1,6 @@
1
1
  module Fog
2
2
  module AWS
3
3
  class AutoScaling
4
-
5
4
  class Real
6
5
 
7
6
  require 'fog/aws/parsers/auto_scaling/basic'
@@ -52,6 +51,9 @@ module Fog
52
51
  # ==== See Also
53
52
  # http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_UpdateAutoScalingGroup.html
54
53
  #
54
+
55
+ ExpectedOptions[:update_auto_scaling_group] = %w[AvailabilityZones DefaultCooldown DesiredCapacity HealthCheckGracePeriod HealthCheckType LaunchConfigurationName MaxSize MinSize PlacementGroup TerminationPolicies VPCZoneIdentifier]
56
+
55
57
  def update_auto_scaling_group(auto_scaling_group_name, options = {})
56
58
  if availability_zones = options.delete('AvailabilityZones')
57
59
  options.merge!(AWS.indexed_param('AvailabilityZones.member.%d', [*availability_zones]))
@@ -71,6 +73,11 @@ module Fog
71
73
  class Mock
72
74
 
73
75
  def update_auto_scaling_group(auto_scaling_group_name, options = {})
76
+ unexpected_options = options.keys - ExpectedOptions[:update_auto_scaling_group]
77
+ unless unexpected_options.empty?
78
+ raise Fog::AWS::AutoScaling::ValidationError.new("Options #{unexpected_options.join(',')} should not be included in request")
79
+ end
80
+
74
81
  unless self.data[:auto_scaling_groups].has_key?(auto_scaling_group_name)
75
82
  raise Fog::AWS::AutoScaling::ValidationError.new('AutoScalingGroup name not found - null')
76
83
  end
@@ -13,7 +13,7 @@ module Fog
13
13
  # * options<~Hash>
14
14
  # * 'SnapshotId'<~String> - Optional, snapshot to create volume from
15
15
  # * 'VolumeType'<~String> - Optional, volume type. standard or io1, default is standard.
16
- # * 'Iops'<~Integer> - Number of IOPS the volume supports. Required if VolumeType is io1, must be between 1 and 1000.
16
+ # * 'Iops'<~Integer> - Number of IOPS the volume supports. Required if VolumeType is io1, must be between 1 and 4000.
17
17
  #
18
18
  # ==== Returns
19
19
  # * response<~Excon::Response>:
@@ -83,8 +83,8 @@ module Fog
83
83
  raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too low; minimum is 100.")
84
84
  end
85
85
 
86
- if iops > 2000
87
- raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 2000.")
86
+ if iops > 4000
87
+ raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 4000.")
88
88
  end
89
89
  end
90
90
 
@@ -25,6 +25,7 @@ module Fog
25
25
  # @param PreferredBackupWindow [String] The daily time range during which automated backups are created if automated backups are enabled
26
26
  # @param PreferredMaintenanceWindow [String] The weekly time range (in UTC) during which system maintenance can occur, which may result in an outage
27
27
  # @param DBSubnetGroupName [String] The name, if any, of the VPC subnet for this RDS instance
28
+ # @param PubliclyAcccesible [Boolean] Whether an RDS instance inside of the VPC subnet should have a public-facing endpoint
28
29
  #
29
30
  # @return [Excon::Response]:
30
31
  # * body [Hash]:
@@ -103,7 +104,8 @@ module Fog
103
104
  # "ReadReplicaSourceDBInstanceIdentifier" => nil,
104
105
  # "LatestRestorableTime" => nil,
105
106
  "AvailabilityZone" => options["AvailabilityZone"],
106
- "DBSubnetGroupName" => options["DBSubnetGroupName"]
107
+ "DBSubnetGroupName" => options["DBSubnetGroupName"],
108
+ "PubliclyAccessible" => options["PubliclyAccessible"]
107
109
  }
108
110
 
109
111
 
@@ -0,0 +1,67 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/describe_db_log_files'
7
+
8
+ # Describe log files for a DB instance
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DescribeDBLogFiles.html
10
+ # ==== Parameters
11
+ # * DBInstanceIdentifier <~String> - ID of instance to retrieve information for. Required.
12
+ # * Options <~Hash> - Hash of options. Optional. The following keys are used:
13
+ # * :file_last_written <~Long> - Filter available log files for those written after this time. Optional.
14
+ # * :file_size <~Long> - Filters the available log files for files larger than the specified size. Optional.
15
+ # * :filename_contains <~String> - Filters the available log files for log file names that contain the specified string. Optional.
16
+ # * :marker <~String> - The pagination token provided in the previous request. If this parameter is specified the response includes only records beyond the marker, up to MaxRecords. Optional.
17
+ # * :max_records <~Integer> - The maximum number of records to include in the response. If more records exist, a pagination token is included in the response. Optional.
18
+ # ==== Returns
19
+ # * response<~Excon::Response>:
20
+ # * body<~Hash>:
21
+ def describe_db_log_files(rds_id=nil, opts={})
22
+ params = {}
23
+ params['DBInstanceIdentifier'] = rds_id if rds_id
24
+ params['Marker'] = opts[:marker] if opts[:marker]
25
+ params['MaxRecords'] = opts[:max_records] if opts[:max_records]
26
+ params['FilenameContains'] = opts[:filename_contains] if opts[:filename_contains]
27
+ params['FileSize'] = opts[:file_size] if opts[:file_size]
28
+ params['FileLastWritten'] = opts[:file_last_written] if opts[:file_last_written]
29
+
30
+ request({
31
+ 'Action' => 'DescribeDBLogFiles',
32
+ :parser => Fog::Parsers::AWS::RDS::DescribeDBLogFiles.new(rds_id)
33
+ }.merge(params))
34
+ end
35
+ end
36
+
37
+ class Mock
38
+
39
+ def describe_db_log_files(rds_id=nil, opts={})
40
+ response = Excon::Response.new
41
+ log_file_set = []
42
+
43
+ if rds_id
44
+ if server = self.data[:servers][rds_id]
45
+ log_file_set << {"LastWritten" => Time.parse('2013-07-05 17:00:00 -0700'), "LogFileName" => "error/mysql-error.log", "Size" => 0}
46
+ log_file_set << {"LastWritten" => Time.parse('2013-07-05 17:10:00 -0700'), "LogFileName" => "error/mysql-error-running.log", "Size" => 0}
47
+ log_file_set << {"LastWritten" => Time.parse('2013-07-05 17:20:00 -0700'), "LogFileName" => "error/mysql-error-running.log.0", "Size" => 8220}
48
+ log_file_set << {"LastWritten" => Time.parse('2013-07-05 17:30:00 -0700'), "LogFileName" => "error/mysql-error-running.log.1", "Size" => 0}
49
+ else
50
+ raise Fog::AWS::RDS::NotFound.new("DBInstance #{rds_id} not found")
51
+ end
52
+ else
53
+ raise Fog::AWS::RDS::NotFound.new('An identifier for an RDS instance must be provided')
54
+ end
55
+
56
+ response.status = 200
57
+ response.body = {
58
+ "ResponseMetadata" => { "RequestId" => Fog::AWS::Mock.request_id },
59
+ "DescribeDBLogFilesResult" => { "DBLogFiles" => log_file_set }
60
+ }
61
+ response
62
+ end
63
+
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,63 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/download_db_logfile_portion'
7
+
8
+ # Retrieve a portion of a log file of a db instance
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DownloadDBLogFilePortion.html
10
+ # ==== Parameters
11
+ # * DBInstanceIdentifier <~String> - ID of instance to retrieve information for. Required.
12
+ # * LogFileName <~String> - The name of the log file to be downloaded. Required.
13
+ # * Options <~Hash> - Hash of options. Optional. The following keys are used:
14
+ # * :marker <~String> - The pagination token provided in the previous request. If this parameter is specified the response includes only records beyond the marker, up to MaxRecords. Optional.
15
+ # * :max_records <~Integer> - The maximum number of records to include in the response. If more records exist, a pagination token is included in the response. Optional.
16
+ # * :number_of_lines <~Integer> - The number of lines to download. Optional.
17
+ # ==== Returns
18
+ # * response<~Excon::Response>:
19
+ # * body<~Hash>:
20
+ def download_db_logfile_portion(identifier=nil, filename=nil, opts={})
21
+ params = {}
22
+ params['DBInstanceIdentifier'] = identifier if identifier
23
+ params['LogFileName'] = filename if filename
24
+ params['Marker'] = opts[:marker] if opts[:marker]
25
+ params['MaxRecords'] = opts[:max_records] if opts[:max_records]
26
+ params['NumberOfLines'] = opts[:number_of_lines] if opts[:number_of_lines]
27
+
28
+ request({
29
+ 'Action' => 'DownloadDBLogFilePortion',
30
+ :parser => Fog::Parsers::AWS::RDS::DownloadDBLogFilePortion.new
31
+ }.merge(params))
32
+ end
33
+
34
+ end
35
+
36
+ class Mock
37
+
38
+ def download_db_logfile_portion(identifier=nil, filename=nil, opts={})
39
+ response = Excon::Response.new
40
+ server_set = []
41
+ if identifier
42
+ if server = self.data[:servers][identifier]
43
+ server_set << server
44
+ else
45
+ raise Fog::AWS::RDS::NotFound.new("DBInstance #{identifier} not found")
46
+ end
47
+ else
48
+ server_set = self.data[:servers].values
49
+ end
50
+
51
+ response.status = 200
52
+ response.body = {
53
+ "ResponseMetadata" => { "RequestId"=> Fog::AWS::Mock.request_id },
54
+ "DescribeDBInstancesResult" => { "DBInstances" => server_set }
55
+ }
56
+ response
57
+ end
58
+
59
+
60
+ end
61
+ end
62
+ end
63
+ end