fog 0.0.47 → 0.0.48
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +0 -36
- data/VERSION.yml +1 -1
- data/fog.gemspec +434 -467
- data/lib/fog/aws.rb +1 -1
- data/lib/fog/aws/ec2.rb +1 -1
- data/lib/fog/aws/models/ec2/addresses.rb +6 -10
- data/lib/fog/aws/models/ec2/flavors.rb +1 -7
- data/lib/fog/aws/models/ec2/images.rb +1 -8
- data/lib/fog/aws/models/ec2/key_pairs.rb +1 -8
- data/lib/fog/aws/models/ec2/security_groups.rb +1 -8
- data/lib/fog/aws/models/ec2/servers.rb +6 -9
- data/lib/fog/aws/models/ec2/snapshots.rb +3 -10
- data/lib/fog/aws/models/ec2/volumes.rb +2 -10
- data/lib/fog/aws/models/s3/directories.rb +2 -9
- data/lib/fog/aws/models/s3/files.rb +1 -5
- data/lib/fog/aws/s3.rb +1 -1
- data/lib/fog/aws/simpledb.rb +1 -1
- data/lib/fog/collection.rb +8 -2
- data/lib/fog/rackspace.rb +1 -1
- data/lib/fog/rackspace/files.rb +1 -1
- data/lib/fog/rackspace/models/files/directories.rb +1 -8
- data/lib/fog/rackspace/models/files/files.rb +1 -5
- data/lib/fog/rackspace/models/servers/flavors.rb +2 -9
- data/lib/fog/rackspace/models/servers/images.rb +3 -11
- data/lib/fog/rackspace/models/servers/servers.rb +2 -9
- data/lib/fog/rackspace/servers.rb +1 -1
- data/lib/fog/slicehost.rb +1 -1
- data/lib/fog/slicehost/models/flavors.rb +2 -9
- data/lib/fog/slicehost/models/images.rb +2 -9
- data/lib/fog/slicehost/models/servers.rb +1 -8
- data/lib/fog/terremark.rb +1 -1
- metadata +4 -37
data/lib/fog/aws.rb
CHANGED
data/lib/fog/aws/ec2.rb
CHANGED
@@ -22,19 +22,15 @@ module Fog
|
|
22
22
|
|
23
23
|
def all(public_ip = @public_ip)
|
24
24
|
@public_ip = public_ip
|
25
|
-
if @loaded
|
26
|
-
clear
|
27
|
-
end
|
28
|
-
@loaded = true
|
29
25
|
data = connection.describe_addresses(public_ip).body
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
load(
|
27
|
+
data['addressesSet'].map do |address|
|
28
|
+
address.reject {|key, value| value.nil? || value.empty? }
|
29
|
+
end
|
30
|
+
)
|
34
31
|
if server
|
35
|
-
|
32
|
+
self.replace(self.select {|address| address.instance_id == server.id})
|
36
33
|
end
|
37
|
-
self.replace(addresses)
|
38
34
|
end
|
39
35
|
|
40
36
|
def get(public_ip)
|
@@ -11,10 +11,6 @@ module Fog
|
|
11
11
|
model Fog::AWS::EC2::Flavor
|
12
12
|
|
13
13
|
def all
|
14
|
-
if @loaded
|
15
|
-
clear
|
16
|
-
end
|
17
|
-
@loaded = true
|
18
14
|
data = [
|
19
15
|
{ :bits => 32, :cores => 1, :disk => 160, :id => 'm1.small', :name => 'Small Instance', :ram => 1740.8},
|
20
16
|
{ :bits => 64, :cores => 4, :disk => 850, :id => 'm1.large', :name => 'Large Instance', :ram => 7680},
|
@@ -26,9 +22,7 @@ module Fog
|
|
26
22
|
{ :bits => 64, :cores => 13, :disk => 850, :id => 'm2.2xlarge', :name => 'High Memory Double Extra Large', :ram => 35020.8},
|
27
23
|
{ :bits => 64, :cores => 26, :disk => 1690, :id => 'm2.4xlarge', :name => 'High Memory Quadruple Extra Large', :ram => 70041.6},
|
28
24
|
]
|
29
|
-
|
30
|
-
self << new(flavor)
|
31
|
-
end
|
25
|
+
load(data)
|
32
26
|
self
|
33
27
|
end
|
34
28
|
|
@@ -19,15 +19,8 @@ module Fog
|
|
19
19
|
|
20
20
|
def all(image_id = @image_id)
|
21
21
|
@image_id = image_id
|
22
|
-
if @loaded
|
23
|
-
clear
|
24
|
-
end
|
25
|
-
@loaded = true
|
26
22
|
data = connection.describe_images('ImageId' => image_id).body
|
27
|
-
data['imagesSet']
|
28
|
-
self << new(image)
|
29
|
-
end
|
30
|
-
self
|
23
|
+
load(data['imagesSet'])
|
31
24
|
end
|
32
25
|
|
33
26
|
def get(image_id)
|
@@ -19,15 +19,8 @@ module Fog
|
|
19
19
|
|
20
20
|
def all(key_name = @key_name)
|
21
21
|
@key_name = key_name
|
22
|
-
if @loaded
|
23
|
-
clear
|
24
|
-
end
|
25
|
-
@loaded = true
|
26
22
|
data = connection.describe_key_pairs(key_name).body
|
27
|
-
data['keySet']
|
28
|
-
self << new(key)
|
29
|
-
end
|
30
|
-
self
|
23
|
+
load(data['keySet'])
|
31
24
|
end
|
32
25
|
|
33
26
|
def get(key_name)
|
@@ -19,15 +19,8 @@ module Fog
|
|
19
19
|
|
20
20
|
def all(group_name = @group_name)
|
21
21
|
@group_name = group_name
|
22
|
-
if @loaded
|
23
|
-
clear
|
24
|
-
end
|
25
|
-
@loaded = true
|
26
22
|
data = connection.describe_security_groups(group_name).body
|
27
|
-
data['securityGroupInfo']
|
28
|
-
self << new(security_group)
|
29
|
-
end
|
30
|
-
self
|
23
|
+
load(data['securityGroupInfo'])
|
31
24
|
end
|
32
25
|
|
33
26
|
def get(group_name)
|
@@ -19,17 +19,14 @@ module Fog
|
|
19
19
|
|
20
20
|
def all(server_id = @server_id)
|
21
21
|
@server_id = server_id
|
22
|
-
if @loaded
|
23
|
-
clear
|
24
|
-
end
|
25
|
-
@loaded = true
|
26
22
|
data = connection.describe_instances(server_id).body
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
load(
|
24
|
+
data['reservationSet'].map do |reservation|
|
25
|
+
reservation['instancesSet'].map do |instance|
|
26
|
+
instance.merge(:groups => reservation['groupSet'])
|
27
|
+
end
|
30
28
|
end
|
31
|
-
|
32
|
-
self
|
29
|
+
)
|
33
30
|
end
|
34
31
|
|
35
32
|
def get(server_id)
|
@@ -22,19 +22,12 @@ module Fog
|
|
22
22
|
|
23
23
|
def all(snapshot_id = @snapshot_id)
|
24
24
|
@snapshot_id = snapshot_id
|
25
|
-
if @loaded
|
26
|
-
clear
|
27
|
-
end
|
28
|
-
@loaded = true
|
29
25
|
data = connection.describe_snapshots(snapshot_id).body
|
30
|
-
|
31
|
-
data['snapshotSet'].each do |snapshot|
|
32
|
-
snapshots << new(snapshot)
|
33
|
-
end
|
26
|
+
load(data['snapshotSet'])
|
34
27
|
if volume
|
35
|
-
|
28
|
+
self.replace(self.select {|snapshot| snapshot.volume_id == volume.id})
|
36
29
|
end
|
37
|
-
self
|
30
|
+
self
|
38
31
|
end
|
39
32
|
|
40
33
|
def get(snapshot_id)
|
@@ -22,19 +22,11 @@ module Fog
|
|
22
22
|
|
23
23
|
def all(volume_id = @volume_id)
|
24
24
|
@volume_id = volume_id
|
25
|
-
if @loaded
|
26
|
-
clear
|
27
|
-
end
|
28
|
-
@loaded = true
|
29
25
|
data = connection.describe_volumes(volume_id).body
|
30
|
-
|
31
|
-
data['volumeSet'].each do |volume|
|
32
|
-
volumes << new(volume)
|
33
|
-
end
|
26
|
+
load(data['volumeSet'])
|
34
27
|
if server
|
35
|
-
|
28
|
+
self.replace(self.select {|volume| volume.server_id == server.id})
|
36
29
|
end
|
37
|
-
self.replace(volumes)
|
38
30
|
end
|
39
31
|
|
40
32
|
def get(volume_id)
|
@@ -11,15 +11,8 @@ module Fog
|
|
11
11
|
model Fog::AWS::S3::Directory
|
12
12
|
|
13
13
|
def all
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
@loaded = true
|
18
|
-
data = connection.get_service.body
|
19
|
-
data['Buckets'].each do |directory|
|
20
|
-
self << new(directory)
|
21
|
-
end
|
22
|
-
self
|
14
|
+
data = connection.get_service.body['Buckets']
|
15
|
+
load(data)
|
23
16
|
end
|
24
17
|
|
25
18
|
def get(name, options = {})
|
@@ -14,16 +14,12 @@ module Fog
|
|
14
14
|
|
15
15
|
def all(options = {})
|
16
16
|
merge_attributes(options)
|
17
|
-
if @loaded
|
18
|
-
clear
|
19
|
-
end
|
20
|
-
@loaded = true
|
21
17
|
collection = directory.collection.get(
|
22
18
|
directory.name,
|
23
19
|
options
|
24
20
|
)
|
25
21
|
if collection
|
26
|
-
|
22
|
+
load(collection.files {|file| file.attributes})
|
27
23
|
else
|
28
24
|
nil
|
29
25
|
end
|
data/lib/fog/aws/s3.rb
CHANGED
data/lib/fog/aws/simpledb.rb
CHANGED
data/lib/fog/collection.rb
CHANGED
@@ -101,9 +101,15 @@ module Fog
|
|
101
101
|
data
|
102
102
|
end
|
103
103
|
|
104
|
-
def load(
|
104
|
+
def load(objects)
|
105
|
+
if @loaded
|
106
|
+
clear
|
107
|
+
end
|
105
108
|
@loaded = true
|
106
|
-
|
109
|
+
for object in objects
|
110
|
+
self << new(object)
|
111
|
+
end
|
112
|
+
self
|
107
113
|
end
|
108
114
|
|
109
115
|
def model
|
data/lib/fog/rackspace.rb
CHANGED
data/lib/fog/rackspace/files.rb
CHANGED
@@ -11,15 +11,8 @@ module Fog
|
|
11
11
|
model Fog::Rackspace::Files::Directory
|
12
12
|
|
13
13
|
def all
|
14
|
-
if @loaded
|
15
|
-
clear
|
16
|
-
end
|
17
|
-
@loaded = true
|
18
14
|
data = connection.get_containers.body
|
19
|
-
data
|
20
|
-
self << new(directory)
|
21
|
-
end
|
22
|
-
self
|
15
|
+
load(data)
|
23
16
|
end
|
24
17
|
|
25
18
|
def get(name, options = {})
|
@@ -13,16 +13,12 @@ module Fog
|
|
13
13
|
|
14
14
|
def all(options = {})
|
15
15
|
merge_attributes(options)
|
16
|
-
if @loaded
|
17
|
-
clear
|
18
|
-
end
|
19
|
-
@loaded = true
|
20
16
|
collection = directory.collection.get(
|
21
17
|
directory.name,
|
22
18
|
options
|
23
19
|
)
|
24
20
|
if collection
|
25
|
-
|
21
|
+
load(collection.files.map {|file| file.attributes})
|
26
22
|
else
|
27
23
|
nil
|
28
24
|
end
|
@@ -11,15 +11,8 @@ module Fog
|
|
11
11
|
model Fog::Rackspace::Servers::Flavor
|
12
12
|
|
13
13
|
def all
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
@loaded = true
|
18
|
-
data = connection.list_flavors_detail.body
|
19
|
-
for flavor in data['flavors']
|
20
|
-
self << new(flavor)
|
21
|
-
end
|
22
|
-
self
|
14
|
+
data = connection.list_flavors_detail.body['flavors']
|
15
|
+
load(data)
|
23
16
|
end
|
24
17
|
|
25
18
|
def get(flavor_id)
|
@@ -15,19 +15,11 @@ module Fog
|
|
15
15
|
attribute :server
|
16
16
|
|
17
17
|
def all
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
@loaded = true
|
22
|
-
data = connection.list_images_detail.body
|
23
|
-
images = []
|
24
|
-
for image in data['images']
|
25
|
-
images << new(image)
|
26
|
-
end
|
18
|
+
data = connection.list_images_detail.body['images']
|
19
|
+
load(images)
|
27
20
|
if server
|
28
|
-
|
21
|
+
self.replace(self.select {|image| image.server_id == server.id})
|
29
22
|
end
|
30
|
-
self.replace(images)
|
31
23
|
end
|
32
24
|
|
33
25
|
def get(image_id)
|
@@ -11,15 +11,8 @@ module Fog
|
|
11
11
|
model Fog::Rackspace::Servers::Server
|
12
12
|
|
13
13
|
def all
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
@loaded = true
|
18
|
-
data = connection.list_servers_detail.body
|
19
|
-
for server in data['servers']
|
20
|
-
self << new(server)
|
21
|
-
end
|
22
|
-
self
|
14
|
+
data = connection.list_servers_detail.body['servers']
|
15
|
+
load(data)
|
23
16
|
end
|
24
17
|
|
25
18
|
def get(server_id)
|
data/lib/fog/slicehost.rb
CHANGED
@@ -10,15 +10,8 @@ module Fog
|
|
10
10
|
model Fog::Slicehost::Flavor
|
11
11
|
|
12
12
|
def all
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
@loaded = true
|
17
|
-
data = connection.get_flavors.body
|
18
|
-
for flavor in data['flavors']
|
19
|
-
self << new(flavor)
|
20
|
-
end
|
21
|
-
self
|
13
|
+
data = connection.get_flavors.body['flavors']
|
14
|
+
load(self)
|
22
15
|
end
|
23
16
|
|
24
17
|
def get(flavor_id)
|
@@ -12,15 +12,8 @@ module Fog
|
|
12
12
|
model Fog::Slicehost::Image
|
13
13
|
|
14
14
|
def all
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
@loaded = true
|
19
|
-
data = connection.get_images.body
|
20
|
-
for image in data['images']
|
21
|
-
self << new(image)
|
22
|
-
end
|
23
|
-
self
|
15
|
+
data = connection.get_images.body['images']
|
16
|
+
load(data)
|
24
17
|
end
|
25
18
|
|
26
19
|
def get(image_id)
|
@@ -10,15 +10,8 @@ module Fog
|
|
10
10
|
model Fog::Slicehost::Server
|
11
11
|
|
12
12
|
def all
|
13
|
-
if @loaded
|
14
|
-
clear
|
15
|
-
end
|
16
|
-
@loaded = true
|
17
13
|
data = connection.get_slices.body['slices']
|
18
|
-
|
19
|
-
self << new(server)
|
20
|
-
end
|
21
|
-
self
|
14
|
+
load(data)
|
22
15
|
end
|
23
16
|
|
24
17
|
def get(server_id)
|
data/lib/fog/terremark.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 48
|
9
|
+
version: 0.0.48
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- geemus (Wesley Beary)
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-08 00:00:00 -08:00
|
18
18
|
default_executable: fog
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -425,40 +425,7 @@ has_rdoc: true
|
|
425
425
|
homepage: http://github.com/geemus/fog
|
426
426
|
licenses: []
|
427
427
|
|
428
|
-
post_install_message:
|
429
|
-
==================================================
|
430
|
-
|
431
|
-
fog 0.0.41 has a minor change to the API for ec2 servers:
|
432
|
-
|
433
|
-
# what_it_was => what_it_is
|
434
|
-
|
435
|
-
ec2.servers.new(:group_id => 'foo') => ec2.servers.new(:groups => ['foo'])
|
436
|
-
|
437
|
-
Updating to the newest api version also means you can now assign multiple groups:
|
438
|
-
|
439
|
-
ec2.servers.new(:groups => ['foo', 'bar'])
|
440
|
-
|
441
|
-
==================================================
|
442
|
-
|
443
|
-
fog 0.0.40 has API changes you should know about.
|
444
|
-
|
445
|
-
Some changes you might care about happened in the models:
|
446
|
-
|
447
|
-
# what_it_was => what_it_is
|
448
|
-
|
449
|
-
ec2.instances => ec2.servers
|
450
|
-
ec2.instance => ec2.server
|
451
|
-
|
452
|
-
s3.buckets => s3.directories
|
453
|
-
s3.bucket => s3.directory
|
454
|
-
|
455
|
-
s3.objects => s3.files
|
456
|
-
s3.object => s3.file
|
457
|
-
|
458
|
-
Sorry for the bother, but it will allow for a more consistent API as fog continues to expand.
|
459
|
-
|
460
|
-
==================================================
|
461
|
-
|
428
|
+
post_install_message:
|
462
429
|
rdoc_options:
|
463
430
|
- --charset=UTF-8
|
464
431
|
require_paths:
|