Class: SoftLayer::NetworkService
- Includes:
- DynamicAttribute
- Defined in:
- lib/softlayer/NetworkService.rb
Overview
Each SoftLayer NetworkService instance provides connectivity information for a specific Network Service Resource.
This class roughly corresponds to the entity SoftLayer_Network_Service_Resource in the API.
Instance Attribute Summary
Attributes inherited from ModelBase
Instance Method Summary collapse
-
#api ⇒ Object
Returns the api properties used to connect to the network service resource.
-
#datacenter ⇒ Object
Retrieve the datacenter that this network service resource is available in :call-seq: datacenter(force_update=false).
-
#name ⇒ Object
:attr_reader: The name associated with this resource.
-
#private_ip ⇒ Object
:attr_reader: private_ip The backend IP address for this resource.
-
#public_ip ⇒ Object
:attr_reader: public_ip The frontend IP address for this resource.
-
#ssh_username ⇒ Object
:attr_reader: ssh_username The ssh username of for this resource.
-
#type ⇒ Object
Returns the network service resource type name.
Methods included from DynamicAttribute
Methods inherited from ModelBase
#[], #has_sl_property?, #initialize, #refresh_details, #service, sl_attr, #to_ary
Constructor Details
This class inherits a constructor from SoftLayer::ModelBase
Instance Method Details
#api ⇒ Object
Returns the api properties used to connect to the network service resource
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/softlayer/NetworkService.rb', line 56 def api { 'host' => self['apiHost'], 'password' => self['apiPassword'], 'path' => self['apiPath'], 'port' => self['apiPort'], 'protocol' => self['apiProtocol'], 'username' => self['apiUsername'] } end |
#datacenter ⇒ Object
Retrieve the datacenter that this network service resource is available in :call-seq:
datacenter(force_update=false)
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/softlayer/NetworkService.rb', line 42 sl_dynamic_attr :datacenter do |resource| resource.should_update? do #only retrieved once per instance @datacenter == nil end resource.to_update do Datacenter::datacenter_named(self['datacenter']['name'], self.softlayer_client) end end |
#name ⇒ Object
:attr_reader: The name associated with this resource
21 |
# File 'lib/softlayer/NetworkService.rb', line 21 sl_attr :name |
#private_ip ⇒ Object
:attr_reader: private_ip The backend IP address for this resource
26 |
# File 'lib/softlayer/NetworkService.rb', line 26 sl_attr :private_ip, 'backendIpAddress' |
#public_ip ⇒ Object
:attr_reader: public_ip The frontend IP address for this resource
31 |
# File 'lib/softlayer/NetworkService.rb', line 31 sl_attr :public_ip, 'frontendIpAddress' |
#ssh_username ⇒ Object
:attr_reader: ssh_username The ssh username of for this resource
36 |
# File 'lib/softlayer/NetworkService.rb', line 36 sl_attr :ssh_username, 'sshUsername' |
#type ⇒ Object
Returns the network service resource type name
70 71 72 |
# File 'lib/softlayer/NetworkService.rb', line 70 def type self['type']['type'] end |