class Saklient::Cloud::Resources::LbServer
ロードバランサの監視対象サーバ設定.
Attributes
@private @return [Fixnum]
@private @return [bool]
@private @return [String]
@private @return [String]
@private @return [Fixnum]
@private @return [String]
@private @return [Fixnum]
@private @return [String]
現在の接続数
@return [Fixnum]
有効状態
@return [bool]
IPアドレス
@return [String]
監視対象パス
@return [String]
ポート番号
@return [Fixnum]
監視方法
@return [String]
監視時に期待されるレスポンスコード
@return [Fixnum]
現在の状態
@return [String]
Public Class Methods
@private @param [any] obj
# File lib/saklient/cloud/resources/lb_server.rb, line 277 def initialize(obj = nil) obj = {} if (obj).nil? health = Saklient::Util::get_by_path_any([obj], [ 'HealthCheck', 'healthCheck', 'health_check', 'health' ]) 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' ]) @_protocol = Saklient::Util::get_by_path_any([health, obj], ['Protocol', 'protocol']) @_path_to_check = Saklient::Util::get_by_path_any([health, obj], [ 'Path', 'path', 'pathToCheck', 'path_to_check' ]) port = Saklient::Util::get_by_path_any([obj], ['Port', 'port']) @_port = nil @_port = (port).to_s().to_i(10) if !(port).nil? @_port = nil if @_port == 0 responseExpected = Saklient::Util::get_by_path_any([health, obj], [ 'Status', 'status', 'responseExpected', 'response_expected' ]) @_response_expected = nil @_response_expected = (responseExpected).to_s().to_i(10) if !(responseExpected).nil? @_response_expected = nil if @_response_expected == 0 @_active_connections = 0 @_status = nil end
Public Instance Methods
# File lib/saklient/cloud/resources/lb_server.rb, line 45 def enabled=(v) set_enabled(v) end
@private @return [Fixnum]
# File lib/saklient/cloud/resources/lb_server.rb, line 239 def get_active_connections return @_active_connections end
@private @return [bool]
# File lib/saklient/cloud/resources/lb_server.rb, line 23 def get_enabled return @_enabled end
@private @return [String]
# File lib/saklient/cloud/resources/lb_server.rb, line 59 def get_ip_address return @_ip_address end
@private @return [String]
# File lib/saklient/cloud/resources/lb_server.rb, line 167 def get_path_to_check return @_path_to_check end
@private @return [Fixnum]
# File lib/saklient/cloud/resources/lb_server.rb, line 95 def get_port return @_port end
@private @return [String]
# File lib/saklient/cloud/resources/lb_server.rb, line 131 def get_protocol return @_protocol end
@private @return [Fixnum]
# File lib/saklient/cloud/resources/lb_server.rb, line 203 def get_response_expected return @_response_expected end
@private @return [String]
# File lib/saklient/cloud/resources/lb_server.rb, line 262 def get_status return @_status end
# File lib/saklient/cloud/resources/lb_server.rb, line 81 def ip_address=(v) set_ip_address(v) end
# File lib/saklient/cloud/resources/lb_server.rb, line 189 def path_to_check=(v) set_path_to_check(v) end
# File lib/saklient/cloud/resources/lb_server.rb, line 117 def port=(v) set_port(v) end
# File lib/saklient/cloud/resources/lb_server.rb, line 153 def protocol=(v) set_protocol(v) end
# File lib/saklient/cloud/resources/lb_server.rb, line 225 def response_expected=(v) set_response_expected(v) end
@private @param [bool] v @return [bool]
# File lib/saklient/cloud/resources/lb_server.rb, line 30 def set_enabled(v) Saklient::Util::validate_type(v, 'bool') @_enabled = v return @_enabled end
@private @param [String] v @return [String]
# File lib/saklient/cloud/resources/lb_server.rb, line 66 def set_ip_address(v) Saklient::Util::validate_type(v, 'String') @_ip_address = v return @_ip_address end
@private @param [String] v @return [String]
# File lib/saklient/cloud/resources/lb_server.rb, line 174 def set_path_to_check(v) Saklient::Util::validate_type(v, 'String') @_path_to_check = v return @_path_to_check end
@private @param [Fixnum] v @return [Fixnum]
# File lib/saklient/cloud/resources/lb_server.rb, line 102 def set_port(v) Saklient::Util::validate_type(v, 'Fixnum') @_port = v return @_port end
@private @param [String] v @return [String]
# File lib/saklient/cloud/resources/lb_server.rb, line 138 def set_protocol(v) Saklient::Util::validate_type(v, 'String') @_protocol = v return @_protocol end
@private @param [Fixnum] v @return [Fixnum]
# File lib/saklient/cloud/resources/lb_server.rb, line 210 def set_response_expected(v) Saklient::Util::validate_type(v, 'Fixnum') @_response_expected = v return @_response_expected end
@return [any]
# File lib/saklient/cloud/resources/lb_server.rb, line 322 def to_raw_settings return { Enabled: (@_enabled).nil? ? nil : (@_enabled ? 'True' : 'False'), IPAddress: @_ip_address, Port: @_port, HealthCheck: { Protocol: @_protocol, Path: @_path_to_check, Status: @_response_expected } } end
@private @param [any] obj @return [LbServer]
# File lib/saklient/cloud/resources/lb_server.rb, line 338 def update_status(obj) connStr = obj[:ActiveConn] @_active_connections = 0 @_active_connections = (connStr).to_s().to_i(10) if !(connStr).nil? status = obj[:Status] @_status = (status).nil? ? nil : status.downcase() return self end