fog-softlayer 0.3.15 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjM3ZjY0NjYzYjg4ZmQ3YjA1MDUzODVmNDk3OWQwMjhiNWI0ZDE3Nw==
4
+ NmQwNjc3NzUzZWIwY2I2YTcwYjNjYzA5ZDFjNGRhYWI1ZmIxOWZlMA==
5
5
  data.tar.gz: !binary |-
6
- NGUzN2I2ZmFhZjk3MjU2Y2IxZmNlOGM2ZGFmNjY3MTFkMDhlMjRkOQ==
6
+ ZjNkZGM0NmM4ODhiMzY0ZjhmZDkxMjNmMTNiMGI2YjcxYmM5Zjk0MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmRhZjg5Mjc4ZGE0MjRkYTAwMmI1ZDdhM2NjZWMwYjAyOGRkOGE0Y2MyZDQ1
10
- MWQyYzBjMTdlODQ4NWIwMTllMTMxNTRkNDYxZDcwZjIyNDY1ZTUwNDVkODQ4
11
- NzQxZjI1ZjQ1NGNhNDljODk4NTM5MjNhYmM4ZjEyNmNiNmE5NzI=
9
+ OTQ2ZGIxMDEyYzkzMDk4MzVlNmZmMDM5ZjgzM2YxMTJiZGQ2NjMwOGNjYWU1
10
+ MjVjNTZmMDk3ZDM2ZGZkODM5ZThlZDkxYzgxMGIzYWRkNmUzMTk2NTZhMjA3
11
+ YjgwOTFhNGNiYzA5ODA3NGQ2NTM2OTJhNmQ4ZTZmZjNjOTcwMjQ=
12
12
  data.tar.gz: !binary |-
13
- ZDNiMGJiNTUyZDgzODZjN2QwZTRkOTRkNDU1NjczOTNiZDc0MGU5MGRhOGU5
14
- ZDgyZTY0Zjk0MzU4MGEwMTM2OTA0ZTkxNDgyZjA2NDg1ZDU0MDIzNGNlMjg0
15
- ZTRlNWI1M2RiNmI0ZDg1Y2UzNjBkZGQzMTk4ZjgyMjRmNmI3MWU=
13
+ MGJkMGJkYzZlMWVhMjg0NTVlNGJlYjI5ZDFhMzU3YjgzYzRjM2NlYTdkODgy
14
+ MDU2MTg2ZGM5OTZmOGI5YzEyODBmODc5NGM0MWJiYzYzN2ZlYzE3MGZiNTBl
15
+ Yjk2YTY3ZWUxZGIyNTBkN2UwODI1NzhjMTlkYmEyNzg2NjUzYzk=
@@ -27,6 +27,8 @@ module Fog
27
27
  model :image
28
28
  collection :key_pairs
29
29
  model :key_pair
30
+ collection :network_components
31
+ model :network_component
30
32
  collection :servers
31
33
  model :server
32
34
  collection :tags
@@ -0,0 +1,44 @@
1
+ #
2
+ # Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
3
+ # © Copyright IBM Corporation 2014.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ require 'fog/core/model'
9
+
10
+ module Fog
11
+ module Compute
12
+ class Softlayer
13
+ class NetworkComponent < Fog::Model
14
+ identity :id
15
+
16
+ attribute :name
17
+ attribute :port
18
+ attribute :mac_address, :aliases => 'macAddress'
19
+ attribute :max_speed, :aliases => 'maxSpeed'
20
+ attribute :modify_date, :aliases => 'modifyDate'
21
+ attribute :status
22
+ attribute :speed
23
+ attribute :primary_ip_address, :aliases => 'primaryIpAddress'
24
+
25
+ def save
26
+ raise "#{self.class.name} objects are readonly."
27
+ end
28
+
29
+ def create
30
+ raise "#{self.class.name} objects are readonly."
31
+ end
32
+
33
+ def update
34
+ raise "#{self.class.name} objects are readonly."
35
+ end
36
+
37
+ def destroy
38
+ raise "#{self.class.name} objects are readonly."
39
+ end
40
+
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,22 @@
1
+ #
2
+ # Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
3
+ # © Copyright IBM Corporation 2014.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ require 'fog/core/collection'
9
+ require 'fog/softlayer/models/compute/key_pair'
10
+
11
+ module Fog
12
+ module Compute
13
+ class Softlayer
14
+ class NetworkComponents < Fog::Collection
15
+ model Fog::Compute::Softlayer::NetworkComponent
16
+
17
+ # just a stub
18
+
19
+ end
20
+ end
21
+ end
22
+ end
@@ -28,6 +28,7 @@ module Fog
28
28
  attribute :image_id
29
29
  attribute :ephemeral_storage, :aliases => 'localDiskFlag'
30
30
  attribute :key_pairs, :aliases => 'sshKeys'
31
+ attribute :network_components
31
32
 
32
33
  # Times
33
34
  attribute :created_at, :aliases => ['createDate', 'provisionDate'], :type => :time
@@ -129,6 +130,14 @@ module Fog
129
130
  if self.key_pairs
130
131
  attributes[:key_pairs].map! { |key| { :id => key.id } }
131
132
  end
133
+ if self.network_components
134
+ self.network_components = self.network_components.map do |component|
135
+ component[:maxSpeed] = component.delete(:speed) if component[:speed]
136
+ component[:maxSpeed] = component.delete(:max_speed) if component[:max_speed]
137
+ component
138
+ end
139
+ end
140
+
132
141
  remap_attributes(attributes, attributes_mapping)
133
142
  clean_attributes
134
143
  end
@@ -202,6 +211,30 @@ module Fog
202
211
  attributes[:user_data]
203
212
  end
204
213
 
