gapinc-fog 1.12.1.1 → 1.12.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/Rakefile +3 -7
  2. data/bin/fog +22 -0
  3. data/fog.gemspec +1 -1
  4. data/lib/fog/aws.rb +11 -0
  5. data/lib/fog/aws/auto_scaling.rb +13 -18
  6. data/lib/fog/aws/beanstalk.rb +8 -10
  7. data/lib/fog/aws/cloud_formation.rb +9 -12
  8. data/lib/fog/aws/compute.rb +8 -10
  9. data/lib/fog/aws/credential_fetcher.rb +6 -6
  10. data/lib/fog/aws/elasticache.rb +13 -17
  11. data/lib/fog/aws/elb.rb +29 -31
  12. data/lib/fog/aws/iam.rb +10 -13
  13. data/lib/fog/aws/models/rds/server.rb +3 -1
  14. data/lib/fog/aws/models/rds/snapshot.rb +1 -0
  15. data/lib/fog/aws/parsers/rds/db_parser.rb +1 -1
  16. data/lib/fog/aws/parsers/ses/verify_domain_identity.rb +26 -0
  17. data/lib/fog/aws/rds.rb +19 -14
  18. data/lib/fog/aws/requests/compute/create_volume.rb +3 -3
  19. data/lib/fog/aws/requests/rds/create_db_instance.rb +3 -1
  20. data/lib/fog/aws/requests/ses/verify_domain_identity.rb +30 -0
  21. data/lib/fog/aws/ses.rb +1 -0
  22. data/lib/fog/aws/storage.rb +2 -1
  23. data/lib/fog/aws/sts.rb +9 -15
  24. data/lib/fog/core.rb +7 -2
  25. data/lib/fog/core/connection.rb +62 -29
  26. data/lib/fog/core/deprecated/connection.rb +24 -0
  27. data/lib/fog/core/parser.rb +1 -1
  28. data/lib/fog/google/compute.rb +31 -7
  29. data/lib/fog/google/models/compute/disk.rb +80 -0
  30. data/lib/fog/google/models/compute/disks.rb +28 -0
  31. data/lib/fog/google/models/compute/image.rb +36 -0
  32. data/lib/fog/google/models/compute/server.rb +46 -33
  33. data/lib/fog/google/models/compute/servers.rb +15 -8
  34. data/lib/fog/google/requests/compute/delete_server.rb +5 -2
  35. data/lib/fog/google/requests/compute/get_disk.rb +3 -0
  36. data/lib/fog/google/requests/compute/get_server.rb +7 -1
  37. data/lib/fog/google/requests/compute/insert_disk.rb +8 -2
  38. data/lib/fog/google/requests/compute/insert_server.rb +51 -22
  39. data/lib/fog/google/requests/compute/list_machine_types.rb +3 -2
  40. data/lib/fog/hp/storage.rb +26 -9
  41. data/lib/fog/{core/json.rb → json.rb} +13 -2
  42. data/lib/fog/openstack/models/compute/metadata.rb +1 -1
  43. data/lib/fog/openstack/models/image/images.rb +1 -1
  44. data/lib/fog/openstack/requests/compute/detach_volume.rb +2 -1
  45. data/lib/fog/openstack/requests/compute/list_security_groups.rb +1 -1
  46. data/lib/fog/rackspace.rb +5 -0
  47. data/lib/fog/rackspace/block_storage.rb +13 -28
  48. data/lib/fog/rackspace/cdn.rb +10 -24
  49. data/lib/fog/rackspace/compute.rb +17 -45
  50. data/lib/fog/rackspace/compute_v2.rb +13 -33
  51. data/lib/fog/rackspace/databases.rb +13 -29
  52. data/lib/fog/rackspace/dns.rb +20 -22
  53. data/lib/fog/rackspace/identity.rb +10 -26
  54. data/lib/fog/rackspace/load_balancers.rb +13 -29
  55. data/lib/fog/rackspace/mock_data.rb +3 -3
  56. data/lib/fog/rackspace/models/compute/server.rb +1 -1
  57. data/lib/fog/rackspace/models/identity/users.rb +2 -2
  58. data/lib/fog/rackspace/models/storage/file.rb +1 -0
  59. data/lib/fog/rackspace/requests/storage/get_object.rb +3 -1
  60. data/lib/fog/rackspace/service.rb +43 -1
  61. data/lib/fog/rackspace/storage.rb +9 -31
  62. data/lib/fog/xenserver/compute.rb +2 -0
  63. data/lib/fog/xenserver/models/compute/server.rb +9 -7
  64. data/lib/fog/xenserver/requests/compute/snapshot_revert.rb +22 -0
  65. data/lib/fog/xenserver/requests/compute/snapshot_server.rb +22 -0
  66. data/lib/fog/xml.rb +21 -0
  67. data/lib/fog/xml/sax_parser_connection.rb +43 -0
  68. data/tests/aws/requests/compute/volume_tests.rb +3 -3
  69. data/tests/aws/requests/rds/helper.rb +1 -0
  70. data/tests/aws/requests/ses/verified_domain_identity_tests.rb +16 -0
  71. data/tests/core/connection_tests.rb +26 -0
  72. data/tests/helper.rb +9 -7
  73. data/tests/rackspace/block_storage_tests.rb +9 -0
  74. data/tests/rackspace/compute_tests.rb +9 -0
  75. data/tests/rackspace/compute_v2_tests.rb +9 -0
  76. data/tests/rackspace/databases_tests.rb +9 -0
  77. data/tests/rackspace/dns_tests.rb +9 -0
  78. data/tests/rackspace/helper.rb +12 -1
  79. data/tests/rackspace/identity_tests.rb +25 -0
  80. data/tests/rackspace/load_balancer_tests.rb +10 -0
  81. data/tests/rackspace/models/block_storage/volume_tests.rb +2 -2
  82. data/tests/rackspace/models/compute_v2/metadata_tests.rb +2 -2
  83. data/tests/rackspace/models/compute_v2/server_tests.rb +22 -21
  84. data/tests/rackspace/models/storage/file_tests.rb +22 -6
  85. data/tests/rackspace/rackspace_tests.rb +35 -0
  86. data/tests/rackspace/requests/block_storage/snapshot_tests.rb +2 -3
  87. data/tests/rackspace/requests/block_storage/volume_type_tests.rb +4 -11
  88. data/tests/rackspace/requests/compute_v2/address_tests.rb +1 -1
  89. data/tests/rackspace/requests/compute_v2/attachment_tests.rb +8 -9
  90. data/tests/rackspace/requests/compute_v2/flavor_tests.rb +1 -1
  91. data/tests/rackspace/requests/compute_v2/metadata_tests.rb +4 -4
  92. data/tests/rackspace/requests/databases/database_tests.rb +23 -20
  93. data/tests/rackspace/requests/databases/user_tests.rb +6 -6
  94. data/tests/rackspace/requests/identity/user_tests.rb +4 -1
  95. data/tests/rackspace/requests/load_balancers/usage_tests.rb +4 -2
  96. data/tests/rackspace/service_tests.rb +83 -0
  97. data/tests/rackspace/storage_tests.rb +9 -0
  98. data/tests/xenserver/models/compute/server_tests.rb +11 -1
  99. metadata +19 -4
  100. data/tests/core/user_agent_tests.rb +0 -6
