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::Servers.update_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
|
+
eventually(128) do
|
19
|
+
servers.update_server(@server_id, :name => 'server_name', :adminPass => 'admin_password')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
describe 'failure' do
|
25
|
+
|
26
|
+
it "should raise a NotFound error if the server does not exist" do
|
27
|
+
lambda do
|
28
|
+
servers.update_server(0, :name => 'server_name', :adminPass => 'admin_password')
|
29
|
+
end.should raise_error(Excon::Errors::NotFound)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -74,7 +74,7 @@ def eventually(max_delay = 16, &block)
|
|
74
74
|
sleep(delay)
|
75
75
|
yield
|
76
76
|
break
|
77
|
-
rescue => error
|
77
|
+
rescue Excon::Errors::Error => error
|
78
78
|
raise error if delay >= max_delay
|
79
79
|
end
|
80
80
|
end
|
@@ -83,3 +83,7 @@ end
|
|
83
83
|
unless defined?(GENTOO_AMI)
|
84
84
|
GENTOO_AMI = 'ami-5ee70037'
|
85
85
|
end
|
86
|
+
|
87
|
+
def lorem_file
|
88
|
+
File.open(File.dirname(__FILE__) + '/lorem.txt', 'r')
|
89
|
+
end
|
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.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
@@ -9,9 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-14 00:00:00 -08:00
|
13
13
|
default_executable: fog
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: excon
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
15
25
|
- !ruby/object:Gem::Dependency
|
16
26
|
name: mime-types
|
17
27
|
type: :runtime
|
@@ -57,10 +67,8 @@ files:
|
|
57
67
|
- Rakefile
|
58
68
|
- VERSION
|
59
69
|
- benchs/fog_vs.rb
|
60
|
-
- benchs/headers_split_vs_match.rb
|
61
70
|
- benchs/params.rb
|
62
71
|
- benchs/parse_vs_push.rb
|
63
|
-
- benchs/stripping.rb
|
64
72
|
- bin/fog
|
65
73
|
- fog.gemspec
|
66
74
|
- lib/fog.rb
|
@@ -166,29 +174,37 @@ files:
|
|
166
174
|
- lib/fog/aws/simpledb.rb
|
167
175
|
- lib/fog/collection.rb
|
168
176
|
- lib/fog/connection.rb
|
169
|
-
- lib/fog/errors.rb
|
170
177
|
- lib/fog/model.rb
|
171
178
|
- lib/fog/parser.rb
|
172
179
|
- lib/fog/rackspace.rb
|
173
180
|
- lib/fog/rackspace/files.rb
|
174
181
|
- lib/fog/rackspace/models/servers/server.rb
|
175
182
|
- lib/fog/rackspace/models/servers/servers.rb
|
183
|
+
- lib/fog/rackspace/requests/files/delete_container.rb
|
184
|
+
- lib/fog/rackspace/requests/files/delete_object.rb
|
185
|
+
- lib/fog/rackspace/requests/files/get_container.rb
|
176
186
|
- lib/fog/rackspace/requests/files/get_containers.rb
|
187
|
+
- lib/fog/rackspace/requests/files/head_container.rb
|
177
188
|
- lib/fog/rackspace/requests/files/head_containers.rb
|
189
|
+
- lib/fog/rackspace/requests/files/put_container.rb
|
190
|
+
- lib/fog/rackspace/requests/files/put_object.rb
|
178
191
|
- lib/fog/rackspace/requests/servers/create_image.rb
|
179
192
|
- lib/fog/rackspace/requests/servers/create_server.rb
|
180
193
|
- lib/fog/rackspace/requests/servers/delete_image.rb
|
181
194
|
- lib/fog/rackspace/requests/servers/delete_server.rb
|
182
195
|
- lib/fog/rackspace/requests/servers/get_server_details.rb
|
196
|
+
- lib/fog/rackspace/requests/servers/list_addresses.rb
|
183
197
|
- lib/fog/rackspace/requests/servers/list_flavors.rb
|
198
|
+
- lib/fog/rackspace/requests/servers/list_flavors_detail.rb
|
184
199
|
- lib/fog/rackspace/requests/servers/list_images.rb
|
185
200
|
- lib/fog/rackspace/requests/servers/list_images_detail.rb
|
201
|
+
- lib/fog/rackspace/requests/servers/list_private_addresses.rb
|
202
|
+
- lib/fog/rackspace/requests/servers/list_public_addresses.rb
|
186
203
|
- lib/fog/rackspace/requests/servers/list_servers.rb
|
187
204
|
- lib/fog/rackspace/requests/servers/list_servers_detail.rb
|
188
205
|
- lib/fog/rackspace/requests/servers/reboot_server.rb
|
189
206
|
- lib/fog/rackspace/requests/servers/update_server.rb
|
190
207
|
- lib/fog/rackspace/servers.rb
|
191
|
-
- lib/fog/response.rb
|
192
208
|
- spec/aws/models/ec2/address_spec.rb
|
193
209
|
- spec/aws/models/ec2/addresses_spec.rb
|
194
210
|
- spec/aws/models/ec2/instance_spec.rb
|
@@ -257,20 +273,30 @@ files:
|
|
257
273
|
- spec/aws/requests/simpledb/put_attributes_spec.rb
|
258
274
|
- spec/aws/requests/simpledb/select_spec.rb
|
259
275
|
- spec/lorem.txt
|
276
|
+
- spec/rackspace/requests/files/delete_container_spec.rb
|
277
|
+
- spec/rackspace/requests/files/delete_object_spec.rb
|
278
|
+
- spec/rackspace/requests/files/get_container_spec.rb
|
260
279
|
- spec/rackspace/requests/files/get_containers_spec.rb
|
280
|
+
- spec/rackspace/requests/files/head_container_spec.rb
|
261
281
|
- spec/rackspace/requests/files/head_containers_spec.rb
|
282
|
+
- spec/rackspace/requests/files/put_container_spec.rb
|
283
|
+
- spec/rackspace/requests/files/put_object_spec.rb
|
262
284
|
- spec/rackspace/requests/servers/create_image_spec.rb
|
263
285
|
- spec/rackspace/requests/servers/create_server_spec.rb
|
264
|
-
- spec/rackspace/requests/servers/
|
286
|
+
- spec/rackspace/requests/servers/delete_image_spec.rb
|
265
287
|
- spec/rackspace/requests/servers/delete_server_spec.rb
|
266
288
|
- spec/rackspace/requests/servers/get_server_details_spec.rb
|
289
|
+
- spec/rackspace/requests/servers/list_addresses_spec.rb
|
290
|
+
- spec/rackspace/requests/servers/list_flavors_detail_spec.rb
|
267
291
|
- spec/rackspace/requests/servers/list_flavors_spec.rb
|
268
|
-
- spec/rackspace/requests/servers/
|
292
|
+
- spec/rackspace/requests/servers/list_images_detail_spec.rb
|
269
293
|
- spec/rackspace/requests/servers/list_images_spec.rb
|
294
|
+
- spec/rackspace/requests/servers/list_private_addresses_spec.rb
|
295
|
+
- spec/rackspace/requests/servers/list_public_addresses_spec.rb
|
270
296
|
- spec/rackspace/requests/servers/list_servers_detail_spec.rb
|
271
297
|
- spec/rackspace/requests/servers/list_servers_spec.rb
|
272
|
-
- spec/rackspace/requests/servers/
|
273
|
-
- spec/rackspace/requests/servers/
|
298
|
+
- spec/rackspace/requests/servers/reboot_server_spec.rb
|
299
|
+
- spec/rackspace/requests/servers/update_server_spec.rb
|
274
300
|
- spec/spec.opts
|
275
301
|
- spec/spec_helper.rb
|
276
302
|
has_rdoc: true
|
@@ -369,18 +395,28 @@ test_files:
|
|
369
395
|
- spec/aws/requests/simpledb/list_domains_spec.rb
|
370
396
|
- spec/aws/requests/simpledb/put_attributes_spec.rb
|
371
397
|
- spec/aws/requests/simpledb/select_spec.rb
|
398
|
+
- spec/rackspace/requests/files/delete_container_spec.rb
|
399
|
+
- spec/rackspace/requests/files/delete_object_spec.rb
|
400
|
+
- spec/rackspace/requests/files/get_container_spec.rb
|
372
401
|
- spec/rackspace/requests/files/get_containers_spec.rb
|
402
|
+
- spec/rackspace/requests/files/head_container_spec.rb
|
373
403
|
- spec/rackspace/requests/files/head_containers_spec.rb
|
404
|
+
- spec/rackspace/requests/files/put_container_spec.rb
|
405
|
+
- spec/rackspace/requests/files/put_object_spec.rb
|
374
406
|
- spec/rackspace/requests/servers/create_image_spec.rb
|
375
407
|
- spec/rackspace/requests/servers/create_server_spec.rb
|
376
|
-
- spec/rackspace/requests/servers/
|
408
|
+
- spec/rackspace/requests/servers/delete_image_spec.rb
|
377
409
|
- spec/rackspace/requests/servers/delete_server_spec.rb
|
378
410
|
- spec/rackspace/requests/servers/get_server_details_spec.rb
|
411
|
+
- spec/rackspace/requests/servers/list_addresses_spec.rb
|
412
|
+
- spec/rackspace/requests/servers/list_flavors_detail_spec.rb
|
379
413
|
- spec/rackspace/requests/servers/list_flavors_spec.rb
|
380
|
-
- spec/rackspace/requests/servers/
|
414
|
+
- spec/rackspace/requests/servers/list_images_detail_spec.rb
|
381
415
|
- spec/rackspace/requests/servers/list_images_spec.rb
|
416
|
+
- spec/rackspace/requests/servers/list_private_addresses_spec.rb
|
417
|
+
- spec/rackspace/requests/servers/list_public_addresses_spec.rb
|
382
418
|
- spec/rackspace/requests/servers/list_servers_detail_spec.rb
|
383
419
|
- spec/rackspace/requests/servers/list_servers_spec.rb
|
384
|
-
- spec/rackspace/requests/servers/
|
385
|
-
- spec/rackspace/requests/servers/
|
420
|
+
- spec/rackspace/requests/servers/reboot_server_spec.rb
|
421
|
+
- spec/rackspace/requests/servers/update_server_spec.rb
|
386
422
|
- spec/spec_helper.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'benchmark'
|
2
|
-
|
3
|
-
COUNT = 1000
|
4
|
-
data = "Content-Length: 100"
|
5
|
-
Benchmark.bmbm(25) do |bench|
|
6
|
-
bench.report('regex') do
|
7
|
-
COUNT.times do
|
8
|
-
header = data.match(/(.*):\s(.*)/)
|
9
|
-
"#{header[1]}: #{header[2]}"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
bench.report('split') do
|
13
|
-
COUNT.times do
|
14
|
-
header = data.split(': ')
|
15
|
-
"#{header[0]}: #{header[1]}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/benchs/stripping.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'benchmark'
|
2
|
-
|
3
|
-
COUNT = 1_000_000
|
4
|
-
data = "Content-Length: 100\r\n"
|
5
|
-
Benchmark.bmbm(25) do |bench|
|
6
|
-
bench.report('chomp') do
|
7
|
-
COUNT.times do
|
8
|
-
data.chomp
|
9
|
-
end
|
10
|
-
end
|
11
|
-
bench.report('chop') do
|
12
|
-
COUNT.times do
|
13
|
-
data.chop
|
14
|
-
end
|
15
|
-
end
|
16
|
-
bench.report('strip') do
|
17
|
-
COUNT.times do
|
18
|
-
data.strip
|
19
|
-
end
|
20
|
-
end
|
21
|
-
bench.report('index') do
|
22
|
-
COUNT.times do
|
23
|
-
data[0..-3]
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
data/lib/fog/errors.rb
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
require "fog/parser"
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Errors
|
5
|
-
class Continue < StandardError; end # 100
|
6
|
-
class SwitchingProtocols < StandardError; end # 101
|
7
|
-
class OK < StandardError; end # 200
|
8
|
-
class Created < StandardError; end # 201
|
9
|
-
class Accepted < StandardError; end # 202
|
10
|
-
class NonAuthoritativeInformation < StandardError; end # 203
|
11
|
-
class NoContent < StandardError; end # 204
|
12
|
-
class ResetContent < StandardError; end # 205
|
13
|
-
class PartialContent < StandardError; end # 206
|
14
|
-
class MultipleChoices < StandardError; end # 300
|
15
|
-
class MovedPermanently < StandardError; end # 301
|
16
|
-
class Found < StandardError; end # 302
|
17
|
-
class SeeOther < StandardError; end # 303
|
18
|
-
class NotModified < StandardError; end # 304
|
19
|
-
class UseProxy < StandardError; end # 305
|
20
|
-
class TemporaryRedirect < StandardError; end # 307
|
21
|
-
class BadRequest < StandardError; end # 400
|
22
|
-
class Unauthorized < StandardError; end # 401
|
23
|
-
class PaymentRequired < StandardError; end # 402
|
24
|
-
class Forbidden < StandardError; end # 403
|
25
|
-
class NotFound < StandardError; end # 404
|
26
|
-
class MethodNotAllowed < StandardError; end # 405
|
27
|
-
class NotAcceptable < StandardError; end #406
|
28
|
-
class ProxyAuthenticationRequired < StandardError; end #407
|
29
|
-
class RequestTimeout < StandardError; end # 408
|
30
|
-
class Conflict < StandardError; end # 409
|
31
|
-
class Gone < StandardError; end # 410
|
32
|
-
class LengthRequired < StandardError; end # 411
|
33
|
-
class PreconditionFailed < StandardError; end # 412
|
34
|
-
class RequestEntityTooLarge < StandardError; end # 412
|
35
|
-
class RequestURITooLong < StandardError; end # 414
|
36
|
-
class UnsupportedMediaType < StandardError; end # 415
|
37
|
-
class RequestedRangeNotSatisfiable < StandardError; end # 416
|
38
|
-
class ExpectationFailed < StandardError; end # 417
|
39
|
-
class InternalServerError < StandardError; end # 500
|
40
|
-
class NotImplemented < StandardError; end # 501
|
41
|
-
class BadGateway < StandardError; end # 502
|
42
|
-
class ServiceUnavailable < StandardError; end # 503
|
43
|
-
class GatewayTimeout < StandardError; end # 504
|
44
|
-
|
45
|
-
# Messages for nicer exceptions, from rfc2616
|
46
|
-
def self.status_error(expected, actual, response)
|
47
|
-
@errors ||= {
|
48
|
-
100 => Fog::Errors::Continue,
|
49
|
-
101 => Fog::Errors::SwitchingProtocols,
|
50
|
-
200 => Fog::Errors::OK,
|
51
|
-
201 => Fog::Errors::Created,
|
52
|
-
202 => Fog::Errors::Accepted,
|
53
|
-
203 => Fog::Errors::NonAuthoritativeInformation,
|
54
|
-
204 => Fog::Errors::NoContent,
|
55
|
-
205 => Fog::Errors::ResetContent,
|
56
|
-
206 => Fog::Errors::PartialContent,
|
57
|
-
300 => Fog::Errors::MultipleChoices,
|
58
|
-
301 => Fog::Errors::MovedPermanently,
|
59
|
-
302 => Fog::Errors::Found,
|
60
|
-
303 => Fog::Errors::SeeOther,
|
61
|
-
304 => Fog::Errors::NotModified,
|
62
|
-
305 => Fog::Errors::UseProxy,
|
63
|
-
307 => Fog::Errors::TemporaryRedirect,
|
64
|
-
400 => Fog::Errors::BadRequest,
|
65
|
-
401 => Fog::Errors::Unauthorized,
|
66
|
-
402 => Fog::Errors::PaymentRequired,
|
67
|
-
403 => Fog::Errors::Forbidden,
|
68
|
-
404 => Fog::Errors::NotFound,
|
69
|
-
405 => Fog::Errors::MethodNotAllowed,
|
70
|
-
406 => Fog::Errors::NotAcceptable,
|
71
|
-
407 => Fog::Errors::ProxyAuthenticationRequired,
|
72
|
-
408 => Fog::Errors::RequestTimeout,
|
73
|
-
409 => Fog::Errors::Conflict,
|
74
|
-
410 => Fog::Errors::Gone,
|
75
|
-
411 => Fog::Errors::LengthRequired,
|
76
|
-
412 => Fog::Errors::PreconditionFailed,
|
77
|
-
413 => Fog::Errors::RequestEntityTooLarge,
|
78
|
-
414 => Fog::Errors::RequestURITooLong,
|
79
|
-
415 => Fog::Errors::UnsupportedMediaType,
|
80
|
-
416 => Fog::Errors::RequestedRangeNotSatisfiable,
|
81
|
-
417 => Fog::Errors::ExpectationFailed,
|
82
|
-
500 => Fog::Errors::InternalServerError,
|
83
|
-
501 => Fog::Errors::NotImplemented,
|
84
|
-
502 => Fog::Errors::BadGateway,
|
85
|
-
503 => Fog::Errors::ServiceUnavailable,
|
86
|
-
504 => Fog::Errors::GatewayTimeout
|
87
|
-
}
|
88
|
-
@messages ||= {
|
89
|
-
100 => 'Continue',
|
90
|
-
101 => 'Switching Protocols',
|
91
|
-
200 => 'OK',
|
92
|
-
201 =>'Created',
|
93
|
-
202 => 'Accepted',
|
94
|
-
203 => 'Non-Authoritative Information',
|
95
|
-
204 => 'No Content',
|
96
|
-
205 => 'Reset Content',
|
97
|
-
206 => 'Partial Content',
|
98
|
-
300 => 'Multiple Choices',
|
99
|
-
301 => 'Moved Permanently',
|
100
|
-
302 => 'Found',
|
101
|
-
303 => 'See Other',
|
102
|
-
304 => 'Not Modified',
|
103
|
-
305 => 'Use Proxy',
|
104
|
-
307 => 'Temporary Redirect',
|
105
|
-
400 => 'Bad Request',
|
106
|
-
401 => 'Unauthorized',
|
107
|
-
402 => 'Payment Required',
|
108
|
-
403 => 'Forbidden',
|
109
|
-
404 => 'Not Found',
|
110
|
-
405 => 'Method Not Allowed',
|
111
|
-
406 => 'Not Acceptable',
|
112
|
-
407 => 'Proxy Authentication Required',
|
113
|
-
408 => 'Request Timeout',
|
114
|
-
409 => 'Conflict',
|
115
|
-
410 => 'Gone',
|
116
|
-
411 => 'Length Required',
|
117
|
-
412 => 'Precondition Failed',
|
118
|
-
413 => 'Request Entity Too Large',
|
119
|
-
414 => 'Request-URI Too Long',
|
120
|
-
415 => 'Unsupported Media Type',
|
121
|
-
416 => 'Requested Range Not Satisfiable',
|
122
|
-
417 => 'Expectation Failed',
|
123
|
-
500 => 'Internal Server Error',
|
124
|
-
501 => 'Not Implemented',
|
125
|
-
502 => 'Bad Gateway',
|
126
|
-
503 => 'Service Unavailable',
|
127
|
-
504 => 'Gateway Timeout'
|
128
|
-
}
|
129
|
-
response = "#{response.body['Code']} => #{response.body['Message']}"
|
130
|
-
@errors[actual].new("Expected(#{expected} #{@messages[expected]}) <=> Actual(#{actual} #{@messages[actual]}): #{response}")
|
131
|
-
end
|
132
|
-
|
133
|
-
class Parser < Fog::Parsers::Base
|
134
|
-
|
135
|
-
def end_element(name)
|
136
|
-
case name
|
137
|
-
when 'Code', 'Message'
|
138
|
-
@response[name] = @value
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
end
|
143
|
-
|
144
|
-
end
|
145
|
-
end
|
data/lib/fog/response.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Rackspace::Servers.update_server' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
it "should return proper attributes" do
|
7
|
-
pending
|
8
|
-
p servers.update_server(id, :name => 'foo', :adminPass => 'bar')
|
9
|
-
end
|
10
|
-
|
11
|
-
end
|
12
|
-
end
|