fog 0.0.67 → 0.0.68
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/VERSION.yml +1 -1
- data/fog.gemspec +24 -6
- data/lib/fog/aws/ec2.rb +48 -47
- data/lib/fog/aws/requests/ec2/describe_instances.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_snapshots.rb +3 -3
- data/lib/fog/aws/requests/ec2/run_instances.rb +2 -3
- data/lib/fog/aws/s3.rb +18 -17
- data/lib/fog/aws/simpledb.rb +11 -10
- data/lib/fog/bin.rb +12 -4
- data/lib/fog/rackspace/files.rb +16 -15
- data/lib/fog/rackspace/requests/servers/get_image_details.rb +35 -0
- data/lib/fog/rackspace/servers.rb +26 -24
- data/lib/fog/slicehost.rb +18 -17
- data/lib/fog/slicehost/models/flavors.rb +11 -3
- data/lib/fog/slicehost/models/images.rb +14 -4
- data/lib/fog/slicehost/models/servers.rb +10 -2
- data/lib/fog/terremark.rb +83 -17
- data/lib/fog/terremark/parsers/get_public_Ips.rb +28 -0
- data/lib/fog/terremark/parsers/internet_service.rb +63 -0
- data/lib/fog/terremark/parsers/node_service.rb +30 -0
- data/lib/fog/terremark/requests/add_internet_service.rb +63 -0
- data/lib/fog/terremark/requests/add_node_service.rb +63 -0
- data/lib/fog/terremark/requests/create_internet_service.rb +63 -0
- data/lib/fog/terremark/requests/delete_internet_service.rb +40 -0
- data/lib/fog/terremark/requests/delete_node_service.rb +40 -0
- data/lib/fog/terremark/requests/deploy_vapp.rb +2 -2
- data/lib/fog/terremark/requests/get_public_ips.rb +37 -0
- data/lib/fog/terremark/requests/get_task.rb +1 -1
- data/lib/fog/terremark/requests/get_tasks_list.rb +1 -1
- data/lib/fog/terremark/requests/get_vapp.rb +1 -1
- data/lib/fog/terremark/requests/instantiate_vapp_template.rb +4 -8
- data/lib/fog/terremark/requests/power_off.rb +1 -1
- data/lib/fog/terremark/requests/power_on.rb +1 -1
- data/lib/fog/terremark/requests/reset.rb +1 -1
- data/lib/fog/terremark/requests/shutdown.rb +1 -1
- data/tests/{test_helper.rb → helper.rb} +8 -7
- data/tests/{test_helper_tests.rb → helper_tests.rb} +7 -9
- data/tests/rackspace/helper.rb +64 -0
- data/tests/rackspace/requests/servers/create_image_tests.rb +22 -0
- data/tests/rackspace/requests/servers/create_server_tests.rb +19 -0
- data/tests/rackspace/requests/servers/delete_image_tests.rb +32 -0
- data/tests/rackspace/requests/servers/delete_server_tests.rb +26 -0
- data/tests/rackspace/requests/servers/get_flavor_details_tests.rb +25 -0
- data/tests/rackspace/requests/servers/get_image_details_tests.rb +25 -0
- data/tests/rackspace/requests/servers/get_server_details_tests.rb +31 -0
- data/tests/slicehost/{slicehost_helper.rb → helper.rb} +0 -0
- data/tests/slicehost/requests/create_slice_tests.rb +1 -1
- data/tests/slicehost/requests/get_backups_tests.rb +1 -1
- data/tests/slicehost/requests/get_flavor_tests.rb +5 -2
- data/tests/slicehost/requests/get_flavors_tests.rb +5 -2
- data/tests/slicehost/requests/get_image_tests.rb +5 -2
- data/tests/slicehost/requests/get_images_tests.rb +5 -2
- data/tests/slicehost/requests/get_slice_tests.rb +2 -2
- data/tests/slicehost/requests/get_slices_tests.rb +5 -2
- data/tests/slicehost/requests/reboot_slice_tests.rb +1 -1
- metadata +24 -6
data/README.rdoc
CHANGED
data/VERSION.yml
CHANGED
data/fog.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fog}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.68"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["geemus (Wesley Beary)"]
|
12
|
-
s.date = %q{2010-04-
|
12
|
+
s.date = %q{2010-04-08}
|
13
13
|
s.default_executable = %q{fog}
|
14
14
|
s.description = %q{The Ruby cloud computing library.}
|
15
15
|
s.email = %q{geemus@gmail.com}
|
@@ -169,6 +169,7 @@ Gem::Specification.new do |s|
|
|
169
169
|
"lib/fog/rackspace/requests/servers/delete_image.rb",
|
170
170
|
"lib/fog/rackspace/requests/servers/delete_server.rb",
|
171
171
|
"lib/fog/rackspace/requests/servers/get_flavor_details.rb",
|
172
|
+
"lib/fog/rackspace/requests/servers/get_image_details.rb",
|
172
173
|
"lib/fog/rackspace/requests/servers/get_server_details.rb",
|
173
174
|
"lib/fog/rackspace/requests/servers/list_addresses.rb",
|
174
175
|
"lib/fog/rackspace/requests/servers/list_flavors.rb",
|
@@ -214,18 +215,27 @@ Gem::Specification.new do |s|
|
|
214
215
|
"lib/fog/terremark/parsers/get_catalog_item.rb",
|
215
216
|
"lib/fog/terremark/parsers/get_organization.rb",
|
216
217
|
"lib/fog/terremark/parsers/get_organizations.rb",
|
218
|
+
"lib/fog/terremark/parsers/get_public_Ips.rb",
|
217
219
|
"lib/fog/terremark/parsers/get_tasks_list.rb",
|
218
220
|
"lib/fog/terremark/parsers/get_vapp_template.rb",
|
219
221
|
"lib/fog/terremark/parsers/get_vdc.rb",
|
220
222
|
"lib/fog/terremark/parsers/instantiate_vapp_template.rb",
|
223
|
+
"lib/fog/terremark/parsers/internet_service.rb",
|
224
|
+
"lib/fog/terremark/parsers/node_service.rb",
|
221
225
|
"lib/fog/terremark/parsers/task.rb",
|
222
226
|
"lib/fog/terremark/parsers/vapp.rb",
|
227
|
+
"lib/fog/terremark/requests/add_internet_service.rb",
|
228
|
+
"lib/fog/terremark/requests/add_node_service.rb",
|
229
|
+
"lib/fog/terremark/requests/create_internet_service.rb",
|
230
|
+
"lib/fog/terremark/requests/delete_internet_service.rb",
|
231
|
+
"lib/fog/terremark/requests/delete_node_service.rb",
|
223
232
|
"lib/fog/terremark/requests/delete_vapp.rb",
|
224
233
|
"lib/fog/terremark/requests/deploy_vapp.rb",
|
225
234
|
"lib/fog/terremark/requests/get_catalog.rb",
|
226
235
|
"lib/fog/terremark/requests/get_catalog_item.rb",
|
227
236
|
"lib/fog/terremark/requests/get_organization.rb",
|
228
237
|
"lib/fog/terremark/requests/get_organizations.rb",
|
238
|
+
"lib/fog/terremark/requests/get_public_ips.rb",
|
229
239
|
"lib/fog/terremark/requests/get_task.rb",
|
230
240
|
"lib/fog/terremark/requests/get_tasks_list.rb",
|
231
241
|
"lib/fog/terremark/requests/get_vapp.rb",
|
@@ -342,6 +352,17 @@ Gem::Specification.new do |s|
|
|
342
352
|
"spec/slicehost/models/server_spec.rb",
|
343
353
|
"spec/slicehost/models/servers_spec.rb",
|
344
354
|
"spec/spec_helper.rb",
|
355
|
+
"tests/helper.rb",
|
356
|
+
"tests/helper_tests.rb",
|
357
|
+
"tests/rackspace/helper.rb",
|
358
|
+
"tests/rackspace/requests/servers/create_image_tests.rb",
|
359
|
+
"tests/rackspace/requests/servers/create_server_tests.rb",
|
360
|
+
"tests/rackspace/requests/servers/delete_image_tests.rb",
|
361
|
+
"tests/rackspace/requests/servers/delete_server_tests.rb",
|
362
|
+
"tests/rackspace/requests/servers/get_flavor_details_tests.rb",
|
363
|
+
"tests/rackspace/requests/servers/get_image_details_tests.rb",
|
364
|
+
"tests/rackspace/requests/servers/get_server_details_tests.rb",
|
365
|
+
"tests/slicehost/helper.rb",
|
345
366
|
"tests/slicehost/requests/create_slice_tests.rb",
|
346
367
|
"tests/slicehost/requests/delete_slice_tests.rb",
|
347
368
|
"tests/slicehost/requests/get_backups_tests.rb",
|
@@ -351,10 +372,7 @@ Gem::Specification.new do |s|
|
|
351
372
|
"tests/slicehost/requests/get_images_tests.rb",
|
352
373
|
"tests/slicehost/requests/get_slice_tests.rb",
|
353
374
|
"tests/slicehost/requests/get_slices_tests.rb",
|
354
|
-
"tests/slicehost/requests/reboot_slice_tests.rb"
|
355
|
-
"tests/slicehost/slicehost_helper.rb",
|
356
|
-
"tests/test_helper.rb",
|
357
|
-
"tests/test_helper_tests.rb"
|
375
|
+
"tests/slicehost/requests/reboot_slice_tests.rb"
|
358
376
|
]
|
359
377
|
s.homepage = %q{http://github.com/geemus/fog}
|
360
378
|
s.rdoc_options = ["--charset=UTF-8"]
|
data/lib/fog/aws/ec2.rb
CHANGED
@@ -1,55 +1,56 @@
|
|
1
|
-
require 'fog/aws/models/ec2/address'
|
2
|
-
require 'fog/aws/models/ec2/addresses'
|
3
|
-
require 'fog/aws/models/ec2/flavor'
|
4
|
-
require 'fog/aws/models/ec2/flavors'
|
5
|
-
require 'fog/aws/models/ec2/image'
|
6
|
-
require 'fog/aws/models/ec2/images'
|
7
|
-
require 'fog/aws/models/ec2/key_pair'
|
8
|
-
require 'fog/aws/models/ec2/key_pairs'
|
9
|
-
require 'fog/aws/models/ec2/security_group'
|
10
|
-
require 'fog/aws/models/ec2/security_groups'
|
11
|
-
require 'fog/aws/models/ec2/server'
|
12
|
-
require 'fog/aws/models/ec2/servers'
|
13
|
-
require 'fog/aws/models/ec2/snapshot'
|
14
|
-
require 'fog/aws/models/ec2/snapshots'
|
15
|
-
require 'fog/aws/models/ec2/volume'
|
16
|
-
require 'fog/aws/models/ec2/volumes'
|
17
|
-
require 'fog/aws/requests/ec2/allocate_address'
|
18
|
-
require 'fog/aws/requests/ec2/associate_address'
|
19
|
-
require 'fog/aws/requests/ec2/attach_volume'
|
20
|
-
require 'fog/aws/requests/ec2/authorize_security_group_ingress'
|
21
|
-
require 'fog/aws/requests/ec2/create_key_pair'
|
22
|
-
require 'fog/aws/requests/ec2/create_security_group'
|
23
|
-
require 'fog/aws/requests/ec2/create_snapshot'
|
24
|
-
require 'fog/aws/requests/ec2/create_volume'
|
25
|
-
require 'fog/aws/requests/ec2/delete_key_pair'
|
26
|
-
require 'fog/aws/requests/ec2/delete_security_group'
|
27
|
-
require 'fog/aws/requests/ec2/delete_snapshot'
|
28
|
-
require 'fog/aws/requests/ec2/delete_volume'
|
29
|
-
require 'fog/aws/requests/ec2/describe_addresses'
|
30
|
-
require 'fog/aws/requests/ec2/describe_availability_zones'
|
31
|
-
require 'fog/aws/requests/ec2/describe_images'
|
32
|
-
require 'fog/aws/requests/ec2/describe_instances'
|
33
|
-
require 'fog/aws/requests/ec2/describe_reserved_instances'
|
34
|
-
require 'fog/aws/requests/ec2/describe_key_pairs'
|
35
|
-
require 'fog/aws/requests/ec2/describe_regions'
|
36
|
-
require 'fog/aws/requests/ec2/describe_security_groups'
|
37
|
-
require 'fog/aws/requests/ec2/describe_snapshots'
|
38
|
-
require 'fog/aws/requests/ec2/describe_volumes'
|
39
|
-
require 'fog/aws/requests/ec2/detach_volume'
|
40
|
-
require 'fog/aws/requests/ec2/disassociate_address'
|
41
|
-
require 'fog/aws/requests/ec2/get_console_output'
|
42
|
-
require 'fog/aws/requests/ec2/reboot_instances'
|
43
|
-
require 'fog/aws/requests/ec2/release_address'
|
44
|
-
require 'fog/aws/requests/ec2/revoke_security_group_ingress'
|
45
|
-
require 'fog/aws/requests/ec2/run_instances'
|
46
|
-
require 'fog/aws/requests/ec2/terminate_instances'
|
47
|
-
|
48
1
|
module Fog
|
49
2
|
module AWS
|
50
3
|
module EC2
|
51
4
|
|
52
5
|
def self.new(options={})
|
6
|
+
|
7
|
+
require 'fog/aws/models/ec2/address'
|
8
|
+
require 'fog/aws/models/ec2/addresses'
|
9
|
+
require 'fog/aws/models/ec2/flavor'
|
10
|
+
require 'fog/aws/models/ec2/flavors'
|
11
|
+
require 'fog/aws/models/ec2/image'
|
12
|
+
require 'fog/aws/models/ec2/images'
|
13
|
+
require 'fog/aws/models/ec2/key_pair'
|
14
|
+
require 'fog/aws/models/ec2/key_pairs'
|
15
|
+
require 'fog/aws/models/ec2/security_group'
|
16
|
+
require 'fog/aws/models/ec2/security_groups'
|
17
|
+
require 'fog/aws/models/ec2/server'
|
18
|
+
require 'fog/aws/models/ec2/servers'
|
19
|
+
require 'fog/aws/models/ec2/snapshot'
|
20
|
+
require 'fog/aws/models/ec2/snapshots'
|
21
|
+
require 'fog/aws/models/ec2/volume'
|
22
|
+
require 'fog/aws/models/ec2/volumes'
|
23
|
+
require 'fog/aws/requests/ec2/allocate_address'
|
24
|
+
require 'fog/aws/requests/ec2/associate_address'
|
25
|
+
require 'fog/aws/requests/ec2/attach_volume'
|
26
|
+
require 'fog/aws/requests/ec2/authorize_security_group_ingress'
|
27
|
+
require 'fog/aws/requests/ec2/create_key_pair'
|
28
|
+
require 'fog/aws/requests/ec2/create_security_group'
|
29
|
+
require 'fog/aws/requests/ec2/create_snapshot'
|
30
|
+
require 'fog/aws/requests/ec2/create_volume'
|
31
|
+
require 'fog/aws/requests/ec2/delete_key_pair'
|
32
|
+
require 'fog/aws/requests/ec2/delete_security_group'
|
33
|
+
require 'fog/aws/requests/ec2/delete_snapshot'
|
34
|
+
require 'fog/aws/requests/ec2/delete_volume'
|
35
|
+
require 'fog/aws/requests/ec2/describe_addresses'
|
36
|
+
require 'fog/aws/requests/ec2/describe_availability_zones'
|
37
|
+
require 'fog/aws/requests/ec2/describe_images'
|
38
|
+
require 'fog/aws/requests/ec2/describe_instances'
|
39
|
+
require 'fog/aws/requests/ec2/describe_reserved_instances'
|
40
|
+
require 'fog/aws/requests/ec2/describe_key_pairs'
|
41
|
+
require 'fog/aws/requests/ec2/describe_regions'
|
42
|
+
require 'fog/aws/requests/ec2/describe_security_groups'
|
43
|
+
require 'fog/aws/requests/ec2/describe_snapshots'
|
44
|
+
require 'fog/aws/requests/ec2/describe_volumes'
|
45
|
+
require 'fog/aws/requests/ec2/detach_volume'
|
46
|
+
require 'fog/aws/requests/ec2/disassociate_address'
|
47
|
+
require 'fog/aws/requests/ec2/get_console_output'
|
48
|
+
require 'fog/aws/requests/ec2/reboot_instances'
|
49
|
+
require 'fog/aws/requests/ec2/release_address'
|
50
|
+
require 'fog/aws/requests/ec2/revoke_security_group_ingress'
|
51
|
+
require 'fog/aws/requests/ec2/run_instances'
|
52
|
+
require 'fog/aws/requests/ec2/terminate_instances'
|
53
|
+
|
53
54
|
unless options[:aws_access_key_id]
|
54
55
|
raise ArgumentError.new('aws_access_key_id is required to access ec2')
|
55
56
|
end
|
@@ -43,11 +43,11 @@ module Fog
|
|
43
43
|
|
44
44
|
snapshot_set.each do |snapshot|
|
45
45
|
case snapshot['status']
|
46
|
-
when '
|
47
|
-
if Time.now -
|
46
|
+
when 'in progress', 'pending'
|
47
|
+
if Time.now - snapshot['startTime'] > 2
|
48
48
|
snapshot['progress'] = '100%'
|
49
49
|
snapshot['status'] = 'completed'
|
50
|
-
|
50
|
+
elsif Time.now - snapshot['startTime'] > 1
|
51
51
|
snapshot['progress'] = '50%'
|
52
52
|
snapshot['status'] = 'in progress'
|
53
53
|
end
|
@@ -102,7 +102,6 @@ module Fog
|
|
102
102
|
|
103
103
|
group_set = [ (options['GroupId'] || 'default') ]
|
104
104
|
instances_set = []
|
105
|
-
owner_id = @owner_id
|
106
105
|
reservation_id = Fog::AWS::Mock.reservation_id
|
107
106
|
|
108
107
|
min_count.times do |i|
|
@@ -120,7 +119,7 @@ module Fog
|
|
120
119
|
'keyName' => options['KeyName'] || '',
|
121
120
|
'launchTime' => Time.now,
|
122
121
|
'monitoring' => { 'state' => options['Monitoring.Enabled'] || false },
|
123
|
-
'ownerId' => owner_id,
|
122
|
+
'ownerId' => @owner_id,
|
124
123
|
'placement' => { 'availabilityZone' => options['Placement.AvailabilityZone'] || Fog::AWS::Mock.availability_zone },
|
125
124
|
'privateDnsName' => '',
|
126
125
|
'productCodes' => [],
|
@@ -135,7 +134,7 @@ module Fog
|
|
135
134
|
response.body = {
|
136
135
|
'groupSet' => group_set,
|
137
136
|
'instancesSet' => instances_set,
|
138
|
-
'ownerId' => owner_id,
|
137
|
+
'ownerId' => @owner_id,
|
139
138
|
'requestId' => Fog::AWS::Mock.request_id,
|
140
139
|
'reservationId' => reservation_id
|
141
140
|
}
|
data/lib/fog/aws/s3.rb
CHANGED
@@ -1,25 +1,26 @@
|
|
1
|
-
require 'fog/aws/models/s3/directories'
|
2
|
-
require 'fog/aws/models/s3/directory'
|
3
|
-
require 'fog/aws/models/s3/files'
|
4
|
-
require 'fog/aws/models/s3/file'
|
5
|
-
require 'fog/aws/requests/s3/copy_object'
|
6
|
-
require 'fog/aws/requests/s3/delete_bucket'
|
7
|
-
require 'fog/aws/requests/s3/delete_object'
|
8
|
-
require 'fog/aws/requests/s3/get_bucket'
|
9
|
-
require 'fog/aws/requests/s3/get_bucket_location'
|
10
|
-
require 'fog/aws/requests/s3/get_object'
|
11
|
-
require 'fog/aws/requests/s3/get_request_payment'
|
12
|
-
require 'fog/aws/requests/s3/get_service'
|
13
|
-
require 'fog/aws/requests/s3/head_object'
|
14
|
-
require 'fog/aws/requests/s3/put_bucket'
|
15
|
-
require 'fog/aws/requests/s3/put_object'
|
16
|
-
require 'fog/aws/requests/s3/put_request_payment'
|
17
|
-
|
18
1
|
module Fog
|
19
2
|
module AWS
|
20
3
|
module S3
|
21
4
|
|
22
5
|
def self.new(options={})
|
6
|
+
|
7
|
+
require 'fog/aws/models/s3/directories'
|
8
|
+
require 'fog/aws/models/s3/directory'
|
9
|
+
require 'fog/aws/models/s3/files'
|
10
|
+
require 'fog/aws/models/s3/file'
|
11
|
+
require 'fog/aws/requests/s3/copy_object'
|
12
|
+
require 'fog/aws/requests/s3/delete_bucket'
|
13
|
+
require 'fog/aws/requests/s3/delete_object'
|
14
|
+
require 'fog/aws/requests/s3/get_bucket'
|
15
|
+
require 'fog/aws/requests/s3/get_bucket_location'
|
16
|
+
require 'fog/aws/requests/s3/get_object'
|
17
|
+
require 'fog/aws/requests/s3/get_request_payment'
|
18
|
+
require 'fog/aws/requests/s3/get_service'
|
19
|
+
require 'fog/aws/requests/s3/head_object'
|
20
|
+
require 'fog/aws/requests/s3/put_bucket'
|
21
|
+
require 'fog/aws/requests/s3/put_object'
|
22
|
+
require 'fog/aws/requests/s3/put_request_payment'
|
23
|
+
|
23
24
|
if Fog.mocking?
|
24
25
|
Fog::AWS::S3::Mock.new(options)
|
25
26
|
else
|
data/lib/fog/aws/simpledb.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
|
-
require 'fog/aws/requests/simpledb/batch_put_attributes'
|
2
|
-
require 'fog/aws/requests/simpledb/create_domain'
|
3
|
-
require 'fog/aws/requests/simpledb/delete_attributes'
|
4
|
-
require 'fog/aws/requests/simpledb/delete_domain'
|
5
|
-
require 'fog/aws/requests/simpledb/domain_metadata'
|
6
|
-
require 'fog/aws/requests/simpledb/get_attributes'
|
7
|
-
require 'fog/aws/requests/simpledb/list_domains'
|
8
|
-
require 'fog/aws/requests/simpledb/put_attributes'
|
9
|
-
require 'fog/aws/requests/simpledb/select'
|
10
|
-
|
11
1
|
module Fog
|
12
2
|
module AWS
|
13
3
|
module SimpleDB
|
14
4
|
|
15
5
|
def self.new(options={})
|
6
|
+
|
7
|
+
require 'fog/aws/requests/simpledb/batch_put_attributes'
|
8
|
+
require 'fog/aws/requests/simpledb/create_domain'
|
9
|
+
require 'fog/aws/requests/simpledb/delete_attributes'
|
10
|
+
require 'fog/aws/requests/simpledb/delete_domain'
|
11
|
+
require 'fog/aws/requests/simpledb/domain_metadata'
|
12
|
+
require 'fog/aws/requests/simpledb/get_attributes'
|
13
|
+
require 'fog/aws/requests/simpledb/list_domains'
|
14
|
+
require 'fog/aws/requests/simpledb/put_attributes'
|
15
|
+
require 'fog/aws/requests/simpledb/select'
|
16
|
+
|
16
17
|
if Fog.mocking?
|
17
18
|
Fog::AWS::SimpleDB::Mock.new(options)
|
18
19
|
else
|
data/lib/fog/bin.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'credentials')
|
2
|
+
|
1
3
|
module Fog
|
2
4
|
class << self
|
3
5
|
|
@@ -14,7 +16,9 @@ module Fog
|
|
14
16
|
def flavors
|
15
17
|
flavors = {}
|
16
18
|
services.each do |service|
|
17
|
-
|
19
|
+
if service.respond_to?(:flavors)
|
20
|
+
flavors[service] = service.flavors
|
21
|
+
end
|
18
22
|
end
|
19
23
|
flavors
|
20
24
|
end
|
@@ -22,7 +26,9 @@ module Fog
|
|
22
26
|
def images
|
23
27
|
images = {}
|
24
28
|
services.each do |service|
|
25
|
-
|
29
|
+
if service.respond_to?(:images)
|
30
|
+
images[service] = service.images
|
31
|
+
end
|
26
32
|
end
|
27
33
|
images
|
28
34
|
end
|
@@ -30,10 +36,12 @@ module Fog
|
|
30
36
|
def servers
|
31
37
|
servers = {}
|
32
38
|
services.each do |service|
|
33
|
-
|
39
|
+
if service.respond_to?(:servers)
|
40
|
+
servers[service] = service.servers
|
41
|
+
end
|
34
42
|
end
|
35
43
|
servers
|
36
44
|
end
|
37
45
|
|
38
46
|
end
|
39
|
-
end
|
47
|
+
end
|
data/lib/fog/rackspace/files.rb
CHANGED
@@ -1,23 +1,24 @@
|
|
1
|
-
require 'fog/rackspace/models/files/directory'
|
2
|
-
require 'fog/rackspace/models/files/directories'
|
3
|
-
require 'fog/rackspace/models/files/file'
|
4
|
-
require 'fog/rackspace/models/files/files'
|
5
|
-
require 'fog/rackspace/requests/files/delete_container'
|
6
|
-
require 'fog/rackspace/requests/files/delete_object'
|
7
|
-
require 'fog/rackspace/requests/files/get_container'
|
8
|
-
require 'fog/rackspace/requests/files/get_containers'
|
9
|
-
require 'fog/rackspace/requests/files/get_object'
|
10
|
-
require 'fog/rackspace/requests/files/head_container'
|
11
|
-
require 'fog/rackspace/requests/files/head_containers'
|
12
|
-
require 'fog/rackspace/requests/files/head_object'
|
13
|
-
require 'fog/rackspace/requests/files/put_container'
|
14
|
-
require 'fog/rackspace/requests/files/put_object'
|
15
|
-
|
16
1
|
module Fog
|
17
2
|
module Rackspace
|
18
3
|
module Files
|
19
4
|
|
20
5
|
def self.new(options={})
|
6
|
+
|
7
|
+
require 'fog/rackspace/models/files/directory'
|
8
|
+
require 'fog/rackspace/models/files/directories'
|
9
|
+
require 'fog/rackspace/models/files/file'
|
10
|
+
require 'fog/rackspace/models/files/files'
|
11
|
+
require 'fog/rackspace/requests/files/delete_container'
|
12
|
+
require 'fog/rackspace/requests/files/delete_object'
|
13
|
+
require 'fog/rackspace/requests/files/get_container'
|
14
|
+
require 'fog/rackspace/requests/files/get_containers'
|
15
|
+
require 'fog/rackspace/requests/files/get_object'
|
16
|
+
require 'fog/rackspace/requests/files/head_container'
|
17
|
+
require 'fog/rackspace/requests/files/head_containers'
|
18
|
+
require 'fog/rackspace/requests/files/head_object'
|
19
|
+
require 'fog/rackspace/requests/files/put_container'
|
20
|
+
require 'fog/rackspace/requests/files/put_object'
|
21
|
+
|
21
22
|
if Fog.mocking?
|
22
23
|
Fog::Rackspace::Files::Mock.new(options)
|
23
24
|
else
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
module Servers
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Get details for image by id
|
7
|
+
#
|
8
|
+
# ==== Returns
|
9
|
+
# * response<~Excon::Response>:
|
10
|
+
# * body<~Hash>:
|
11
|
+
# * 'id'<~Integer> - Id of the image
|
12
|
+
# * 'name'<~String> - Name of the image
|
13
|
+
# * 'serverId'<~Integer> - Id of server image was created from
|
14
|
+
# * 'status'<~Integer> - Status of image
|
15
|
+
# * 'updated'<~String> - Timestamp of last update
|
16
|
+
def get_image_details(image_id)
|
17
|
+
request(
|
18
|
+
:expects => [200, 203],
|
19
|
+
:method => 'GET',
|
20
|
+
:path => "images/#{image_id}.json"
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
class Mock
|
27
|
+
|
28
|
+
def get_image_details(image_id)
|
29
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,32 +1,34 @@
|
|
1
|
-
require 'fog/rackspace/models/servers/flavor'
|
2
|
-
require 'fog/rackspace/models/servers/flavors'
|
3
|
-
require 'fog/rackspace/models/servers/image'
|
4
|
-
require 'fog/rackspace/models/servers/images'
|
5
|
-
require 'fog/rackspace/models/servers/server'
|
6
|
-
require 'fog/rackspace/models/servers/servers'
|
7
|
-
require 'fog/rackspace/requests/servers/create_image'
|
8
|
-
require 'fog/rackspace/requests/servers/create_server'
|
9
|
-
require 'fog/rackspace/requests/servers/delete_image'
|
10
|
-
require 'fog/rackspace/requests/servers/delete_server'
|
11
|
-
require 'fog/rackspace/requests/servers/get_flavor_details'
|
12
|
-
require 'fog/rackspace/requests/servers/get_server_details'
|
13
|
-
require 'fog/rackspace/requests/servers/list_addresses'
|
14
|
-
require 'fog/rackspace/requests/servers/list_private_addresses'
|
15
|
-
require 'fog/rackspace/requests/servers/list_public_addresses'
|
16
|
-
require 'fog/rackspace/requests/servers/list_flavors'
|
17
|
-
require 'fog/rackspace/requests/servers/list_flavors_detail'
|
18
|
-
require 'fog/rackspace/requests/servers/list_images'
|
19
|
-
require 'fog/rackspace/requests/servers/list_images_detail'
|
20
|
-
require 'fog/rackspace/requests/servers/list_servers'
|
21
|
-
require 'fog/rackspace/requests/servers/list_servers_detail'
|
22
|
-
require 'fog/rackspace/requests/servers/reboot_server'
|
23
|
-
require 'fog/rackspace/requests/servers/update_server'
|
24
|
-
|
25
1
|
module Fog
|
26
2
|
module Rackspace
|
27
3
|
module Servers
|
28
4
|
|
29
5
|
def self.new(options={})
|
6
|
+
|
7
|
+
require 'fog/rackspace/models/servers/flavor'
|
8
|
+
require 'fog/rackspace/models/servers/flavors'
|
9
|
+
require 'fog/rackspace/models/servers/image'
|
10
|
+
require 'fog/rackspace/models/servers/images'
|
11
|
+
require 'fog/rackspace/models/servers/server'
|
12
|
+
require 'fog/rackspace/models/servers/servers'
|
13
|
+
require 'fog/rackspace/requests/servers/create_image'
|
14
|
+
require 'fog/rackspace/requests/servers/create_server'
|
15
|
+
require 'fog/rackspace/requests/servers/delete_image'
|
16
|
+
require 'fog/rackspace/requests/servers/delete_server'
|
17
|
+
require 'fog/rackspace/requests/servers/get_flavor_details'
|
18
|
+
require 'fog/rackspace/requests/servers/get_image_details'
|
19
|
+
require 'fog/rackspace/requests/servers/get_server_details'
|
20
|
+
require 'fog/rackspace/requests/servers/list_addresses'
|
21
|
+
require 'fog/rackspace/requests/servers/list_private_addresses'
|
22
|
+
require 'fog/rackspace/requests/servers/list_public_addresses'
|
23
|
+
require 'fog/rackspace/requests/servers/list_flavors'
|
24
|
+
require 'fog/rackspace/requests/servers/list_flavors_detail'
|
25
|
+
require 'fog/rackspace/requests/servers/list_images'
|
26
|
+
require 'fog/rackspace/requests/servers/list_images_detail'
|
27
|
+
require 'fog/rackspace/requests/servers/list_servers'
|
28
|
+
require 'fog/rackspace/requests/servers/list_servers_detail'
|
29
|
+
require 'fog/rackspace/requests/servers/reboot_server'
|
30
|
+
require 'fog/rackspace/requests/servers/update_server'
|
31
|
+
|
30
32
|
if Fog.mocking?
|
31
33
|
Fog::Rackspace::Servers::Mock.new(options)
|
32
34
|
else
|