data/Rakefile CHANGED
@@ -53,20 +53,15 @@ require "tasks/test_task"
53
53
  Fog::Rake::TestTask.new
54
54
 
55
55
  namespace :test do
56
+ mock = 'true' || ENV['FOG_MOCK']
56
57
  task :travis do
57
- [true].each do |mock|
58
58
  sh("export FOG_MOCK=#{mock} && bundle exec shindont")
59
- end
60
59
  end
61
60
  task :vsphere do
62
- [true].each do |mock|
63
61
  sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/vsphere")
64
- end
65
62
  end
66
63
  task :openvz do
67
- [true].each do |mock|
68
64
  sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/openvz")
69
- end
70
65
  end
71
66
  end
72
67
 
@@ -194,7 +189,8 @@ require "tasks/changelog_task"
194
189
  Fog::Rake::ChangelogTask.new
195
190
 
196
191
  task :coveralls_push_workaround do
197
- if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
192
+ ENV['COVERAGE'] = 'false' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.9')
193
+ unless ENV['COVERAGE'] == 'false'
198
194
  require 'coveralls/rake/task'
199
195
  Coveralls::RakeTask.new
200
196
  Rake::Task["coveralls:push"].invoke
data/bin/fog CHANGED
@@ -1,7 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'fog'))
4
+ require 'optparse'
3
5
  require 'irb'
