fog 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -6
- data/fog.gemspec +3 -3
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/parsers/ses/delete_verified_email_address.rb +24 -0
- data/lib/fog/aws/parsers/ses/get_send_quota.rb +26 -0
- data/lib/fog/aws/parsers/ses/get_send_statistics.rb +29 -0
- data/lib/fog/aws/parsers/ses/list_verified_email_addresses.rb +25 -0
- data/lib/fog/aws/parsers/ses/send_email.rb +26 -0
- data/lib/fog/aws/parsers/ses/send_raw_email.rb +26 -0
- data/lib/fog/aws/parsers/ses/verify_email_address.rb +24 -0
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/ses/delete_verified_email_address.rb +37 -0
- data/lib/fog/aws/requests/ses/get_send_quota.rb +40 -0
- data/lib/fog/aws/requests/ses/get_send_statistics.rb +43 -0
- data/lib/fog/aws/requests/ses/list_verified_email_addresses.rb +37 -0
- data/lib/fog/aws/requests/ses/send_email.rb +82 -0
- data/lib/fog/aws/requests/ses/send_raw_email.rb +50 -0
- data/lib/fog/aws/requests/ses/verify_email_address.rb +37 -0
- data/lib/fog/aws/ses.rb +106 -0
- data/lib/fog/bin/aws.rb +5 -1
- data/lib/fog/cdn.rb +1 -1
- data/lib/fog/compute/aws.rb +1 -0
- data/lib/fog/compute/models/aws/server.rb +5 -2
- data/lib/fog/compute/models/bluebox/server.rb +5 -2
- data/lib/fog/compute/models/go_grid/images.rb +1 -1
- data/lib/fog/compute/models/go_grid/server.rb +55 -8
- data/lib/fog/compute/models/go_grid/servers.rb +2 -2
- data/lib/fog/compute/models/rackspace/server.rb +5 -2
- data/lib/fog/compute/models/slicehost/server.rb +5 -2
- data/lib/fog/compute/parsers/aws/describe_reserved_instances_offerings.rb +34 -0
- data/lib/fog/compute/rackspace.rb +28 -7
- data/lib/fog/compute/requests/aws/describe_images.rb +48 -1
- data/lib/fog/compute/requests/aws/describe_reserved_instances_offerings.rb +45 -0
- data/lib/fog/compute/requests/go_grid/grid_server_add.rb +2 -2
- data/lib/fog/core/ssh.rb +7 -3
- data/lib/fog/dns.rb +1 -1
- data/lib/fog/dns/requests/aws/create_hosted_zone.rb +8 -8
- data/lib/fog/providers/aws.rb +1 -0
- data/lib/fog/storage/aws.rb +49 -30
- data/lib/fog/storage/google.rb +48 -29
- data/lib/fog/storage/local.rb +2 -0
- data/lib/fog/storage/models/aws/file.rb +1 -1
- data/lib/fog/storage/models/google/file.rb +1 -1
- data/lib/fog/storage/models/local/file.rb +9 -1
- data/lib/fog/storage/requests/aws/put_bucket.rb +6 -6
- data/lib/fog/storage/requests/aws/put_object.rb +7 -7
- data/lib/fog/storage/requests/google/put_bucket.rb +5 -6
- data/lib/fog/storage/requests/google/put_object.rb +7 -7
- data/lib/fog/storage/requests/rackspace/get_container.rb +1 -0
- data/lib/fog/storage/requests/rackspace/get_containers.rb +1 -0
- data/tests/aws/requests/ses/helper.rb +15 -0
- data/tests/aws/requests/ses/verified_email_address_tests.rb +27 -0
- data/tests/compute/requests/terremark_ecloud/catalog_tests.rb +1 -1
- data/tests/compute/requests/terremark_ecloud/network_tests.rb +1 -1
- data/tests/compute/requests/terremark_ecloud/organization_tests.rb +1 -1
- data/tests/compute/requests/terremark_ecloud/vdc_tests.rb +1 -1
- data/tests/helper.rb +4 -36
- data/tests/helpers/mock_helper.rb +33 -0
- metadata +32 -9
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fog (0.
|
4
|
+
fog (0.5.0)
|
5
5
|
builder
|
6
6
|
excon (>= 0.4.0)
|
7
7
|
formatador (>= 0.0.16)
|
@@ -17,8 +17,6 @@ GEM
|
|
17
17
|
builder (3.0.0)
|
18
18
|
excon (0.4.0)
|
19
19
|
formatador (0.0.16)
|
20
|
-
gestalt (0.0.11)
|
21
|
-
formatador (>= 0.0.12)
|
22
20
|
json (1.4.6)
|
23
21
|
mime-types (1.16)
|
24
22
|
net-ssh (2.0.23)
|
@@ -26,9 +24,8 @@ GEM
|
|
26
24
|
rake (0.8.7)
|
27
25
|
rspec (1.3.1)
|
28
26
|
ruby-hmac (0.4.0)
|
29
|
-
shindo (0.
|
27
|
+
shindo (0.2.0)
|
30
28
|
formatador (>= 0.0.16)
|
31
|
-
gestalt (>= 0.0.11)
|
32
29
|
|
33
30
|
PLATFORMS
|
34
31
|
ruby
|
@@ -45,4 +42,4 @@ DEPENDENCIES
|
|
45
42
|
rake
|
46
43
|
rspec (= 1.3.1)
|
47
44
|
ruby-hmac
|
48
|
-
shindo (= 0.
|
45
|
+
shindo (= 0.2.0)
|
data/fog.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
8
|
## the sub! line in the Rakefile
|
9
9
|
s.name = 'fog'
|
10
|
-
s.version = '0.
|
11
|
-
s.date = '2011-01-
|
10
|
+
s.version = '0.5.0'
|
11
|
+
s.date = '2011-01-27'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
@@ -55,7 +55,7 @@ Gem::Specification.new do |s|
|
|
55
55
|
## those that are only needed during development
|
56
56
|
s.add_development_dependency('rake')
|
57
57
|
s.add_development_dependency('rspec', '1.3.1')
|
58
|
-
s.add_development_dependency('shindo', '0.
|
58
|
+
s.add_development_dependency('shindo', '0.2.0')
|
59
59
|
|
60
60
|
s.files = `git ls-files`.split("\n")
|
61
61
|
s.test_files = `git ls-files -- {spec,tests}/*`.split("\n")
|
data/lib/fog.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module SES
|
5
|
+
|
6
|
+
class DeleteVerifiedEmailAddress < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@response = { 'ResponseMetadata' => {} }
|
10
|
+
end
|
11
|
+
|
12
|
+
def end_element(name)
|
13
|
+
case name
|
14
|
+
when 'RequestId'
|
15
|
+
@response['ResponseMetadata'][name] = @value
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module SES
|
5
|
+
|
6
|
+
class GetSendQuota < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@response = { 'ResponseMetadata' => {} }
|
10
|
+
end
|
11
|
+
|
12
|
+
def end_element(name)
|
13
|
+
case name
|
14
|
+
when "Max24HourSend", "MaxSendRate", "SentLast24Hours"
|
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
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module SES
|
5
|
+
|
6
|
+
class GetSendStatistics < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@response = { 'SendDataPoints' => [], 'ResponseMetadata' => {} }
|
10
|
+
@send_data_point = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def end_element(name)
|
14
|
+
case name
|
15
|
+
when "Bounces", "Complaints", "DeliveryAttempts", "Rejects", "Timestamp"
|
16
|
+
@send_data_point[name] = @value
|
17
|
+
when 'member'
|
18
|
+
@response['SendDataPoints'] << @send_data_point
|
19
|
+
@send_data_point = {}
|
20
|
+
when 'RequestId'
|
21
|
+
@response['ResponseMetadata'][name] = @value
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module SES
|
5
|
+
|
6
|
+
class ListVerifiedEmailAddresses < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@response = { 'VerifiedEmailAddresses' => [], 'ResponseMetadata' => {} }
|
10
|
+
end
|
11
|
+
|
12
|
+
def end_element(name)
|
13
|
+
case name
|
14
|
+
when 'member'
|
15
|
+
@response['VerifiedEmailAddresses'] << @value
|
16
|
+
when 'RequestId'
|
17
|
+
@response['ResponseMetadata'][name] = @value
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module SES
|
5
|
+
|
6
|
+
class SendEmail < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@response = { 'ResponseMetadata' => {} }
|
10
|
+
end
|
11
|
+
|
12
|
+
def end_element(name)
|
13
|
+
case name
|
14
|
+
when 'MessageId'
|
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
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module SES
|
5
|
+
|
6
|
+
class SendRawEmail < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@response = { 'ResponseMetadata' => {} }
|
10
|
+
end
|
11
|
+
|
12
|
+
def end_element(name)
|
13
|
+
case name
|
14
|
+
when 'MessageId'
|
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
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module SES
|
5
|
+
|
6
|
+
class VerifyEmailAddress < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@response = { 'ResponseMetadata' => {} }
|
10
|
+
end
|
11
|
+
|
12
|
+
def end_element(name)
|
13
|
+
case name
|
14
|
+
when 'RequestId'
|
15
|
+
@response['ResponseMetadata'][name] = @value
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -22,7 +22,7 @@ module Fog
|
|
22
22
|
# * 'CreateLoadBalancerResult'<~Hash>:
|
23
23
|
# * 'DNSName'<~String> - DNS name for the newly created ELB
|
24
24
|
def create_load_balancer(availability_zones, lb_name, listeners)
|
25
|
-
params =
|
25
|
+
params = AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
|
26
26
|
|
27
27
|
listener_protocol = []
|
28
28
|
listener_lb_port = []
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class SES
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/ses/delete_verified_email_address'
|
7
|
+
|
8
|
+
# Delete an existing verified email address
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# * email_address<~String> - Email Address to be removed
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
# * 'ResponseMetadata'<~Hash>:
|
16
|
+
# * 'RequestId'<~String> - Id of request
|
17
|
+
def delete_verified_email_address(email_address)
|
18
|
+
request({
|
19
|
+
'Action' => 'DeleteVerifiedEmailAddress',
|
20
|
+
'EmailAddress' => email_address,
|
21
|
+
:parser => Fog::Parsers::AWS::SES::DeleteVerifiedEmailAddress.new
|
22
|
+
})
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
class Mock
|
28
|
+
|
29
|
+
def delete_verified_email_address(email_address)
|
30
|
+
Fog::Mock.not_implemented
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class SES
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/ses/get_send_quota'
|
7
|
+
|
8
|
+
# Returns the user's current activity limits.
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
#
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
# * 'GetSendQuotaResult'<~Hash>
|
16
|
+
# * 'Max24HourSend' <~String>
|
17
|
+
# * 'MaxSendRate' <~String>
|
18
|
+
# * 'SentLast24Hours' <~String>
|
19
|
+
# * 'ResponseMetadata'<~Hash>:
|
20
|
+
# * 'RequestId'<~String> - Id of request
|
21
|
+
def get_send_quota
|
22
|
+
request({
|
23
|
+
'Action' => 'GetSendQuota',
|
24
|
+
:parser => Fog::Parsers::AWS::SES::GetSendQuota.new
|
25
|
+
})
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
class Mock
|
31
|
+
|
32
|
+
def get_send_quota
|
33
|
+
Fog::Mock.not_implemented
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class SES
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/ses/get_send_statistics'
|
7
|
+
|
8
|
+
# Returns the user's current activity limits.
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
#
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
# * 'GetSendStatisticsResult'<~Hash>
|
16
|
+
# * 'SendDataPoints' <~Array>
|
17
|
+
# * 'Bounces' <~String>
|
18
|
+
# * 'Complaints' <~String>
|
19
|
+
# * 'DeliveryAttempts' <~String>
|
20
|
+
# * 'Rejects' <~String>
|
21
|
+
# * 'Timestamp' <~String>
|
22
|
+
# * 'ResponseMetadata'<~Hash>:
|
23
|
+
# * 'RequestId'<~String> - Id of request
|
24
|
+
def get_send_statistics
|
25
|
+
request({
|
26
|
+
'Action' => 'GetSendStatistics',
|
27
|
+
:parser => Fog::Parsers::AWS::SES::GetSendStatistics.new
|
28
|
+
})
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
class Mock
|
34
|
+
|
35
|
+
def get_send_statistics
|
36
|
+
Fog::Mock.not_implemented
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class SES
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/ses/list_verified_email_addresses'
|
7
|
+
|
8
|
+
# Returns a list containing all of the email addresses that have been verified
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
#
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
# * 'VerifiedEmailAddresses' <~Array>
|
16
|
+
# * 'ResponseMetadata'<~Hash>:
|
17
|
+
# * 'RequestId'<~String> - Id of request
|
18
|
+
def list_verified_email_addresses
|
19
|
+
request({
|
20
|
+
'Action' => 'ListVerifiedEmailAddresses',
|
21
|
+
:parser => Fog::Parsers::AWS::SES::ListVerifiedEmailAddresses.new
|
22
|
+
})
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
class Mock
|
28
|
+
|
29
|
+
def list_verified_email_addresses
|
30
|
+
Fog::Mock.not_implemented
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class SES
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/ses/send_email'
|
7
|
+
|
8
|
+
# Send an email
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# * Source <~String> - The sender's email address
|
12
|
+
# * Destination <~Hash> - The destination for this email, composed of To:, From:, and CC: fields.
|
13
|
+
# * BccAddresses <~Array> - The BCC: field(s) of the message.
|
14
|
+
# * CcAddresses <~Array> - The CC: field(s) of the message.
|
15
|
+
# * ToAddresses <~Array> - The To: field(s) of the message.
|
16
|
+
# * Message <~Hash> - The message to be sent.
|
17
|
+
# * Body <~Hash>
|
18
|
+
# * Html <~Hash>
|
19
|
+
# * Charset <~String>
|
20
|
+
# * Data <~String>
|
21
|
+
# * Text <~Hash>
|
22
|
+
# * Charset <~String>
|
23
|
+
# * Data <~String>
|
24
|
+
# * Subject <~Hash>
|
25
|
+
# * Charset <~String>
|
26
|
+
# * Data <~String>
|
27
|
+
# * options <~Hash>:
|
28
|
+
# * ReplyToAddresses <~Array> - The reply-to email address(es) for the message. If the recipient replies to the message, each reply-to address will receive the reply.
|
29
|
+
# * ReturnPath <~String> - The email address to which bounce notifications are to be forwarded. If the message cannot be delivered to the recipient, then an error message will be returned from the recipient's ISP; this message will then be forwarded to the email address specified by the ReturnPath parameter.
|
30
|
+
#
|
31
|
+
# ==== Returns
|
32
|
+
# * response<~Excon::Response>:
|
33
|
+
# * body<~Hash>:
|
34
|
+
# * 'MessageId'<~String> - Id of message
|
35
|
+
# * 'ResponseMetadata'<~Hash>:
|
36
|
+
# * 'RequestId'<~String> - Id of request
|
37
|
+
def send_email(source, destination, message, options = {})
|
38
|
+
params = {
|
39
|
+
'Source' => source
|
40
|
+
}
|
41
|
+
|
42
|
+
for key, values in destination
|
43
|
+
params.merge!(AWS.indexed_param("Destination.#{key}.member", [*values]))
|
44
|
+
end
|
45
|
+
|
46
|
+
for key, value in message['Subject']
|
47
|
+
params["Message.Subject.#{key}"] = value
|
48
|
+
end
|
49
|
+
|
50
|
+
for type, data in message['Body']
|
51
|
+
for key, value in data
|
52
|
+
params["Message.Body.#{type}.#{key}"] = value
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
if options.has_key?('ReplyToAddresses')
|
57
|
+
params.merge!(AWS.indexed_param("ReplyToAddresses.member", [*options['ReplyToAddresses']]))
|
58
|
+
end
|
59
|
+
|
60
|
+
if options.has_key?('ReturnPath')
|
61
|
+
params['ReturnPath'] = options['ReturnPath']
|
62
|
+
end
|
63
|
+
|
64
|
+
request({
|
65
|
+
'Action' => 'SendEmail',
|
66
|
+
:parser => Fog::Parsers::AWS::SES::SendEmail.new
|
67
|
+
}.merge(params))
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
class Mock
|
73
|
+
|
74
|
+
def send_email(source, destination, message, options = {})
|
75
|
+
Fog::Mock.not_implemented
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|