class SoftLayer::NetworkStorageAllowedHost
Each SoftLayer NetworkStorageAllowedHost instance provides information about a hosts allowed access to a storage product group.
This class roughly corresponds to the entity SoftLayer_Network_Storage_Allowed_Host in the API.
Attributes
name[R]
The name of allowed host, usually an IQN or other identifier
Protected Class Methods
default_object_mask()
click to toggle source
# File lib/softlayer/NetworkStorageAllowedHost.rb, line 74 def self.default_object_mask { "mask(SoftLayer_Network_Storage_Allowed_Host)" => [ 'id', 'name' ] }.to_sl_object_mask end
Public Instance Methods
assigned_groups(force_update=false)
click to toggle source
Retrieve the NetworkStorageGroup instances assigned to this host
# File lib/softlayer/NetworkStorageAllowedHost.rb, line 21 sl_dynamic_attr :assigned_groups do |resource| resource.should_update? do #only retrieved once per instance @assigned_groups == nil end resource.to_update do assigned_groups = self.service.object_mask(NetworkStorageGroup.default_object_mask).getAssignedGroups assigned_groups.collect { |assigned_group| NetworkStorageGroup.new(softlayer_client, assigned_group) unless assigned_group.empty? }.compact end end
assigned_volumes(force_update=false)
click to toggle source
Retrieve the NetworkStorage instances assigned to this host
# File lib/softlayer/NetworkStorageAllowedHost.rb, line 37 sl_dynamic_attr :assigned_volumes do |resource| resource.should_update? do #only retrieved once per instance @assigned_volumes == nil end resource.to_update do assigned_volumes = self.service.object_mask(NetworkStorage.default_object_mask).getAssignedVolumes assigned_volumes.collect { |assigned_volume| NetworkStorage.new(softlayer_client, assigned_volume) unless assigned_volume.empty? }.compact end end
credential(force_update=false)
click to toggle source
Retrieve the NetworkStorageCredential instance used to access NetworkStorage for this host
# File lib/softlayer/NetworkStorageAllowedHost.rb, line 53 sl_dynamic_attr :credential do |resource| resource.should_update? do #only retrieved once per instance @credential == nil end resource.to_update do credential = self.service.object_mask(NetworkStorageCredential.default_object_mask).getCredential NetworkStorageCredential.new(softlayer_client, credential) unless credential.empty? end end
service()
click to toggle source
Returns the service for interacting with this network storage through the network API
# File lib/softlayer/NetworkStorageAllowedHost.rb, line 68 def service softlayer_client[:Network_Storage_Allowed_Host].object_with_id(self.id) end