4
6
  require 'yaml'
7
+
8
+ options = OptionParser.new do |opts|
9
+ opts.banner = 'usage: fog [options] CREDENTIAL'
10
+
11
+ opts.on('-C', '--credentials-path FILE', 'Path to the credentials file') do |file|
12
+ Fog.credentials_path = file
13
+ end
14
+
15
+ opts.on_tail('-v', '--version', 'Prints the version') do
16
+ puts Fog::VERSION
17
+ exit
18
+ end
19
+
20
+ opts.on_tail('-h', '--help', 'Prints this message') do
21
+ puts opts
22
+ exit
23
+ end
24
+ end
25
+ options.parse!
26
+
5
27
  Fog.credential = ARGV.first ? ARGV.first.to_sym : nil
6
28
  Fog.mock! if ENV['FOG_MOCK']
7
29
  if Fog.credentials.empty?
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  ## If your rubyforge_project name is different, then edit it and comment out
7
7
  ## the sub! line in the Rakefile
8
8
  s.name = 'gapinc-fog'
9
- s.version = '1.12.1.1'
9
+ s.version = '1.12.1.2'
10
10
  s.date = '2013-06-10'
11
11
  s.rubyforge_project = 'fog'
12
12
 
@@ -301,5 +301,16 @@ module Fog
301
301
  end
302
302
  options
303
303
  end
304
+
305
+ module Errors
306
+ def self.match_error(error)
307
+ matcher = lambda {|s| s.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)}
308
+ [error.message, error.response.body].each(&Proc.new {|s|
309
+ match = matcher.call(s)
310
+ return {:code => match[1].split('.').last, :message => match[2]} if match
311
+ })
312
+ {} # we did not match the message or response body
313
+ end
314
+ end
304
315
  end
305
316
  end
@@ -143,7 +143,7 @@ module Fog
143
143
 
144
144
  def _request(body, idempotent, parser)
145
145
  begin
146
- response = @connection.request({
146
+ @connection.request({
147
147
  :body => body,
148
148
  :expects => 200,
149
149
  :idempotent => idempotent,
@@ -153,24 +153,19 @@ module Fog
153
153
  :parser => parser
154
154
  })
155
155
  rescue Excon::Errors::HTTPStatusError => error
156
- if match = error.message.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)
157
- case match[1]
158
- when 'AlreadyExists'
159
- #raise Fog::AWS::AutoScaling::IdentifierTaken.new(match[2])
160
- raise Fog::AWS::AutoScaling::IdentifierTaken.slurp(error, match[2])
161
- when 'ResourceInUse'
162
- raise Fog::AWS::AutoScaling::ResourceInUse.slurp(error, match[2])
163
- when 'ValidationError'
164
- raise Fog::AWS::AutoScaling::ValidationError.slurp(error, match[2])
165
- else
166
- raise Fog::Compute::AWS::Error.slurp(error, "#{match[1]} => #{match[2]}")
167
- end
168
- else
169
- raise
170
- end
156
+ match = Fog::AWS::Errors.match_error(error)
157
+ raise if match.empty?
158
+ raise case match[:code]
159
+ when 'AlreadyExists'
160
+ Fog::AWS::AutoScaling::IdentifierTaken.slurp(error, match[:message])
161
+ when 'ResourceInUse'
162
+ Fog::AWS::AutoScaling::ResourceInUse.slurp(error, match[:message])
163
+ when 'ValidationError'
164
+ Fog::AWS::AutoScaling::ValidationError.slurp(error, match[:message])
165
+ else
166
+ Fog::AWS::AutoScaling::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
167
+ end
171
168
  end
172
-
173
- response
174
169
  end
175
170
 
176
171
  def setup_credentials(options)
@@ -131,16 +131,14 @@ module Fog
131
131
  :parser => parser
132
132
  })
133
133
  rescue Excon::Errors::HTTPStatusError => error
