Class: SoftLayer::NetworkStorageGroup

Inherits:
ModelBase
  • Object
show all
Includes:
DynamicAttribute
Defined in:
lib/softlayer/NetworkStorageGroup.rb

Overview

Each SoftLayer NetworkStorageGroup instance provides information about a storage product group and hosts allowed access.

This class roughly corresponds to the entity SoftLayer_Network_Storage_Group in the API.

Instance Attribute Summary

Attributes inherited from ModelBase

#softlayer_client

Instance Method Summary collapse

Methods included from DynamicAttribute

included

Methods inherited from ModelBase

#[], #has_sl_property?, #initialize, #refresh_details, sl_attr, #to_ary

Constructor Details

This class inherits a constructor from SoftLayer::ModelBase

Instance Method Details

#accountObject

Retrieve the SoftLayer_Account which owns this group. :call-seq:

(force_update=false)


45
46
47
48
49
50
51
52
53
54
55
# File 'lib/softlayer/NetworkStorageGroup.rb', line 45

sl_dynamic_attr :account do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @account == nil
  end

  resource.to_update do
     = self.service.getAccount
    Account.new(softlayer_client, ) unless .empty?
  end
end

#aliasObject

:attr_reader: The friendly name of this group



15
# File 'lib/softlayer/NetworkStorageGroup.rb', line 15

sl_attr :alias

#allowed_hostsObject

Retrieve the allowed hosts list for this group. :call-seq:

allowed_hosts(force_update=false)


61
62
63
64
65
66
67
68
69
70
71
# File 'lib/softlayer/NetworkStorageGroup.rb', line 61

sl_dynamic_attr :allowed_hosts do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @allowed_hosts == nil
  end

  resource.to_update do
    allowed_hosts = self.service.object_mask(NetworkStorageAllowedHost.default_object_mask).getAllowedHosts
    allowed_hosts.collect { |allowed_host| NetworkStorageAllowedHost.new(softlayer_client, allowed_host) unless allowed_host.empty? }.compact
  end
end

#attached_volumesObject

Retrieve the network storage volumes this group is attached to. :call-seq:

attached_volumes(force_update=false)


77
78
79
80
81
82
83
84
85
86
87
# File 'lib/softlayer/NetworkStorageGroup.rb', line 77

sl_dynamic_attr :attached_volumes do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @attached_volumes == nil
  end

  resource.to_update do
    attached_volumes = self.service.object_mask(NetworkStorage.default_object_mask).getAttachedVolumes
    attached_volumes.collect { |attached_volume| NetworkStorage.new(softlayer_client, attached_volume) unless attached_volume.empty? }.compact
  end
end

#createdObject

:attr_reader: created The date this group was created. DEPRECATION WARNING: This attribute is deprecated in favor of created_at and will be removed in the next major release.



27
# File 'lib/softlayer/NetworkStorageGroup.rb', line 27

sl_attr :created, 'createDate'

#created_atObject

:attr_reader: created_at The date this group was created.



20
# File 'lib/softlayer/NetworkStorageGroup.rb', line 20

sl_attr :created_at, 'createDate'

#ip_addressObject

Retrieve the IP address for for SoftLayer_Network_Storage_Allowed_Host objects within this group. :call-seq:

ip_address(force_update=false)


93
94
95
96
97
98
99
100
101
102
103
# File 'lib/softlayer/NetworkStorageGroup.rb', line 93

sl_dynamic_attr :ip_address do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @ip_address == nil
  end

  resource.to_update do
    network_connection_details = self.service.getNetworkConnectionDetails
    network_connection_details["ipAddress"] unless network_connection_details.empty?
  end
end

#modifiedObject

:attr_reader: modified The date this group was modified. DEPRECATION WARNING: This attribute is deprecated in favor of modified_at and will be removed in the next major release.



39
# File 'lib/softlayer/NetworkStorageGroup.rb', line 39

sl_attr :modified, 'modifyDate'

#modified_atObject

:attr_reader: modified_at The date this group was modified.



32
# File 'lib/softlayer/NetworkStorageGroup.rb', line 32

sl_attr :modified_at, 'modifyDate'

#os_descriptionObject

Retrieve the description of the SoftLayer_Network_Storage_OS_Type Operating System designation that this group was created for. :call-seq:

os_description(force_update=false)


110
111
112
113
114
115
116
117
118
119
120
# File 'lib/softlayer/NetworkStorageGroup.rb', line 110

sl_dynamic_attr :os_description do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @os_description == nil
  end

  resource.to_update do
    os_type = self.service.getOsType
    os_type["description"] unless os_type.empty?
  end
end

#os_nameObject

Retrieve the name of the SoftLayer_Network_Storage_OS_Type Operating System designation that this group was created for. :call-seq:

os_name(force_update=false)


127
128
129
130
131
132
133
134
135
136
137
# File 'lib/softlayer/NetworkStorageGroup.rb', line 127

sl_dynamic_attr :os_name do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @os_name == nil
  end

  resource.to_update do
    os_type = self.service.getOsType
    os_type["name"] unless os_type.empty?
  end
end

#serviceObject

Returns the service for interacting with this network storage through the network API



174
175
176
# File 'lib/softlayer/NetworkStorageGroup.rb', line 174

def service
  softlayer_client[:Network_Storage_Group].object_with_id(self.id)
end

#service_resourceObject

Retrieve the network resource this group is created on. :call-seq:

service_resource(force_update=false)


143
144
145
146
147
148
149
150
151
152
153
# File 'lib/softlayer/NetworkStorageGroup.rb', line 143

sl_dynamic_attr :service_resource do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @service_resource == nil
  end

  resource.to_update do
    service_resource = self.service.object_mask(NetworkService.default_object_mask).getServiceResource
    NetworkService.new(softlayer_client, service_resource) unless service_resource.empty?
  end
end

#typeObject

Retrieve the name of the SoftLayer_Network_Storage_Group_Type which describes this group. :call-seq:

type(force_update=false)


159
160
161
162
163
164
165
166
167
168
169
# File 'lib/softlayer/NetworkStorageGroup.rb', line 159

sl_dynamic_attr :type do |resource|
  resource.should_update? do
    #only retrieved once per instance
    @type == nil
  end

  resource.to_update do
    group_type = self.service.getGroupType
    group_type["name"]
  end
end