idcf-ilb 0.0.4 → 0.0.5

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: c43978bfcc0d6b373d2586cbf103218c16258a8d
4
- data.tar.gz: 1cff46a6595456a9ffd710552b19f155e1e30b20
3
+ metadata.gz: 12529dd3c976b11261ced9c4a59e82ba8e441209
4
+ data.tar.gz: 21bea9b157f9407a6eae2bc27ddcfe584d227e94
5
5
  SHA512:
6
- metadata.gz: dc3a839c02ecd91dbf994979359b91f057520b857d5751463647b1e5e8cd59e2b10980b302cf67e2a7b69104ff4aeedfbdcbe7857a0e7aa6d1af4c306871d4b7
7
- data.tar.gz: 7d98c898ea9bd7401fe5ba3f2796300e868bd3997708fd354bc35e04f57a03b1f5c657ee7d57eff20ade7abc2cb3da3cbf8ebafe8a88fafe7ef9ee66c43de0c6
6
+ metadata.gz: b217ebe3b2f739a711cc2e2b7a805526c9c07d48c39b84e336a03622b9aecb0ab3966cdc90f0f7bf082d1707f5b3e9f1b794d128055b2aeb2e4e26f8626bd250
7
+ data.tar.gz: 292034c6d95ca018c61969d66d3298ef220b8e655c3237656412a73fdfd091f13cb6e85b9268f44b8e0625bfd152c4e4ba4f3e523323ec83f31b8944579687a8
@@ -9,6 +9,7 @@ module Idcf
9
9
  include ClientExtensions::Loadbalancer
10
10
  include ClientExtensions::Config
11
11
  include ClientExtensions::Server
12
+ include ClientExtensions::L7route
12
13
  include ClientExtensions::Job
13
14
  include ClientExtensions::Sslcert
14
15
  include ClientExtensions::Sslalgorithm
@@ -12,6 +12,7 @@ end
12
12
  require "idcf/ilb/client_extensions/loadbalancer"
13
13
  require "idcf/ilb/client_extensions/config"
14
14
  require "idcf/ilb/client_extensions/server"
15
+ require "idcf/ilb/client_extensions/l7route"
15
16
  require "idcf/ilb/client_extensions/job"
16
17
  require "idcf/ilb/client_extensions/sslcert"
17
18
  require "idcf/ilb/client_extensions/sslalgorithm"
@@ -0,0 +1,84 @@
1
+ module Idcf
2
+ module Ilb
3
+ module ClientExtensions
4
+ # SDK APIs for l7route resource
5
+ module L7route
6
+ # Create a loadbalancer config's l7route.
7
+ #
8
+ # @param lb_id [String] ID of loadbalancer
9
+ # @param config_id [String] ID of loadbalancer's config
10
+ # @param data [Hash] add l7route hash
11
+ # @option data [Hash] :servers (required)
12
+ # @option data [String] :pattern (required)
13
+ # @param headers [Hash] HTTP request headers
14
+ # @return [Array<Hash>] An array of [loadbalancer's config server] hash
15
+ def create_l7route(lb_id, config_id, data, headers = {})
16
+ Validators::L7route.validate_attributes!(data, :create)
17
+ res = post!("loadbalancers/#{lb_id}/configs/#{config_id}/l7routes", data, headers)
18
+ check_job(res.body["job_id"], headers, ["get_l7route", lb_id, config_id, res.body["resource_id"]], false)
19
+ end
20
+
21
+ # Get list of existing [loadbalancer's config l7routes]
22
+ #
23
+ # @param lb_id [String] ID of loadbalancer
24
+ # @param config_id [String] ID of loadbalancer's config
25
+ # @param headers [Hash] HTTP request headers
26
+ # @return [Array<Hash>] An array of [loadbalancer's config l7route] hash
27
+ def list_l7routes(lb_id, config_id, headers = {})
28
+ get!("loadbalancers/#{lb_id}/configs/#{config_id}/l7routes", {}, headers)
29
+ end
30
+
31
+ # Get of existing [loadbalancer's config l7route]
32
+ #
33
+ # @param lb_id [String] ID of loadbalancer
34
+ # @param config_id [String] ID of loadbalancer's config
35
+ # @param id [String] ID of loadbalancer's config l7route
36
+ # @param headers [Hash] HTTP request headers
37
+ # @return [Array<Hash>] An array of [loadbalancer's config l7route] hash
38
+ def get_l7route(lb_id, config_id, id, headers = {})
39
+ get!("loadbalancers/#{lb_id}/configs/#{config_id}/l7routes/#{id}", {}, headers)
40
+ end
41
+
42
+ # Delete a [loadbalancer's config l7route]
43
+ #
44
+ # @param lb_id [String] ID of loadbalancer
45
+ # @param config_id [String] ID of loadbalancer's config
46
+ # @param id [String] ID of loadbalancer's config l7route
47
+ # @param headers [Hash] HTTP request headers
48
+ # @return [Array<Hash>] An array of [loadbalancer's config l7route] hash
49
+ def delete_l7route(lb_id, config_id, id, headers = {})
50
+ res = delete!("loadbalancers/#{lb_id}/configs/#{config_id}/l7routes/#{id}", {}, headers)
51
+ check_job(res.body["job_id"], headers)
52
+ end
53
+
54
+ # Patch a l7route.
55
+ #
56
+ # @param lb_id [String] ID of loadbalancer
57
+ # @param config_id [String] ID of loadbalancer's config
58
+ # @param id [String] ID of loadbalancer's config l7route
59
+ # @param data [Hash] add l7route hash
60
+ # @option data [Hash] :servers (required)
61
+ # @option data [String] :pattern (required)
62
+ # @param headers [Hash] HTTP request headers
63
+ # @return [Array<Hash>] An array of [loadbalancer's config server] hash
64
+ def patch_l7route(lb_id, config_id, id, data, headers = {})
65
+ Validators::L7route.validate_attributes!(data, :patch)
66
+ res = patch!("loadbalancers/#{lb_id}/configs/#{config_id}/l7routes/#{id}", data, headers)
67
+ check_job(res.body["job_id"], headers, ["get_l7route", lb_id, config_id, id], false)
68
+ end
69
+
70
+ # Get an array of existing l7routes objects.
71
+ #
72
+ # @param lb_id [String] ID of loadbalancer
73
+ # @param config_id [String] ID of loadbalancer's config
74
+ # @param headers [Hash] HTTP request headers
75
+ # @return [Array<Resources::L7route>] An array of l7route objects
76
+ def l7routes(lb_id, config_id, headers = {})
77
+ list_l7routes(lb_id, config_id, headers).resources.map do |l7route|
78
+ Resources::L7route.new(self, l7route)
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -10,6 +10,7 @@ require "idcf/ilb/resources/base"
10
10
  require "idcf/ilb/resources/loadbalancer"