134
- if match = error.message.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)
135
- raise case match[1].split('.').last
136
- when 'InvalidParameterValue'
137
- Fog::AWS::ElasticBeanstalk::InvalidParameterError.slurp(error, match[2])
138
- else
139
- Fog::AWS::ElasticBeanstalk::Error.slurp(error, "#{match[1]} => #{match[2]}")
140
- end
141
- else
142
- raise error
143
- end
134
+ match = Fog::AWS::Errors.match_error(error)
135
+ raise if match.empty?
136
+ raise case match[:code]
137
+ when 'InvalidParameterValue'
138
+ Fog::AWS::ElasticBeanstalk::InvalidParameterError.slurp(error, match[:message])
139
+ else
140
+ Fog::AWS::ElasticBeanstalk::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
141
+ end
144
142
  end
145
143
 
146
144
  end
@@ -98,7 +98,7 @@ module Fog
98
98
  )
99
99
 
100
100
  begin
101
- response = @connection.request({
101
+ @connection.request({
102
102
  :body => body,
103
103
  :expects => 200,
104
104
  :idempotent => idempotent,
@@ -108,19 +108,16 @@ module Fog
108
108
  :parser => parser
109
109
  })
110
110
  rescue Excon::Errors::HTTPStatusError => error
111
- if match = error.message.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)
112
- raise case match[1].split('.').last
113
- when 'NotFound', 'ValidationError'
114
- Fog::AWS::CloudFormation::NotFound.slurp(error, match[2])
115
- else
116
- Fog::AWS::CloudFormation::Error.slurp(error, "#{match[1]} => #{match[2]}")
117
- end
118
- else
119
- raise error
120
- end
111
+ match = Fog::AWS::Errors.match_error(error)
112
+ raise if match.empty?
113
+ raise case match[:code]
114
+ when 'NotFound', 'ValidationError'
115
+ Fog::AWS::CloudFormation::NotFound.slurp(error, match[:message])
116
+ else
117
+ Fog::AWS::CloudFormation::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
118
+ end
121
119
  end
122
120
 
123
- response
124
121
  end
125
122
 
126
123
  end
@@ -392,16 +392,14 @@ module Fog
392
392
  :parser => parser
393
393
  })
394
394
  rescue Excon::Errors::HTTPStatusError => error
395
- if match = error.message.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)
396
- raise case match[1].split('.').last
397
- when 'NotFound', 'Unknown'
398
- Fog::Compute::AWS::NotFound.slurp(error, match[2])
399
- else
400
- Fog::Compute::AWS::Error.slurp(error, "#{match[1]} => #{match[2]}")
401
- end
402
- else
403
- raise error
404
- end
395
+ match = Fog::AWS::Errors.match_error(error)
396
+ raise if match.empty?
397
+ raise case match[:code]
398
+ when 'NotFound', 'Unknown'
399
+ Fog::Compute::AWS::NotFound.slurp(error, match[:message])
400
+ else
401
+ Fog::Compute::AWS::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
402
+ end
405
403
  end
406
404
 
407
405
  end
@@ -1,4 +1,5 @@
1
- require 'fog/core/json'
1
+ require "fog/json"
2
+
2
3
  module Fog
3
4
  module AWS
4
5
  module CredentialFetcher
@@ -14,7 +15,7 @@ module Fog
14
15
 
15
16
  session = Fog::JSON.decode(role_data)
16
17
  credentials = {}
17
- credentials[:aws_access_key_id] = session['AccessKeyId']
18
+ credentials[:aws_access_key_id] = session['AccessKeyId']
18
19
  credentials[:aws_secret_access_key] = session['SecretAccessKey']
19
20
  credentials[:aws_session_token] = session['Token']
20
21
  credentials[:aws_credentials_expire_at] = Time.xmlschema session['Expiration']
@@ -31,7 +32,7 @@ module Fog
31
32
  end
32
33
 
33
34
  module ConnectionMethods
34
-
35
+
35
36
  def refresh_credentials_if_expired
36
37
  refresh_credentials if credentials_expired?
37
38
  end
@@ -39,8 +40,8 @@ module Fog
39
40
  private
40
41
 
41
42
  def credentials_expired?
42
- @use_iam_profile &&
43
- (!@aws_credentials_expire_at ||
43
+ @use_iam_profile &&
44
+ (!@aws_credentials_expire_at ||
44
45
  (@aws_credentials_expire_at && Fog::Time.now > @aws_credentials_expire_at - 15)) #new credentials become available from around 5 minutes before expiration time
45
46
  end
46
47
 
@@ -61,4 +62,3 @@ module Fog
61
62
  end
62
63
  end
63
64
  end
64
-
@@ -94,7 +94,7 @@ module Fog
94
94
  )
