fog 0.2.18 → 0.2.19
Sign up to get free protection for your applications and to get access to all the features.
- data/fog.gemspec +11 -2
- data/lib/fog.rb +2 -1
- data/lib/fog/aws.rb +13 -10
- data/lib/fog/aws/ec2.rb +1 -0
- data/lib/fog/aws/models/ec2/image.rb +28 -10
- data/lib/fog/aws/parsers/ec2/deregister_image.rb +20 -0
- data/lib/fog/aws/parsers/ec2/describe_images.rb +14 -3
- data/lib/fog/aws/requests/ec2/deregister_image.rb +51 -0
- data/lib/fog/aws/requests/ec2/describe_images.rb +3 -0
- data/lib/fog/bin.rb +2 -1
- data/lib/fog/go_grid.rb +88 -0
- data/lib/fog/go_grid/bin.rb +30 -0
- data/lib/fog/go_grid/requests/common_lookup_list.rb +36 -0
- data/lib/fog/go_grid/requests/grid_image_list.rb +39 -0
- data/lib/fog/go_grid/requests/grid_ip_list.rb +38 -0
- data/lib/fog/go_grid/requests/grid_loadbalancer_list.rb +36 -0
- data/lib/fog/go_grid/requests/grid_server_list.rb +38 -0
- data/spec/aws/requests/ec2/describe_images_spec.rb +5 -0
- metadata +12 -3
data/fog.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
8
|
## the sub! line in the Rakefile
|
9
9
|
s.name = 'fog'
|
10
|
-
s.version = '0.2.
|
11
|
-
s.date = '2010-07-
|
10
|
+
s.version = '0.2.19'
|
11
|
+
s.date = '2010-07-25'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
@@ -104,6 +104,7 @@ Gem::Specification.new do |s|
|
|
104
104
|
lib/fog/aws/parsers/ec2/create_key_pair.rb
|
105
105
|
lib/fog/aws/parsers/ec2/create_snapshot.rb
|
106
106
|
lib/fog/aws/parsers/ec2/create_volume.rb
|
107
|
+
lib/fog/aws/parsers/ec2/deregister_image.rb
|
107
108
|
lib/fog/aws/parsers/ec2/describe_addresses.rb
|
108
109
|
lib/fog/aws/parsers/ec2/describe_availability_zones.rb
|
109
110
|
lib/fog/aws/parsers/ec2/describe_images.rb
|
@@ -154,6 +155,7 @@ Gem::Specification.new do |s|
|
|
154
155
|
lib/fog/aws/requests/ec2/delete_security_group.rb
|
155
156
|
lib/fog/aws/requests/ec2/delete_snapshot.rb
|
156
157
|
lib/fog/aws/requests/ec2/delete_volume.rb
|
158
|
+
lib/fog/aws/requests/ec2/deregister_image.rb
|
157
159
|
lib/fog/aws/requests/ec2/describe_addresses.rb
|
158
160
|
lib/fog/aws/requests/ec2/describe_availability_zones.rb
|
159
161
|
lib/fog/aws/requests/ec2/describe_images.rb
|
@@ -240,6 +242,13 @@ Gem::Specification.new do |s|
|
|
240
242
|
lib/fog/credentials.rb
|
241
243
|
lib/fog/deprecation.rb
|
242
244
|
lib/fog/errors.rb
|
245
|
+
lib/fog/go_grid.rb
|
246
|
+
lib/fog/go_grid/bin.rb
|
247
|
+
lib/fog/go_grid/requests/common_lookup_list.rb
|
248
|
+
lib/fog/go_grid/requests/grid_image_list.rb
|
249
|
+
lib/fog/go_grid/requests/grid_ip_list.rb
|
250
|
+
lib/fog/go_grid/requests/grid_loadbalancer_list.rb
|
251
|
+
lib/fog/go_grid/requests/grid_server_list.rb
|
243
252
|
lib/fog/hmac.rb
|
244
253
|
lib/fog/linode.rb
|
245
254
|
lib/fog/linode/bin.rb
|
data/lib/fog.rb
CHANGED
@@ -29,6 +29,7 @@ require 'fog/ssh'
|
|
29
29
|
|
30
30
|
require 'fog/aws'
|
31
31
|
require 'fog/bluebox'
|
32
|
+
require 'fog/go_grid'
|
32
33
|
require 'fog/linode'
|
33
34
|
require 'fog/local'
|
34
35
|
require 'fog/new_servers'
|
@@ -40,7 +41,7 @@ require 'fog/vcloud'
|
|
40
41
|
module Fog
|
41
42
|
|
42
43
|
unless const_defined?(:VERSION)
|
43
|
-
VERSION = '0.2.
|
44
|
+
VERSION = '0.2.19'
|
44
45
|
end
|
45
46
|
|
46
47
|
module Mock
|
data/lib/fog/aws.rb
CHANGED
@@ -67,16 +67,19 @@ module Fog
|
|
67
67
|
path << letters(rand(9) + 8)
|
68
68
|
end
|
69
69
|
{
|
70
|
-
"imageOwnerId"
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"
|
77
|
-
"
|
78
|
-
"
|
79
|
-
"
|
70
|
+
"imageOwnerId" => letters(rand(5) + 4),
|
71
|
+
"blockDeviceMapping" => [],
|
72
|
+
"productCodes" => [],
|
73
|
+
"kernelId" => kernel_id,
|
74
|
+
"ramdiskId" => ramdisk_id,
|
75
|
+
"imageState" => "available",
|
76
|
+
"imageId" => image_id,
|
77
|
+
"architecture" => "i386",
|
78
|
+
"isPublic" => true,
|
79
|
+
"imageLocation" => path.join('/'),
|
80
|
+
"imageType" => "machine",
|
81
|
+
"rootDeviceType" => ["ebs","instance-store"][rand(2)],
|
82
|
+
"rootDeviceName" => "/dev/sda1"
|
80
83
|
}
|
81
84
|
end
|
82
85
|
|
data/lib/fog/aws/ec2.rb
CHANGED
@@ -6,21 +6,39 @@ module Fog
|
|
6
6
|
|
7
7
|
class Image < Fog::Model
|
8
8
|
|
9
|
-
identity :id,
|
9
|
+
identity :id, 'imageId'
|
10
10
|
|
11
11
|
attribute :architecture
|
12
|
-
attribute :
|
13
|
-
attribute :
|
14
|
-
attribute :
|
15
|
-
attribute :
|
16
|
-
attribute :
|
17
|
-
attribute :
|
12
|
+
attribute :block_device_mapping, 'blockDeviceMapping'
|
13
|
+
attribute :location, 'imageLocation'
|
14
|
+
attribute :owner_id, 'imageOwnerId'
|
15
|
+
attribute :state, 'imageState'
|
16
|
+
attribute :type, 'imageType'
|
17
|
+
attribute :is_public, 'isPublic'
|
18
|
+
attribute :kernel_id, 'kernelId'
|
18
19
|
attribute :platform
|
19
|
-
attribute :product_codes,
|
20
|
-
attribute :ramdisk_id,
|
20
|
+
attribute :product_codes, 'productCodes'
|
21
|
+
attribute :ramdisk_id, 'ramdiskId'
|
22
|
+
attribute :root_device_type, 'rootDeviceType'
|
23
|
+
attribute :root_device_name, 'rootDeviceName'
|
24
|
+
|
25
|
+
def deregister(delete_snapshot = false)
|
26
|
+
connection.deregister_image(@id)
|
27
|
+
|
28
|
+
if(delete_snapshot && @root_device_type=="ebs")
|
29
|
+
@block_device_mapping.each do |block_device|
|
30
|
+
next if block_device["deviceName"] != @root_device_name
|
31
|
+
snapshot_id = block_device["snapshotId"]
|
32
|
+
snapshot = @connection.snapshots.get(snapshot_id)
|
33
|
+
return snapshot.destroy
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
return true
|
38
|
+
end
|
21
39
|
|
22
40
|
end
|
23
41
|
|
24
42
|
end
|
25
43
|
end
|
26
|
-
end
|
44
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module EC2
|
5
|
+
|
6
|
+
class DeregisterImage < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def end_element(name)
|
9
|
+
case name
|
10
|
+
when 'return', 'requestId', 'imageId'
|
11
|
+
@response[name] = @value
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
class DescribeImages < Fog::Parsers::Base
|
7
7
|
|
8
8
|
def reset
|
9
|
-
@image = { 'productCodes' => [] }
|
9
|
+
@image = { 'productCodes' => [], 'blockDeviceMapping' => nil }
|
10
10
|
@response = { 'imagesSet' => [] }
|
11
11
|
end
|
12
12
|
|
@@ -14,12 +14,17 @@ module Fog
|
|
14
14
|
super
|
15
15
|
if name == 'productCodes'
|
16
16
|
@in_product_codes = true
|
17
|
+
elsif name == 'blockDeviceMapping'
|
18
|
+
@in_block_device_mapping = true
|
19
|
+
@image['blockDeviceMapping'] = []
|
20
|
+
elsif name == 'item' && @in_block_device_mapping
|
21
|
+
@image['blockDeviceMapping'] << {}
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
20
25
|
def end_element(name)
|
21
26
|
case name
|
22
|
-
when 'architecture', 'imageId', 'imageLocation', 'imageOwnerId', 'imageState', 'imageType', 'kernelId', 'platform', 'ramdiskId'
|
27
|
+
when 'architecture', 'imageId', 'imageLocation', 'imageOwnerId', 'imageState', 'imageType', 'kernelId', 'platform', 'ramdiskId', 'rootDeviceType','rootDeviceName'
|
23
28
|
@image[name] = @value
|
24
29
|
when 'isPublic'
|
25
30
|
if @value == 'true'
|
@@ -28,7 +33,8 @@ module Fog
|
|
28
33
|
@image[name] = false
|
29
34
|
end
|
30
35
|
when 'item'
|
31
|
-
|
36
|
+
if @in_block_device_mapping
|
37
|
+
elsif !@in_product_codes
|
32
38
|
@response['imagesSet'] << @image
|
33
39
|
@image = { 'productCodes' => [] }
|
34
40
|
end
|
@@ -36,8 +42,13 @@ module Fog
|
|
36
42
|
@image['productCodes'] << @value
|
37
43
|
when 'productCodes'
|
38
44
|
@in_product_codes = false
|
45
|
+
when 'blockDeviceMapping'
|
46
|
+
@in_block_device_mapping = false
|
39
47
|
when 'requestId'
|
40
48
|
@response[name] = @value
|
49
|
+
when 'deviceName','virtualName','snapshotId','volumeSize','deleteOnTermination'
|
50
|
+
l = @image['blockDeviceMapping'].length
|
51
|
+
@image['blockDeviceMapping'][l-1].store(name,@value)
|
41
52
|
end
|
42
53
|
end
|
43
54
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/ec2/deregister_image'
|
7
|
+
|
8
|
+
# deregister an image
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# * image_id<~String> - Id of image to deregister
|
12
|
+
#
|
13
|
+
# ==== Returns
|
14
|
+
# * response<~Excon::Response>:
|
15
|
+
# * body<~Hash>:
|
16
|
+
# * 'return'<~Boolean> - Returns true if deregistration succeeded
|
17
|
+
# * 'requestId'<~String> - Id of request
|
18
|
+
def deregister_image(image_id)
|
19
|
+
request(
|
20
|
+
'Action' => 'DeregisterImage',
|
21
|
+
'ImageId' => image_id,
|
22
|
+
:parser => Fog::Parsers::AWS::EC2::DeregisterImage.new
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
class Mock
|
29
|
+
|
30
|
+
def deregister_image(image_id)
|
31
|
+
response = Excon::Response.new
|
32
|
+
if image_id
|
33
|
+
response.status = 200
|
34
|
+
response.body = {
|
35
|
+
'requestId' => Fog::AWS::Mock.request_id,
|
36
|
+
'return' => "true"
|
37
|
+
}
|
38
|
+
response
|
39
|
+
else
|
40
|
+
message = 'MissingParameter => '
|
41
|
+
if !instance_id
|
42
|
+
message << 'The request must contain the parameter image_id'
|
43
|
+
end
|
44
|
+
raise Fog::AWS::EC2::Error.new(message)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -20,6 +20,7 @@ module Fog
|
|
20
20
|
# * 'requestId'<~String> - Id of request
|
21
21
|
# * 'imagesSet'<~Array>:
|
22
22
|
# * 'architecture'<~String> - Architecture of the image
|
23
|
+
# * 'blockDeviceMapping'<~Array> - An array of mapped block devices
|
23
24
|
# * 'imageId'<~String> - Id of the image
|
24
25
|
# * 'imageLocation'<~String> - Location of the image
|
25
26
|
# * 'imageOwnerId'<~String> - Id of the owner of the image
|
@@ -30,6 +31,8 @@ module Fog
|
|
30
31
|
# * 'platform'<~String> - Operating platform of the image
|
31
32
|
# * 'productCodes'<~Array> - Product codes for the image
|
32
33
|
# * 'ramdiskId'<~String> - Ramdisk id associated with image, if any
|
34
|
+
# * 'rootDeviceName'<~String> - Root device name, e.g. /dev/sda1
|
35
|
+
# * 'rootDeviceType'<~String> - Root device type, ebs or instance-store
|
33
36
|
def describe_images(options = {})
|
34
37
|
if image_id = options.delete('ImageId')
|
35
38
|
options.merge!(AWS.indexed_param('ImageId', image_id))
|
data/lib/fog/bin.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'fog/credentials'
|
2
2
|
|
3
3
|
require 'fog/aws/bin'
|
4
|
+
require 'fog/go_grid/bin'
|
4
5
|
require 'fog/linode/bin'
|
5
6
|
require 'fog/local/bin'
|
6
7
|
require 'fog/new_servers/bin'
|
@@ -15,7 +16,7 @@ module Fog
|
|
15
16
|
|
16
17
|
def services
|
17
18
|
services = []
|
18
|
-
[::AWS, ::Linode, ::Local, ::NewServers, ::Rackspace, ::Slicehost, ::Terremark, ::Vcloud, ::Bluebox].each do |service|
|
19
|
+
[::AWS, ::GoGrid, ::Linode, ::Local, ::NewServers, ::Rackspace, ::Slicehost, ::Terremark, ::Vcloud, ::Bluebox].each do |service|
|
19
20
|
if service.initialized?
|
20
21
|
services << service
|
21
22
|
end
|
data/lib/fog/go_grid.rb
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
module Fog
|
2
|
+
module GoGrid
|
3
|
+
extend Fog::Service
|
4
|
+
|
5
|
+
requires :go_grid_api_key
|
6
|
+
requires :go_grid_shared_secret
|
7
|
+
|
8
|
+
model_path 'fog/go_grid/models'
|
9
|
+
|
10
|
+
request_path 'fog/go_grid/requests'
|
11
|
+
request 'common_lookup_list'
|
12
|
+
request 'grid_image_list'
|
13
|
+
request 'grid_ip_list'
|
14
|
+
request 'grid_loadbalancer_list'
|
15
|
+
request 'grid_server_list'
|
16
|
+
|
17
|
+
class Mock
|
18
|
+
include Collections
|
19
|
+
|
20
|
+
def self.data
|
21
|
+
@data ||= Hash.new do |hash, key|
|
22
|
+
hash[key] = {}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.reset_data(keys=data.keys)
|
27
|
+
for key in [*keys]
|
28
|
+
data.delete(key)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def initialize(options={})
|
33
|
+
@go_grid_api_key = options[:go_grid_api_key]
|
34
|
+
@go_grid_shared_secret = options[:go_grid_shared_secret]
|
35
|
+
@data = self.class.data[@go_grid_api_key]
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
class Real
|
41
|
+
include Collections
|
42
|
+
|
43
|
+
def initialize(options={})
|
44
|
+
@go_grid_api_key = options[:go_grid_api_key]
|
45
|
+
@go_grid_shared_secret = options[:go_grid_shared_secret]
|
46
|
+
@host = options[:host] || "api.gogrid.com"
|
47
|
+
@path = options[:path] || "/api"
|
48
|
+
@port = options[:port] || 443
|
49
|
+
@scheme = options[:scheme] || 'https'
|
50
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
51
|
+
end
|
52
|
+
|
53
|
+
def reload
|
54
|
+
@connection.reset
|
55
|
+
end
|
56
|
+
|
57
|
+
def request(params)
|
58
|
+
params[:query] ||= {}
|
59
|
+
params[:query].merge!({
|
60
|
+
'api_key' => @go_grid_api_key,
|
61
|
+
'format' => 'json',
|
62
|
+
'sig' => Digest::MD5.hexdigest("#{@go_grid_api_key}#{@go_grid_shared_secret}#{Time.now.to_i}"),
|
63
|
+
'v' => '1.4'
|
64
|
+
})
|
65
|
+
|
66
|
+
begin
|
67
|
+
response = @connection.request(
|
68
|
+
params.merge!(:path => "#{@path}/#{params[:path]}")
|
69
|
+
)
|
70
|
+
rescue Excon::Errors::Error => error
|
71
|
+
raise case error
|
72
|
+
when Excon::Errors::NotFound
|
73
|
+
Fog::Go_Grid::NotFound.slurp(error)
|
74
|
+
else
|
75
|
+
error
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
unless response.body.empty?
|
80
|
+
response.body = JSON.parse(response.body)
|
81
|
+
end
|
82
|
+
|
83
|
+
response
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module GoGrid
|
2
|
+
class << self
|
3
|
+
if Fog.credentials[:go_grid_api_key] && Fog.credentials[:go_grid_shared_secret]
|
4
|
+
|
5
|
+
def initialized?
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
def [](service)
|
10
|
+
@@connections ||= Hash.new do |hash, key|
|
11
|
+
credentials = Fog.credentials.reject do |k,v|
|
12
|
+
![:go_grid_api_key, :go_grid_shared_secret].include?(k)
|
13
|
+
end
|
14
|
+
hash[key] = case key
|
15
|
+
when :go_grid
|
16
|
+
Fog::GoGrid.new(credentials)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
@@connections[service]
|
20
|
+
end
|
21
|
+
|
22
|
+
else
|
23
|
+
|
24
|
+
def initialized?
|
25
|
+
false
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Fog
|
2
|
+
module GoGrid
|
3
|
+
class Real
|
4
|
+
|
5
|
+
# List options and lookups
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# * 'lookup'<~String> - the lookup to be listed
|
9
|
+
# * options<~Hash>:
|
10
|
+
# * 'sort'<~String> - column to sort result by in ['description', 'id', 'name']
|
11
|
+
# * 'asc'<~String> - order to sort in ['true','false']
|
12
|
+
#
|
13
|
+
# ==== Returns
|
14
|
+
# * response<~Excon::Response>:
|
15
|
+
# * body<~Array>:
|
16
|
+
# TODO: docs
|
17
|
+
def common_lookup_list(lookup, options={})
|
18
|
+
request(
|
19
|
+
:expects => 200,
|
20
|
+
:method => 'GET',
|
21
|
+
:path => 'common/lookup/list',
|
22
|
+
:query => {'lookup' => lookup}.merge!(options)
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
class Mock
|
29
|
+
|
30
|
+
def common_lookup_list(lookup, options={})
|
31
|
+
Fog::Mock.not_implemented
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Fog
|
2
|
+
module GoGrid
|
3
|
+
class Real
|
4
|
+
|
5
|
+
# List images
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# * options<~Hash>:
|
9
|
+
# * 'datacenter'<~String> - datacenter to limit results to
|
10
|
+
# * 'isPublic'<~String> - If true only returns public images, in ['false', 'true']
|
11
|
+
# * 'num_items'<~Integer> - Number of items to return
|
12
|
+
# * 'page'<~Integer> - Page index for paginated results
|
13
|
+
# * 'state'<~String> - state to limit results to, in ['Saving', 'Available']
|
14
|
+
# * 'type'<~String> - image type to limit results to
|
15
|
+
#
|
16
|
+
# ==== Returns
|
17
|
+
# * response<~Excon::Response>:
|
18
|
+
# * body<~Array>:
|
19
|
+
# TODO: docs
|
20
|
+
def grid_image_list(options={})
|
21
|
+
request(
|
22
|
+
:expects => 200,
|
23
|
+
:method => 'GET',
|
24
|
+
:path => 'grid/image/list',
|
25
|
+
:query => options
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
class Mock
|
32
|
+
|
33
|
+
def grid_image_list(options={})
|
34
|
+
Fog::Mock.not_implemented
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Fog
|
2
|
+
module GoGrid
|
3
|
+
class Real
|
4
|
+
|
5
|
+
# List ips
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# * options<~Hash>:
|
9
|
+
# * 'datacenter'<~String> - datacenter to limit results to
|
10
|
+
# * 'ip.state'<~String> - state to limit results to in ip.state
|
11
|
+
# * 'ip.type'<~String> - type to limit results to in ip.type
|
12
|
+
# * 'num_items'<~Integer> - Number of items to return
|
13
|
+
# * 'page'<~Integer> - Page index for paginated results
|
14
|
+
#
|
15
|
+
# ==== Returns
|
16
|
+
# * response<~Excon::Response>:
|
17
|
+
# * body<~Array>:
|
18
|
+
# TODO: docs
|
19
|
+
def grid_ip_list(options={})
|
20
|
+
request(
|
21
|
+
:expects => 200,
|
22
|
+
:method => 'GET',
|
23
|
+
:path => 'grid/ip/list',
|
24
|
+
:query => options
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
class Mock
|
31
|
+
|
32
|
+
def grid_ip_list(options={})
|
33
|
+
Fog::Mock.not_implemented
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Fog
|
2
|
+
module GoGrid
|
3
|
+
class Real
|
4
|
+
|
5
|
+
# List load balancers
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# * options<~Hash>:
|
9
|
+
# * 'datacenter'<~String> - datacenter to limit results to
|
10
|
+
# * 'num_items'<~Integer> - Number of items to return
|
11
|
+
# * 'page'<~Integer> - Page index for paginated results
|
12
|
+
#
|
13
|
+
# ==== Returns
|
14
|
+
# * response<~Excon::Response>:
|
15
|
+
# * body<~Array>:
|
16
|
+
# TODO: docs
|
17
|
+
def grid_loadbalancer_list(options={})
|
18
|
+
request(
|
19
|
+
:expects => 200,
|
20
|
+
:method => 'GET',
|
21
|
+
:path => 'grid/loadbalancer/list',
|
22
|
+
:query => options
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
class Mock
|
29
|
+
|
30
|
+
def grid_loadbalancer_list(options={})
|
31
|
+
Fog::Mock.not_implemented
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Fog
|
2
|
+
module GoGrid
|
3
|
+
class Real
|
4
|
+
|
5
|
+
# List servers
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# * options<~Hash>:
|
9
|
+
# * 'datacenter'<~String> - datacenter to limit results to
|
10
|
+
# * 'isSandbox'<~String> - If true only returns Image Sandbox servers, in ['false', 'true']
|
11
|
+
# * 'num_items'<~Integer> - Number of items to return
|
12
|
+
# * 'page'<~Integer> - Page index for paginated results
|
13
|
+
# * 'server.type'<~String> - server type to limit results to
|
14
|
+
#
|
15
|
+
# ==== Returns
|
16
|
+
# * response<~Excon::Response>:
|
17
|
+
# * body<~Array>:
|
18
|
+
# TODO: docs
|
19
|
+
def grid_server_list(options={})
|
20
|
+
request(
|
21
|
+
:expects => 200,
|
22
|
+
:method => 'GET',
|
23
|
+
:path => 'grid/server/list',
|
24
|
+
:query => options
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
class Mock
|
31
|
+
|
32
|
+
def grid_server_list(options={})
|
33
|
+
Fog::Mock.not_implemented
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -17,6 +17,9 @@ describe 'EC2.describe_images' do
|
|
17
17
|
image['kernelId'].should be_a(String) if image['kernelId']
|
18
18
|
image['platform'].should be_a(String) if image['platform']
|
19
19
|
image['ramdiskId'].should be_a(String) if image['ramdiskId']
|
20
|
+
image['rootDeviceName'].should be_a(String) if image['rootDeviceName']
|
21
|
+
["ebs","instance-store"].should include(image['rootDeviceType'])
|
22
|
+
image['rootDeviceName'].should be_a(String) if image['rootDeviceName']
|
20
23
|
end
|
21
24
|
|
22
25
|
it "should return proper attributes with params" do
|
@@ -33,6 +36,8 @@ describe 'EC2.describe_images' do
|
|
33
36
|
image['kernelId'].should be_a(String) if image['kernelId']
|
34
37
|
image['platform'].should be_a(String) if image['platform']
|
35
38
|
image['ramdiskId'].should be_a(String) if image['ramdiskId']
|
39
|
+
["ebs","instance-store"].should include(image['rootDeviceType'])
|
40
|
+
image['rootDeviceName'].should be_a(String) if image['rootDeviceName']
|
36
41
|
end
|
37
42
|
|
38
43
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 19
|
9
|
+
version: 0.2.19
|
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-07-
|
17
|
+
date: 2010-07-25 00:00:00 -07:00
|
18
18
|
default_executable: fog
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- lib/fog/aws/parsers/ec2/create_key_pair.rb
|
194
194
|
- lib/fog/aws/parsers/ec2/create_snapshot.rb
|
195
195
|
- lib/fog/aws/parsers/ec2/create_volume.rb
|
196
|
+
- lib/fog/aws/parsers/ec2/deregister_image.rb
|
196
197
|
- lib/fog/aws/parsers/ec2/describe_addresses.rb
|
197
198
|
- lib/fog/aws/parsers/ec2/describe_availability_zones.rb
|
198
199
|
- lib/fog/aws/parsers/ec2/describe_images.rb
|
@@ -243,6 +244,7 @@ files:
|
|
243
244
|
- lib/fog/aws/requests/ec2/delete_security_group.rb
|
244
245
|
- lib/fog/aws/requests/ec2/delete_snapshot.rb
|
245
246
|
- lib/fog/aws/requests/ec2/delete_volume.rb
|
247
|
+
- lib/fog/aws/requests/ec2/deregister_image.rb
|
246
248
|
- lib/fog/aws/requests/ec2/describe_addresses.rb
|
247
249
|
- lib/fog/aws/requests/ec2/describe_availability_zones.rb
|
248
250
|
- lib/fog/aws/requests/ec2/describe_images.rb
|
@@ -329,6 +331,13 @@ files:
|
|
329
331
|
- lib/fog/credentials.rb
|
330
332
|
- lib/fog/deprecation.rb
|
331
333
|
- lib/fog/errors.rb
|
334
|
+
- lib/fog/go_grid.rb
|
335
|
+
- lib/fog/go_grid/bin.rb
|
336
|
+
- lib/fog/go_grid/requests/common_lookup_list.rb
|
337
|
+
- lib/fog/go_grid/requests/grid_image_list.rb
|
338
|
+
- lib/fog/go_grid/requests/grid_ip_list.rb
|
339
|
+
- lib/fog/go_grid/requests/grid_loadbalancer_list.rb
|
340
|
+
- lib/fog/go_grid/requests/grid_server_list.rb
|
332
341
|
- lib/fog/hmac.rb
|
333
342
|
- lib/fog/linode.rb
|
334
343
|
- lib/fog/linode/bin.rb
|