11
11
  require "idcf/ilb/resources/config"
12
12
  require "idcf/ilb/resources/server"
13
+ require "idcf/ilb/resources/l7route"
13
14
  require "idcf/ilb/resources/job"
14
15
  require "idcf/ilb/resources/sslcert"
15
16
  require "idcf/ilb/resources/sslalgorithm"
@@ -0,0 +1,13 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Resources
4
+ # Server resource class
5
+ class L7route < Base
6
+ def inspect
7
+ o_id = object_id
8
+ "#<#{self.class}:0x%014x @pattern=#{pattern} @id=#{id}>" % [o_id]
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -10,6 +10,7 @@ require "idcf/ilb/validators/base"
10
10
  require "idcf/ilb/validators/loadbalancer"
11
11
  require "idcf/ilb/validators/config"
12
12
  require "idcf/ilb/validators/server"
13
+ require "idcf/ilb/validators/l7route"
13
14
  require "idcf/ilb/validators/job"
14
15
  require "idcf/ilb/validators/sslcert"
15
16
  require "idcf/ilb/validators/sslalgorithm"
@@ -16,6 +16,7 @@ module Idcf
16
16
  stickiness_policy: { type: String, create: :optional, patch: :optional },
17
17
  algorithm: { type: String, create: :required, patch: :optional },
18
18
  healthcheck: { type: Hash, create: :required, patch: :optional },
19
+ l7routes: { type: Array, create: :optional, patch: :optional },
19
20
  backupserver: { type: Hash, create: :optional, patch: :optional },
20
21
  state: { type: String },
21
22
  created_at: { type: String },
@@ -0,0 +1,16 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # L7route validator class
5
+ class L7route < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ servers: { type: Array, create: :required, patch: :optional },
9
+ pattern: { type: String, create: :required, patch: :optional },
10
+ created_at: { type: String },
11
+ updated_at: { type: String }
12
+ }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  module Idcf
2
2
  module Ilb
3
- VERSION = "0.0.4".freeze
3
+ VERSION = "0.0.5".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.4
4
+ version: 0.0.5
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: 2018-02-22 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -166,6 +166,7 @@ files:
166
166
  - lib/idcf/ilb/client_extensions/config.rb
167
167
  - lib/idcf/ilb/client_extensions/fwgroup.rb
168
168
  - lib/idcf/ilb/client_extensions/job.rb
169
+ - lib/idcf/ilb/client_extensions/l7route.rb
169
170
  - lib/idcf/ilb/client_extensions/limit.rb
170
171
  - lib/idcf/ilb/client_extensions/loadbalancer.rb
171
172
  - lib/idcf/ilb/client_extensions/log.rb
@@ -183,6 +184,7 @@ files:
183
184
  - lib/idcf/ilb/resources/config.rb
184
185
  - lib/idcf/ilb/resources/fwgroup.rb
185
186
  - lib/idcf/ilb/resources/job.rb
187
+ - lib/idcf/ilb/resources/l7route.rb
186
188
  - lib/idcf/ilb/resources/limit.rb
187
189
  - lib/idcf/ilb/resources/loadbalancer.rb
188
190
  - lib/idcf/ilb/resources/log.rb
@@ -200,6 +202,7 @@ files:
200
202
  - lib/idcf/ilb/validators/config.rb
201
203
  - lib/idcf/ilb/validators/fwgroup.rb
202
204
  - lib/idcf/ilb/validators/job.rb
205
+ - lib/idcf/ilb/validators/l7route.rb
203
206
  - lib/idcf/ilb/validators/limit.rb
204
207
  - lib/idcf/ilb/validators/loadbalancer.rb
205
208
  - lib/idcf/ilb/validators/log.rb
@@ -230,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
233
  version: '0'
231
234
  requirements: []
232
235
  rubyforge_project:
233
- rubygems_version: 2.6.13
236
+ rubygems_version: 2.4.5.1
234
237
  signing_key:
235
238
  specification_version: 4
236
239
  summary: A Ruby client for IDCF Cloud ILB Service.