fog 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -0
- data/Rakefile +12 -0
- data/VERSION +1 -1
- data/bin/fog +28 -40
- data/fog.gemspec +16 -3
- data/lib/fog.rb +27 -3
- data/lib/fog/aws/ec2.rb +7 -3
- data/lib/fog/aws/models/ec2/security_group.rb +1 -1
- data/lib/fog/aws/models/ec2/server.rb +8 -3
- data/lib/fog/aws/models/ec2/servers.rb +1 -1
- data/lib/fog/aws/parsers/ec2/terminate_instances.rb +10 -10
- data/lib/fog/aws/requests/ec2/run_instances.rb +1 -1
- data/lib/fog/aws/s3.rb +6 -2
- data/lib/fog/rackspace.rb +8 -2
- data/lib/fog/slicehost.rb +3 -1
- data/spec/aws/models/ec2/address_spec.rb +8 -8
- data/spec/aws/models/ec2/addresses_spec.rb +10 -10
- data/spec/aws/models/ec2/key_pair_spec.rb +8 -8
- data/spec/aws/models/ec2/key_pairs_spec.rb +10 -10
- data/spec/aws/models/ec2/security_group_spec.rb +8 -8
- data/spec/aws/models/ec2/security_groups_spec.rb +10 -10
- data/spec/aws/models/ec2/server_spec.rb +1 -4
- data/spec/aws/models/ec2/servers_spec.rb +1 -1
- data/spec/aws/models/ec2/snapshot_spec.rb +12 -10
- data/spec/aws/models/ec2/snapshots_spec.rb +20 -20
- data/spec/aws/models/ec2/volume_spec.rb +10 -10
- data/spec/aws/models/ec2/volumes_spec.rb +10 -10
- data/spec/aws/models/s3/directories_spec.rb +8 -8
- data/spec/aws/models/s3/directory_spec.rb +11 -11
- data/spec/aws/models/s3/file_spec.rb +2 -2
- data/spec/aws/models/s3/files_spec.rb +2 -2
- data/spec/aws/requests/ec2/allocate_address_spec.rb +2 -2
- data/spec/aws/requests/ec2/associate_address_spec.rb +15 -13
- data/spec/aws/requests/ec2/attach_volume_spec.rb +12 -12
- data/spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb +3 -3
- data/spec/aws/requests/ec2/create_key_pair_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_security_group_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_snapshot_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_volume_spec.rb +2 -2
- data/spec/aws/requests/ec2/delete_key_pair_spec.rb +3 -3
- data/spec/aws/requests/ec2/delete_security_group_spec.rb +3 -3
- data/spec/aws/requests/ec2/delete_snapshot_spec.rb +5 -5
- data/spec/aws/requests/ec2/delete_volume_spec.rb +3 -3
- data/spec/aws/requests/ec2/describe_addresses_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_availability_zones_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_images_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_instances_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_key_pairs_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_regions_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_security_groups_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_snapshots_spec.rb +7 -7
- data/spec/aws/requests/ec2/describe_volumes_spec.rb +5 -5
- data/spec/aws/requests/ec2/detach_volume_spec.rb +7 -7
- data/spec/aws/requests/ec2/disassociate_address_spec.rb +9 -7
- data/spec/aws/requests/ec2/get_console_output_spec.rb +4 -4
- data/spec/aws/requests/ec2/reboot_instances_spec.rb +4 -4
- data/spec/aws/requests/ec2/release_address_spec.rb +3 -3
- data/spec/aws/requests/ec2/revoke_security_group_ingress_spec.rb +4 -4
- data/spec/aws/requests/ec2/run_instances_spec.rb +2 -2
- data/spec/aws/requests/ec2/terminate_instances_spec.rb +7 -7
- data/spec/aws/requests/s3/copy_object_spec.rb +11 -11
- data/spec/aws/requests/s3/delete_bucket_spec.rb +8 -8
- data/spec/aws/requests/s3/delete_object_spec.rb +8 -8
- data/spec/aws/requests/s3/get_bucket_location_spec.rb +4 -4
- data/spec/aws/requests/s3/get_bucket_spec.rb +12 -12
- data/spec/aws/requests/s3/get_object_spec.rb +9 -9
- data/spec/aws/requests/s3/get_request_payment_spec.rb +4 -4
- data/spec/aws/requests/s3/get_service_spec.rb +4 -4
- data/spec/aws/requests/s3/head_object_spec.rb +5 -5
- data/spec/aws/requests/s3/put_bucket_spec.rb +3 -3
- data/spec/aws/requests/s3/put_object_spec.rb +11 -11
- data/spec/aws/requests/s3/put_request_payment_spec.rb +4 -4
- data/spec/aws/requests/simpledb/batch_put_attributes_spec.rb +4 -4
- data/spec/aws/requests/simpledb/create_domain_spec.rb +4 -4
- data/spec/aws/requests/simpledb/delete_attributes_spec.rb +8 -8
- data/spec/aws/requests/simpledb/delete_domain_spec.rb +3 -3
- data/spec/aws/requests/simpledb/domain_metadata_spec.rb +6 -6
- data/spec/aws/requests/simpledb/get_attributes_spec.rb +9 -9
- data/spec/aws/requests/simpledb/list_domains_spec.rb +4 -4
- data/spec/aws/requests/simpledb/put_attributes_spec.rb +4 -4
- data/spec/compact_progress_bar_formatter.rb +195 -0
- data/spec/rackspace/models/servers/server_spec.rb +1 -1
- data/spec/rackspace/requests/files/delete_container_spec.rb +3 -3
- data/spec/rackspace/requests/files/delete_object_spec.rb +8 -8
- data/spec/rackspace/requests/files/get_container_spec.rb +6 -6
- data/spec/rackspace/requests/files/get_containers_spec.rb +3 -3
- data/spec/rackspace/requests/files/head_container_spec.rb +6 -6
- data/spec/rackspace/requests/files/head_containers_spec.rb +3 -3
- data/spec/rackspace/requests/files/put_container_spec.rb +2 -2
- data/spec/rackspace/requests/files/put_object_spec.rb +4 -4
- data/spec/rackspace/requests/servers/create_image_spec.rb +4 -4
- data/spec/rackspace/requests/servers/create_server_spec.rb +2 -2
- data/spec/rackspace/requests/servers/delete_image_spec.rb +5 -5
- data/spec/rackspace/requests/servers/delete_server_spec.rb +3 -3
- data/spec/rackspace/requests/servers/get_flavor_details_spec.rb +1 -1
- data/spec/rackspace/requests/servers/get_server_details_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_flavors_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_flavors_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_images_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_images_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_private_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_public_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_servers_detail_spec.rb +3 -3
- data/spec/rackspace/requests/servers/list_servers_spec.rb +3 -3
- data/spec/rackspace/requests/servers/reboot_server_spec.rb +4 -4
- data/spec/rackspace/requests/servers/update_server_spec.rb +4 -4
- data/spec/slicehost/requests/create_slice_spec.rb +2 -2
- data/spec/slicehost/requests/delete_slice_spec.rb +2 -2
- data/spec/slicehost/requests/get_backups_spec.rb +1 -1
- data/spec/slicehost/requests/get_flavors_spec.rb +1 -1
- data/spec/slicehost/requests/get_images_spec.rb +1 -1
- data/spec/slicehost/requests/get_slices_spec.rb +1 -1
- data/spec/spec_helper.rb +60 -38
- metadata +16 -3
- data/spec/spec.opts +0 -1
@@ -5,13 +5,13 @@ describe 'Slicehost.create_slice' do
|
|
5
5
|
|
6
6
|
after(:each) do
|
7
7
|
eventually(128) do
|
8
|
-
|
8
|
+
Slicehost[:slices].delete_slice(@slice_id)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should return proper attributes" do
|
13
13
|
# flavor_id 1: 256 ram, image_id 3: Gentoo 2008.0
|
14
|
-
actual =
|
14
|
+
actual = Slicehost[:slices].create_slice(1, 3, 'fog_create_slice').body
|
15
15
|
actual['addresses'].should be_a(Array)
|
16
16
|
# actual['backup-id'].should be_an(Integer)
|
17
17
|
actual['bw-in'].should be_an(Float)
|
@@ -5,12 +5,12 @@ describe 'Slicehost.delete_slice' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor_id 1: 256 ram, image_id 3: Gentoo 2008.0
|
8
|
-
@slice_id =
|
8
|
+
@slice_id = Slicehost[:slices].create_slice(1, 3, 'fog_delete_slice').body['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should return proper attributes" do
|
12
12
|
eventually(128) do
|
13
|
-
actual =
|
13
|
+
actual = Slicehost[:slices].delete_slice(@slice_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -4,7 +4,7 @@ describe 'Slicehost.get_backups' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual =
|
7
|
+
actual = Slicehost[:slices].get_backups.body
|
8
8
|
actual['backups'].should be_an(Array)
|
9
9
|
backup = actual['backups'].first
|
10
10
|
# backup['date'].should be_a(String)
|
@@ -4,7 +4,7 @@ describe 'Slicehost.get_flavors' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual =
|
7
|
+
actual = Slicehost[:slices].get_flavors.body
|
8
8
|
actual['flavors'].should be_an(Array)
|
9
9
|
flavor = actual['flavors'].first
|
10
10
|
flavor['id'].should be_an(Integer)
|
@@ -4,7 +4,7 @@ describe 'Slicehost.get_images' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual =
|
7
|
+
actual = Slicehost[:slices].get_images.body
|
8
8
|
actual['images'].should be_an(Array)
|
9
9
|
image = actual['images'].first
|
10
10
|
image['id'].should be_an(Integer)
|
@@ -4,7 +4,7 @@ describe 'Slicehost.get_slices' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual =
|
7
|
+
actual = Slicehost[:slices].get_slices.body
|
8
8
|
actual['slices'].should be_an(Array)
|
9
9
|
slice = actual['slices'].first
|
10
10
|
# slice['addresses'].should be_a(Array)
|
data/spec/spec_helper.rb
CHANGED
@@ -5,54 +5,76 @@ current_directory = File.dirname(__FILE__)
|
|
5
5
|
require "#{current_directory}/../lib/fog"
|
6
6
|
# Fog.mock!
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
unless defined?(LOADED_SPEC_OPTS)
|
9
|
+
# inlined spec.opts
|
10
|
+
require "#{current_directory}/compact_progress_bar_formatter"
|
11
|
+
Spec::Runner.options.parse_format("Spec::Runner::Formatter::CompactProgressBarFormatter")
|
12
|
+
Spec::Runner.options.loadby = 'mtime'
|
13
|
+
Spec::Runner.options.reverse = true
|
14
|
+
LOADED_SPEC_OPTS = true
|
13
15
|
end
|
14
16
|
|
15
|
-
def eu_s3
|
16
|
-
Fog::AWS::S3.new(
|
17
|
-
:aws_access_key_id => Fog.credentials[:aws_access_key_id],
|
18
|
-
:aws_secret_access_key => Fog.credentials[:aws_secret_access_key],
|
19
|
-
:host => 's3-external-3.amazonaws.com'
|
20
|
-
)
|
21
|
-
end
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
module AWS
|
19
|
+
class << self
|
20
|
+
def [](service)
|
21
|
+
@@connections ||= Hash.new do |hash, key|
|
22
|
+
credentials = Fog.credentials.reject do |k, v|
|
23
|
+
![:aws_access_key_id, :aws_secret_access_key].include?(k)
|
24
|
+
end
|
25
|
+
hash[key] = case key
|
26
|
+
when :ec2
|
27
|
+
Fog::AWS::EC2.new(credentials)
|
28
|
+
when :eu_s3
|
29
|
+
Fog::AWS::S3.new(credentials.merge!(:host => 's3-external-3.amazonaws.com'))
|
30
|
+
when :sdb
|
31
|
+
Fog::AWS::SimpleDB.new(credentials)
|
32
|
+
when :s3
|
33
|
+
Fog::AWS::S3.new(credentials)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
@@connections[service]
|
37
|
+
end
|
38
|
+
end
|
28
39
|
end
|
29
40
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
41
|
+
module Rackspace
|
42
|
+
class << self
|
43
|
+
def [](service)
|
44
|
+
@@connections ||= Hash.new do |hash, key|
|
45
|
+
credentials = Fog.credentials.reject do |k, v|
|
46
|
+
![:rackspace_api_key, :rackspace_username].include?(k)
|
47
|
+
end
|
48
|
+
hash[key] = case key
|
49
|
+
when :files
|
50
|
+
Fog::Rackspace::Files.new(credentials)
|
51
|
+
when :servers
|
52
|
+
Fog::Rackspace::Servers.new(credentials)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
@@connections[service]
|
56
|
+
end
|
57
|
+
end
|
35
58
|
end
|
36
59
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
60
|
+
module Slicehost
|
61
|
+
class << self
|
62
|
+
def [](service)
|
63
|
+
@@connections ||= Hash.new do |hash, key|
|
64
|
+
credentials = Fog.credentials.reject do |k, v|
|
65
|
+
![:slicehost_password].include?(k)
|
66
|
+
end
|
67
|
+
hash[key] = case key
|
68
|
+
when :slices
|
69
|
+
Fog::Slicehost.new(credentials)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
@@connections[service]
|
73
|
+
end
|
74
|
+
end
|
42
75
|
end
|
43
76
|
|
44
|
-
def servers
|
45
|
-
Fog::Rackspace::Servers.new(
|
46
|
-
:rackspace_api_key => Fog.credentials[:rackspace_api_key],
|
47
|
-
:rackspace_username => Fog.credentials[:rackspace_username]
|
48
|
-
)
|
49
|
-
end
|
50
77
|
|
51
|
-
def slicehost
|
52
|
-
Fog::Slicehost.new(
|
53
|
-
:password => Fog.credentials[:slicehost_password]
|
54
|
-
)
|
55
|
-
end
|
56
78
|
|
57
79
|
def eventually(max_delay = 16, &block)
|
58
80
|
delays = [0]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-25 00:00:00 -08:00
|
13
13
|
default_executable: fog
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -291,6 +291,7 @@ files:
|
|
291
291
|
- spec/aws/requests/simpledb/list_domains_spec.rb
|
292
292
|
- spec/aws/requests/simpledb/put_attributes_spec.rb
|
293
293
|
- spec/aws/requests/simpledb/select_spec.rb
|
294
|
+
- spec/compact_progress_bar_formatter.rb
|
294
295
|
- spec/lorem.txt
|
295
296
|
- spec/rackspace/models/servers/server_spec.rb
|
296
297
|
- spec/rackspace/requests/files/delete_container_spec.rb
|
@@ -325,13 +326,24 @@ files:
|
|
325
326
|
- spec/slicehost/requests/get_flavors_spec.rb
|
326
327
|
- spec/slicehost/requests/get_images_spec.rb
|
327
328
|
- spec/slicehost/requests/get_slices_spec.rb
|
328
|
-
- spec/spec.opts
|
329
329
|
- spec/spec_helper.rb
|
330
330
|
has_rdoc: true
|
331
331
|
homepage: http://github.com/geemus/fog
|
332
332
|
licenses: []
|
333
333
|
|
334
334
|
post_install_message: |
|
335
|
+
==================================================
|
336
|
+
|
337
|
+
fog 0.0.41 has a minor change to the API for ec2 servers:
|
338
|
+
|
339
|
+
# what_it_was => what_it_is
|
340
|
+
|
341
|
+
ec2.servers.new(:group_id => 'foo') => ec2.servers.new(:groups => ['foo'])
|
342
|
+
|
343
|
+
Updating to the newest api version also means you can now assign multiple groups:
|
344
|
+
|
345
|
+
ec2.servers.new(:groups => ['foo', 'bar'])
|
346
|
+
|
335
347
|
==================================================
|
336
348
|
|
337
349
|
fog 0.0.40 has API changes you should know about.
|
@@ -443,6 +455,7 @@ test_files:
|
|
443
455
|
- spec/aws/requests/simpledb/list_domains_spec.rb
|
444
456
|
- spec/aws/requests/simpledb/put_attributes_spec.rb
|
445
457
|
- spec/aws/requests/simpledb/select_spec.rb
|
458
|
+
- spec/compact_progress_bar_formatter.rb
|
446
459
|
- spec/rackspace/models/servers/server_spec.rb
|
447
460
|
- spec/rackspace/requests/files/delete_container_spec.rb
|
448
461
|
- spec/rackspace/requests/files/delete_object_spec.rb
|
data/spec/spec.opts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--colour
|