fog 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/.gitignore +1 -1
  2. data/Rakefile +43 -0
  3. data/changelog.txt +39 -0
  4. data/docs/_config.yml +39 -0
  5. data/docs/_layouts/default.html +96 -0
  6. data/docs/_posts/2011-01-01-cdn.markdown +82 -0
  7. data/docs/_posts/2011-01-01-contributing.markdown +228 -0
  8. data/docs/_posts/2011-01-01-dns.markdown +79 -0
  9. data/docs/_posts/2011-01-01-press.markdown +32 -0
  10. data/docs/_posts/2011-01-01-start.markdown +21 -0
  11. data/docs/_posts/2011-01-01-storage.markdown +145 -0
  12. data/docs/_posts/2011-01-01-structure.markdown +78 -0
  13. data/docs/_posts/2011-01-01-users.markdown +33 -0
  14. data/docs/index.markdown +94 -0
  15. data/docs/public/crossdomain.xml +25 -0
  16. data/docs/public/css/fog.css +129 -0
  17. data/docs/public/css/handheld.css +8 -0
  18. data/docs/public/css/style.css +129 -0
  19. data/docs/public/images/.gitignore +3 -0
  20. data/docs/public/js/libs/dd_belatedpng.js +13 -0
  21. data/docs/public/js/libs/jquery-1.4.2.js +6240 -0
  22. data/docs/public/js/libs/jquery-1.4.2.min.js +154 -0
  23. data/docs/public/js/libs/modernizr-1.6.min.js +30 -0
  24. data/docs/public/js/mylibs/.gitignore +3 -0
  25. data/docs/public/js/plugins.js +34 -0
  26. data/docs/public/js/profiling/config.js +59 -0
  27. data/docs/public/js/profiling/yahoo-profiling.css +7 -0
  28. data/docs/public/js/profiling/yahoo-profiling.min.js +39 -0
  29. data/docs/public/js/script.js +26 -0
  30. data/docs/public/robots.txt +5 -0
  31. data/fog.gemspec +6 -5
  32. data/lib/fog.rb +1 -1
  33. data/lib/fog/aws/cloud_formation.rb +1 -1
  34. data/lib/fog/compute/aws.rb +24 -0
  35. data/lib/fog/compute/models/aws/key_pair.rb +19 -1
  36. data/lib/fog/compute/models/aws/server.rb +6 -12
  37. data/lib/fog/compute/models/rackspace/server.rb +7 -7
  38. data/lib/fog/compute/requests/aws/attach_volume.rb +4 -0
  39. data/lib/fog/compute/requests/aws/create_security_group.rb +3 -3
  40. data/lib/fog/compute/requests/aws/create_tags.rb +2 -0
  41. data/lib/fog/compute/requests/aws/create_volume.rb +4 -0
  42. data/lib/fog/compute/requests/aws/delete_tags.rb +43 -0
  43. data/lib/fog/compute/requests/aws/describe_instances.rb +3 -7
  44. data/lib/fog/compute/requests/aws/describe_snapshots.rb +4 -6
  45. data/lib/fog/compute/requests/aws/describe_volumes.rb +2 -6
  46. data/lib/fog/core.rb +1 -0
  47. data/lib/fog/core/connection.rb +1 -1
  48. data/lib/fog/core/credentials.rb +5 -1
  49. data/lib/fog/core/parser.rb +1 -2
  50. data/lib/fog/core/ssh.rb +2 -3
  51. data/lib/fog/dns/models/aws/record.rb +1 -1
  52. data/lib/fog/dns/models/bluebox/zone.rb +1 -0
  53. data/lib/fog/storage/models/rackspace/directory.rb +8 -2
  54. data/lib/fog/storage/rackspace.rb +3 -1
  55. data/lib/fog/storage/requests/rackspace/delete_container.rb +1 -1
  56. data/lib/fog/storage/requests/rackspace/delete_object.rb +1 -1
  57. data/lib/fog/storage/requests/rackspace/get_container.rb +1 -1
  58. data/lib/fog/storage/requests/rackspace/get_object.rb +1 -1
  59. data/lib/fog/storage/requests/rackspace/head_container.rb +1 -1
  60. data/lib/fog/storage/requests/rackspace/head_object.rb +2 -2
  61. data/lib/fog/storage/requests/rackspace/put_container.rb +1 -1
  62. data/lib/fog/storage/requests/rackspace/put_object.rb +1 -1
  63. data/spec/spec_helper.rb +0 -4
  64. data/tests/aws/requests/cloud_formation/stack_tests.rb +16 -5
  65. data/tests/aws/requests/rds/instance_tests.rb +4 -2
  66. data/tests/compute/models/aws/address_tests.rb +16 -0
  67. data/tests/compute/models/aws/addresses_tests.rb +5 -0
  68. data/tests/compute/models/aws/key_pair_tests.rb +27 -0
  69. data/tests/compute/models/aws/key_pairs_tests.rb +5 -0
  70. data/tests/compute/models/aws/security_group_tests.rb +5 -0
  71. data/tests/compute/models/aws/security_groups.rb +5 -0
  72. data/tests/compute/models/aws/server_tests.rb +39 -0
  73. data/tests/compute/models/aws/snapshot_tests.rb +10 -0
  74. data/tests/compute/models/aws/snapshots_tests.rb +10 -0
  75. data/tests/compute/models/aws/volume_tests.rb +26 -0
  76. data/tests/compute/models/aws/volumes_tests.rb +5 -0
  77. data/tests/core/credential_tests.rb +36 -0
  78. data/tests/storage/requests/aws/object_tests.rb +1 -1
  79. data/tests/storage/requests/google/object_tests.rb +1 -1
  80. data/tests/storage/requests/rackspace/object_tests.rb +8 -0
  81. metadata +118 -75
  82. data/spec/aws/models/compute/address_spec.rb +0 -103
  83. data/spec/aws/models/compute/addresses_spec.rb +0 -70
  84. data/spec/aws/models/compute/key_pair_spec.rb +0 -86
  85. data/spec/aws/models/compute/key_pairs_spec.rb +0 -71
  86. data/spec/aws/models/compute/security_group_spec.rb +0 -88
  87. data/spec/aws/models/compute/security_groups_spec.rb +0 -71
  88. data/spec/aws/models/compute/server_spec.rb +0 -105
  89. data/spec/aws/models/compute/snapshot_spec.rb +0 -79
  90. data/spec/aws/models/compute/snapshots_spec.rb +0 -85
  91. data/spec/aws/models/compute/volume_spec.rb +0 -174
  92. data/spec/aws/models/compute/volumes_spec.rb +0 -71
  93. data/tests/compute/models/aws/server_monitor_tests.rb +0 -47
