saklient 0.0.2.9 → 0.0.2.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ab63f76a21266e18fe5466381967948027fea9d
4
- data.tar.gz: 0d9d5dd5a860dc56b56fd6d908d4584fedb87007
3
+ metadata.gz: b8f956480d46ba84627c6bacddbb2c8acada65f3
4
+ data.tar.gz: 0058a8cc91a28f7cd58915d10755fea2a892ec01
5
5
  SHA512:
6
- metadata.gz: c360db4cb3446c9287a06213db05116f1572e0b68170aa50e1487af129a1276ec1f06bb35d8cb51d5d6a9d0ed056f7c9d0ba720cdd41a6d77156b6bac3b0f2f2
7
- data.tar.gz: 36a984cb53f0f9eb7fe9fe610da771bdc4bbeca57328c69e671d37d55ad6ab18b77d627874082ed5a36d93ebe81a64506fd4420a46daff0ccfbd826752a413cc
6
+ metadata.gz: 2987aeb3168cf685611a043fa9297bc5a92bc3b2b9a54f6bdf14c0f8dd6cb4e81db13511037284cf85c1a09fed2c8e49ff13fe944c8ef517439b9e1ee25662db
7
+ data.tar.gz: ffb11239467def0c4725a4c446e90f744ccc6eac9b195676eac687b512063ca1a981078cb08606b7431fc1b890a421eefa8e2bd5d0fce9efdf8b0951df2cfd4d
@@ -73,7 +73,7 @@ module Saklient
73
73
 
74
74
  extra_headers = {
75
75
  'Content-Type' => 'application/x-www-form-urlencoded',
76
- 'User-Agent' => 'saklient.ruby ver-0.0.2.9 rev-ba6f656e7fdf2e344bc279593970d0d325ad25dd',
76
+ 'User-Agent' => 'saklient.ruby ver-0.0.2.10 rev-ba6f656e7fdf2e344bc279593970d0d325ad25dd',
77
77
  'X-Requested-With' => 'XMLHttpRequest',
78
78
  'X-Sakura-HTTP-Method' => method,
79
79
  'X-Sakura-Error-Level' => 'warning',
@@ -2,6 +2,7 @@
2
2
 
3
3
  # This code is automatically transpiled by Saklient Translator
4
4
 
5
+ require_relative '../../errors/http_exception'
5
6
  require_relative '../../errors/saklient_exception'
6
7
  require_relative '../client'
7
8
  require_relative 'resource'
@@ -221,7 +222,11 @@ module Saklient
221
222
  Saklient::Util::validate_type(timeoutSec, 'Fixnum')
222
223
  step = 10
223
224
  while 0 < timeoutSec do
224
- reload
225
+ begin
226
+ reload
227
+ rescue Saklient::Errors::HttpException
228
+ {}
229
+ end
225
230
  a = get_availability
226
231
  return true if a == Saklient::Cloud::Enums::EAvailability::available
227
232
  timeoutSec = 0 if a != Saklient::Cloud::Enums::EAvailability::migrating
@@ -262,7 +267,11 @@ module Saklient
262
267
  Saklient::Util::validate_type(timeoutSec, 'Fixnum')
263
268
  step = 10
264
269
  while 0 < timeoutSec do
265
- reload
270
+ begin
271
+ reload
272
+ rescue Saklient::Errors::HttpException
273
+ {}
274
+ end
266
275
  s = get_status
267
276
  s = Saklient::Cloud::Enums::EServerInstanceStatus::down if (s).nil?
268
277
  return true if s == status
@@ -10,6 +10,7 @@ require_relative 'disk_plan'
10
10
  require_relative 'server'
11
11
  require_relative '../enums/escope'
12
12
  require_relative '../enums/eavailability'
13
+ require_relative '../../errors/http_exception'
13
14
  require_relative '../../errors/saklient_exception'
14
15
 
15
16
  module Saklient
@@ -334,7 +335,11 @@ module Saklient
334
335
  Saklient::Util::validate_type(timeoutSec, 'Fixnum')
335
336
  step = 3
336
337
  while 0 < timeoutSec do
337
- reload
338
+ begin
339
+ reload
340
+ rescue Saklient::Errors::HttpException
341
+ {}
342
+ end
338
343
  a = get_availability
339
344
  return true if a == Saklient::Cloud::Enums::EAvailability::available
340
345
  timeoutSec = 0 if a != Saklient::Cloud::Enums::EAvailability::migrating
@@ -3,6 +3,7 @@
3
3
  # This code is automatically transpiled by Saklient Translator
4
4
 
5
5
  require_relative '../../errors/saklient_exception'
6
+ require_relative '../../errors/http_exception'
6
7
  require_relative '../client'
7
8
  require_relative 'resource'
8
9
  require_relative 'icon'
@@ -328,7 +329,11 @@ module Saklient
328
329
  Saklient::Util::validate_type(timeoutSec, 'Fixnum')
329
330
  step = 10
330
331
  while 0 < timeoutSec do
331
- reload
332
+ begin
333
+ reload
334
+ rescue Saklient::Errors::HttpException
335
+ {}
336
+ end
332
337
  a = get_availability
333
338
  return true if a == Saklient::Cloud::Enums::EAvailability::available
334
339
  timeoutSec = 0 if a != Saklient::Cloud::Enums::EAvailability::migrating
@@ -13,6 +13,42 @@ module Saklient
13
13
 
14
14
  protected
15
15
 
16
+ # @private
17
+ # @return [bool]
18
+ attr_accessor :_enabled
19
+
20
+ public
21
+
22
+ # @private
23
+ # @return [bool]
24
+ def get_enabled
25
+ return @_enabled
26
+ end
27
+
28
+ # @private
29
+ # @param [bool] v
30
+ # @return [bool]
31
+ def set_enabled(v)
32
+ Saklient::Util::validate_type(v, 'bool')
33
+ @_enabled = v
34
+ return @_enabled
35
+ end
36
+
37
+ # 有効状態
38
+ #
39
+ # @return [bool]
40
+ attr_accessor :enabled
41
+
42
+ def enabled
43
+ get_enabled
44
+ end
45
+
46
+ def enabled=(v)
47
+ set_enabled(v)
48
+ end
49
+
50
+ protected
51
+
16
52
  # @private
17
53
  # @return [String]
18
54
  attr_accessor :_ip_address
@@ -247,6 +283,9 @@ module Saklient
247
283
  'health_check',
248
284
  'health'
249
285
  ])