95
95
 
96
96
  begin
97
- response = @connection.request({
97
+ @connection.request({
98
98
  :body => body,
99
99
  :expects => 200,
100
100
  :headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
@@ -104,24 +104,20 @@ module Fog
104
104
  :parser => parser
105
105
  })
106
106
  rescue Excon::Errors::HTTPStatusError => error
107
- if match = error.message.match(/(?:.*<Code>(.*)<\/Code>?)/m)
108
- case match[1]
109
- when 'CacheSecurityGroupNotFound', 'CacheParameterGroupNotFound',
110
- 'CacheClusterNotFound'
111
- raise Fog::AWS::Elasticache::NotFound
112
- when 'CacheSecurityGroupAlreadyExists'
113
- raise Fog::AWS::Elasticache::IdentifierTaken
114
- when 'InvalidParameterValue'
115
- raise Fog::AWS::Elasticache::InvalidInstance
116
- else
117
- raise
118
- end
119
- else
120
- raise
121
- end
107
+ match = Fog::AWS::Errors.match_error(error)
108
+ raise if match.empty?
109
+ raise case match[:code]
110
+ when 'CacheSecurityGroupNotFound', 'CacheParameterGroupNotFound', 'CacheClusterNotFound'
111
+ Fog::AWS::Elasticache::NotFound.slurp(error, match[:message])
112
+ when 'CacheSecurityGroupAlreadyExists'
113
+ Fog::AWS::Elasticache::IdentifierTaken.slurp(error, match[:message])
114
+ when 'InvalidParameterValue'
115
+ Fog::AWS::Elasticache::InvalidInstance.slurp(error, match[:message])
116
+ else
117
+ Fog::AWS::Elasticache::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
118
+ end
122
119
  end
123
120
 
124
- response
125
121
  end
126
122
 
127
123
  end
@@ -191,37 +191,35 @@ module Fog
191
191
  :parser => parser
192
192
  })
193
193
  rescue Excon::Errors::HTTPStatusError => error
194
- if match = error.message.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)
195
- case match[1]
196
- when 'CertificateNotFound'
197
- raise Fog::AWS::IAM::NotFound.slurp(error, match[2])
198
- when 'DuplicateLoadBalancerName'
199
- raise Fog::AWS::ELB::IdentifierTaken.slurp(error, match[2])
200
- when 'DuplicatePolicyName'
201
- raise Fog::AWS::ELB::DuplicatePolicyName.slurp(error, match[2])
202
- when 'InvalidInstance'
203
- raise Fog::AWS::ELB::InvalidInstance.slurp(error, match[2])
204
- when 'InvalidConfigurationRequest'
205
- # when do they fucking use this shit?
206
- raise Fog::AWS::ELB::InvalidConfigurationRequest.slurp(error, match[2])
207
- when 'LoadBalancerNotFound'
208
- raise Fog::AWS::ELB::NotFound.slurp(error, match[2])
209
- when 'PolicyNotFound'
210
- raise Fog::AWS::ELB::PolicyNotFound.slurp(error, match[2])
211
- when 'PolicyTypeNotFound'
212
- raise Fog::AWS::ELB::PolicyTypeNotFound.slurp(error, match[2])
213
- when 'Throttling'
214
- raise Fog::AWS::ELB::Throttled.slurp(error, match[2])
215
- when 'TooManyPolicies'
216
- raise Fog::AWS::ELB::TooManyPolicies.slurp(error, match[2])
217
- when 'ValidationError'
218
- raise Fog::AWS::ELB::ValidationError.slurp(error, match[2])
219
- else
220
- raise
221
- end
222
- else
223
- raise
224
- end
194
+ match = Fog::AWS::Errors.match_error(error)
195
+ raise if match.empty?
196
+ raise case match[:code]
197
+ when 'CertificateNotFound'
198
+ Fog::AWS::IAM::NotFound.slurp(error, match[:message])
199
+ when 'DuplicateLoadBalancerName'
200
+ Fog::AWS::ELB::IdentifierTaken.slurp(error, match[:message])
201
+ when 'DuplicatePolicyName'
202
+ Fog::AWS::ELB::DuplicatePolicyName.slurp(error, match[:message])
203
+ when 'InvalidInstance'
204
+ Fog::AWS::ELB::InvalidInstance.slurp(error, match[:message])
205
+ when 'InvalidConfigurationRequest'
206
+ # when do they fucking use this shit?
207
+ Fog::AWS::ELB::InvalidConfigurationRequest.slurp(error, match[:message])
208
+ when 'LoadBalancerNotFound'
209
+ Fog::AWS::ELB::NotFound.slurp(error, match[:message])
210
+ when 'PolicyNotFound'
211
+ Fog::AWS::ELB::PolicyNotFound.slurp(error, match[:message])
212
+ when 'PolicyTypeNotFound'
213
+ Fog::AWS::ELB::PolicyTypeNotFound.slurp(error, match[:message])
214
+ when 'Throttling'
215
+ Fog::AWS::ELB::Throttled.slurp(error, match[:message])
216
+ when 'TooManyPolicies'
217
+ Fog::AWS::ELB::TooManyPolicies.slurp(error, match[:message])
218
+ when 'ValidationError'
219
+ Fog::AWS::ELB::ValidationError.slurp(error, match[:message])
220
+ else
221
+ Fog::AWS::ELB::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
222
+ end
225
223
  end
