Class: Saklient::Cloud::Resources::GslbServer
- Inherits:
-
Object
- Object
- Saklient::Cloud::Resources::GslbServer
- Defined in:
- lib/saklient/cloud/resources/gslb_server.rb
Overview
GSLBの監視対象サーバ設定.
Instance Attribute Summary collapse
-
#enabled ⇒ bool
有効状態.
-
#ip_address ⇒ String
IPアドレス.
-
#weight ⇒ Fixnum
重み値.
Instance Method Summary collapse
- #get_enabled ⇒ bool
- #get_ip_address ⇒ String
- #get_weight ⇒ Fixnum
-
#initialize(obj = nil) ⇒ GslbServer
constructor
A new instance of GslbServer.
- #set_enabled(v) ⇒ bool
- #set_ip_address(v) ⇒ String
- #set_weight(v) ⇒ Fixnum
- #to_raw_settings ⇒ any
Constructor Details
#initialize(obj = nil) ⇒ GslbServer
Returns a new instance of GslbServer.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 124 def initialize(obj = nil) obj = {} if (obj).nil? enabled = Saklient::Util::get_by_path_any([obj], ['Enabled', 'enabled']) @_enabled = nil if !(enabled).nil? enabledStr = enabled @_enabled = enabledStr.downcase() == 'true' end @_ip_address = Saklient::Util::get_by_path_any([obj], [ 'IPAddress', 'ipAddress', 'ip_address', 'ip' ]) weight = Saklient::Util::get_by_path_any([obj], ['Weight', 'weight']) @_weight = nil @_weight = (weight).to_s().to_i(10) if !(weight).nil? @_weight = nil if @_weight == 0 end |
Instance Attribute Details
#enabled ⇒ bool
有効状態
40 41 42 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 40 def enabled @enabled end |
#ip_address ⇒ String
IPアドレス
76 77 78 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 76 def ip_address @ip_address end |
#weight ⇒ Fixnum
重み値
112 113 114 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 112 def weight @weight end |
Instance Method Details
#get_enabled ⇒ bool
24 25 26 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 24 def get_enabled return @_enabled end |
#get_ip_address ⇒ String
60 61 62 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 60 def get_ip_address return @_ip_address end |
#get_weight ⇒ Fixnum
96 97 98 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 96 def get_weight return @_weight end |
#set_enabled(v) ⇒ bool
31 32 33 34 35 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 31 def set_enabled(v) Saklient::Util::validate_type(v, 'bool') @_enabled = v return @_enabled end |
#set_ip_address(v) ⇒ String
67 68 69 70 71 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 67 def set_ip_address(v) Saklient::Util::validate_type(v, 'String') @_ip_address = v return @_ip_address end |
#set_weight(v) ⇒ Fixnum
103 104 105 106 107 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 103 def set_weight(v) Saklient::Util::validate_type(v, 'Fixnum') @_weight = v return @_weight end |
#to_raw_settings ⇒ any
145 146 147 148 149 150 151 |
# File 'lib/saklient/cloud/resources/gslb_server.rb', line 145 def to_raw_settings return { Enabled: (@_enabled).nil? ? nil : (@_enabled ? 'True' : 'False'), IPAddress: @_ip_address, Weight: @_weight } end |