saklient 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c8d94e9f3de0cbb81a439c7ec8635499bd6847a
|
4
|
+
data.tar.gz: 01f810508d8cc60a666ebb3615876a087ed5a484
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5506de61e5462b1677ff9bd122240501511fe247575008a8f7e523b7d301b12ee9682af102f6ca271c72020b91ceaa5fdba03a41e76c654ced1eddd0fae5e4fd
|
7
|
+
data.tar.gz: 6e7dd71ce64c6c2900d8cc6ea4b837d4be5c5b61143c13aed8f58da7e9027ceb9e2947ff7212b8aee2b06be1a3d2a83a1ce72dcccd7eba93257af116e3f52c4a
|
@@ -78,7 +78,7 @@ module Saklient
|
|
78
78
|
|
79
79
|
extra_headers = {
|
80
80
|
'Content-Type' => 'application/x-www-form-urlencoded',
|
81
|
-
'User-Agent' => 'saklient.ruby ver-0.0.
|
81
|
+
'User-Agent' => 'saklient.ruby ver-0.0.9 rev-bab628f6f4c2a9d37b38c634b4a514cb66467939',
|
82
82
|
'X-Requested-With' => 'XMLHttpRequest',
|
83
83
|
'X-Sakura-HTTP-Method' => method,
|
84
84
|
'X-Sakura-Error-Level' => 'warning',
|
@@ -51,6 +51,10 @@ module Saklient
|
|
51
51
|
# @return [any]
|
52
52
|
attr_accessor :m_raw_settings
|
53
53
|
|
54
|
+
# @private
|
55
|
+
# @return [String]
|
56
|
+
attr_accessor :m_raw_settings_hash
|
57
|
+
|
54
58
|
# ステータスの生データ
|
55
59
|
#
|
56
60
|
# @return [any]
|
@@ -115,6 +119,13 @@ module Saklient
|
|
115
119
|
|
116
120
|
protected
|
117
121
|
|
122
|
+
# @private
|
123
|
+
# @param [any] query
|
124
|
+
# @return [void]
|
125
|
+
def _on_before_save(query)
|
126
|
+
Saklient::Util::set_by_path(query, 'OriginalSettingsHash', get_raw_settings_hash)
|
127
|
+
end
|
128
|
+
|
118
129
|
# @return [bool]
|
119
130
|
attr_accessor :n_id
|
120
131
|
|
@@ -364,6 +375,29 @@ module Saklient
|
|
364
375
|
|
365
376
|
protected
|
366
377
|
|
378
|
+
# @return [bool]
|
379
|
+
attr_accessor :n_raw_settings_hash
|
380
|
+
|
381
|
+
# (This method is generated in Translator_default#buildImpl)
|
382
|
+
#
|
383
|
+
# @private
|
384
|
+
# @return [String]
|
385
|
+
def get_raw_settings_hash
|
386
|
+
return @m_raw_settings_hash
|
387
|
+
end
|
388
|
+
|
389
|
+
public
|
390
|
+
|
391
|
+
# @private
|
392
|
+
# @return [String]
|
393
|
+
attr_reader :raw_settings_hash
|
394
|
+
|
395
|
+
def raw_settings_hash
|
396
|
+
get_raw_settings_hash
|
397
|
+
end
|
398
|
+
|
399
|
+
protected
|
400
|
+
|
367
401
|
# @return [bool]
|
368
402
|
attr_accessor :n_raw_status
|
369
403
|
|
@@ -453,6 +487,13 @@ module Saklient
|
|
453
487
|
@is_incomplete = true
|
454
488
|
end
|
455
489
|
@n_raw_settings = false
|
490
|
+
if Saklient::Util::exists_path(r, 'SettingsHash')
|
491
|
+
@m_raw_settings_hash = (Saklient::Util::get_by_path(r, 'SettingsHash')).nil? ? nil : Saklient::Util::get_by_path(r, 'SettingsHash').to_s
|
492
|
+
else
|
493
|
+
@m_raw_settings_hash = nil
|
494
|
+
@is_incomplete = true
|
495
|
+
end
|
496
|
+
@n_raw_settings_hash = false
|
456
497
|
if Saklient::Util::exists_path(r, 'Status')
|
457
498
|
@m_raw_status = Saklient::Util::get_by_path(r, 'Status')
|
458
499
|
else
|
@@ -487,6 +528,7 @@ module Saklient
|
|
487
528
|
Saklient::Util::set_by_path(ret, 'Icon', withClean ? ((@m_icon).nil? ? nil : @m_icon.api_serialize(withClean)) : ((@m_icon).nil? ? { ID: '0' } : @m_icon.api_serialize_id)) if withClean || @n_icon
|
488
529
|
Saklient::Util::set_by_path(ret, 'CommonServiceProvider', withClean ? ((@m_provider).nil? ? nil : @m_provider.api_serialize(withClean)) : ((@m_provider).nil? ? { ID: '0' } : @m_provider.api_serialize_id)) if withClean || @n_provider
|
489
530
|
Saklient::Util::set_by_path(ret, 'Settings', @m_raw_settings) if withClean || @n_raw_settings
|
531
|
+
Saklient::Util::set_by_path(ret, 'SettingsHash', @m_raw_settings_hash) if withClean || @n_raw_settings_hash
|
490
532
|
Saklient::Util::set_by_path(ret, 'Status', @m_raw_status) if withClean || @n_raw_status
|
491
533
|
raise Saklient::Errors::SaklientException.new('required_field', 'Required fields must be set before the CommonServiceItem creation: ' + missing.join(', ')) if missing.length > 0
|
492
534
|
return ret
|
@@ -122,6 +122,42 @@ module Saklient
|
|
122
122
|
|
123
123
|
protected
|
124
124
|
|
125
|
+
# @private
|
126
|
+
# @return [String]
|
127
|
+
attr_accessor :_sorry_server
|
128
|
+
|
129
|
+
public
|
130
|
+
|
131
|
+
# @private
|
132
|
+
# @return [String]
|
133
|
+
def get_sorry_server
|
134
|
+
return @_sorry_server
|
135
|
+
end
|
136
|
+
|
137
|
+
# @private
|
138
|
+
# @param [String] v
|
139
|
+
# @return [String]
|
140
|
+
def set_sorry_server(v)
|
141
|
+
Saklient::Util::validate_type(v, 'String')
|
142
|
+
@_sorry_server = v
|
143
|
+
return @_sorry_server
|
144
|
+
end
|
145
|
+
|
146
|
+
# ソーリーサーバ
|
147
|
+
#
|
148
|
+
# @return [String]
|
149
|
+
attr_accessor :sorry_server
|
150
|
+
|
151
|
+
def sorry_server
|
152
|
+
get_sorry_server
|
153
|
+
end
|
154
|
+
|
155
|
+
def sorry_server=(v)
|
156
|
+
set_sorry_server(v)
|
157
|
+
end
|
158
|
+
|
159
|
+
protected
|
160
|
+
|
125
161
|
# @private
|
126
162
|
# @return [Array<LbServer>]
|
127
163
|
attr_accessor :_servers
|
@@ -167,6 +203,14 @@ module Saklient
|
|
167
203
|
@_delay_loop = nil
|
168
204
|
@_delay_loop = (delayLoop).to_s().to_i(10) if !(delayLoop).nil?
|
169
205
|
@_delay_loop = nil if @_delay_loop == 0
|
206
|
+
sorryServer = Saklient::Util::get_by_path_any([obj], [
|
207
|
+
'SorryServer',
|
208
|
+
'sorryServer',
|
209
|
+
'sorry_server',
|
210
|
+
'sorryserver'
|
211
|
+
])
|
212
|
+
@_sorry_server = nil
|
213
|
+
@_sorry_server = sorryServer if !(sorryServer).nil?
|
170
214
|
@_servers = []
|
171
215
|
serversDyn = Saklient::Util::get_by_path_any([obj], ['Servers', 'servers'])
|
172
216
|
if !(serversDyn).nil?
|
@@ -197,6 +241,7 @@ module Saklient
|
|
197
241
|
VirtualIPAddress: @_virtual_ip_address,
|
198
242
|
Port: @_port,
|
199
243
|
DelayLoop: @_delay_loop,
|
244
|
+
SorryServer: @_sorry_server,
|
200
245
|
Servers: servers
|
201
246
|
}
|
202
247
|
end
|
data/lib/saklient/version.rb
CHANGED
data/spec/loadbalancer_spec.rb
CHANGED
@@ -151,11 +151,13 @@ describe 'LoadBalancer' do
|
|
151
151
|
vip2Ip = IPAddr.new(IPAddr.new(net.default_route).to_i + 10, Socket::AF_INET).to_s
|
152
152
|
vip2SrvIp1 = IPAddr.new(IPAddr.new(net.default_route).to_i + 11, Socket::AF_INET).to_s
|
153
153
|
vip2SrvIp2 = IPAddr.new(IPAddr.new(net.default_route).to_i + 12, Socket::AF_INET).to_s
|
154
|
+
vip2SrvIp3 = IPAddr.new(IPAddr.new(net.default_route).to_i + 13, Socket::AF_INET).to_s
|
154
155
|
|
155
156
|
vip2 = lb.add_virtual_ip
|
156
157
|
vip2.virtual_ip_address = vip2Ip
|
157
158
|
vip2.port = 80
|
158
159
|
vip2.delay_loop = 15
|
160
|
+
vip2.sorry_server = vip2SrvIp3
|
159
161
|
vip2Srv1 = vip2.add_server
|
160
162
|
vip2Srv1.enabled = true
|
161
163
|
vip2Srv1.ip_address = vip2SrvIp1
|
@@ -173,6 +175,7 @@ describe 'LoadBalancer' do
|
|
173
175
|
|
174
176
|
expect(lb.virtual_ips.length).to eq 2
|
175
177
|
expect(lb.virtual_ips[0].virtual_ip_address).to eq vip1Ip
|
178
|
+
expect(lb.virtual_ips[0].sorry_server).to be_nil
|
176
179
|
expect(lb.virtual_ips[0].servers.length).to eq 3
|
177
180
|
expect(lb.virtual_ips[0].servers[0].enabled).to be_nil
|
178
181
|
expect(lb.virtual_ips[0].servers[0].ip_address).to eq vip1SrvIp1
|
@@ -189,6 +192,7 @@ describe 'LoadBalancer' do
|
|
189
192
|
expect(lb.virtual_ips[0].servers[2].port).to eq 80
|
190
193
|
expect(lb.virtual_ips[0].servers[2].protocol).to eq 'tcp'
|
191
194
|
expect(lb.virtual_ips[1].virtual_ip_address).to eq vip2Ip
|
195
|
+
expect(lb.virtual_ips[1].sorry_server).to eq vip2SrvIp3
|
192
196
|
expect(lb.virtual_ips[1].servers.length).to eq 2
|
193
197
|
expect(lb.virtual_ips[1].servers[0].enabled).to be_truthy
|
194
198
|
expect(lb.virtual_ips[1].servers[0].ip_address).to eq vip2SrvIp1
|
@@ -214,10 +218,12 @@ describe 'LoadBalancer' do
|
|
214
218
|
lb.reload
|
215
219
|
|
216
220
|
expect(lb.virtual_ips.length).to eq 2
|
221
|
+
expect(lb.virtual_ips[0].sorry_server).to be_nil
|
217
222
|
expect(lb.virtual_ips[0].servers.length).to eq 4
|
218
223
|
expect(lb.virtual_ips[0].servers[3].ip_address).to eq vip1SrvIp4
|
219
224
|
expect(lb.virtual_ips[0].servers[3].port).to eq 80
|
220
225
|
expect(lb.virtual_ips[0].servers[3].protocol).to eq 'ping'
|
226
|
+
expect(lb.virtual_ips[1].sorry_server).to eq vip2SrvIp3
|
221
227
|
expect(lb.virtual_ips[1].servers.length).to eq 2
|
222
228
|
|
223
229
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saklient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- townewgokgok
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|