fog 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +11 -6
- data/changelog.txt +49 -0
- data/fog.gemspec +5 -4
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/cloud_formation.rb +124 -0
- data/lib/fog/aws/elb.rb +4 -1
- data/lib/fog/aws/iam.rb +6 -0
- data/lib/fog/aws/parsers/cloud_formation/basic.rb +12 -0
- data/lib/fog/aws/parsers/cloud_formation/create_stack.rb +19 -0
- data/lib/fog/aws/parsers/cloud_formation/describe_stack_events.rb +31 -0
- data/lib/fog/aws/parsers/cloud_formation/describe_stack_resources.rb +31 -0
- data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +72 -0
- data/lib/fog/aws/parsers/cloud_formation/get_template.rb +19 -0
- data/lib/fog/aws/parsers/cloud_formation/validate_template.rb +52 -0
- data/lib/fog/aws/parsers/iam/login_profile.rb +27 -0
- data/lib/fog/aws/parsers/iam/upload_server_certificate.rb +26 -0
- data/lib/fog/aws/parsers/rds/authorize_db_security_group_ingress.rb +38 -0
- data/lib/fog/aws/parsers/rds/create_db_instance.rb +34 -0
- data/lib/fog/aws/parsers/rds/create_db_instance_read_replica.rb +34 -0
- data/lib/fog/aws/parsers/rds/create_db_parameter_group.rb +35 -0
- data/lib/fog/aws/parsers/rds/create_db_security_group.rb +38 -0
- data/lib/fog/aws/parsers/rds/create_db_snapshot.rb +35 -0
- data/lib/fog/aws/parsers/rds/db_parser.rb +123 -0
- data/lib/fog/aws/parsers/rds/delete_db_instance.rb +35 -0
- data/lib/fog/aws/parsers/rds/delete_db_parameter_group.rb +27 -0
- data/lib/fog/aws/parsers/rds/delete_db_security_group.rb +33 -0
- data/lib/fog/aws/parsers/rds/delete_db_snapshot.rb +34 -0
- data/lib/fog/aws/parsers/rds/describe_db_instances.rb +36 -0
- data/lib/fog/aws/parsers/rds/describe_db_parameter_groups.rb +38 -0
- data/lib/fog/aws/parsers/rds/describe_db_parameters.rb +44 -0
- data/lib/fog/aws/parsers/rds/describe_db_security_groups.rb +39 -0
- data/lib/fog/aws/parsers/rds/describe_db_snapshots.rb +39 -0
- data/lib/fog/aws/parsers/rds/modify_db_instance.rb +34 -0
- data/lib/fog/aws/parsers/rds/modify_db_parameter_group.rb +28 -0
- data/lib/fog/aws/parsers/rds/reboot_db_instance.rb +35 -0
- data/lib/fog/aws/parsers/rds/restore_db_instance_from_db_snapshot.rb +34 -0
- data/lib/fog/aws/parsers/rds/restore_db_instance_to_point_in_time.rb +35 -0
- data/lib/fog/aws/parsers/rds/revoke_db_security_group_ingress.rb +39 -0
- data/lib/fog/aws/parsers/rds/security_group_parser.rb +39 -0
- data/lib/fog/aws/parsers/rds/snapshot_parser.rb +40 -0
- data/lib/fog/aws/rds.rb +161 -0
- data/lib/fog/aws/rds/models/parameter.rb +21 -0
- data/lib/fog/aws/rds/models/parameter_group.rb +36 -0
- data/lib/fog/aws/rds/models/parameter_groups.rb +27 -0
- data/lib/fog/aws/rds/models/parameters.rb +37 -0
- data/lib/fog/aws/rds/models/security_group.rb +73 -0
- data/lib/fog/aws/rds/models/security_groups.rb +43 -0
- data/lib/fog/aws/rds/models/server.rb +105 -0
- data/lib/fog/aws/rds/models/servers.rb +27 -0
- data/lib/fog/aws/rds/models/snapshot.rb +49 -0
- data/lib/fog/aws/rds/models/snapshots.rb +45 -0
- data/lib/fog/aws/requests/cloud_formation/create_stack.rb +71 -0
- data/lib/fog/aws/requests/cloud_formation/delete_stack.rb +30 -0
- data/lib/fog/aws/requests/cloud_formation/describe_stack_events.rb +44 -0
- data/lib/fog/aws/requests/cloud_formation/describe_stack_resources.rb +43 -0
- data/lib/fog/aws/requests/cloud_formation/describe_stacks.rb +42 -0
- data/lib/fog/aws/requests/cloud_formation/get_template.rb +32 -0
- data/lib/fog/aws/requests/cloud_formation/validate_template.rb +34 -0
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +4 -0
- data/lib/fog/aws/requests/iam/create_login_profile.rb +36 -0
- data/lib/fog/aws/requests/iam/delete_login_profile.rb +31 -0
- data/lib/fog/aws/requests/iam/delete_server_certificate.rb +32 -0
- data/lib/fog/aws/requests/iam/get_login_profile.rb +35 -0
- data/lib/fog/aws/requests/iam/update_login_profile.rb +33 -0
- data/lib/fog/aws/requests/iam/upload_server_certificate.rb +45 -0
- data/lib/fog/aws/requests/rds/authorize_db_security_group_ingress.rb +43 -0
- data/lib/fog/aws/requests/rds/create_db_instance.rb +56 -0
- data/lib/fog/aws/requests/rds/create_db_instance_read_replica.rb +42 -0
- data/lib/fog/aws/requests/rds/create_db_parameter_group.rb +41 -0
- data/lib/fog/aws/requests/rds/create_db_security_group.rb +37 -0
- data/lib/fog/aws/requests/rds/create_db_snapshot.rb +36 -0
- data/lib/fog/aws/requests/rds/delete_db_instance.rb +40 -0
- data/lib/fog/aws/requests/rds/delete_db_parameter_group.rb +36 -0
- data/lib/fog/aws/requests/rds/delete_db_security_group.rb +36 -0
- data/lib/fog/aws/requests/rds/delete_db_snapshot.rb +36 -0
- data/lib/fog/aws/requests/rds/describe_db_instances.rb +42 -0
- data/lib/fog/aws/requests/rds/describe_db_parameter_groups.rb +45 -0
- data/lib/fog/aws/requests/rds/describe_db_parameters.rb +46 -0
- data/lib/fog/aws/requests/rds/describe_db_security_groups.rb +39 -0
- data/lib/fog/aws/requests/rds/describe_db_snapshots.rb +42 -0
- data/lib/fog/aws/requests/rds/modify_db_instance.rb +54 -0
- data/lib/fog/aws/requests/rds/modify_db_parameter_group.rb +55 -0
- data/lib/fog/aws/requests/rds/reboot_db_instance.rb +34 -0
- data/lib/fog/aws/requests/rds/restore_db_instance_from_db_snapshot.rb +34 -0
- data/lib/fog/aws/requests/rds/restore_db_instance_to_point_in_time.rb +35 -0
- data/lib/fog/aws/requests/rds/revoke_db_security_group_ingress.rb +44 -0
- data/lib/fog/aws/simpledb.rb +21 -7
- data/lib/fog/bin.rb +2 -1
- data/lib/fog/bin/aws.rb +8 -0
- data/lib/fog/bin/virtual_box.rb +52 -0
- data/lib/fog/cdn/aws.rb +9 -8
- data/lib/fog/cdn/rackspace.rb +6 -6
- data/lib/fog/cdn/requests/rackspace/post_container.rb +30 -0
- data/lib/fog/cdn/requests/rackspace/put_container.rb +1 -1
- data/lib/fog/compute.rb +6 -3
- data/lib/fog/compute/aws.rb +11 -7
- data/lib/fog/compute/bluebox.rb +5 -6
- data/lib/fog/compute/brightbox.rb +3 -0
- data/lib/fog/compute/go_grid.rb +5 -6
- data/lib/fog/compute/linode.rb +5 -6
- data/lib/fog/compute/models/aws/flavors.rb +19 -18
- data/lib/fog/compute/models/aws/server.rb +23 -0
- data/lib/fog/compute/models/aws/tag.rb +1 -1
- data/lib/fog/compute/models/brightbox/server.rb +7 -1
- data/lib/fog/compute/models/virtual_box/medium.rb +87 -0
- data/lib/fog/compute/models/virtual_box/medium_format.rb +34 -0
- data/lib/fog/compute/models/virtual_box/mediums.rb +32 -0
- data/lib/fog/compute/models/virtual_box/nat_engine.rb +65 -0
- data/lib/fog/compute/models/virtual_box/nat_redirect.rb +91 -0
- data/lib/fog/compute/models/virtual_box/nat_redirects.rb +41 -0
- data/lib/fog/compute/models/virtual_box/network_adapter.rb +82 -0
- data/lib/fog/compute/models/virtual_box/network_adapters.rb +42 -0
- data/lib/fog/compute/models/virtual_box/server.rb +241 -0
- data/lib/fog/compute/models/virtual_box/servers.rb +41 -0
- data/lib/fog/compute/models/virtual_box/storage_controller.rb +83 -0
- data/lib/fog/compute/models/virtual_box/storage_controllers.rb +38 -0
- data/lib/fog/compute/models/voxel/servers.rb +7 -6
- data/lib/fog/compute/new_servers.rb +5 -6
- data/lib/fog/compute/parsers/aws/monitor_unmonitor_instances.rb +35 -0
- data/lib/fog/compute/rackspace.rb +7 -7
- data/lib/fog/compute/requests/aws/delete_tags.rb +12 -9
- data/lib/fog/compute/requests/aws/monitor_instances.rb +52 -0
- data/lib/fog/compute/requests/aws/revoke_security_group_ingress.rb +24 -8
- data/lib/fog/compute/requests/aws/unmonitor_instances.rb +53 -0
- data/lib/fog/compute/requests/brightbox/activate_console_server.rb +20 -0
- data/lib/fog/compute/requests/brightbox/add_listeners_load_balancer.rb +20 -0
- data/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb +20 -0
- data/lib/fog/compute/slicehost.rb +5 -6
- data/lib/fog/compute/virtual_box.rb +48 -0
- data/lib/fog/compute/voxel.rb +30 -27
- data/lib/fog/core.rb +1 -0
- data/lib/fog/core/attributes.rb +3 -1
- data/lib/fog/core/collection.rb +2 -2
- data/lib/fog/core/credentials.rb +13 -3
- data/lib/fog/core/scp.rb +0 -4
- data/lib/fog/core/service.rb +0 -8
- data/lib/fog/core/ssh.rb +0 -4
- data/lib/fog/dns.rb +3 -3
- data/lib/fog/dns/aws.rb +8 -8
- data/lib/fog/dns/bluebox.rb +5 -7
- data/lib/fog/dns/dnsimple.rb +7 -7
- data/lib/fog/dns/linode.rb +5 -6
- data/lib/fog/dns/models/dnsimple/record.rb +11 -1
- data/lib/fog/dns/models/dnsimple/records.rb +7 -7
- data/lib/fog/dns/models/dnsimple/zones.rb +2 -1
- data/lib/fog/dns/requests/dnsimple/get_record.rb +34 -0
- data/lib/fog/dns/slicehost.rb +5 -6
- data/lib/fog/dns/zerigo.rb +5 -7
- data/lib/fog/providers.rb +2 -1
- data/lib/fog/providers/aws.rb +10 -8
- data/lib/fog/providers/virtual_box.rb +11 -0
- data/lib/fog/storage.rb +21 -0
- data/lib/fog/storage/aws.rb +16 -32
- data/lib/fog/storage/google.rb +6 -27
- data/lib/fog/storage/local.rb +7 -7
- data/lib/fog/storage/models/rackspace/directory.rb +1 -1
- data/lib/fog/storage/models/rackspace/file.rb +1 -0
- data/lib/fog/storage/rackspace.rb +5 -27
- data/lib/fog/storage/requests/aws/put_object.rb +2 -2
- data/lib/fog/storage/requests/aws/upload_part.rb +1 -1
- data/lib/fog/storage/requests/google/put_object.rb +2 -2
- data/lib/fog/storage/requests/rackspace/put_object.rb +1 -1
- data/tests/aws/requests/cloud_formation/stack_tests.rb +130 -0
- data/tests/aws/requests/iam/login_profile_tests.rb +64 -0
- data/tests/aws/requests/rds/helper.rb +169 -0
- data/tests/aws/requests/rds/instance_tests.rb +129 -0
- data/tests/aws/requests/rds/model_tests.rb +98 -0
- data/tests/aws/requests/rds/parameter_group_tests.rb +68 -0
- data/tests/aws/requests/rds/parameter_request_tests.rb +35 -0
- data/tests/compute/models/aws/server_monitor_tests.rb +47 -0
- data/tests/compute/models/server_tests.rb +7 -23
- data/tests/compute/parsers/aws/monitor_unmonitor_instances_tests.rb +49 -0
- data/tests/compute/requests/aws/security_group_tests.rb +69 -52
- data/tests/compute/requests/aws/tag_tests.rb +5 -5
- data/tests/compute/requests/brightbox/helper.rb +7 -6
- data/tests/compute/requests/brightbox/server_tests.rb +5 -0
- data/tests/compute/requests/voxel/server_tests.rb +2 -3
- data/tests/storage/requests/aws/bucket_tests.rb +10 -0
- metadata +148 -12
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fog (0.
|
4
|
+
fog (0.7.0)
|
5
5
|
builder
|
6
6
|
excon (>= 0.5.5)
|
7
|
-
formatador (>= 0.
|
7
|
+
formatador (>= 0.1.1)
|
8
8
|
json
|
9
9
|
mime-types
|
10
10
|
net-ssh (>= 2.0.23)
|
@@ -16,7 +16,9 @@ GEM
|
|
16
16
|
specs:
|
17
17
|
builder (3.0.0)
|
18
18
|
excon (0.5.6)
|
19
|
-
|
19
|
+
ffi (0.6.3)
|
20
|
+
rake (>= 0.8.7)
|
21
|
+
formatador (0.1.1)
|
20
22
|
json (1.5.1)
|
21
23
|
mime-types (1.16)
|
22
24
|
net-ssh (2.1.0)
|
@@ -24,8 +26,10 @@ GEM
|
|
24
26
|
rake (0.8.7)
|
25
27
|
rspec (1.3.1)
|
26
28
|
ruby-hmac (0.4.0)
|
27
|
-
shindo (0.
|
28
|
-
formatador (>= 0.
|
29
|
+
shindo (0.3.3)
|
30
|
+
formatador (>= 0.1.1)
|
31
|
+
virtualbox (0.8.3)
|
32
|
+
ffi (~> 0.6.3)
|
29
33
|
|
30
34
|
PLATFORMS
|
31
35
|
ruby
|
@@ -34,4 +38,5 @@ DEPENDENCIES
|
|
34
38
|
fog!
|
35
39
|
rake
|
36
40
|
rspec (= 1.3.1)
|
37
|
-
shindo (= 0.
|
41
|
+
shindo (= 0.3.3)
|
42
|
+
virtualbox (= 0.8.3)
|
data/changelog.txt
CHANGED
@@ -1,3 +1,52 @@
|
|
1
|
+
0.7.0 03/14/2011
|
2
|
+
================
|
3
|
+
|
4
|
+
[aws] added ap-northeast-1 (tokyo) region options
|
5
|
+
|
6
|
+
[aws|cloudformation] add basic support. thanks crazed
|
7
|
+
|
8
|
+
[aws|elb] add support for configuring https
|
9
|
+
|
10
|
+
[aws|iam]
|
11
|
+
add support for server certificates. thanks bensie
|
12
|
+
add support for login profiles. thanks fcheung
|
13
|
+
|
14
|
+
[aws|rds]
|
15
|
+
support basic rds operations. thanks fcheung
|
16
|
+
add support for restoring servers and security groups. thanks ktheory
|
17
|
+
|
18
|
+
[cdn|rackspace] use post_container to update
|
19
|
+
|
20
|
+
[compute]
|
21
|
+
[aws]
|
22
|
+
fix tag.destroy. thanks eabbott
|
23
|
+
allow deleting all tags (instead of just specific ones)
|
24
|
+
fix revoke_security_group method signature
|
25
|
+
FLAVORS is now a constant
|
26
|
+
allow for modifying server monitoring. thanks gilles
|
27
|
+
[brightbox] thanks tokengeek
|
28
|
+
Added listener management (add/remove) requests for Load Balancers
|
29
|
+
Added new Server console activation request
|
30
|
+
Added activate_console method to Brightbox servers
|
31
|
+
Set Server#private_ip_address to be the first interface
|
32
|
+
[rackspace] 'official' workaround for awful caching
|
33
|
+
[virtualbox] rough proof of concept/initial implementation
|
34
|
+
|
35
|
+
[core]
|
36
|
+
fix behavior of slice on collections. thanks eabbott
|
37
|
+
fix reset_data to be instance method on mock connection (and work)
|
38
|
+
[credentials]
|
39
|
+
handle undefined ENV['HOME']
|
40
|
+
Allow string keys in credentials file [issue 179]. thanks ryanlower
|
41
|
+
|
42
|
+
[dns|dnsimple] fix misc bugs in models. thanks ijonas
|
43
|
+
|
44
|
+
[storage]
|
45
|
+
use shared parse_data across providers
|
46
|
+
[rackspace]
|
47
|
+
pass through explicit content-type
|
48
|
+
fix bug preventing file uploads to be streamed
|
49
|
+
|
1
50
|
0.6.0 02/28/2011
|
2
51
|
================
|
3
52
|
|
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-
|
10
|
+
s.version = '0.7.0'
|
11
|
+
s.date = '2011-03-18'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
|
|
44
44
|
## that are needed for an end user to actually USE your code.
|
45
45
|
s.add_dependency('builder')
|
46
46
|
s.add_dependency('excon', '>=0.5.5')
|
47
|
-
s.add_dependency('formatador', '>=0.
|
47
|
+
s.add_dependency('formatador', '>=0.1.1')
|
48
48
|
s.add_dependency('json')
|
49
49
|
s.add_dependency('mime-types')
|
50
50
|
s.add_dependency('net-ssh', '>=2.0.23')
|
@@ -55,7 +55,8 @@ 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.3.3')
|
59
|
+
s.add_development_dependency('virtualbox', '0.8.3')
|
59
60
|
|
60
61
|
s.files = `git ls-files`.split("\n")
|
61
62
|
s.test_files = `git ls-files -- {spec,tests}/*`.split("\n")
|
data/lib/fog.rb
CHANGED
@@ -0,0 +1,124 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class CloudFormation < Fog::Service
|
4
|
+
|
5
|
+
requires :aws_access_key_id, :aws_secret_access_key
|
6
|
+
recognizes :host, :path, :port, :scheme, :persistent
|
7
|
+
|
8
|
+
request_path 'fog/aws/requests/cloud_formation'
|
9
|
+
request :create_stack
|
10
|
+
request :delete_stack
|
11
|
+
request :describe_stack_events
|
12
|
+
request :describe_stack_resources
|
13
|
+
request :describe_stacks
|
14
|
+
request :get_template
|
15
|
+
request :validate_template
|
16
|
+
|
17
|
+
class Mock
|
18
|
+
|
19
|
+
def initialize(options={})
|
20
|
+
Fog::Mock.not_implemented
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
class Real
|
26
|
+
|
27
|
+
# Initialize connection to CloudFormation
|
28
|
+
#
|
29
|
+
# ==== Notes
|
30
|
+
# options parameter must include values for :aws_access_key_id and
|
31
|
+
# :aws_secret_access_key in order to create a connection
|
32
|
+
#
|
33
|
+
# ==== Examples
|
34
|
+
# cf = CloudFormation.new(
|
35
|
+
# :aws_access_key_id => your_aws_access_key_id,
|
36
|
+
# :aws_secret_access_key => your_aws_secret_access_key
|
37
|
+
# )
|
38
|
+
#
|
39
|
+
# ==== Parameters
|
40
|
+
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
41
|
+
#
|
42
|
+
# ==== Returns
|
43
|
+
# * CloudFormation object with connection to AWS.
|
44
|
+
def initialize(options={})
|
45
|
+
require 'fog/core/parser'
|
46
|
+
require 'json'
|
47
|
+
|
48
|
+
@aws_access_key_id = options[:aws_access_key_id]
|
49
|
+
@aws_secret_access_key = options[:aws_secret_access_key]
|
50
|
+
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
51
|
+
|
52
|
+
options[:region] ||= 'us-east-1'
|
53
|
+
@host = options[:host] || case options[:region]
|
54
|
+
when 'ap-northeast-1'
|
55
|
+
'cloudformation.ap-northeast-1.amazonaws.com'
|
56
|
+
when 'ap-southeast-1'
|
57
|
+
'cloudformation.ap-southeast-1.amazonaws.com'
|
58
|
+
when 'eu-west-1'
|
59
|
+
'cloudformation.eu-west-1.amazonaws.com'
|
60
|
+
when 'us-east-1'
|
61
|
+
'cloudformation.us-east-1.amazonaws.com'
|
62
|
+
when 'us-west-1'
|
63
|
+
'cloudformation.us-west-1.amazonaws.com'
|
64
|
+
else
|
65
|
+
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
66
|
+
end
|
67
|
+
@path = options[:path] || '/'
|
68
|
+
@port = options[:port] || 443
|
69
|
+
@scheme = options[:scheme] || 'https'
|
70
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:persistent])
|
71
|
+
end
|
72
|
+
|
73
|
+
def reload
|
74
|
+
@connection.reset
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def request(params)
|
80
|
+
idempotent = params.delete(:idempotent)
|
81
|
+
parser = params.delete(:parser)
|
82
|
+
|
83
|
+
body = AWS.signed_params(
|
84
|
+
params,
|
85
|
+
{
|
86
|
+
:aws_access_key_id => @aws_access_key_id,
|
87
|
+
:hmac => @hmac,
|
88
|
+
:host => @host,
|
89
|
+
:path => @path,
|
90
|
+
:port => @port,
|
91
|
+
:version => '2010-05-15'
|
92
|
+
}
|
93
|
+
)
|
94
|
+
|
95
|
+
begin
|
96
|
+
response = @connection.request({
|
97
|
+
:body => body,
|
98
|
+
:expects => 200,
|
99
|
+
:idempotent => idempotent,
|
100
|
+
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
101
|
+
:host => @host,
|
102
|
+
:method => 'POST',
|
103
|
+
:parser => parser
|
104
|
+
})
|
105
|
+
rescue Excon::Errors::HTTPStatusError => error
|
106
|
+
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
107
|
+
raise case match[1].split('.').last
|
108
|
+
when 'NotFound'
|
109
|
+
Fog::AWS::Compute::NotFound.slurp(error, match[2])
|
110
|
+
else
|
111
|
+
Fog::AWS::Compute::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
112
|
+
end
|
113
|
+
else
|
114
|
+
raise error
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
response
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
data/lib/fog/aws/elb.rb
CHANGED
@@ -48,8 +48,11 @@ module Fog
|
|
48
48
|
@aws_access_key_id = options[:aws_access_key_id]
|
49
49
|
@aws_secret_access_key = options[:aws_secret_access_key]
|
50
50
|
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
51
|
+
|
51
52
|
options[:region] ||= 'us-east-1'
|
52
53
|
@host = options[:host] || case options[:region]
|
54
|
+
when 'ap-northeast-1'
|
55
|
+
'elasticloadbalancing.ap-northeast-1.amazonaws.com'
|
53
56
|
when 'ap-southeast-1'
|
54
57
|
'elasticloadbalancing.ap-southeast-1.amazonaws.com'
|
55
58
|
when 'eu-west-1'
|
@@ -85,7 +88,7 @@ module Fog
|
|
85
88
|
:host => @host,
|
86
89
|
:path => @path,
|
87
90
|
:port => @port,
|
88
|
-
:version => '
|
91
|
+
:version => '2010-07-01'
|
89
92
|
}
|
90
93
|
)
|
91
94
|
|
data/lib/fog/aws/iam.rb
CHANGED
@@ -10,12 +10,16 @@ module Fog
|
|
10
10
|
request :create_access_key
|
11
11
|
request :create_group
|
12
12
|
request :create_user
|
13
|
+
request :create_login_profile
|
13
14
|
request :delete_access_key
|
14
15
|
request :delete_group
|
15
16
|
request :delete_group_policy
|
17
|
+
request :delete_login_profile
|
18
|
+
request :delete_server_certificate
|
16
19
|
request :delete_signing_certificate
|
17
20
|
request :delete_user
|
18
21
|
request :delete_user_policy
|
22
|
+
request :get_login_profile
|
19
23
|
request :get_user
|
20
24
|
request :get_user_policy
|
21
25
|
request :get_group
|
@@ -31,8 +35,10 @@ module Fog
|
|
31
35
|
request :remove_user_from_group
|
32
36
|
request :update_access_key
|
33
37
|
request :update_group
|
38
|
+
request :update_login_profile
|
34
39
|
request :update_user
|
35
40
|
request :update_signing_certificate
|
41
|
+
request :upload_server_certificate
|
36
42
|
request :upload_signing_certificate
|
37
43
|
|
38
44
|
class Mock
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module CloudFormation
|
5
|
+
|
6
|
+
class CreateStack < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def end_element(name)
|
9
|
+
case name
|
10
|
+
when 'RequestId', 'StackId'
|
11
|
+
@response[name] = @value
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module CloudFormation
|
5
|
+
|
6
|
+
class DescribeStackEvents < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@event = {}
|
10
|
+
@response = { 'StackEvents' => [] }
|
11
|
+
end
|
12
|
+
|
13
|
+
def end_element(name)
|
14
|
+
case name
|
15
|
+
when 'EventId', 'LogicalResourceId', 'PhysicalResourceId', 'ResourceProperties', 'ResourceStatus', 'ResourceStatusReason', 'ResourceType', 'StackId', 'StackName'
|
16
|
+
@event[name] = @value
|
17
|
+
when 'member'
|
18
|
+
@response['StackEvents'] << @event
|
19
|
+
@event = {}
|
20
|
+
when 'RequestId'
|
21
|
+
@response[name] = @value
|
22
|
+
when 'Timestamp'
|
23
|
+
@event[name] = Time.parse(@value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module CloudFormation
|
5
|
+
|
6
|
+
class DescribeStackResources < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@resource = {}
|
10
|
+
@response = { 'StackResources' => [] }
|
11
|
+
end
|
12
|
+
|
13
|
+
def end_element(name)
|
14
|
+
case name
|
15
|
+
when 'StackId', 'StackName', 'LogicalResourceId', 'PhysicalResourceId', 'ResourceType', 'ResourceStatus'
|
16
|
+
@resource[name] = @value
|
17
|
+
when 'member'
|
18
|
+
@response['StackResources'] << @resource
|
19
|
+
@resource = {}
|
20
|
+
when 'RequestId'
|
21
|
+
@response[name] = @value
|
22
|
+
when 'Timestamp'
|
23
|
+
@resource[name] = Time.parse(@value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module CloudFormation
|
5
|
+
|
6
|
+
class DescribeStacks < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@stack = { 'Outputs' => [], 'Parameters' => [] }
|
10
|
+
@output = {}
|
11
|
+
@parameter = {}
|
12
|
+
@response = { 'Stacks' => [] }
|
13
|
+
end
|
14
|
+
|
15
|
+
def start_element(name, attrs = [])
|
16
|
+
super
|
17
|
+
case name
|
18
|
+
when 'Outputs'
|
19
|
+
@in_outputs = true
|
20
|
+
when 'Parameters'
|
21
|
+
@in_parameters = true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def end_element(name)
|
26
|
+
if @in_outputs
|
27
|
+
case name
|
28
|
+
when 'OutputKey', 'OutputValue'
|
29
|
+
@output[name] = @value
|
30
|
+
when 'member'
|
31
|
+
@stack['Outputs'] << @output
|
32
|
+
@output = {}
|
33
|
+
when 'Outputs'
|
34
|
+
@in_outputs = false
|
35
|
+
end
|
36
|
+
elsif @in_parameters
|
37
|
+
case name
|
38
|
+
when 'ParameterKey', 'ParameterValue'
|
39
|
+
@parameter[name] = @value
|
40
|
+
when 'member'
|
41
|
+
@stack['Parameters'] << @parameter
|
42
|
+
@parameter = {}
|
43
|
+
when 'Parameters'
|
44
|
+
@in_parameters = false
|
45
|
+
end
|
46
|
+
else
|
47
|
+
case name
|
48
|
+
when 'member'
|
49
|
+
@response['Stacks'] << @stack
|
50
|
+
@stack = { 'Outputs' => [], 'Parameters' => [] }
|
51
|
+
when 'RequestId'
|
52
|
+
@response[name] = @value
|
53
|
+
when 'CreationTime'
|
54
|
+
@stack[name] = Time.parse(@value)
|
55
|
+
when 'DisableRollback'
|
56
|
+
case @value
|
57
|
+
when 'false'
|
58
|
+
@stack[name] = false
|
59
|
+
when 'true'
|
60
|
+
@stack[name] = true
|
61
|
+
end
|
62
|
+
when 'StackName', 'StackId', 'StackStatus'
|
63
|
+
@stack[name] = @value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|