@@ -1,105 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Fog::AWS::Compute::Server' do
4
-
5
- subject { @server = @servers.new(:image_id => GENTOO_AMI) }
6
-
7
- before(:each) do
8
- @servers = AWS[:compute].servers
9
- end
10
-
11
- after(:each) do
12
- if @server && !@server.new_record?
13
- @server.wait_for { ready? }
14
- @server.destroy.should be_true
15
- end
16
- end
17
-
18
- describe "#initialize" do
19
-
20
- it "should remap attributes from parser" do
21
- server = @servers.new({
22
- 'amiLaunchIndex' => 'ami_launch_index',
23
- 'clientToken' => 'client_token',
24
- 'dnsName' => 'dns_name',
25
- 'imageId' => 'image_id',
26
- 'instanceId' => 'instance_id',
27
- 'instanceType' => 'instance_type',
28
- 'kernelId' => 'kernel_id',
29
- 'keyName' => 'key_name',
30
- 'launchTime' => 'launch_time',
31
- 'productCodes' => 'product_codes',
32
- 'privateDnsName' => 'private_dns_name',
33
- 'ramdiskId' => 'ramdisk_id'
34
- })
35
- server.ami_launch_index.should == 'ami_launch_index'
36
- server.client_token.should == 'client_token'
37
- server.dns_name.should == 'dns_name'
38
- server.image_id.should == 'image_id'
39
- server.id.should == 'instance_id'
40
- server.kernel_id.should == 'kernel_id'
41
- server.key_name.should == 'key_name'
42
- server.created_at.should == 'launch_time'
43
- server.product_codes.should == 'product_codes'
44
- server.private_dns_name.should == 'private_dns_name'
45
- server.ramdisk_id.should == 'ramdisk_id'
46
- end
47
-
48
- end
49
-
50
- describe "#addresses" do
51
-
52
- it "should return a Fog::AWS::Compute::Addresses" do
53
- subject.save
54
- subject.addresses.should be_a(Fog::AWS::Compute::Addresses)
55
- end
56
-
57
- end
58
-
59
- describe "#state" do
60
- it "should remap values out of hash" do
61
- server = Fog::AWS::Compute::Server.new({
62
- 'instanceState' => { 'name' => 'instance_state' },
63
- })
64
- server.state.should == 'instance_state'
65
- end
66
- end
67
-
68
- describe "#key_pair" do
69
- it "should have tests"
70
- end
71
-
72
- describe "#key_pair=" do
73
- it "should have tests"
74
- end
75
-
76
- describe "#monitoring=" do
77
- it "should remap values out of hash" do
78
- server = Fog::AWS::Compute::Server.new({
79
- 'monitoring' => { 'state' => true }
80
- })
81
- server.monitoring.should == true
82
- end
83
- end
84
-
85
- describe "#placement=" do
86
-
87
- it "should remap values into availability_zone" do
88
- server = Fog::AWS::Compute::Server.new({
89
- 'placement' => { 'availabilityZone' => 'availability_zone' }
90
- })
91
- server.availability_zone.should == 'availability_zone'
92
- end
93
-
94
- end
95
-
96
- describe "#volumes" do
97
-
98
- it "should return a Fog::AWS::Compute::Volumes" do
99
- subject.save
100
- subject.volumes.should be_a(Fog::AWS::Compute::Volumes)
101
- end
102
-
103
- end
104
-
105
- end
@@ -1,79 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Fog::AWS::Compute::Snapshot' do
4
-
5
- before(:all) do
6
- @volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
7
- @volume.wait_for { ready? }
8
- end
9
-
10
- after(:all) do
11
- @volume.destroy
12
- end
13
-
14
- after(:each) do
15
- if @snapshot && !@snapshot.new_record?
16
- @snapshot.wait_for { ready? }
17
- @snapshot.destroy
18
- end
19
- end
20
-
21
- describe "#initialize" do
22
-
23
- it "should remap attributes from parser" do
24
- snapshot = AWS[:compute].snapshots.new(
25
- 'snapshotId' => 'snap-00000000',
26
- 'startTime' => 'now',
27
- 'volumeId' => 'vol-00000000',
28
- 'description' => 'taken for safety'
29
- )
30
- snapshot.id.should == 'snap-00000000'
31
- snapshot.created_at.should == 'now'
32
- snapshot.volume_id.should == 'vol-00000000'
33
- snapshot.description.should == 'taken for safety'
34
- end
35
-
36
- end
37
-
38
- describe "#destroy" do
39
-
40
- it "should return true if the snapshot is deleted" do
41
- @snapshot = @volume.snapshots.create
42
- @snapshot.wait_for { ready? }
43
- @snapshot.destroy.should be_true
44
- @snapshot = nil # avoid the after(:each) block
45
- end
46
-
47
- end
48
-
49
- describe "#reload" do
50
-
51
- before(:each) do
52
- @snapshot = @volume.snapshots.create
53
- @reloaded = @snapshot.reload
54
- end
55
-
56
- it "should match the original" do
57
- @reloaded.should be_a(Fog::AWS::Compute::Snapshot)
58
- @reloaded.attributes.should == @snapshot.attributes
59
- end
60
-
61
- end
62
-
63
- describe "#save" do
64
-
65
- it "should persist the snapshot" do
66
- @snapshot = @volume.snapshots.new
67
- AWS[:compute].snapshots.get(@snapshot.id).should be_nil
68
- @snapshot.save.should be_true
69
- AWS[:compute].snapshots.get(@snapshot.id).should_not be_nil
70
- end
71
-
72
- it "should allow a description" do
73
- @snapshot = @volume.snapshots.create(:description => 'taken for safety')
74
- AWS[:compute].snapshots.get(@snapshot.id).description.should == 'taken for safety'
75
- end
76
-
77
- end
78
-
79
- end
@@ -1,85 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Fog::AWS::Compute::Snapshots' do
4
-
5
- before(:all) do
6
- @volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
7
- @volume.wait_for { ready? }
8
- end
9
-
10
- after(:all) do
11
- @volume.destroy
12
- end
13
-
14
- after(:each) do
15
- if @snapshot && !@snapshot.new_record?
16
- @snapshot.wait_for { ready? }
17
- @snapshot.destroy
18
- end
19
- end
20
-
21
- describe "#all" do
22
-
23
- before(:each) do
24
- @snapshot = @volume.snapshots.create
25
- end
26
-
27
- it "should include persisted snapshots" do
28
- AWS[:compute].snapshots.all.map {|snapshot| snapshot.id}.should include(@snapshot.id)
29
- end
30
-
31
- it "should limit snapshots by volume if present" do
32
- @other_volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
33
-
34
- @volume.snapshots.map {|snapshot| snapshot.id}.should include(@snapshot.identity)
35
- @other_volume.snapshots.map {|snapshot| snapshot.id}.should_not include(@snapshot.identity)
36
-
37
- @other_volume.destroy
38
- end
39
-
40
- end
41
-
42
- describe "#create" do
43
-
44
- before(:each) do
45
- @snapshot = @volume.snapshots.create
46
- end
47
-
48
- it "should exist on ec2" do
49
- AWS[:compute].snapshots.get(@snapshot.id).should_not be_nil
50
- end
51
-
52
- end
53
-
54
- describe "#get" do
55
-
56
- it "should return a Fog::AWS::Compute::Snapshot if a matching snapshot exists" do
57
- @snapshot = @volume.snapshots.create
58
- @snapshot.wait_for { ready? }
59
- get = AWS[:compute].snapshots.get(@snapshot.id)
60
- @snapshot.attributes.should == get.attributes
61
- end
62
-
63
- it "should return nil if no matching address exists" do
64
- AWS[:compute].snapshots.get('snap-00000000').should be_nil
65
- end
66
-
67
- end
68
-
69
- describe "#new" do
70
-
71
- it "should return a Fog::AWS::Compute::Snapshot" do
72
- AWS[:compute].snapshots.new.should be_a(Fog::AWS::Compute::Snapshot)
73
- end
74
-
75
- end
76
-
77
- describe "#reload" do
78
-
79
- it "should return a Fog::AWS::Compute::Snapshots" do
80
- AWS[:compute].snapshots.all.reload.should be_a(Fog::AWS::Compute::Snapshots)
81
- end
82
-
83
- end
84
-
85
- end
@@ -1,174 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Fog::AWS::Compute::Volume' do
4
-
5
- describe "#initialize" do
6
-
7
- it "should remap attributes from parser" do
8
- volume = AWS[:compute].volumes.new(
9
- 'attachTime' => 'now',
10
- 'availabilityZone' => 'us-east-1a',
11
- 'createTime' => 'recently',
12
- 'instanceId' => 'i-00000000',
13
- 'snapshotId' => 'snap-00000000',
14
- 'volumeId' => 'vol-00000000'
15
- )
16
- volume.attached_at.should == 'now'
17
- volume.availability_zone.should == 'us-east-1a'
18
- volume.created_at.should == 'recently'
19
- volume.server_id.should == 'i-00000000'
20
- volume.snapshot_id.should == 'snap-00000000'
21
- volume.id.should == 'vol-00000000'
22
- end
23
-
24
- end
25
-
26
- describe "#collection" do
27
-
28
- it "should return a Fog::AWS::Compute::Volumes" do
29
- AWS[:compute].volumes.new.collection.should be_a(Fog::AWS::Compute::Volumes)
30
- end
31
-
32
- it "should be the volumes the volume is related to" do
33
- volumes = AWS[:compute].volumes
34
- volumes.new.collection.should == volumes
35
- end
36
-
37
- end
38
-
39
- describe "#destroy" do
40
-
41
- it "should return true if the volume is deleted" do
42
- volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => '/dev/sdz1')
43
- volume.destroy.should be_true
44
- end
45
-
46
- it 'should fail if the volume is attached to an instance' do
47
- server = AWS[:compute].servers.create(:image_id => GENTOO_AMI)
48
- server.wait_for { ready? }
49
- volume = AWS[:compute].volumes.create(:availability_zone => server.availability_zone, :size => 1, :device => '/dev/sdz1')
50
- volume.server = server
51
- lambda { volume.destroy }.should raise_error
52
- end
53
-
54
- end
55
-
56
- describe "#server=" do
57
- before(:all) do
58
- @server = AWS[:compute].servers.create(:image_id => GENTOO_AMI)
59
- @server.wait_for { ready? }
60
- end
61
-
62
- after(:all) do
63
- @server.destroy
64
- end
65
-
66
- before(:each) do
67
- @volume = AWS[:compute].volumes.new(:availability_zone => @server.availability_zone, :size => 1, :device => '/dev/sdz1')
68
- end
69
-
70
- describe "when set to a server" do
71
- after(:each) do
72
- if @volume.id
73
- @volume.wait_for { state == 'in-use' }
74
- @volume.server = nil
75
- @volume.wait_for { ready? }
76
- @volume.destroy
77
- end
78
- end
79
-
80
- it "should not attach to server if the volume has not been saved" do
81
- @volume.server = @server
82
- @volume.server_id.should_not == @server.id
83
- end
84
-
85
- it "should change the availability_zone if the volume has not been saved" do
86
- @volume.server = @server
87
- @volume.availability_zone.should == @server.availability_zone
88
- end
89
-
90
- it "should attach to server when the volume is saved" do
91
- @volume.server = @server
92
- @volume.save.should be_true
93
- @volume.server_id.should == @server.id
94
- end
95
-
96
- it "should attach to server to an already saved volume" do
97
- @volume.save.should be_true
98
- @volume.server = @server
99
- @volume.server_id.should == @server.id
100
- end
101
-
102
- it "should not change the availability_zone if the volume has been saved" do
103
- @volume.save.should be_true
104
- @volume.server = @server
105
- @volume.availability_zone.should == @server.availability_zone
106
- end
107
-
108
- end
109
-
110
- describe "when set to nil" do
111
- after(:each) do
112
- @volume.destroy
113
- end
114
-
115
- it "should detach from server if the volume has been saved" do
116
- @volume.server = @server
117
- @volume.save.should be_true
118
- @server.reload.volumes.map(&:id).should include(@volume.id)
119
-
120
- @volume.server = nil
121
- @volume.wait_for { ready? }
122
- @volume.server_id.should be_nil
123
- @server.reload.volumes.map(&:id).should_not include(@volume.id)
124
- end
125
-
126
- end
127
-
128
- end
129
-
130
- describe "#reload" do
131
-
132
- before(:each) do
133
- @volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => '/dev/sdz1')
134
- @reloaded = @volume.reload
135
- end
136
-
137
- after(:each) do
138
- @volume.destroy
139
- end
140
-
141
- it "should return a Fog::AWS::Compute::Volume" do
142
- @reloaded.should be_a(Fog::AWS::Compute::Volume)
143
- end
144
-
145
- it "should reset attributes to remote state" do
146
- @volume.attributes.should == @reloaded.attributes
147
- end
148
-
149
- end
150
-
151
- describe "#save" do
152
-
153
- before(:each) do
154
- @volume = AWS[:compute].volumes.new(:availability_zone => 'us-east-1a', :size => 1, :device => '/dev/sdz1')
155
- end
156
-
157
- it "should return true when it succeeds" do
158
- @volume.save.should be_true
159
- @volume.destroy
160
- end
161
-
162
- it "should not exist in volumes before save" do
163
- AWS[:compute].volumes.get(@volume.id).should be_nil
164
- end
165
-
166
- it "should exist in buckets after save" do
167
- @volume.save
168
- AWS[:compute].volumes.get(@volume.id).should_not be_nil
169
- @volume.destroy
170
- end
171
-
172
- end
173
-
174
- end
@@ -1,71 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Fog::AWS::Compute::Volumes' do
4
-
5
- describe "#all" do
6
-
7
- it "should return a Fog::AWS::Compute::Volumes" do
8
- AWS[:compute].volumes.all.should be_a(Fog::AWS::Compute::Volumes)
9
- end
10
-
11
- it "should include persisted volumes" do
12
- volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
13
- AWS[:compute].volumes.get(volume.id).should_not be_nil
14
- volume.destroy
15
- end
16
-
17
- end
18
-
19
- describe "#create" do
20
-
21
- before(:each) do
22
- @volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
23
- end
24
-
25
- after(:each) do
26
- @volume.destroy
27
- end
28
-
29
- it "should return a Fog::AWS::Compute::Volume" do
30
- @volume.should be_a(Fog::AWS::Compute::Volume)
31
- end
32
-
33
- it "should exist on ec2" do
34
- AWS[:compute].volumes.get(@volume.id).should_not be_nil
35
- end
36
-
37
- end
38
-
39
- describe "#get" do
40
-
41
- it "should return a Fog::AWS::Compute::Volume if a matching volume exists" do
42
- volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
43
- volume.wait_for { ready? }
44
- get = AWS[:compute].volumes.get(volume.id)
45
- volume.attributes.should == get.attributes
46
- volume.destroy
47
- end
48
-
49
- it "should return nil if no matching address exists" do
50
- AWS[:compute].volumes.get('vol-00000000').should be_nil
51
- end
52
-
53
- end
54
-
55
- describe "#new" do
56
-
57
- it "should return a Fog::AWS::Compute::Volume" do
58
- AWS[:compute].volumes.new.should be_a(Fog::AWS::Compute::Volume)
59
- end
60
-
61
- end
62
-
63
- describe "#reload" do
64
-
65
- it "should return a Fog::AWS::Compute::Volumes" do
66
- AWS[:compute].volumes.all.reload.should be_a(Fog::AWS::Compute::Volumes)
67
- end
68
-
69
- end
70
-
71
- end