226
224
  end
227
225
  end
@@ -208,19 +208,16 @@ module Fog
208
208
  :parser => parser
209
209
  })
210
210
  rescue Excon::Errors::HTTPStatusError => error
211
- if match = error.message.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)
212
- case match[1]
213
- when 'CertificateNotFound', 'NoSuchEntity'
214
- raise Fog::AWS::IAM::NotFound.slurp(error, match[2])
215
- when 'EntityAlreadyExists', 'KeyPairMismatch', 'LimitExceeded', 'MalformedCertificate', 'ValidationError'
216
- raise Fog::AWS::IAM.const_get(match[1]).slurp(error, match[2])
217
- else
218
- raise Fog::AWS::IAM::Error.slurp(error, "#{match[1]} => #{match[2]}") if match[1]
219
- raise
220
- end
221
- else
222
- raise
223
- end
211
+ match = Fog::AWS::Errors.match_error(error)
212
+ raise if match.empty?
213
+ raise case match[:code]
214
+ when 'CertificateNotFound', 'NoSuchEntity'
215
+ Fog::AWS::IAM::NotFound.slurp(error, match[:message])
216
+ when 'EntityAlreadyExists', 'KeyPairMismatch', 'LimitExceeded', 'MalformedCertificate', 'ValidationError'
217
+ Fog::AWS::IAM.const_get(match[:code]).slurp(error, match[:message])
218
+ else
219
+ Fog::AWS::IAM::Error.slurp(error, "#{match[:code]} => #{match[:message]}")
220
+ end
224
221
  end
225
222
 
226
223
  end
@@ -30,6 +30,7 @@ module Fog
30
30
  attribute :backup_retention_period, :aliases => 'BackupRetentionPeriod', :type => :integer
31
31
  attribute :license_model, :aliases => 'LicenseModel'
32
32
  attribute :db_subnet_group_name, :aliases => 'DBSubnetGroupName'
33
+ attribute :publicly_accessible, :aliases => 'PubliclyAccessible'
33
34
 
34
35
  attr_accessor :password, :parameter_group_name, :security_group_names, :port
35
36
 
@@ -120,7 +121,8 @@ module Fog
120
121
  'PreferredBackupWindow' => preferred_backup_window,
121
122
  'MultiAZ' => multi_az,
122
123
  'LicenseModel' => license_model,
123
- 'DBSubnetGroupName' => db_subnet_group_name
124
+ 'DBSubnetGroupName' => db_subnet_group_name,
125
+ 'PubliclyAccessible' => publicly_accessible
124
126
  }
125
127
 
126
128
  options.delete_if {|key, value| value.nil?}
@@ -18,6 +18,7 @@ module Fog
18
18
  attribute :allocated_storage, :aliases => 'AllocatedStorage', :type => :integer
19
19
  attribute :availability_zone, :aliases => 'AvailabilityZone'
20
20
  attribute :type, :aliases => 'SnapshotType'
21
+ attribute :publicly_accessible, :aliases => 'PubliclyAccessible'
21
22
 
22
23
  def ready?
23
24
  state == 'available'
@@ -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,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