fog 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/fog +18 -11
- data/fog.gemspec +43 -14
- data/lib/fog.rb +7 -1
- data/lib/fog/aws/ec2.rb +0 -7
- data/lib/fog/aws/models/ec2/address.rb +22 -26
- data/lib/fog/aws/models/ec2/addresses.rb +7 -22
- data/lib/fog/aws/models/ec2/instance.rb +2 -15
- data/lib/fog/aws/models/ec2/instances.rb +6 -23
- data/lib/fog/aws/models/ec2/key_pair.rb +2 -17
- data/lib/fog/aws/models/ec2/key_pairs.rb +6 -23
- data/lib/fog/aws/models/ec2/security_group.rb +18 -22
- data/lib/fog/aws/models/ec2/security_groups.rb +6 -23
- data/lib/fog/aws/models/ec2/snapshot.rb +2 -15
- data/lib/fog/aws/models/ec2/snapshots.rb +7 -20
- data/lib/fog/aws/models/ec2/volume.rb +23 -22
- data/lib/fog/aws/models/ec2/volumes.rb +8 -22
- data/lib/fog/aws/models/s3/bucket.rb +1 -1
- data/lib/fog/aws/models/s3/buckets.rb +3 -20
- data/lib/fog/aws/models/s3/objects.rb +11 -22
- data/lib/fog/aws/requests/ec2/allocate_address.rb +1 -1
- data/lib/fog/aws/requests/ec2/associate_address.rb +2 -2
- data/lib/fog/aws/requests/ec2/attach_volume.rb +2 -2
- data/lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/ec2/create_key_pair.rb +2 -2
- data/lib/fog/aws/requests/ec2/create_security_group.rb +2 -2
- data/lib/fog/aws/requests/ec2/create_snapshot.rb +2 -2
- data/lib/fog/aws/requests/ec2/create_volume.rb +3 -3
- data/lib/fog/aws/requests/ec2/delete_key_pair.rb +1 -1
- data/lib/fog/aws/requests/ec2/delete_security_group.rb +2 -2
- data/lib/fog/aws/requests/ec2/delete_snapshot.rb +2 -2
- data/lib/fog/aws/requests/ec2/delete_volume.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_addresses.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_availability_zones.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_images.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_instances.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_key_pairs.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_regions.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_security_groups.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_snapshots.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_volumes.rb +2 -2
- data/lib/fog/aws/requests/ec2/detach_volume.rb +2 -2
- data/lib/fog/aws/requests/ec2/disassociate_address.rb +2 -2
- data/lib/fog/aws/requests/ec2/get_console_output.rb +2 -2
- data/lib/fog/aws/requests/ec2/reboot_instances.rb +2 -2
- data/lib/fog/aws/requests/ec2/release_address.rb +2 -2
- data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/ec2/run_instances.rb +2 -2
- data/lib/fog/aws/requests/ec2/terminate_instances.rb +2 -2
- data/lib/fog/aws/requests/s3/copy_object.rb +2 -2
- data/lib/fog/aws/requests/s3/delete_bucket.rb +3 -3
- data/lib/fog/aws/requests/s3/delete_object.rb +2 -2
- data/lib/fog/aws/requests/s3/get_bucket.rb +2 -2
- data/lib/fog/aws/requests/s3/get_bucket_location.rb +2 -2
- data/lib/fog/aws/requests/s3/get_object.rb +2 -2
- data/lib/fog/aws/requests/s3/get_request_payment.rb +2 -2
- data/lib/fog/aws/requests/s3/get_service.rb +1 -1
- data/lib/fog/aws/requests/s3/head_object.rb +1 -1
- data/lib/fog/aws/requests/s3/put_bucket.rb +1 -1
- data/lib/fog/aws/requests/s3/put_object.rb +2 -2
- data/lib/fog/aws/requests/s3/put_request_payment.rb +1 -1
- data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +2 -2
- data/lib/fog/aws/requests/simpledb/create_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/delete_attributes.rb +2 -2
- data/lib/fog/aws/requests/simpledb/delete_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/domain_metadata.rb +2 -2
- data/lib/fog/aws/requests/simpledb/get_attributes.rb +2 -2
- data/lib/fog/aws/requests/simpledb/list_domains.rb +1 -1
- data/lib/fog/aws/requests/simpledb/put_attributes.rb +1 -1
- data/lib/fog/aws/requests/simpledb/select.rb +1 -1
- data/lib/fog/aws/s3.rb +0 -7
- data/lib/fog/aws/simpledb.rb +0 -4
- data/lib/fog/collection.rb +35 -7
- data/lib/fog/connection.rb +10 -130
- data/lib/fog/model.rb +18 -13
- data/lib/fog/parser.rb +0 -5
- data/lib/fog/rackspace.rb +35 -15
- data/lib/fog/rackspace/files.rb +36 -6
- data/lib/fog/rackspace/models/servers/server.rb +2 -16
- data/lib/fog/rackspace/models/servers/servers.rb +6 -21
- data/lib/fog/rackspace/requests/files/delete_container.rb +38 -0
- data/lib/fog/rackspace/requests/files/delete_object.rb +39 -0
- data/lib/fog/rackspace/requests/files/get_container.rb +61 -0
- data/lib/fog/rackspace/requests/files/get_containers.rb +5 -7
- data/lib/fog/rackspace/requests/files/head_container.rb +44 -0
- data/lib/fog/rackspace/requests/files/head_containers.rb +1 -1
- data/lib/fog/rackspace/requests/files/put_container.rb +38 -0
- data/lib/fog/rackspace/requests/files/put_object.rb +41 -0
- data/lib/fog/rackspace/requests/servers/create_image.rb +6 -0
- data/lib/fog/rackspace/requests/servers/create_server.rb +21 -2
- data/lib/fog/rackspace/requests/servers/delete_server.rb +18 -3
- data/lib/fog/rackspace/requests/servers/get_server_details.rb +17 -5
- data/lib/fog/rackspace/requests/servers/list_addresses.rb +52 -0
- data/lib/fog/rackspace/requests/servers/list_flavors.rb +2 -4
- data/lib/fog/rackspace/requests/servers/list_flavors_detail.rb +41 -0
- data/lib/fog/rackspace/requests/servers/list_images.rb +1 -1
- data/lib/fog/rackspace/requests/servers/list_images_detail.rb +1 -1
- data/lib/fog/rackspace/requests/servers/list_private_addresses.rb +50 -0
- data/lib/fog/rackspace/requests/servers/list_public_addresses.rb +50 -0
- data/lib/fog/rackspace/requests/servers/list_servers.rb +11 -2
- data/lib/fog/rackspace/requests/servers/list_servers_detail.rb +17 -2
- data/lib/fog/rackspace/requests/servers/reboot_server.rb +3 -6
- data/lib/fog/rackspace/requests/servers/update_server.rb +18 -5
- data/lib/fog/rackspace/servers.rb +20 -0
- data/spec/aws/models/ec2/address_spec.rb +4 -4
- data/spec/aws/models/ec2/instance_spec.rb +6 -6
- data/spec/aws/models/ec2/key_pair_spec.rb +5 -5
- data/spec/aws/models/ec2/security_group_spec.rb +5 -5
- data/spec/aws/models/ec2/snapshot_spec.rb +8 -8
- data/spec/aws/models/ec2/snapshots_spec.rb +6 -6
- data/spec/aws/models/ec2/volume_spec.rb +6 -5
- data/spec/aws/models/ec2/volumes_spec.rb +4 -4
- data/spec/aws/requests/ec2/associate_address_spec.rb +2 -2
- data/spec/aws/requests/ec2/attach_volume_spec.rb +2 -2
- data/spec/aws/requests/ec2/create_key_pair_spec.rb +1 -1
- data/spec/aws/requests/ec2/create_security_group_spec.rb +1 -1
- data/spec/aws/requests/ec2/create_snapshot_spec.rb +1 -1
- data/spec/aws/requests/ec2/delete_security_group_spec.rb +1 -1
- data/spec/aws/requests/ec2/delete_snapshot_spec.rb +1 -1
- data/spec/aws/requests/ec2/delete_volume_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_addresses_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_instances_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_key_pairs_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_security_groups_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_snapshots_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_volumes_spec.rb +1 -1
- data/spec/aws/requests/ec2/detach_volume_spec.rb +1 -1
- data/spec/aws/requests/ec2/disassociate_address_spec.rb +1 -1
- data/spec/aws/requests/ec2/get_console_output_spec.rb +1 -1
- data/spec/aws/requests/ec2/reboot_instances_spec.rb +1 -1
- data/spec/aws/requests/ec2/release_address_spec.rb +1 -1
- data/spec/aws/requests/ec2/terminate_instances_spec.rb +1 -1
- data/spec/aws/requests/s3/copy_object_spec.rb +4 -5
- data/spec/aws/requests/s3/delete_bucket_spec.rb +3 -4
- data/spec/aws/requests/s3/delete_object_spec.rb +2 -3
- data/spec/aws/requests/s3/get_bucket_location_spec.rb +1 -1
- data/spec/aws/requests/s3/get_bucket_spec.rb +4 -6
- data/spec/aws/requests/s3/get_object_spec.rb +6 -10
- data/spec/aws/requests/s3/get_request_payment_spec.rb +1 -1
- data/spec/aws/requests/s3/head_object_spec.rb +2 -4
- data/spec/aws/requests/s3/put_object_spec.rb +4 -7
- data/spec/aws/requests/s3/put_request_payment_spec.rb +1 -1
- data/spec/aws/requests/simpledb/batch_put_attributes_spec.rb +1 -1
- data/spec/aws/requests/simpledb/delete_attributes_spec.rb +1 -1
- data/spec/aws/requests/simpledb/domain_metadata_spec.rb +1 -1
- data/spec/aws/requests/simpledb/get_attributes_spec.rb +1 -1
- data/spec/aws/requests/simpledb/put_attributes_spec.rb +1 -1
- data/spec/rackspace/requests/files/delete_container_spec.rb +24 -0
- data/spec/rackspace/requests/files/delete_object_spec.rb +37 -0
- data/spec/rackspace/requests/files/get_container_spec.rb +33 -0
- data/spec/rackspace/requests/files/get_containers_spec.rb +12 -1
- data/spec/rackspace/requests/files/head_container_spec.rb +30 -0
- data/spec/rackspace/requests/files/head_containers_spec.rb +9 -1
- data/spec/rackspace/requests/files/put_container_spec.rb +15 -0
- data/spec/rackspace/requests/files/put_object_spec.rb +20 -0
- data/spec/rackspace/requests/servers/create_image_spec.rb +16 -2
- data/spec/rackspace/requests/servers/create_server_spec.rb +1 -1
- data/spec/rackspace/requests/servers/delete_image_spec.rb +32 -0
- data/spec/rackspace/requests/servers/delete_server_spec.rb +1 -1
- data/spec/rackspace/requests/servers/get_server_details_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_addresses_spec.rb +34 -0
- data/spec/rackspace/requests/servers/list_flavors_detail_spec.rb +17 -0
- data/spec/rackspace/requests/servers/list_flavors_spec.rb +6 -3
- data/spec/rackspace/requests/servers/list_images_detail_spec.rb +18 -0
- data/spec/rackspace/requests/servers/list_images_spec.rb +5 -2
- data/spec/rackspace/requests/servers/list_private_addresses_spec.rb +32 -0
- data/spec/rackspace/requests/servers/list_public_addresses_spec.rb +32 -0
- data/spec/rackspace/requests/servers/list_servers_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/reboot_server_spec.rb +31 -0
- data/spec/rackspace/requests/servers/update_server_spec.rb +33 -0
- data/spec/spec_helper.rb +5 -1
- metadata +50 -14
- data/benchs/headers_split_vs_match.rb +0 -18
- data/benchs/stripping.rb +0 -26
- data/lib/fog/errors.rb +0 -145
- data/lib/fog/response.rb +0 -12
- data/spec/rackspace/requests/servers/delete_image.rb +0 -12
- data/spec/rackspace/requests/servers/list_images_detail.rb +0 -12
- data/spec/rackspace/requests/servers/reboot_server.rb +0 -12
- data/spec/rackspace/requests/servers/update_server.rb +0 -12
@@ -0,0 +1,33 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Files.get_container' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
files.put_container('container_name')
|
8
|
+
files.put_object('container_name', 'object_name', lorem_file)
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
files.delete_object('container_name', 'object_name')
|
13
|
+
files.delete_container('container_name')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return proper attributes" do
|
17
|
+
actual = files.get_container('container_name').body
|
18
|
+
actual.first['bytes'].should be_an(Integer)
|
19
|
+
actual.first['content_type'].should be_a(String)
|
20
|
+
actual.first['hash'].should be_a(String)
|
21
|
+
actual.first['last_modified'].should be_a(String)
|
22
|
+
actual.first['name'].should be_a(String)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
describe 'failure' do
|
27
|
+
|
28
|
+
it "should not raise an if the container does not exist" do
|
29
|
+
files.get_container('container_name')
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -3,8 +3,19 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
3
|
describe 'Rackspace::Files.get_containers' do
|
4
4
|
describe 'success' do
|
5
5
|
|
6
|
+
before(:each) do
|
7
|
+
files.put_container('container_name')
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
files.delete_container('container_name')
|
12
|
+
end
|
13
|
+
|
6
14
|
it "should return proper attributes" do
|
7
|
-
|
15
|
+
actual = files.get_containers.body
|
16
|
+
actual.first['bytes'].should be_an(Integer)
|
17
|
+
actual.first['count'].should be_an(Integer)
|
18
|
+
actual.first['name'].should be_a(String)
|
8
19
|
end
|
9
20
|
|
10
21
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Files.head_container' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
files.put_container('container_name')
|
8
|
+
files.put_object('container_name', 'object_name', lorem_file)
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
files.delete_object('container_name', 'object_name')
|
13
|
+
files.delete_container('container_name')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return proper attributes" do
|
17
|
+
files.head_container('container_name')
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
describe 'failure' do
|
22
|
+
|
23
|
+
it "should raise a NotFound error if the container does not exist" do
|
24
|
+
lambda do
|
25
|
+
files.head_container('container_name')
|
26
|
+
end.should raise_error(Excon::Errors::NotFound)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -3,8 +3,16 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
3
|
describe 'Rackspace::Files.head_containers' do
|
4
4
|
describe 'success' do
|
5
5
|
|
6
|
+
before(:each) do
|
7
|
+
files.put_container('container_name')
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
files.delete_container('container_name')
|
12
|
+
end
|
13
|
+
|
6
14
|
it "should return proper attributes" do
|
7
|
-
|
15
|
+
files.head_containers
|
8
16
|
end
|
9
17
|
|
10
18
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Files.put_container' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
after(:each) do
|
7
|
+
files.delete_container('container_name')
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should return proper attributes" do
|
11
|
+
files.put_container('container_name')
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Files.put_object' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
files.put_container('container_name')
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
files.delete_object('container_name', 'object_name')
|
12
|
+
files.delete_container('container_name')
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return proper attributes" do
|
16
|
+
files.put_object('container_name', 'object_name', lorem_file)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -3,9 +3,23 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
3
3
|
describe 'Rackspace::Servers.create_image' do
|
4
4
|
describe 'success' do
|
5
5
|
|
6
|
+
before(:each) do
|
7
|
+
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
+
@server_id = servers.create_server(1, 3).body['server']['id']
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
eventually(128) do
|
13
|
+
servers.delete_server(@server_id)
|
14
|
+
end
|
15
|
+
servers.delete_image(@image_id)
|
16
|
+
end
|
17
|
+
|
6
18
|
it "should return proper attributes" do
|
7
|
-
|
8
|
-
|
19
|
+
actual = servers.create_image(@server_id).body['image']
|
20
|
+
@image_id = actual['id']
|
21
|
+
actual['id'].should be_an(Integer)
|
22
|
+
actual['serverId'].should be_an(Integer)
|
9
23
|
end
|
10
24
|
|
11
25
|
end
|
@@ -25,7 +25,7 @@ describe 'Rackspace::Servers.create_server' do
|
|
25
25
|
actual['imageId'].should be_an(Integer)
|
26
26
|
actual['metadata'].should be_a(Hash)
|
27
27
|
actual['name'].should be_a(String)
|
28
|
-
actual['progress'].should be_an(Integer)
|
28
|
+
# actual['progress'].should be_an(Integer)
|
29
29
|
actual['status'].should be_a(String)
|
30
30
|
end
|
31
31
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Servers.delete_image' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
+
@server_id = servers.create_server(1, 3).body['server']['id']
|
9
|
+
@image_id = servers.create_image(@server_id)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should return proper attributes" do
|
13
|
+
eventually(128) do
|
14
|
+
servers.delete_server(@server_id)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should return proper attributes" do
|
19
|
+
servers.delete_image(@image_id)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
describe 'failure' do
|
24
|
+
|
25
|
+
it "should raise a NotFound error if the image does not exist" do
|
26
|
+
lambda do
|
27
|
+
servers.delete_image(0)
|
28
|
+
end.should raise_error(Excon::Errors::NotFound)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -20,7 +20,7 @@ describe 'Rackspace::Servers.delete_server' do
|
|
20
20
|
it "should raise a NotFound error if the server does not exist" do
|
21
21
|
lambda {
|
22
22
|
servers.delete_server(0)
|
23
|
-
}.should raise_error(
|
23
|
+
}.should raise_error(Excon::Errors::NotFound)
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
@@ -37,7 +37,7 @@ describe 'Rackspace::Servers.get_server_details' do
|
|
37
37
|
it "should raise a NotFound error if the server does not exist" do
|
38
38
|
lambda {
|
39
39
|
servers.get_server_details(0)
|
40
|
-
}.should raise_error(
|
40
|
+
}.should raise_error(Excon::Errors::NotFound)
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Servers.list_addresses' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
+
@server_id = servers.create_server(1, 3).body['server']['id']
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
eventually(128) do
|
13
|
+
servers.delete_server(@server_id)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return proper attributes" do
|
18
|
+
actual = servers.list_addresses(@server_id).body
|
19
|
+
actual['addresses'].should be_a(Hash)
|
20
|
+
actual['addresses']['private'].should be_an(Array)
|
21
|
+
actual['addresses']['public'].should be_an(Array)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
describe 'failure' do
|
26
|
+
|
27
|
+
it "should raise a NotFound error if the server does not exist" do
|
28
|
+
lambda {
|
29
|
+
servers.list_addresses(0)
|
30
|
+
}.should raise_error(Excon::Errors::NotFound)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Servers.list_flavors_detail' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
it "should return proper attributes" do
|
7
|
+
actual = servers.list_flavors_detail.body
|
8
|
+
actual['flavors'].should be_an(Array)
|
9
|
+
flavor = actual['flavors'].first
|
10
|
+
flavor['disk'].should be_an(Integer)
|
11
|
+
flavor['id'].should be_an(Integer)
|
12
|
+
flavor['name'].should be_a(String)
|
13
|
+
flavor['ram'].should be_an(Integer)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -4,9 +4,12 @@ describe 'Rackspace::Servers.list_flavors' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
|
8
|
-
|
7
|
+
actual = servers.list_flavors.body
|
8
|
+
actual['flavors'].should be_an(Array)
|
9
|
+
flavor = actual['flavors'].first
|
10
|
+
flavor['id'].should be_an(Integer)
|
11
|
+
flavor['name'].should be_a(String)
|
9
12
|
end
|
10
13
|
|
11
14
|
end
|
12
|
-
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Servers.list_images_detail' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
it "should return proper attributes" do
|
7
|
+
actual = servers.list_images_detail.body
|
8
|
+
actual['images'].should be_an(Array)
|
9
|
+
image = actual['images'].first
|
10
|
+
image['created'].should be_a(String)
|
11
|
+
image['id'].should be_an(Integer)
|
12
|
+
image['name'].should be_a(String)
|
13
|
+
image['status'].should be_a(String)
|
14
|
+
image['updated'].should be_a(String)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -4,8 +4,11 @@ describe 'Rackspace::Servers.list_images' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes" do
|
7
|
-
|
8
|
-
|
7
|
+
actual = servers.list_images.body
|
8
|
+
actual['images'].should be_an(Array)
|
9
|
+
image = actual['images'].first
|
10
|
+
image['id'].should be_an(Integer)
|
11
|
+
image['name'].should be_a(String)
|
9
12
|
end
|
10
13
|
|
11
14
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Servers.list_private_addresses' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
+
@server_id = servers.create_server(1, 3).body['server']['id']
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
eventually(128) do
|
13
|
+
servers.delete_server(@server_id)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return proper attributes" do
|
18
|
+
actual = servers.list_private_addresses(@server_id).body
|
19
|
+
actual['private'].should be_an(Array)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
describe 'failure' do
|
24
|
+
|
25
|
+
it "should raise a NotFound error if the server does not exist" do
|
26
|
+
lambda {
|
27
|
+
servers.list_private_addresses(0)
|
28
|
+
}.should raise_error(Excon::Errors::NotFound)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Servers.list_public_addresses' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
+
@server_id = servers.create_server(1, 3).body['server']['id']
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
eventually(128) do
|
13
|
+
servers.delete_server(@server_id)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return proper attributes" do
|
18
|
+
actual = servers.list_public_addresses(@server_id).body
|
19
|
+
actual['public'].should be_an(Array)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
describe 'failure' do
|
24
|
+
|
25
|
+
it "should raise a NotFound error if the server does not exist" do
|
26
|
+
lambda {
|
27
|
+
servers.list_public_addresses(0)
|
28
|
+
}.should raise_error(Excon::Errors::NotFound)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Servers.reboot_server' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
# flavor 1 = 256, image 3 = gentoo 2008.0
|
8
|
+
@server_id = servers.create_server(1, 3).body['server']['id']
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
eventually(128) do
|
13
|
+
servers.delete_server(@server_id)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return proper attributes" do
|
18
|
+
servers.reboot_server(@server_id, 'HARD')
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
describe 'failure' do
|
23
|
+
|
24
|
+
it "should raise a NotFound error if the server does not exist" do
|
25
|
+
lambda do
|
26
|
+
servers.reboot_server(0, 'HARD')
|
27
|
+
end.should raise_error(Excon::Errors::NotFound)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|