fog 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -230,6 +230,7 @@ task :changelog do
230
230
  'Aaron Suggs',
231
231
  'Brian Hartsock',
232
232
  'Christopher Oliver',
233
+ 'Decklin Foster',
233
234
  'Dylan Egan',
234
235
  'geemus',
235
236
  'Henry Addison',
@@ -1,3 +1,35 @@
1
+ 1.3.1 03/27/2012 f0f692456956fe2e414ef8205d0268259901644a
2
+ =========================================================
3
+
4
+ Stats! { 'collaborators' => 32, 'downloads' => 527366, 'forks' => 392, 'open_issues' => 27, 'watchers' => 1901 }
5
+
6
+ MVP! George Scott
7
+
8
+ [aws|dns]
9
+ Preserves change_id. Support for checking sync status via reload. thanks George Scott
10
+ Changed #insync? to #ready?. thanks George Scott
11
+
12
+ [ibm]
13
+ avoid using constants (Rails loads files multiple times, issue #807). thanks Decklin Foster
14
+ Make usage of #state rather than #status consistent. thanks Decklin Foster
15
+
16
+ [ibm|compute]
17
+ Add clone/destroy methods and tests to Image. thanks Decklin Foster
18
+ Add request test for list_vlans and fix mock. thanks Decklin Foster
19
+
20
+ [ibm|storage]
21
+ Restore storage_area, platform_version, clone_status Volume attributes. thanks Decklin Foster
22
+
23
+ [misc]
24
+ Allow custom headers in Storage#put_object_url. thanks Jacob Mattingley
25
+ Use https_url instead of deprecated url for put_object_url. thanks Jacob Mattingley
26
+ Adding Vlan class to IBM SmartCloud. thanks Joe Kinsella
27
+ bump excon dep to get jruby openssl fixes. thanks geemus
28
+
29
+ [storage]
30
+ properly update content-type at save time for file models. thanks geemus
31
+
32
+
1
33
  1.3.0 03/21/2012 f78afe98242a60ae4dbbfcd8c5ab67ba71c6d773
2
34
  =========================================================
3
35
 
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
6
6
  ## If your rubyforge_project name is different, then edit it and comment out
7
7
  ## the sub! line in the Rakefile
8
8
  s.name = 'fog'
9
- s.version = '1.3.0'
10
- s.date = '2012-03-21'
9
+ s.version = '1.3.1'
10
+ s.date = '2012-03-27'
11
11
  s.rubyforge_project = 'fog'
12
12
 
13
13
  ## Make sure your summary is short. The description may be as long
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
37
37
  ## List your runtime dependencies here. Runtime dependencies are those
38
38
  ## that are needed for an end user to actually USE your code.
39
39
  s.add_dependency('builder')
40
- s.add_dependency('excon', '~>0.12.0')
40
+ s.add_dependency('excon', '~>0.13.0')
41
41
  s.add_dependency('formatador', '~>0.2.0')
42
42
  s.add_dependency('multi_json', '~>1.0')
43
43
  s.add_dependency('mime-types')
data/lib/fog.rb CHANGED
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), 'fog', 'core')
3
3
  module Fog
4
4
 
5
5
  unless const_defined?(:VERSION)
6
- VERSION = '1.3.0'
6
+ VERSION = '1.3.1'
7
7
  end
8
8
 
9
9
  end
@@ -17,6 +17,7 @@ module Fog
17
17
  attribute :status, :aliases => ['Status']
18
18
  attribute :created_at, :aliases => ['SubmittedAt']
19
19
  attribute :alias_target, :aliases => ['AliasTarget']
20
+ attribute :change_id, :aliases => ['Id']
20
21
 
21
22
  def initialize(attributes={})
22
23
  self.ttl ||= 3600
@@ -55,6 +56,24 @@ module Fog
55
56
  true
56
57
  end
57
58
 
59
+ # Returns true if record is insync. May only be called for newly created or modified records that
60
+ # have a change_id and status set.
61
+ def ready?
62
+ requires :change_id, :status
63
+ status == 'INSYNC'
64
+ end
65
+
66
+ def reload
67
+ # If we have a change_id (newly created or modified), then reload performs a get_change to update status.
68
+ if change_id
69
+ data = connection.get_change(change_id).body
70
+ merge_attributes(data)
71
+ self
72
+ else
73
+ super
74
+ end
75
+ end
76
+
58
77
  private
59
78
 
60
79
  def zone=(new_zone)
@@ -131,10 +131,11 @@ module Fog
131
131
  merge_attributes(data.body)
132
132
  else
133
133
  data = connection.put_object(directory.key, key, body, options)
134
- merge_attributes(data.headers)
134
+ merge_attributes(data.headers.reject {|key, value| ['Content-Length', 'Content-Type'].include?(key)})
135
135
  end
