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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 426de25224e43ab9c30cac73329470ee89408683
4
- data.tar.gz: 8305e3d6a082bebeee7be8eddb653d31196b4d19
3
+ metadata.gz: 61c5f6ec93f9884029a0d891bc3b9209b8de2774
4
+ data.tar.gz: 0c364b9e592f832e952931cdf5a7e55c16d41930
5
5
  SHA512:
6
- metadata.gz: e29e16fe57ee99966313aac21545496721eb31776a77a4af11e97455688029556ba61fc793687ae803d6d79f038944b8c214252c338a78823c966faa3a0c28b7
7
- data.tar.gz: ea7be01a1d123972930d1203a0e82b2d2d99086421f1bd42b2ffd6aef990753cea6106cfacf15eac7a30a69fdc5788e00ab2e6271425ccb07e602ebc648b4fe9
6
+ metadata.gz: dad17a241316e9cffcae97b36145908c0db7eab5f8840547fe951b5c86621b87ecafad5109921ca686501c1b8e30712906f12b5b94fceca0b51b6f0118921933
7
+ data.tar.gz: 757f510f6e48694733674a9e723dd2197020bc1fe090f1699fb3b27eed4cd41238ac0aa533deb4ff3f9b4d177845fcb77aeaf22d8a523af3e3d16f0a4e45c732
@@ -5,6 +5,5 @@ rvm:
5
5
  before_install: gem install bundler -v 1.11.2
6
6
  env:
7
7
  global:
8
- - secure: "GYnbgGX4ELD31qLfeXmaVAcEZeLSXV4VmQPi7GHBSLckrEfUlc2jJrdwcYY0t4+kfL1HPHkCVb61u7/KizD3fbjo9B+RjIKDCzOnRt0qf4TMnieJDLLaWhGvEPQZpqSSX9skvqbY1eMipFn+PgN9CEFRqnnVANp8PxY3TxGh5zi0hTaxZIh918/FxH0gCiTQOGpkjInSadY8bI9tDlKAV8g+EDolAerWz7WDq3+d/GM/VhpQyprqQkd76cyQ2HkBEvngJYAm1RpsJfnSPuqE0rP6C82onV4kVoREI0l0YZGVV1octXrucHqxLRnqAr3yb0pua8vLYVlSEn0Xf44B2XBQURsOkCmMCbb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57hoOU8NwBIGoinhcuQy7pcIng8GS/iw0LJl/gyMDQlCyTZrwQ4o7P4d7VVEnCz9wjvaXRmEpij37N5E+jCZ0oClLzWrA1UER3qK9OxQ1B17W60qkX8MD+JNIgmjlHL5mPFtAggRTBECgfH891ALTawSGQfNIKmcwbQP/rPVToHvZm6Wm4U1405n3EYgKbOnsnjQiJZe/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=
@@ -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 = ["Akito Ueno"]
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 = false
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
@@ -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
@@ -48,6 +48,8 @@ module Idcf
48
48
  else
49
49
  false
50
50
  end
51
+ when "boolean"
52
+ value.is_a?(FalseClass) || value.is_a?(TrueClass)
51
53
  else
52
54
  value.is_a?(valid_type)
53
55
  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
@@ -16,7 +16,8 @@ module Idcf
16
16
  remaining_days: { type: Integer },
17
17
  expired_at: { type: String },
18
18
  created_at: { type: String },
19
- updated_at: { type: String }
19
+ updated_at: { type: String },
20
+ ats_flag: { type: "boolean" }
20
21
  }
21
22
  end
22
23
  end
@@ -1,5 +1,5 @@
1
1
  module Idcf
2
2
  module Ilb
3
- VERSION = "0.0.2".freeze
3
+ VERSION = "0.0.3".freeze
4
4
  end
5
5
  end
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - Akito Ueno
7
+ - IDC Frontier Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
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.4.5.1
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.