idcf-ilb 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/idcf-ilb.gemspec +1 -2
- data/lib/idcf/ilb/client_extensions/job.rb +22 -16
- data/lib/idcf/ilb/request.rb +10 -1
- data/lib/idcf/ilb/validators/base.rb +2 -0
- data/lib/idcf/ilb/validators/job.rb +3 -1
- data/lib/idcf/ilb/validators/sslcert.rb +2 -1
- data/lib/idcf/ilb/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c5f6ec93f9884029a0d891bc3b9209b8de2774
|
4
|
+
data.tar.gz: 0c364b9e592f832e952931cdf5a7e55c16d41930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dad17a241316e9cffcae97b36145908c0db7eab5f8840547fe951b5c86621b87ecafad5109921ca686501c1b8e30712906f12b5b94fceca0b51b6f0118921933
|
7
|
+
data.tar.gz: 757f510f6e48694733674a9e723dd2197020bc1fe090f1699fb3b27eed4cd41238ac0aa533deb4ff3f9b4d177845fcb77aeaf22d8a523af3e3d16f0a4e45c732
|
data/.travis.yml
CHANGED
@@ -5,6 +5,5 @@ rvm:
|
|
5
5
|
before_install: gem install bundler -v 1.11.2
|
6
6
|
env:
|
7
7
|
global:
|
8
|
-
|
9
|
-
|
10
|
-
- secure: "mS7VhnSfAryhpwQ1ptHcqmO14xQw2HdH6aihL7TLH2meKDTQk+eFr+hZO9A7xNr1qJqLMr7PhlyFNoDxTX49/7U8U4Q6rxsOwnBBZkXaE00hA7y0riiXjw8M5IK7l/oYq7sECJRPZzzlO3rTXRVvtWFl/KjfvxU/xZ6R5NZcSLqFMi9Se/Zew3NbwH7MwFkgW/6gZtFxpK1JP+aw/FJgRnOAGf96AXkkMB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KbOnsnjQiJZe/iKzEqCTl1W48qQeTbrYyFKKU283TfwLH1HLPB6nKr1Q=
|
9
|
+
- secure: QCkE/kL0nXjOX93In80wEISO3+j7az95KlSOnedhF7oP+uVg8ekYfemR4BA10eCEv3XJe27lXL6XoIiNZ422cVo+N928pWK3BhefDhmp+dbNBdzU7ElUj9rh5Ohp1sDtPmpZ8Nv74Q+kZ6EYS85r+AI5VuKIcSPWtcr9gT/QEFlH2Cl/O8XGkExH4BTw7EoF15PbjjmgIVAlMm/hoaf6Bp1FcwHqHyAlUTpp3JgTekPYPGVOqcMbCqNkz0QImUAR4Qi9fNdMzS4VpyiftKECi4oGDf+IloOni/Oj+IfTya8Hapxl6viEBVnk94YmbAAjvZMxjfP17k2g3Ggy1OcrgNkQsQA23FmFem93d4VITCkFnesa6RE/oUCTV3s6WF4TC6jLX55wGSAZbNr9ctM7Mj2r4iq3NJs31CNvxjWLIVYl1T7BuEsP63j9Cr+wPgN5tGqi9BDu+5b2CgZHHNAuC86s8ADykDtOcRbsM36UDf8gez2DomThiG3o3UUWSfDw6+v/NrAsHN6HqXECbf9Jqzb1YsTZJoOsaTqHQP7ZaeL+GsQwEIghHmLEzy+aM1bB4x2Kx1I6ISTGO+Qwm/ah8YRAxa0hiwaxYueFTtWXZmuc93oz2vshw8k5DRFGgjk0ULSklAdBCJwxfLQqlZ3LME5E+QutCVv9DpjQZhVEmqY=
|
data/idcf-ilb.gemspec
CHANGED
@@ -5,8 +5,7 @@ require 'idcf/ilb/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "idcf-ilb"
|
7
7
|
spec.version = Idcf::Ilb::VERSION
|
8
|
-
spec.authors = ["
|
9
|
-
spec.email = ["aueno@idcf.jp"]
|
8
|
+
spec.authors = ["IDC Frontier Inc."]
|
10
9
|
|
11
10
|
spec.summary = %q{A Ruby client for IDCF Cloud ILB Service.}
|
12
11
|
spec.homepage = "http://www.idcf.jp/cloud/"
|
@@ -8,6 +8,8 @@ module Idcf
|
|
8
8
|
# @param attributes [Hash] request attributes
|
9
9
|
# @option attributes [String] :resource name of resource (optional)
|
10
10
|
# @option attributes [String] :method name of http method (optional)
|
11
|
+
# @option attributes [Integer] :limit value of limit (optional)
|
12
|
+
# @option attributes [Integer] :offset value of offset (optional)
|
11
13
|
# @param headers [Hash] HTTP request headers
|
12
14
|
# @return [Response] HTTP response object
|
13
15
|
def list_jobs(attributes = {}, headers = {})
|
@@ -30,22 +32,7 @@ module Idcf
|
|
30
32
|
# @param id [String] ID of target job
|
31
33
|
# @return [Response] HTTP response object
|
32
34
|
def check_job(id, headers = {}, callback_and_args = [], specify_res_id = true)
|
33
|
-
flag =
|
34
|
-
1.upto(20) do |n|
|
35
|
-
@res = get_job(id, headers)
|
36
|
-
if @res.body["job_status"] == "Success"
|
37
|
-
flag = true
|
38
|
-
break
|
39
|
-
elsif @res.body["job_status"] == "Failed"
|
40
|
-
raise(
|
41
|
-
ApiError,
|
42
|
-
"API Failed."
|
43
|
-
)
|
44
|
-
else
|
45
|
-
sleep 2 * n
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
35
|
+
flag = success?(id, headers)
|
49
36
|
return if "DELETE" == @res.body["method"]
|
50
37
|
if flag == true
|
51
38
|
if specify_res_id == true
|
@@ -70,6 +57,25 @@ module Idcf
|
|
70
57
|
Resources::Job.new(self, job)
|
71
58
|
end
|
72
59
|
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def success?(id, headers)
|
64
|
+
1.upto(20) do |n|
|
65
|
+
@res = get_job(id, headers)
|
66
|
+
if @res.body["job_status"] == "Success"
|
67
|
+
return true
|
68
|
+
elsif @res.body["job_status"] == "Failed"
|
69
|
+
raise(
|
70
|
+
ApiError,
|
71
|
+
"API Failed."
|
72
|
+
)
|
73
|
+
else
|
74
|
+
sleep 2 * n
|
75
|
+
end
|
76
|
+
end
|
77
|
+
false
|
78
|
+
end
|
73
79
|
end
|
74
80
|
end
|
75
81
|
end
|
data/lib/idcf/ilb/request.rb
CHANGED
@@ -89,9 +89,18 @@ module Idcf
|
|
89
89
|
path,
|
90
90
|
api_key,
|
91
91
|
expires,
|
92
|
-
|
92
|
+
query_for_get
|
93
93
|
].join("\n")
|
94
94
|
end
|
95
|
+
|
96
|
+
def query_for_get
|
97
|
+
return convert_params_to_query if method == :get && !parameters.empty?
|
98
|
+
""
|
99
|
+
end
|
100
|
+
|
101
|
+
def convert_params_to_query
|
102
|
+
parameters.map { |k, v| "#{k}=#{CGI.escape(v.to_s).gsub(/\+|\ /, '%20')}" }.sort.join("&")
|
103
|
+
end
|
95
104
|
end
|
96
105
|
end
|
97
106
|
end
|
@@ -13,7 +13,9 @@ module Idcf
|
|
13
13
|
path: { type: String },
|
14
14
|
method: { type: String, list: :optional },
|
15
15
|
created_at: { type: String },
|
16
|
-
updated_at: { type: String }
|
16
|
+
updated_at: { type: String },
|
17
|
+
limit: { type: Integer, list: :optional },
|
18
|
+
offset: { type: Integer, list: :optional }
|
17
19
|
}
|
18
20
|
end
|
19
21
|
end
|
data/lib/idcf/ilb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idcf-ilb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- IDC Frontier Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,8 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.10.0
|
139
139
|
description:
|
140
|
-
email:
|
141
|
-
- aueno@idcf.jp
|
140
|
+
email:
|
142
141
|
executables: []
|
143
142
|
extensions: []
|
144
143
|
extra_rdoc_files: []
|
@@ -225,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
224
|
version: '0'
|
226
225
|
requirements: []
|
227
226
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.
|
227
|
+
rubygems_version: 2.6.13
|
229
228
|
signing_key:
|
230
229
|
specification_version: 4
|
231
230
|
summary: A Ruby client for IDCF Cloud ILB Service.
|