136
136
  self.etag.gsub!('"','')
137
137
  self.content_length = Fog::Storage.get_body_size(body)
138
+ self.content_type ||= Fog::Storage.get_content_type(body)
138
139
  true
139
140
  end
140
141
 
@@ -32,9 +32,9 @@ module Fog
32
32
  def put_object(bucket_name, object_name, data, options = {})
33
33
  data = Fog::Storage.parse_data(data)
34
34
  headers = data[:headers].merge!(options)
35
- request({ :body => data[:body],
36
- :expects => 200,
37
-
35
+ request({
36
+ :body => data[:body],
37
+ :expects => 200,
38
38
  :headers => headers,
39
39
  :host => "#{bucket_name}.#{@host}",
40
40
  :idempotent => true,
@@ -17,15 +17,15 @@ module Fog
17
17
  # ==== See Also
18
18
  # http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html
19
19
 
20
- def put_object_url(bucket_name, object_name, expires)
20
+ def put_object_url(bucket_name, object_name, expires, headers = {})
21
21
  unless bucket_name
22
22
  raise ArgumentError.new('bucket_name is required')
23
23
  end
24
24
  unless object_name
25
25
  raise ArgumentError.new('object_name is required')
26
26
  end
27
- url({
28
- :headers => {},
27
+ https_url({
28
+ :headers => headers,
29
29
  :host => @host,
30
30
  :method => 'PUT',
31
31
  :path => "#{bucket_name}/#{object_name}"
@@ -36,15 +36,15 @@ module Fog
36
36
 
37
37
  class Mock # :nodoc:all
38
38
 
39
- def put_object_url(bucket_name, object_name, expires)
39
+ def put_object_url(bucket_name, object_name, expires, headers = {})
40
40
  unless bucket_name
41
41
  raise ArgumentError.new('bucket_name is required')
42
42
  end
43
43
  unless object_name
44
44
  raise ArgumentError.new('object_name is required')
45
45
  end
46
- url({
47
- :headers => {},
46
+ https_url({
47
+ :headers => headers,
48
48
  :host => @host,
49
49
  :method => 'PUT',
50
50
  :path => "#{bucket_name}/#{object_name}"
@@ -118,8 +118,9 @@ module Fog
118
118
  options.merge(metadata)
119
119
 
120
120
  data = connection.put_object(directory.key, key, body, options)
121
- merge_attributes(data.headers)
121
+ merge_attributes(data.headers.reject {|key, value| ['Content-Length', 'Content-Type'].include?(key)})
122
122
  self.content_length = Fog::Storage.get_body_size(body)
123
+ self.content_type ||= Fog::Storage.get_content_type(body)
123
124
  true
124
125
  end
125
126
 
@@ -14,15 +14,15 @@ module Fog
14
14
  # * response<~Excon::Response>:
15
15
  # * body<~String> - url for object
16
16
  #
17
- def put_object_url(bucket_name, object_name, expires)
17
+ def put_object_url(bucket_name, object_name, expires, headers = {})
18
18
  unless bucket_name
19
19
  raise ArgumentError.new('bucket_name is required')
20
20
  end
21
21
  unless object_name
22
22
  raise ArgumentError.new('object_name is required')
23
23
  end
24
- url({
25
- :headers => {},
24
+ https_url({
25
+ :headers => headers,
26
26
  :host => @host,
27
27
  :method => 'PUT',
28
28
  :path => "#{bucket_name}/#{object_name}"
@@ -33,15 +33,15 @@ module Fog
33
33
 
34
34
  class Mock
35
35
 
36
- def put_object_url(bucket_name, object_name, expires)
36
+ def put_object_url(bucket_name, object_name, expires, headers = {})
37
37
  unless bucket_name
38
38
  raise ArgumentError.new('bucket_name is required')
39
39
  end
40
40
  unless object_name
41
41
  raise ArgumentError.new('object_name is required')
42
42
  end
43
- url({
44
- :headers => {},
43
+ https_url({
44
+ :headers => headers,
45
45
  :host => @host,
46
46
  :method => 'PUT',
47
47
  :path => "#{bucket_name}/#{object_name}"
@@ -10,17 +10,18 @@ module Fog
10
10
 
11
11
  # Provisioning is very slow. We'll pass this arg explicitly until there's a way
12
12
  # to set the default timeout on a per-provider basis.
13
- TIMEOUT = 1800
14
13
 
15
- class Connection < Fog::Connection
14
+ def self.timeout
15
+ 1800
16
+ end
16
17
 
17
- ENDPOINT = 'https://www-147.ibm.com/computecloud/enterprise/api/rest/20100331'
18
+ class Connection < Fog::Connection
18
19
 
19
20
  def initialize(user, password)
20
21
  require 'multi_json'
21
22
  @user = user
22
23
  @password = password
23
- @endpoint = URI.parse(ENDPOINT)
24
+ @endpoint = URI.parse('https://www-147.ibm.com/computecloud/enterprise/api/rest/20100331')
24
25
  @base_path = @endpoint.path
25
26
  super("#{@endpoint.scheme}://#{@endpoint.host}:#{@endpoint.port}")
26
27
  end
@@ -20,6 +20,8 @@ module Fog
20
20
  collection :keys
21
21
  model :location
22
22
  collection :locations
23
+ model :vlan
24
+ collection :vlans
23
25
 
24
26
  request_path 'fog/ibm/requests/compute'
25
27
 
@@ -55,6 +55,15 @@ module Fog
55
55
  state == 'Available'
56
56
  end
57
57
 
58
+ def clone(name, description)
59
+ connection.clone_image(id, name, description).body['ImageID']
60
+ end
61
+
62
+ def destroy
63
+ requires :id
64
+ connection.delete_image(id).body['success']
65
+ end
66
+
58
67
  end
59
68
  end
60
69
  end
@@ -6,24 +6,24 @@ module Fog
6
6
 
7
7
  class Server < Fog::Compute::Server
8
8
 
9
- STATES = [
10
- "New", # => 0
11
- "Provisioning", # => 1
12
- "Failed", # => 2
13
- "Removed", # => 3
14
- "Rejected", # => 4
15
- "Active", # => 5
16
- "Unknown", # => 6
17
- "Deprovisioning", # => 7
18
- "Restarting", # => 8
19
- "Starting", # => 9
20
- "Stopping", # => 10
21
- "Stopped", # => 11
22
- "Deprovisioning pending", # => 12
23
- "Restart pending",# => 13
24
- "Attaching", # => 14
25
- "Detaching" # => 15
26
- ]
9
+ STATES = {
10
+ 0 => 'New',
11
+ 1 => 'Provisioning',
12
+ 2 => 'Failed',
13
+ 3 => 'Removed',
14
+ 4 => 'Rejected',
15
+ 5 => 'Active',
16
+ 6 => 'Unknown',
17
+ 7 => 'Deprovisioning',
18
+ 8 => 'Restarting',
19
+ 9 => 'Starting',
20
+ 10 => 'Stopping',
21
+ 11 => 'Stopped',
22
+ 12 => 'Deprovisioning pending',
23
+ 13 => 'Restart pending',
24
+ 14 => 'Attaching',
25
+ 15 => 'Detaching'
26
+ }
27
27
 
28
28
  identity :id
29
29
 
@@ -73,7 +73,7 @@ module Fog
73
73
  end
74
74
 
75
75
  def state
76
- STATES[attributes[:state].to_i]
76
+ STATES[attributes[:state]]
77
77
  end
78
78
 
79
79
  def ready?
@@ -104,7 +104,7 @@ module Fog
104
104
  requires :location_id
105
105
  new_ip = connection.addresses.new(:location => location_id)
106
106
  new_ip.save
107
- new_ip.wait_for(Fog::IBM::TIMEOUT) { ready? } if wait_for_ready
107
+ new_ip.wait_for(Fog::IBM.timeout) { ready? } if wait_for_ready
108
108
  secondary_ip << new_ip
109
109
  new_ip
110
110
  end
@@ -0,0 +1,15 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class IBM
6
+ class Vlan < Fog::Model
7
+
8
+ identity :id
9
+ attribute :name
10
+ attribute :location
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,28 @@
1
+ require 'fog/core/collection'
2
+ require 'fog/ibm/models/compute/vlan'
3
+
4
+ module Fog
5
+ module Compute
6
+ class IBM
7
+
8
+ class Vlans < Fog::Collection
9
+
10
+ model Fog::Compute::IBM::Vlan
11
+
12
+ def all
13
+ load(connection.list_vlans.body['vlan'])
14
+ end
15
+
16
+ def get(vlan_id)
17
+ begin
18
+ vlan = connection.list_vlans.body
19
+ new(vlan['vlan'].find{|vlan| vlan['id'] == vlan_id.to_s })
20
+ rescue Fog::Compute::IBM::NotFound
21
+ nil
22
+ end
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -5,23 +5,23 @@ module Fog
5
5
  class IBM
6
6
  class Volume < Fog::Model
7
7
 
8
- STATUS = [
9
- "New", # => 0
10
- "Creating", # => 1
11
- "Deleting", # => 2
12
- "Deleted", # => 3
13
- "Detached", # => 4
14
- "Attached", # => 5
15
- "Failed", # => 6
16
- "Deletion pending", # => 7
17
- "Being cloned", # => 8
18
- "Cloning", # => 9
19
- "Attaching", # => 10
20
- "Detaching", # => 11
21
- "Copying", # => 12
22
- "Importing", # => 13
23
- "Transfer retrying" # => 14
24
- ]
8
+ STATES = {
9
+ 0 => 'New',
10
+ 1 => 'Creating',
11
+ 2 => 'Deleting',
12
+ 3 => 'Deleted',
13
+ 4 => 'Detached',
14
+ 5 => 'Attached',
15
+ 6 => 'Failed',
16
+ 7 => 'Deletion pending',
17
+ 8 => 'Being cloned',
18
+ 9 => 'Cloning',
19
+ 10 => 'Attaching',
20
+ 11 => 'Detaching',
21
+ 12 => 'Copying',
22
+ 13 => 'Importing',
23
+ 14 => 'Transfer retrying',
24
+ }
25
25
 
26
26
  identity :id
27
27
 
@@ -36,9 +36,12 @@ module Fog
36
36
  attribute :location_id, :aliases => "location"
37
37
  attribute :product_codes, :aliases => "productCodes"
38
38
  attribute :format
39
+ attribute :storage_area, :aliases => 'storageArea'
40
+ attribute :platform_version, :aliases => 'platformVersion'
41
+ attribute :clone_status, :aliases => 'cloneStatus'
39
42
 
40
43
  def attached?
41
- status == "Attached"
44
+ state == "Attached"
42
45
  end
43
46
 
44
47
  def attach(instance_id)
@@ -73,8 +76,8 @@ module Fog
73
76
 
74
77
  # Are we ready to be attached to an instance?
75
78
  def ready?
76
- # TODO: Not sure if this is the only status we should be matching.
77
- status == "Detached"
79
+ # TODO: Not sure if this is the only state we should be matching.
80
+ state == "Detached"
78
81
  end
79
82
 
80
83
  def save
@@ -85,8 +88,8 @@ module Fog
85
88
  true
86
89
  end
87
90
 
88
- def status
89
- STATUS[attributes[:state].to_i]
91
+ def state
92
+ STATES[attributes[:state]]
90
93
  end
91
94
 
92
95
  end
@@ -33,7 +33,7 @@ module Fog
33
33
  response = Excon::Response.new
34
34
  if image_exists? image_id
35
35
  id = Fog::IBM::Mock.instance_id
36
- self.data[:images][id] = self.data[:images][image_id].dup
36
+ self.data[:images][id] = self.data[:images][image_id].merge('id' => id, 'name' => name, 'description' => description)
37
37
  response.status = 200
38
38
  response.body = { "ImageID" => id }
39
39
  else
@@ -34,15 +34,10 @@ module Fog
34
34
  def list_vlans
35
35
  response = Excon::Response.new
36
36
  response.status = 200
37
- response.body = {"addresses"=>
37
+ response.body = {"vlan"=>
38
38
  [{"location"=>"101",
39
- "mode"=>0,
40
- "offeringId"=>"20001223",
41
39
  "id"=>"75321",
42
- "type"=>1,
43
- "ip"=>"170.224.192.210 ",
44
- "hostname"=>"170.224.192.210 ",
45
- "state"=>2}]},
40
+ "name"=>"FOG-VLAN1"}]}
46
41
  response
47
42
  end
48
43
 
@@ -64,8 +64,9 @@ module Fog
64
64
  requires :body, :directory, :key
65
65
  options['Content-Type'] = content_type if content_type
66
66
  data = connection.put_object(directory.key, key, body, options)
67
- merge_attributes(data.headers)
67
+ merge_attributes(data.headers.reject {|key, value| ['Content-Length', 'Content-Type'].include?(key)})
68
68
  self.content_length = Fog::Storage.get_body_size(body)
69
+ self.content_type ||= Fog::Storage.get_content_type(body)
69
70
  true
70
71
  end
71
72
 
@@ -57,23 +57,24 @@ module Fog
57
57
  end
58
58
  end
59
59
 
60
- def self.parse_data(data)
61
- metadata = {
62
- :body => nil,
63
- :headers => {}
64
- }
65
-
66
- metadata[:body] = data
67
- metadata[:headers]['Content-Length'] = get_body_size(data)
68
-
60
+ def self.get_content_type(data)
69
61
  if data.respond_to?(:path) and !data.path.nil?
70
62
  filename = ::File.basename(data.path)
71
63
  unless (mime_types = MIME::Types.of(filename)).empty?
72
- metadata[:headers]['Content-Type'] = mime_types.first.content_type
64
+ mime_types.first.content_type
73
65
  end
74
66
  end
75
- # metadata[:headers]['Content-MD5'] = Base64.encode64(Digest::MD5.digest(metadata[:body])).strip
76
- metadata
67
+ end
68
+
69
+ def self.parse_data(data)
70
+ {
71
+ :body => data,
72
+ :headers => {
73
+ 'Content-Length' => get_body_size(data),
74
+ 'Content-Type' => get_content_type(data)
75
+ #'Content-MD5' => Base64.encode64(Digest::MD5.digest(metadata[:body])).strip
76
+ }
77
+ }
77
78
  end
78
79
 
79
80
  def self.providers
@@ -8,11 +8,23 @@ Shindo.tests("Fog::Dns[:aws] | record", ['aws', 'dns']) do
8
8
  params = { :name => @zone.domain, :type => 'A', :ttl => 3600, :value => ['1.2.3.4'] }
9
9
 
10
10
  model_tests(@zone.records, params, false) do
11
+
12
+ # Newly created records should have a change id
13
+ tests("#change_id") do
14
+ returns(true) { @instance.change_id != nil }
15
+ end
16
+
17
+ # Waits for changes to sync to all Route 53 DNS servers. Usually takes ~30 seconds to complete.
18
+ tests("#ready? - may take a minute to complete...").succeeds do
19
+ @instance.wait_for { ready? }
20
+ end
21
+
11
22
  tests("#modify") do
12
23
  new_value = ['5.5.5.5']
13
24
  returns(true) { @instance.modify(:value => new_value) }
14
25
  returns(new_value) { @instance.value }
15
26
  end
27
+
16
28
  end
17
29
 
18
30
  tests("zones#destroy").succeeds do
@@ -1,10 +1,25 @@
1
1
  Shindo.tests('Fog::Compute[:ibm] | image', ['ibm']) do
2
2
 
3
3
  @image_id = '20010001'
4
- @image = Fog::Compute[:ibm].images.get(@image_id)
4
+ @clone_name = 'fog-test-clone-image-' + Time.now.to_i.to_s(32)
5
5
 
6
6
  tests('success') do
7
7
 
8
+ tests("Fog::Compute[:ibm].images.get('#{@image_id}')") do
9
+ @image = Fog::Compute[:ibm].images.get(@image_id)
10
+ returns(@image_id) { @image.id }
11
+ end
12
+
13
+ tests("Fog::Compute::Image#clone") do
14
+ clone_id = @image.clone(@clone_name, @clone_name)
15
+ @clone = Fog::Compute[:ibm].images.get(clone_id)
16
+ returns(@clone_name) { @clone.name }
17
+ end
18
+
19
+ tests("Fog::Compute::Image#destroy") do
20
+ returns(true) { @clone.destroy }
21
+ end
22
+
8
23
  end
9
24
 
10
25
  end
@@ -32,7 +32,7 @@ Shindo.tests('Fog::Compute[:ibm] | server', ['ibm']) do
32
32
 
33
33
  tests('Fog::Compute::IBM::Server#wait_for { ready? }') do
34
34
  @server = Fog::Compute[:ibm].servers.get(@instance_id)
35
- @server.wait_for(Fog::IBM::TIMEOUT) { ready? }
35
+ @server.wait_for(Fog::IBM.timeout) { ready? }
36
36
  end
37
37
 
38
38
  tests('Fog::Compute::IBM::Server#id') do
@@ -43,7 +43,7 @@ Shindo.tests('Fog::Compute[:ibm] | server', ['ibm']) do
43
43
  returns(true) { @server.ready? }
44
44
  end
45
45
 
46
- tests('Fog::Compute::IBM::Server#status') do
46
+ tests('Fog::Compute::IBM::Server#state') do
47
47
  returns("Active") { @server.state }
48
48
  end
49
49
 
@@ -66,7 +66,7 @@ Shindo.tests('Fog::Compute[:ibm] | server', ['ibm']) do
66
66
  body = @server.to_image(:name => @server.name)
67
67
  returns(@server.name) { body['name'] }
68
68
  image = Fog::Compute[:ibm].images.get(body['id'])
69
- image.wait_for(Fog::IBM::TIMEOUT) { ready? || state == 'New' }
69
+ image.wait_for(Fog::IBM.timeout) { ready? || state == 'New' }
70
70
  unless image.state == 'Capturing'
71
71
  returns(true) { Fog::Compute[:ibm].delete_image(image.id).body['success'] }
72
72
  end
@@ -80,7 +80,7 @@ Shindo.tests('Fog::Compute[:ibm] | server', ['ibm']) do
80
80
  returns(true) { @server.destroy }
81
81
  end
82
82
 
83
- @key.wait_for(Fog::IBM::TIMEOUT) { instance_ids.empty? }
83
+ @key.wait_for(Fog::IBM.timeout) { instance_ids.empty? }
84
84
  @key.destroy
85
85
 
86
86
  end
@@ -21,12 +21,12 @@ Shindo.tests('Fog::Compute[:ibm] | servers', ['ibm']) do
21
21
  returns(@instance_id) { @server.id }
22
22
  end
23
23
 
24
- if @server.wait_for(Fog::IBM::TIMEOUT) { ready? }
24
+ if @server.wait_for(Fog::IBM.timeout) { ready? }
25
25
  @server.destroy
26
26
  else
27
27
  pending
28
28
  end
29
- if @key.wait_for(Fog::IBM::TIMEOUT) { instance_ids.empty? }
29
+ if @key.wait_for(Fog::IBM.timeout) { instance_ids.empty? }
30
30
  @key.destroy
31
31
  else
32
32
  pending
@@ -24,7 +24,7 @@ Shindo.tests('Fog::Storage[:ibm] | volume', ['ibm']) do
24
24
  tests('Fog::Storage::IBM::Volume#save') do
25
25
  returns(true) { @volume.save }
26
26
  returns(String) { @volume.id.class }
27
- @volume.wait_for(Fog::IBM::TIMEOUT) { ready? }
27
+ @volume.wait_for(Fog::IBM.timeout) { ready? }
28
28
  @volume_id = @volume.id
29
29
  end
30
30
 
@@ -47,8 +47,8 @@ Shindo.tests('Fog::Storage[:ibm] | volume', ['ibm']) do
47
47
  returns(true) { @volume.ready? }
48
48
  end
49
49
 
50
- tests('Fog::Storage::IBM::Volume#status') do
51
- returns("Detached") { @volume.status }
50
+ tests('Fog::Storage::IBM::Volume#state') do
51
+ returns("Detached") { @volume.state }
52
52
  end
53
53
 
54
54
  tests('Fog::Storage::IBM::Volume#destroy') do
@@ -35,7 +35,7 @@ Shindo.tests('Fog::Compute[:ibm] | address requests', ['ibm']) do
35
35
  end
36
36
 
37
37
  tests("#delete_address('#{@address_id}')") do
38
- Fog::Compute[:ibm].addresses.get(@address_id).wait_for(Fog::IBM::TIMEOUT) { ready? }
38
+ Fog::Compute[:ibm].addresses.get(@address_id).wait_for(Fog::IBM.timeout) { ready? }
39
39
  returns(true) { Fog::Compute[:ibm].delete_address(@address_id).body['success'] }
40
40
  end
41
41
 
@@ -80,7 +80,7 @@ Shindo.tests('Fog::Compute[:ibm] | image requests', ['ibm']) do
80
80
  :key_name => @key_name
81
81
  ).body
82
82
  @instance_id = response['instances'][0]['id']
83
- Fog::Compute[:ibm].servers.get(@instance_id).wait_for(Fog::IBM::TIMEOUT) { ready? }
83
+ Fog::Compute[:ibm].servers.get(@instance_id).wait_for(Fog::IBM.timeout) { ready? }
84
84
  data = Fog::Compute[:ibm].create_image(@instance_id, @image_name, "").body
85
85
  @id = data['id']
86
86
  data
@@ -100,9 +100,9 @@ Shindo.tests('Fog::Compute[:ibm] | image requests', ['ibm']) do
100
100
  end
101
101
 
102
102
  @server = Fog::Compute[:ibm].servers.get(@instance_id)
103
- @server.wait_for(Fog::IBM::TIMEOUT) { ready? }
103
+ @server.wait_for(Fog::IBM.timeout) { ready? }
104
104
  @server.destroy
105
- @key.wait_for(Fog::IBM::TIMEOUT) { instance_ids.empty? }
105
+ @key.wait_for(Fog::IBM.timeout) { instance_ids.empty? }
106
106
  @key.destroy
107
107
 
108
108
  end
@@ -53,7 +53,7 @@ Shindo.tests('Fog::Compute[:ibm] | instance requests', ['ibm']) do
53
53
  response = Fog::Compute[:ibm].get_instance(@instance_id).body
54
54
  end
55
55
 
56
- Fog::Compute[:ibm].servers.get(@instance_id).wait_for(Fog::IBM::TIMEOUT) { ready? }
56
+ Fog::Compute[:ibm].servers.get(@instance_id).wait_for(Fog::IBM.timeout) { ready? }
57
57
 
58
58
  tests("#list_instances").formats(@instances_format) do
59
59
  instances = Fog::Compute[:ibm].list_instances.body
@@ -74,14 +74,14 @@ Shindo.tests('Fog::Compute[:ibm] | instance requests', ['ibm']) do
74
74
  end
75
75
 
76
76
  tests("#delete_instance('#{@instance_id}')") do
77
- if Fog::Compute[:ibm].servers.get(@instance_id).wait_for(Fog::IBM::TIMEOUT) { ready? }
77
+ if Fog::Compute[:ibm].servers.get(@instance_id).wait_for(Fog::IBM.timeout) { ready? }
78
78
  data = Fog::Compute[:ibm].delete_instance(@instance_id)
79
79
  else
80
80
  pending
81
81
  end
82
82
  end
83
83
 
84
- if @key.wait_for(Fog::IBM::TIMEOUT) { instance_ids.empty? }
84
+ if @key.wait_for(Fog::IBM.timeout) { instance_ids.empty? }
85
85
  @key.destroy
86
86
  else
87
87
  pending
@@ -0,0 +1,21 @@
1
+ Shindo.tests('Fog::Compute[:ibm] | location requests', ['ibm']) do
2
+
3
+ @vlan_format = {
4
+ 'id' => String,
5
+ 'name' => String,
6
+ 'location' => String,
7
+ }
8
+
9
+ @vlans_format = {
10
+ 'vlan' => [ @vlan_format ]
11
+ }
12
+
13
+ tests('success') do
14
+
15
+ tests("#list_vlans").formats(@vlans_format) do
16
+ Fog::Compute[:ibm].list_vlans.body
17
+ end
18
+
19
+ end
20
+
21
+ end
@@ -82,7 +82,7 @@ Shindo.tests('Fog::Storage[:ibm] | volume requests', ['ibm']) do
82
82
  Fog::Compute[:ibm].delete_instance(@instance_id)
83
83
  end
84
84
 
85
- Fog::Storage[:ibm].volumes.get(@volume_id).wait_for(Fog::IBM::TIMEOUT) { ready? }
85
+ Fog::Storage[:ibm].volumes.get(@volume_id).wait_for(Fog::IBM.timeout) { ready? }
86
86
 
87
87
  tests("#delete_volume('#{@volume_id}')") do
88
88
  returns(true) { Fog::Storage[:ibm].delete_volume(@volume_id).body['success'] }
@@ -90,9 +90,9 @@ Shindo.tests('Fog::Storage[:ibm] | volume requests', ['ibm']) do
90
90
 
91
91
  # See above
92
92
  # @server = Fog::Compute[:ibm].servers.get(@instance_id)
93
- # @server.wait_for(Fog::IBM::TIMEOUT) { ready? }
93
+ # @server.wait_for(Fog::IBM.timeout) { ready? }
94
94
  # @server.destroy
95
- # @key.wait_for(Fog::IBM::TIMEOUT) { instance_ids.empty? }
95
+ # @key.wait_for(Fog::IBM.timeout) { instance_ids.empty? }
96
96
  # @key.destroy
97
97
 
98
98
  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: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-21 00:00:00.000000000Z
12
+ date: 2012-03-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
16
- requirement: &70269642732020 !ruby/object:Gem::Requirement
16
+ requirement: &70243822052300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70269642732020
24
+ version_requirements: *70243822052300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: excon
27
- requirement: &70269642730220 !ruby/object:Gem::Requirement
27
+ requirement: &70243822051380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 0.12.0
32
+ version: 0.13.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70269642730220
35
+ version_requirements: *70243822051380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: formatador
38
- requirement: &70269642625560 !ruby/object:Gem::Requirement
38
+ requirement: &70243822050700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70269642625560
46
+ version_requirements: *70243822050700
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: multi_json
49
- requirement: &70269642623060 !ruby/object:Gem::Requirement
49
+ requirement: &70243822049900 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '1.0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70269642623060
57
+ version_requirements: *70243822049900
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mime-types
60
- requirement: &70269642621220 !ruby/object:Gem::Requirement
60
+ requirement: &70243822049140 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70269642621220
68
+ version_requirements: *70243822049140
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: net-scp
71
- requirement: &70269642619920 !ruby/object:Gem::Requirement
71
+ requirement: &70243822047940 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.0.4
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70269642619920
79
+ version_requirements: *70243822047940
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: net-ssh
82
- requirement: &70269642617060 !ruby/object:Gem::Requirement
82
+ requirement: &70243822046380 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.1.3
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70269642617060
90
+ version_requirements: *70243822046380
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: nokogiri
93
- requirement: &70269642616460 !ruby/object:Gem::Requirement
93
+ requirement: &70243822044460 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.5.0
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70269642616460
101
+ version_requirements: *70243822044460
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: ruby-hmac
104
- requirement: &70269642615820 !ruby/object:Gem::Requirement
104
+ requirement: &70243822043860 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70269642615820
112
+ version_requirements: *70243822043860
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: jekyll
115
- requirement: &70269642615080 !ruby/object:Gem::Requirement
115
+ requirement: &70243822042580 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70269642615080
123
+ version_requirements: *70243822042580
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: rake
126
- requirement: &70269642614300 !ruby/object:Gem::Requirement
126
+ requirement: &70243822040880 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70269642614300
134
+ version_requirements: *70243822040880
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: rbvmomi
137
- requirement: &70269642608640 !ruby/object:Gem::Requirement
137
+ requirement: &70243822039140 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70269642608640
145
+ version_requirements: *70243822039140
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: rdoc
148
- requirement: &70269642607440 !ruby/object:Gem::Requirement
148
+ requirement: &70243822038080 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *70269642607440
156
+ version_requirements: *70243822038080
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: thor
159
- requirement: &70269642606600 !ruby/object:Gem::Requirement
159
+ requirement: &70243822034360 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *70269642606600
167
+ version_requirements: *70243822034360
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: rspec
170
- requirement: &70269642605120 !ruby/object:Gem::Requirement
170
+ requirement: &70243822033720 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ~>
@@ -175,10 +175,10 @@ dependencies:
175
175
  version: 1.3.1
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *70269642605120
178
+ version_requirements: *70243822033720
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: rbovirt
181
- requirement: &70269642603900 !ruby/object:Gem::Requirement
181
+ requirement: &70243822032760 !ruby/object:Gem::Requirement
182
182
  none: false
183
183
  requirements:
184
184
  - - ! '>='
@@ -186,10 +186,10 @@ dependencies:
186
186
  version: 0.0.9
187
187
  type: :development
188
188
  prerelease: false
189
- version_requirements: *70269642603900
189
+ version_requirements: *70243822032760
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: shindo
192
- requirement: &70269642602560 !ruby/object:Gem::Requirement
192
+ requirement: &70243822031720 !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
195
195
  - - ~>
@@ -197,10 +197,10 @@ dependencies:
197
197
  version: 0.3.4
198
198
  type: :development
199
199
  prerelease: false
200
- version_requirements: *70269642602560
200
+ version_requirements: *70243822031720
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: virtualbox
203
- requirement: &70269642600780 !ruby/object:Gem::Requirement
203
+ requirement: &70243822030620 !ruby/object:Gem::Requirement
204
204
  none: false
205
205
  requirements:
206
206
  - - ~>
@@ -208,10 +208,10 @@ dependencies:
208
208
  version: 0.9.1
209
209
  type: :development
210
210
  prerelease: false
211
- version_requirements: *70269642600780
211
+ version_requirements: *70243822030620
212
212
  - !ruby/object:Gem::Dependency
213
213
  name: fission
214
- requirement: &70269642580840 !ruby/object:Gem::Requirement
214
+ requirement: &70243822026740 !ruby/object:Gem::Requirement
215
215
  none: false
216
216
  requirements:
217
217
  - - ! '>='
@@ -219,7 +219,7 @@ dependencies:
219
219
  version: '0'
220
220
  type: :development
221
221
  prerelease: false
222
- version_requirements: *70269642580840
222
+ version_requirements: *70243822026740
223
223
  description: The Ruby cloud services library. Supports all major cloud providers including
224
224
  AWS, Rackspace, Linode, Blue Box, StormOnDemand, and many others. Full support for
225
225
  most AWS services including EC2, S3, CloudWatch, SimpleDB, ELB, and RDS.
@@ -1498,6 +1498,8 @@ files:
1498
1498
  - lib/fog/ibm/models/compute/locations.rb
1499
1499
  - lib/fog/ibm/models/compute/server.rb
1500
1500
  - lib/fog/ibm/models/compute/servers.rb
1501
+ - lib/fog/ibm/models/compute/vlan.rb
1502
+ - lib/fog/ibm/models/compute/vlans.rb
1501
1503
  - lib/fog/ibm/models/storage/offering.rb
1502
1504
  - lib/fog/ibm/models/storage/offerings.rb
1503
1505
  - lib/fog/ibm/models/storage/volume.rb
@@ -2439,6 +2441,7 @@ files:
2439
2441
  - tests/ibm/requests/compute/instance_tests.rb
2440
2442
  - tests/ibm/requests/compute/key_tests.rb
2441
2443
  - tests/ibm/requests/compute/location_tests.rb
2444
+ - tests/ibm/requests/compute/vlan_tests.rb
2442
2445
  - tests/ibm/requests/storage/volume_tests.rb
2443
2446
  - tests/joyent/requests/compute/datasets_tests.rb
2444
2447
  - tests/joyent/requests/compute/keys_tests.rb
@@ -2595,7 +2598,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
2595
2598
  version: '0'
2596
2599
  segments:
2597
2600
  - 0
2598
- hash: 3710907370766994265
2601
+ hash: 3422083743033756770
2599
2602
  required_rubygems_version: !ruby/object:Gem::Requirement
2600
2603
  none: false
2601
2604
  requirements:
@@ -2865,6 +2868,7 @@ test_files:
2865
2868
  - tests/ibm/requests/compute/instance_tests.rb
2866
2869
  - tests/ibm/requests/compute/key_tests.rb
2867
2870
  - tests/ibm/requests/compute/location_tests.rb
2871
+ - tests/ibm/requests/compute/vlan_tests.rb
2868
2872
  - tests/ibm/requests/storage/volume_tests.rb
2869
2873
  - tests/joyent/requests/compute/datasets_tests.rb
2870
2874
  - tests/joyent/requests/compute/keys_tests.rb