214
+ def network_components
215
+ if id
216
+ (public_network_components << private_network_components).flatten
217
+ else
218
+ attributes[:network_components]
219
+ end
220
+ end
221
+
222
+ def public_network_components
223
+ if attributes['frontendNetworkComponents']
224
+ attributes['frontendNetworkComponents'].map { |n| Fog::Compute::Softlayer::NetworkComponent.new(n) }
225
+ else
226
+ []
227
+ end
228
+ end
229
+
230
+ def private_network_components
231
+ if attributes['backendNetworkComponents']
232
+ attributes['backendNetworkComponents'].map { |n| Fog::Compute::Softlayer::NetworkComponent.new(n) }
233
+ else
234
+ []
235
+ end
236
+ end
237
+
205
238
  def ready?
206
239
  if bare_metal?
207
240
  state == "on"
@@ -311,7 +344,8 @@ module Fog
311
344
  :private_vlan => :primaryBackendNetworkComponent,
312
345
  :key_pairs => :sshKeys,
313
346
  :private_network_only => :privateNetworkOnlyFlag,
314
- :user_data => :userData
347
+ :user_data => :userData,
348
+ :network_components => :networkComponents,
315
349
  }
316
350
 
317
351
  conditional = if bare_metal?
@@ -26,7 +26,7 @@ module Fog
26
26
 
27
27
  class Real
28
28
  def get_bare_metal_server(identifier)
29
- request(:hardware_server, identifier, :expected => [200, 404], :query => 'objectMask=mask[datacenter,tagReferences,memory,provisionDate,processorCoreAmount,hardDrives,datacenter,hourlyBillingFlag,operatingSystem.softwareLicense.softwareDescription.referenceCode,sshKeys.id,privateNetworkOnlyFlag,userData]')
29
+ request(:hardware_server, identifier, :expected => [200, 404], :query => 'objectMask=mask[datacenter,tagReferences,memory,provisionDate,processorCoreAmount,hardDrives,datacenter,hourlyBillingFlag,operatingSystem.softwareLicense.softwareDescription.referenceCode,sshKeys.id,privateNetworkOnlyFlag,userData,frontendNetworkComponents,backendNetworkComponents]')
30
30
  end
31
31
  end
32
32
  end
@@ -20,7 +20,7 @@ module Fog
20
20
 
21
21
  class Real
22
22
  def get_bare_metal_servers
23
- request(:account, :get_hardware, :query => 'objectMask=mask[datacenter,tagReferences,memory,processorCoreAmount,hardDrives,datacenter,hourlyBillingFlag,operatingSystem.softwareLicense.softwareDescription.referenceCode,sshKeys.id,privateNetworkOnlyFlag,userData]')
23
+ request(:account, :get_hardware, :query => 'objectMask=mask[datacenter,tagReferences,memory,processorCoreAmount,hardDrives,datacenter,hourlyBillingFlag,operatingSystem.softwareLicense.softwareDescription.referenceCode,sshKeys.id,privateNetworkOnlyFlag,userData,frontendNetworkComponents,backendNetworkComponents]')
24
24
  end
25
25
  end
26
26
  end
@@ -26,7 +26,7 @@ module Fog
26
26
 
27
27
  class Real
28
28
  def get_vm(identifier)
29
- request(:virtual_guest, identifier, :expected => [200, 404], :query => 'objectMask=mask[datacenter,tagReferences,blockDevices,blockDeviceTemplateGroup.globalIdentifier,operatingSystem.softwareLicense.softwareDescription.referenceCode,sshKeys.id,privateNetworkOnlyFlag,userData]')
29
+ request(:virtual_guest, identifier, :expected => [200, 404], :query => 'objectMask=mask[datacenter,tagReferences,blockDevices,blockDeviceTemplateGroup.globalIdentifier,operatingSystem.softwareLicense.softwareDescription.referenceCode,sshKeys.id,privateNetworkOnlyFlag,userData,frontendNetworkComponents,backendNetworkComponents]')
30
30
  end
31
31
  end
32
32
  end
@@ -20,7 +20,7 @@ module Fog
20
20
 
21
21
  class Real
22
22
  def get_vms
23
- request(:account, :get_virtual_guests, :query => 'objectMask=mask[datacenter,tagReferences,blockDevices,blockDeviceTemplateGroup.globalIdentifier,operatingSystem.softwareLicense.softwareDescription.referenceCode,primaryNetworkComponent.networkVlan,sshKeys.id,privateNetworkOnlyFlag,userData]')
23
+ request(:account, :get_virtual_guests, :query => 'objectMask=mask[datacenter,tagReferences,blockDevices,blockDeviceTemplateGroup.globalIdentifier,operatingSystem.softwareLicense.softwareDescription.referenceCode,primaryNetworkComponent.networkVlan,sshKeys.id,privateNetworkOnlyFlag,userData,frontendNetworkComponents,backendNetworkComponents]')
24
24
  end
25
25
  end
26
26
  end
@@ -7,6 +7,6 @@
7
7
 
8
8
  module Fog
9
9
  module Softlayer
10
- VERSION = "0.3.15"
10
+ VERSION = "0.3.16"
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-softlayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.15
4
+ version: 0.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Eldridge
@@ -219,6 +219,8 @@ files:
219
219
  - lib/fog/softlayer/models/compute/images.rb
220
220
  - lib/fog/softlayer/models/compute/key_pair.rb
221
221
  - lib/fog/softlayer/models/compute/key_pairs.rb
222
+ - lib/fog/softlayer/models/compute/network_component.rb
223
+ - lib/fog/softlayer/models/compute/network_components.rb
222
224
  - lib/fog/softlayer/models/compute/server.rb
223
225
  - lib/fog/softlayer/models/compute/servers.rb
224
226
  - lib/fog/softlayer/models/compute/tag.rb