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
@@ -4,17 +4,17 @@ describe 'Rackspace::Files.head_container' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
files.put_container('container_name')
|
8
|
-
files.put_object('container_name', 'object_name', lorem_file)
|
7
|
+
Rackspace[:files].put_container('container_name')
|
8
|
+
Rackspace[:files].put_object('container_name', 'object_name', lorem_file)
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
|
-
files.delete_object('container_name', 'object_name')
|
13
|
-
files.delete_container('container_name')
|
12
|
+
Rackspace[:files].delete_object('container_name', 'object_name')
|
13
|
+
Rackspace[:files].delete_container('container_name')
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should return proper attributes" do
|
17
|
-
files.head_container('container_name')
|
17
|
+
Rackspace[:files].head_container('container_name')
|
18
18
|
end
|
19
19
|
|
20
20
|
end
|
@@ -22,7 +22,7 @@ describe 'Rackspace::Files.head_container' do
|
|
22
22
|
|
23
23
|
it "should raise a NotFound error if the container does not exist" do
|
24
24
|
lambda do
|
25
|
-
files.head_container('container_name')
|
25
|
+
Rackspace[:files].head_container('container_name')
|
26
26
|
end.should raise_error(Excon::Errors::NotFound)
|
27
27
|
end
|
28
28
|
|
@@ -4,15 +4,15 @@ describe 'Rackspace::Files.head_containers' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
files.put_container('container_name')
|
7
|
+
Rackspace[:files].put_container('container_name')
|
8
8
|
end
|
9
9
|
|
10
10
|
after(:each) do
|
11
|
-
files.delete_container('container_name')
|
11
|
+
Rackspace[:files].delete_container('container_name')
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should return proper attributes" do
|
15
|
-
files.head_containers
|
15
|
+
Rackspace[:files].head_containers
|
16
16
|
end
|
17
17
|
|
18
18
|
end
|
@@ -4,11 +4,11 @@ describe 'Rackspace::Files.put_container' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
after(:each) do
|
7
|
-
files.delete_container('container_name')
|
7
|
+
Rackspace[:files].delete_container('container_name')
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should return proper attributes" do
|
11
|
-
files.put_container('container_name')
|
11
|
+
Rackspace[:files].put_container('container_name')
|
12
12
|
end
|
13
13
|
|
14
14
|
end
|
@@ -4,16 +4,16 @@ describe 'Rackspace::Files.put_object' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
files.put_container('container_name')
|
7
|
+
Rackspace[:files].put_container('container_name')
|
8
8
|
end
|
9
9
|
|
10
10
|
after(:each) do
|
11
|
-
files.delete_object('container_name', 'object_name')
|
12
|
-
files.delete_container('container_name')
|
11
|
+
Rackspace[:files].delete_object('container_name', 'object_name')
|
12
|
+
Rackspace[:files].delete_container('container_name')
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should return proper attributes" do
|
16
|
-
files.put_object('container_name', 'object_name', lorem_file)
|
16
|
+
Rackspace[:files].put_object('container_name', 'object_name', lorem_file)
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -5,18 +5,18 @@ describe 'Rackspace::Servers.create_image' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
|
-
servers.delete_image(@image_id)
|
15
|
+
Rackspace[:servers].delete_image(@image_id)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should return proper attributes" do
|
19
|
-
actual = servers.create_image(@server_id).body['image']
|
19
|
+
actual = Rackspace[:servers].create_image(@server_id).body['image']
|
20
20
|
@image_id = actual['id']
|
21
21
|
actual['id'].should be_an(Integer)
|
22
22
|
actual['serverId'].should be_an(Integer)
|
@@ -5,13 +5,13 @@ describe 'Rackspace::Servers.create_server' do
|
|
5
5
|
|
6
6
|
after(:each) do
|
7
7
|
eventually(128) do
|
8
|
-
servers.delete_server(@server_id)
|
8
|
+
Rackspace[:servers].delete_server(@server_id)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should return proper attributes" do
|
13
13
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
14
|
-
actual = servers.create_server(1, 3, 'name').body['server']
|
14
|
+
actual = Rackspace[:servers].create_server(1, 3, 'name').body['server']
|
15
15
|
@server_id = actual['id']
|
16
16
|
actual['addresses'].should be_a(Hash)
|
17
17
|
actual['addresses']['private'].should be_an(Array)
|
@@ -5,19 +5,19 @@ describe 'Rackspace::Servers.delete_image' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
9
|
-
@image_id = servers.create_image(@server_id).body['image']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
|
+
@image_id = Rackspace[:servers].create_image(@server_id).body['image']['id']
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should return proper attributes" do
|
13
13
|
eventually(128) do
|
14
|
-
servers.delete_server(@server_id)
|
14
|
+
Rackspace[:servers].delete_server(@server_id)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should return proper attributes" do
|
19
19
|
eventually(128) do
|
20
|
-
servers.delete_image(@image_id)
|
20
|
+
Rackspace[:servers].delete_image(@image_id)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -26,7 +26,7 @@ describe 'Rackspace::Servers.delete_image' do
|
|
26
26
|
|
27
27
|
it "should raise a BadRequest error if the image does not exist" do
|
28
28
|
lambda do
|
29
|
-
servers.delete_image(0)
|
29
|
+
Rackspace[:servers].delete_image(0)
|
30
30
|
end.should raise_error(Excon::Errors::BadRequest)
|
31
31
|
end
|
32
32
|
|
@@ -5,12 +5,12 @@ describe 'Rackspace::Servers.delete_server' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should return proper attributes" do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -19,7 +19,7 @@ describe 'Rackspace::Servers.delete_server' do
|
|
19
19
|
|
20
20
|
it "should raise a NotFound error if the server does not exist" do
|
21
21
|
lambda {
|
22
|
-
servers.delete_server(0)
|
22
|
+
Rackspace[:servers].delete_server(0)
|
23
23
|
}.should raise_error(Excon::Errors::NotFound)
|
24
24
|
end
|
25
25
|
|
@@ -4,7 +4,7 @@ describe 'Rackspace::Servers.get_flavor_details' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual = servers.get_flavor_details(1).body['flavor']
|
7
|
+
actual = Rackspace[:servers].get_flavor_details(1).body['flavor']
|
8
8
|
actual['disk'].should be_an(Integer)
|
9
9
|
actual['id'].should be_an(Integer)
|
10
10
|
actual['name'].should be_a(String)
|
@@ -5,17 +5,17 @@ describe 'Rackspace::Servers.get_server_details' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
actual = servers.get_server_details(@server_id).body['server']
|
18
|
+
actual = Rackspace[:servers].get_server_details(@server_id).body['server']
|
19
19
|
actual['addresses'].should be_a(Hash)
|
20
20
|
actual['addresses']['private'].should be_an(Array)
|
21
21
|
actual['addresses']['private'].first.should be_a(String)
|
@@ -36,7 +36,7 @@ describe 'Rackspace::Servers.get_server_details' do
|
|
36
36
|
|
37
37
|
it "should raise a NotFound error if the server does not exist" do
|
38
38
|
lambda {
|
39
|
-
servers.get_server_details(0)
|
39
|
+
Rackspace[:servers].get_server_details(0)
|
40
40
|
}.should raise_error(Excon::Errors::NotFound)
|
41
41
|
end
|
42
42
|
|
@@ -5,17 +5,17 @@ describe 'Rackspace::Servers.list_addresses' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
actual = servers.list_addresses(@server_id).body
|
18
|
+
actual = Rackspace[:servers].list_addresses(@server_id).body
|
19
19
|
actual['addresses'].should be_a(Hash)
|
20
20
|
actual['addresses']['private'].should be_an(Array)
|
21
21
|
actual['addresses']['public'].should be_an(Array)
|
@@ -26,7 +26,7 @@ describe 'Rackspace::Servers.list_addresses' do
|
|
26
26
|
|
27
27
|
it "should raise a NotFound error if the server does not exist" do
|
28
28
|
lambda {
|
29
|
-
servers.list_addresses(0)
|
29
|
+
Rackspace[:servers].list_addresses(0)
|
30
30
|
}.should raise_error(Excon::Errors::NotFound)
|
31
31
|
end
|
32
32
|
|
@@ -4,7 +4,7 @@ describe 'Rackspace::Servers.list_flavors_detail' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual = servers.list_flavors_detail.body
|
7
|
+
actual = Rackspace[:servers].list_flavors_detail.body
|
8
8
|
actual['flavors'].should be_an(Array)
|
9
9
|
flavor = actual['flavors'].first
|
10
10
|
flavor['disk'].should be_an(Integer)
|
@@ -4,7 +4,7 @@ describe 'Rackspace::Servers.list_flavors' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual = servers.list_flavors.body
|
7
|
+
actual = Rackspace[:servers].list_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 'Rackspace::Servers.list_images_detail' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual = servers.list_images_detail.body
|
7
|
+
actual = Rackspace[:servers].list_images_detail.body
|
8
8
|
actual['images'].should be_an(Array)
|
9
9
|
image = actual['images'].first
|
10
10
|
image['created'].should be_a(String)
|
@@ -4,7 +4,7 @@ describe 'Rackspace::Servers.list_images' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
actual = servers.list_images.body
|
7
|
+
actual = Rackspace[:servers].list_images.body
|
8
8
|
actual['images'].should be_an(Array)
|
9
9
|
image = actual['images'].first
|
10
10
|
image['id'].should be_an(Integer)
|
@@ -5,17 +5,17 @@ describe 'Rackspace::Servers.list_private_addresses' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
actual = servers.list_private_addresses(@server_id).body
|
18
|
+
actual = Rackspace[:servers].list_private_addresses(@server_id).body
|
19
19
|
actual['private'].should be_an(Array)
|
20
20
|
end
|
21
21
|
|
@@ -24,7 +24,7 @@ describe 'Rackspace::Servers.list_private_addresses' do
|
|
24
24
|
|
25
25
|
it "should raise a NotFound error if the server does not exist" do
|
26
26
|
lambda {
|
27
|
-
servers.list_private_addresses(0)
|
27
|
+
Rackspace[:servers].list_private_addresses(0)
|
28
28
|
}.should raise_error(Excon::Errors::NotFound)
|
29
29
|
end
|
30
30
|
|
@@ -5,17 +5,17 @@ describe 'Rackspace::Servers.list_public_addresses' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
actual = servers.list_public_addresses(@server_id).body
|
18
|
+
actual = Rackspace[:servers].list_public_addresses(@server_id).body
|
19
19
|
actual['public'].should be_an(Array)
|
20
20
|
end
|
21
21
|
|
@@ -24,7 +24,7 @@ describe 'Rackspace::Servers.list_public_addresses' do
|
|
24
24
|
|
25
25
|
it "should raise a NotFound error if the server does not exist" do
|
26
26
|
lambda {
|
27
|
-
servers.list_public_addresses(0)
|
27
|
+
Rackspace[:servers].list_public_addresses(0)
|
28
28
|
}.should raise_error(Excon::Errors::NotFound)
|
29
29
|
end
|
30
30
|
|
@@ -5,17 +5,17 @@ describe 'Rackspace::Servers.list_servers_detail' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
actual = servers.list_servers_detail.body['servers'].first
|
18
|
+
actual = Rackspace[:servers].list_servers_detail.body['servers'].first
|
19
19
|
actual['addresses'].should be_a(Hash)
|
20
20
|
actual['addresses']['private'].should be_an(Array)
|
21
21
|
actual['addresses']['private'].first.should be_a(String)
|
@@ -5,17 +5,17 @@ describe 'Rackspace::Servers.list_servers' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
actual = servers.list_servers.body['servers'].first
|
18
|
+
actual = Rackspace[:servers].list_servers.body['servers'].first
|
19
19
|
actual['id'].should be_an(Integer)
|
20
20
|
actual['name'].should be_a(String)
|
21
21
|
end
|
@@ -5,17 +5,17 @@ describe 'Rackspace::Servers.reboot_server' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
servers.reboot_server(@server_id, 'HARD')
|
18
|
+
Rackspace[:servers].reboot_server(@server_id, 'HARD')
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
@@ -23,7 +23,7 @@ describe 'Rackspace::Servers.reboot_server' do
|
|
23
23
|
|
24
24
|
it "should raise a NotFound error if the server does not exist" do
|
25
25
|
lambda do
|
26
|
-
servers.reboot_server(0, 'HARD')
|
26
|
+
Rackspace[:servers].reboot_server(0, 'HARD')
|
27
27
|
end.should raise_error(Excon::Errors::NotFound)
|
28
28
|
end
|
29
29
|
|
@@ -5,18 +5,18 @@ describe 'Rackspace::Servers.update_server' do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
-
@server_id = servers.create_server(1, 3, 'name').body['server']['id']
|
8
|
+
@server_id = Rackspace[:servers].create_server(1, 3, 'name').body['server']['id']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually(128) do
|
13
|
-
servers.delete_server(@server_id)
|
13
|
+
Rackspace[:servers].delete_server(@server_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
18
|
eventually(128) do
|
19
|
-
servers.update_server(@server_id, :name => 'server_name', :adminPass => 'admin_password')
|
19
|
+
Rackspace[:servers].update_server(@server_id, :name => 'server_name', :adminPass => 'admin_password')
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -25,7 +25,7 @@ describe 'Rackspace::Servers.update_server' do
|
|
25
25
|
|
26
26
|
it "should raise a NotFound error if the server does not exist" do
|
27
27
|
lambda do
|
28
|
-
servers.update_server(0, :name => 'server_name', :adminPass => 'admin_password')
|
28
|
+
Rackspace[:servers].update_server(0, :name => 'server_name', :adminPass => 'admin_password')
|
29
29
|
end.should raise_error(Excon::Errors::NotFound)
|
30
30
|
end
|
31
31
|
|