fog 0.0.78 → 0.0.79

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,69 +1,69 @@
1
1
  ---
2
- specs:
3
- - rake:
4
- version: 0.8.7
5
- - annals:
6
- version: 0.0.3
7
- - excon:
8
- version: 0.0.21
9
- - formatador:
10
- version: 0.0.13
11
- - json:
12
- version: 1.4.0
13
- - mime-types:
14
- version: "1.16"
15
- - net-ssh:
16
- version: 2.0.22
17
- - nokogiri:
18
- version: 1.4.1
19
- - rspec:
20
- version: 1.3.0
21
- - ruby-hmac:
22
- version: 0.4.0
23
- - shindo:
24
- version: 0.0.17
25
- hash: e443f12a9a7794f2ff4fc8e8d201b12b1e8b30bb
26
- sources:
27
- - Rubygems:
28
- uri: http://gemcutter.org
29
2
  dependencies:
30
3
  formatador:
31
- version: ">= 0.0.10"
32
4
  group:
33
5
  - :default
34
- nokogiri:
35
- version: ">= 0"
6
+ version: ">= 0.0.10"
7
+ rake:
36
8
  group:
37
9
  - :default
38
- rake:
39
10
  version: ">= 0"
11
+ ruby-hmac:
40
12
  group:
41
13
  - :default
42
- rspec:
43
14
  version: ">= 0"
15
+ mime-types:
44
16
  group:
45
17
  - :default
46
- ruby-hmac:
47
18
  version: ">= 0"
19
+ rspec:
48
20
  group:
49
21
  - :default
50
- mime-types:
51
22
  version: ">= 0"
23
+ net-ssh:
52
24
  group:
53
25
  - :default
54
- net-ssh:
55
26
  version: ">= 0"
27
+ json:
56
28
  group:
57
29
  - :default
58
- json:
59
30
  version: ">= 0"
31
+ excon:
60
32
  group:
61
33
  - :default
62
- excon:
63
34
  version: ">= 0.0.21"
35
+ shindo:
64
36
  group:
65
37
  - :default
66
- shindo:
67
38
  version: ">= 0"
39
+ nokogiri:
68
40
  group:
69
41
  - :default
42
+ version: ">= 0"
43
+ specs:
44
+ - rake:
45
+ version: 0.8.7
46
+ - annals:
47
+ version: 0.0.3
48
+ - excon:
49
+ version: 0.0.21
50
+ - formatador:
51
+ version: 0.0.13
52
+ - json:
53
+ version: 1.4.1
54
+ - mime-types:
55
+ version: "1.16"
56
+ - net-ssh:
57
+ version: 2.0.22
58
+ - nokogiri:
59
+ version: 1.4.1
60
+ - rspec:
61
+ version: 1.3.0
62
+ - ruby-hmac:
63
+ version: 0.4.0
64
+ - shindo:
65
+ version: 0.0.17
66
+ hash: e443f12a9a7794f2ff4fc8e8d201b12b1e8b30bb
67
+ sources:
68
+ - Rubygems:
69
+ uri: http://gemcutter.org
@@ -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.0.78'
11
- s.date = '2010-04-25'
10
+ s.version = '0.0.79'
11
+ s.date = '2010-04-26'
12
12
  s.rubyforge_project = 'fog'
13
13
 
14
14
  ## Make sure your summary is short. The description may be as long
@@ -263,10 +263,13 @@ Gem::Specification.new do |s|
263
263
  lib/fog/terremark/models/shared/servers.rb
264
264
  lib/fog/terremark/models/shared/task.rb
265
265
  lib/fog/terremark/models/shared/tasks.rb
266
+ lib/fog/terremark/models/shared/vdc.rb
267
+ lib/fog/terremark/models/shared/vdcs.rb
266
268
  lib/fog/terremark/parser.rb
267
269
  lib/fog/terremark/parsers/shared/get_catalog.rb
268
270
  lib/fog/terremark/parsers/shared/get_catalog_item.rb
269
271
  lib/fog/terremark/parsers/shared/get_internet_services.rb
272
+ lib/fog/terremark/parsers/shared/get_network_ips.rb
270
273
  lib/fog/terremark/parsers/shared/get_node_services.rb
271
274
  lib/fog/terremark/parsers/shared/get_organization.rb
272
275
  lib/fog/terremark/parsers/shared/get_organizations.rb
@@ -293,6 +296,7 @@ Gem::Specification.new do |s|
293
296
  lib/fog/terremark/requests/shared/get_catalog_item.rb
294
297
  lib/fog/terremark/requests/shared/get_internet_services.rb
295
298
  lib/fog/terremark/requests/shared/get_network.rb
299
+ lib/fog/terremark/requests/shared/get_network_ips.rb
296
300
  lib/fog/terremark/requests/shared/get_node_services.rb
297
301
  lib/fog/terremark/requests/shared/get_organization.rb
298
302
  lib/fog/terremark/requests/shared/get_organizations.rb
data/lib/fog.rb CHANGED
@@ -31,7 +31,7 @@ require 'fog/terremark'
31
31
 
32
32
  module Fog
33
33
 
34
- VERSION = '0.0.78'
34
+ VERSION = '0.0.79'
35
35
 
36
36
  module Mock
37
37
  @delay = 1
@@ -34,8 +34,6 @@ module Fog
34
34
  end
35
35
 
36
36
  def server=(new_server)
37
- requires :device
38
-
39
37
  if new_server
40
38
  attach(new_server)
41
39
  else
@@ -68,6 +66,7 @@ module Fog
68
66
  @server = new_server
69
67
  @availability_zone = new_server.availability_zone
70
68
  elsif new_server
69
+ requires :device
71
70
  @server = nil
72
71
  @server_id = new_server.id
73
72
  connection.attach_volume(@server_id, @id, @device)
@@ -15,6 +15,11 @@ module Fog
15
15
  attribute :fencemode
16
16
  attribute :links
17
17
 
18
+ def ips
19
+ #Until there is a real model for these ?
20
+ connection.get_network_ips(@id).body['IpAddresses']
21
+ end
22
+
18
23
  private
19
24
 
20
25
  def href=(new_href)
@@ -0,0 +1,35 @@
1
+ require 'fog/model'
2
+
3
+ module Fog
4
+ module Terremark
5
+ module Shared
6
+
7
+ class Vdc < Fog::Model
8
+
9
+ identity :id
10
+
11
+ attribute :name
12
+
13
+ def networks
14
+ connection.networks(:vdc_id => @id)
15
+ end
16
+
17
+ def addresses
18
+ connection.addresses(:vdc_id => @id)
19
+ end
20
+
21
+ private
22
+
23
+ def href=(new_href)
24
+ @id = new_href.split('/').last.to_i
25
+ end
26
+
27
+ def type=(new_type); end
28
+
29
+ def rel=(new_rel); end
30
+
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,52 @@
1
+ module Fog
2
+ module Terremark
3
+ module Shared
4
+
5
+ module Mock
6
+ def vdcs(options = {})
7
+ Fog::Terremark::Shared::Vdcs.new(options.merge(:connection => self))
8
+ end
9
+ end
10
+
11
+ module Real
12
+ def vdcs(options = {})
13
+ Fog::Terremark::Shared::Vdcs.new(options.merge(:connection => self))
14
+ end
15
+ end
16
+
17
+ class Vdcs < Fog::Collection
18
+
19
+ model Fog::Terremark::Shared::Vdc
20
+
21
+ def all
22
+ data = connection.get_organization(organization_id).body['Links'].select do |entity|
23
+ entity['type'] == 'application/vnd.vmware.vcloud.vdc+xml'
24
+ end
25
+ load(data)
26
+ end
27
+
28
+ def get(vdc_id)
29
+ if vdc_id && vdc = connection.get_vdc(vdc_id).body
30
+ new(vdc)
31
+ elsif !vdc_id
32
+ nil
33
+ end
34
+ rescue Excon::Errors::Forbidden
35
+ nil
36
+ end
37
+
38
+ def organization_id
39
+ @vdc_id ||= connection.default_organization_id
40
+ end
41
+
42
+ private
43
+
44
+ def organization_id=(new_organization_id)
45
+ @organization_id = new_organization_id
46
+ end
47
+
48
+ end
49
+
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,33 @@
1
+ module Fog
2
+ module Parsers
3
+ module Terremark
4
+ module Shared
5
+
6
+ class GetNetworkIps< Fog::Parsers::Base
7
+
8
+ def reset
9
+ @ip_address = {}
10
+ @response = { 'IpAddresses' => [] }
11
+ end
12
+
13
+ def start_element(name,attributes=[])
14
+ @value = ''
15
+ end
16
+
17
+ def end_element(name)
18
+ case name
19
+ when 'Name', 'Status', 'Server'
20
+ @ip_address[name.downcase] = @value
21
+ when 'IpAddress'
22
+ @response['IpAddresses'] << @ip_address
23
+ @ip_address = {}
24
+ end
25
+ end
26
+
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ end
33
+
@@ -11,9 +11,7 @@ module Fog
11
11
  # ==== Returns
12
12
  # * response<~Excon::Response>:
13
13
  # * body<~Hash>:
14
- # * 'PublicIpAddresses'<~Array>
15
- # * 'href'<~String> - linke to item
16
- # * 'name'<~String> - name of item
14
+ # FIXME
17
15
  def get_network(network_id)
18
16
  request(
19
17
  :expects => 200,
@@ -0,0 +1,40 @@
1
+ module Fog
2
+ module Terremark
3
+ module Shared
4
+ module Real
5
+
6
+ # Get details for a Network
7
+ #
8
+ # ==== Parameters
9
+ # * network_id<~Integer> - Id of the network to look up
10
+ #
11
+ # ==== Returns
12
+ # * response<~Excon::Response>:
13
+ # * body<~Hash>:
14
+ # FIXME
15
+ def get_network_ips(network_id)
16
+ opts = {
17
+ :expects => 200,
18
+ :method => 'GET',
19
+ :parser => Fog::Parsers::Terremark::Shared::GetNetworkIps.new,
20
+ :path => "network/#{network_id}/ipAddresses"
21
+ }
22
+ if self.is_a?(Fog::Terremark::Ecloud::Real)
23
+ opts[:path] = "/extensions/network/#{network_id}/ips"
24
+ end
25
+ request(opts)
26
+ end
27
+
28
+ end
29
+
30
+ module Mock
31
+
32
+ def get_network_ips(network_id)
33
+ raise MockNotImplemented.new("Contributions welcome!")
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+ end
40
+
@@ -87,9 +87,12 @@ module Fog
87
87
  require 'fog/terremark/models/shared/servers'
88
88
  require 'fog/terremark/models/shared/task'
89
89
  require 'fog/terremark/models/shared/tasks'
90
+ require 'fog/terremark/models/shared/vdc'
91
+ require 'fog/terremark/models/shared/vdcs'
90
92
  require 'fog/terremark/parsers/shared/get_catalog'
91
93
  require 'fog/terremark/parsers/shared/get_catalog_item'
92
94
  require 'fog/terremark/parsers/shared/get_internet_services'
95
+ require 'fog/terremark/parsers/shared/get_network_ips'
93
96
  require 'fog/terremark/parsers/shared/get_node_services'
94
97
  require 'fog/terremark/parsers/shared/get_organization'
95
98
  require 'fog/terremark/parsers/shared/get_organizations'
@@ -116,6 +119,7 @@ module Fog
116
119
  require 'fog/terremark/requests/shared/get_catalog_item'
117
120
  require 'fog/terremark/requests/shared/get_internet_services'
118
121
  require 'fog/terremark/requests/shared/get_network'
122
+ require 'fog/terremark/requests/shared/get_network_ips'
119
123
  require 'fog/terremark/requests/shared/get_node_services'
120
124
  require 'fog/terremark/requests/shared/get_organization'
121
125
  require 'fog/terremark/requests/shared/get_organizations'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 78
9
- version: 0.0.78
8
+ - 79
9
+ version: 0.0.79
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-04-25 00:00:00 -07:00
17
+ date: 2010-04-26 00:00:00 -07:00
18
18
  default_executable: fog
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -341,10 +341,13 @@ files:
341
341
  - lib/fog/terremark/models/shared/servers.rb
342
342
  - lib/fog/terremark/models/shared/task.rb
343
343
  - lib/fog/terremark/models/shared/tasks.rb
344
+ - lib/fog/terremark/models/shared/vdc.rb
345
+ - lib/fog/terremark/models/shared/vdcs.rb
344
346
  - lib/fog/terremark/parser.rb
345
347
  - lib/fog/terremark/parsers/shared/get_catalog.rb
346
348
  - lib/fog/terremark/parsers/shared/get_catalog_item.rb
347
349
  - lib/fog/terremark/parsers/shared/get_internet_services.rb
350
+ - lib/fog/terremark/parsers/shared/get_network_ips.rb
348
351
  - lib/fog/terremark/parsers/shared/get_node_services.rb
349
352
  - lib/fog/terremark/parsers/shared/get_organization.rb
350
353
  - lib/fog/terremark/parsers/shared/get_organizations.rb
@@ -371,6 +374,7 @@ files:
371
374
  - lib/fog/terremark/requests/shared/get_catalog_item.rb
372
375
  - lib/fog/terremark/requests/shared/get_internet_services.rb
373
376
  - lib/fog/terremark/requests/shared/get_network.rb
377
+ - lib/fog/terremark/requests/shared/get_network_ips.rb
374
378
  - lib/fog/terremark/requests/shared/get_node_services.rb
375
379
  - lib/fog/terremark/requests/shared/get_organization.rb
376
380
  - lib/fog/terremark/requests/shared/get_organizations.rb