286
+ enabled = Saklient::Util::get_by_path_any([obj], ['Enabled', 'enabled'])
287
+ @_enabled = nil
288
+ @_enabled = enabled if !(enabled).nil?
250
289
  @_ip_address = Saklient::Util::get_by_path_any([obj], [
251
290
  'IPAddress',
252
291
  'ipAddress',
@@ -280,6 +319,7 @@ module Saklient
280
319
  # @return [any]
281
320
  def to_raw_settings
282
321
  return {
322
+ Enabled: @_enabled,
283
323
  IPAddress: @_ip_address,
284
324
  Port: @_port,
285
325
  HealthCheck: {
@@ -2,6 +2,7 @@
2
2
 
3
3
  # This code is automatically transpiled by Saklient Translator
4
4
 
5
+ require_relative '../../errors/http_exception'
5
6
  require_relative '../../errors/saklient_exception'
6
7
  require_relative '../client'
7
8
  require_relative 'resource'
@@ -166,9 +167,13 @@ module Saklient
166
167
  Saklient::Util::validate_type(timeoutSec, 'Fixnum')
167
168
  step = 3
168
169
  while 0 < timeoutSec do
169
- if exists
170
- reload
171
- return true
170
+ begin
171
+ if exists
172
+ reload
173
+ return true
174
+ end
175
+ rescue Saklient::Errors::HttpException
176
+ {}
172
177
  end
173
178
  timeoutSec -= step
174
179
  sleep(step) if 0 < timeoutSec
@@ -2,6 +2,7 @@
2
2
 
3
3
  # This code is automatically transpiled by Saklient Translator
4
4
 
5
+ require_relative '../../errors/http_exception'
5
6
  require_relative '../../errors/saklient_exception'
6
7
  require_relative '../client'
7
8
  require_relative 'resource'
@@ -241,7 +242,11 @@ module Saklient
241
242
  Saklient::Util::validate_type(timeoutSec, 'Fixnum')
242
243
  step = 10
243
244
  while 0 < timeoutSec do
244
- reload
245
+ begin
246
+ reload
247
+ rescue Saklient::Errors::HttpException
248
+ {}
249
+ end
245
250
  s = nil
246
251
  inst = self.instance
247
252
  s = inst.status if !(inst).nil?
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: UTF-8 -*-
2
2
 
3
3
  module Saklient
4
- VERSION = "0.0.2.9"
4
+ VERSION = "0.0.2.10"
5
5
  end
data/spec/archive_spec.rb CHANGED
@@ -78,6 +78,7 @@ describe 'Archive' do
78
78
  cmd += "set ftp:ssl-force true;"
79
79
  cmd += "set ftp:ssl-protect-data true;"
80
80
  cmd += "set ftp:ssl-protect-list true;"
81
+ cmd += "set ssl:verify-certificate no;"
81
82
  cmd += "put #{path};"
82
83
  cmd += "exit"
83
84
  cmd = "lftp -u #{ftp2.user},#{ftp2.password} -p 21 -e '#{cmd}' #{ftp2.host_name}"
@@ -78,6 +78,7 @@ describe 'IsoImage' do
78
78
  cmd += "set ftp:ssl-force true;"
79
79
  cmd += "set ftp:ssl-protect-data true;"
80
80
  cmd += "set ftp:ssl-protect-list true;"
81
+ cmd += "set ssl:verify-certificate no;"
81
82
  cmd += "put #{path};"
82
83
  cmd += "exit"
83
84
  cmd = "lftp -u #{ftp2.user},#{ftp2.password} -p 21 -e '#{cmd}' #{ftp2.host_name}"
@@ -1,4 +1,5 @@
1
1
  $: << File.dirname(__dir__) + '/lib'
2
+ require 'saklient/version'
2
3
  require 'saklient/cloud/api'
3
4
  require 'date'
4
5
  require 'SecureRandom'
@@ -48,6 +49,8 @@ describe 'LoadBalancer' do
48
49
  description = 'This instance was created by saklient.ruby rspec'
49
50
  tag = 'saklient-test'
50
51
 
52
+ puts 'Saklient::VERSION = ' + Saklient::VERSION.to_s
53
+
51
54
 
52
55
 
53
56
  # create a LB
@@ -154,12 +157,14 @@ describe 'LoadBalancer' do
154
157
  vip2.port = 80
155
158
  vip2.delay_loop = 15
156
159
  vip2Srv1 = vip2.add_server
160
+ vip2Srv1.enabled = true
157
161
  vip2Srv1.ip_address = vip2SrvIp1
158
162
  vip2Srv1.port = 80
159
163
  vip2Srv1.protocol = 'http'
160
164
  vip2Srv1.path_to_check = '/index.html'
161
165
  vip2Srv1.response_expected = 200
162
166
  vip2Srv2 = vip2.add_server
167
+ vip2Srv2.enabled = false
163
168
  vip2Srv2.ip_address = vip2SrvIp2
164
169
  vip2Srv2.port = 80
165
170
  vip2Srv2.protocol = 'tcp'
@@ -169,6 +174,7 @@ describe 'LoadBalancer' do
169
174
  expect(lb.virtual_ips.length).to eq 2
170
175
  expect(lb.virtual_ips[0].virtual_ip_address).to eq vip1Ip
171
176
  expect(lb.virtual_ips[0].servers.length).to eq 3
177
+ expect(lb.virtual_ips[0].servers[0].enabled).to be_nil
172
178
  expect(lb.virtual_ips[0].servers[0].ip_address).to eq vip1SrvIp1
173
179
  expect(lb.virtual_ips[0].servers[0].port).to eq 80
174
180
  expect(lb.virtual_ips[0].servers[0].protocol).to eq 'http'
@@ -184,11 +190,13 @@ describe 'LoadBalancer' do
184
190
  expect(lb.virtual_ips[0].servers[2].protocol).to eq 'tcp'
185
191
  expect(lb.virtual_ips[1].virtual_ip_address).to eq vip2Ip
186
192
  expect(lb.virtual_ips[1].servers.length).to eq 2
193
+ expect(lb.virtual_ips[1].servers[0].enabled).to be_truthy
187
194
  expect(lb.virtual_ips[1].servers[0].ip_address).to eq vip2SrvIp1
188
195
  expect(lb.virtual_ips[1].servers[0].port).to eq 80
189
196
  expect(lb.virtual_ips[1].servers[0].protocol).to eq 'http'
190
197
  expect(lb.virtual_ips[1].servers[0].path_to_check).to eq '/index.html'
191
198
  expect(lb.virtual_ips[1].servers[0].response_expected).to eq 200
199
+ expect(lb.virtual_ips[1].servers[1].enabled).to be_falsy
192
200
  expect(lb.virtual_ips[1].servers[1].ip_address).to eq vip2SrvIp2
193
201
  expect(lb.virtual_ips[1].servers[1].port).to eq 80
194
202
  expect(lb.virtual_ips[1].servers[1].protocol).to eq 'tcp'
@@ -227,7 +235,7 @@ describe 'LoadBalancer' do
227
235
  print ' answers'
228
236
  printf ' %d', server.response_expected if server.response_expected
229
237
  print "\n"
230
- expect(server.status).to eq 'down'
238
+ # expect(server.status).to eq 'down'
231
239
  end
232
240
  end
233
241
 
data/spec/server_spec.rb CHANGED
@@ -80,7 +80,7 @@ describe 'Server' do
80
80
  # options
81
81
  additional_ssh_public_key = File.open(ENV['HOME'] + '/.ssh/id_rsa.pub').read.strip
82
82
  tests_disk_expansion = false
83
- breaks_after_server_up = true
83
+ breaks_after_server_up = false
84
84
 
85
85
  # search archives
86
86
  puts 'searching archives...'
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.2.9
4
+ version: 0.0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - townewgokgok
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec