idcf-ilb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +93 -0
  5. data/.travis.yml +9 -0
  6. data/CODE_OF_CONDUCT.md +49 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +111 -0
  10. data/Rakefile +6 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/idcf-ilb.gemspec +29 -0
  14. data/lib/idcf/ilb.rb +13 -0
  15. data/lib/idcf/ilb/client.rb +180 -0
  16. data/lib/idcf/ilb/client_extensions.rb +24 -0
  17. data/lib/idcf/ilb/client_extensions/config.rb +97 -0
  18. data/lib/idcf/ilb/client_extensions/fwgroup.rb +57 -0
  19. data/lib/idcf/ilb/client_extensions/job.rb +75 -0
  20. data/lib/idcf/ilb/client_extensions/limit.rb +24 -0
  21. data/lib/idcf/ilb/client_extensions/loadbalancer.rb +79 -0
  22. data/lib/idcf/ilb/client_extensions/log.rb +30 -0
  23. data/lib/idcf/ilb/client_extensions/network.rb +26 -0
  24. data/lib/idcf/ilb/client_extensions/server.rb +46 -0
  25. data/lib/idcf/ilb/client_extensions/sslalgorithm.rb +43 -0
  26. data/lib/idcf/ilb/client_extensions/sslcert.rb +79 -0
  27. data/lib/idcf/ilb/client_extensions/sslpolicy.rb +58 -0
  28. data/lib/idcf/ilb/client_extensions/traffic.rb +35 -0
  29. data/lib/idcf/ilb/client_extensions/virtualmachine.rb +29 -0
  30. data/lib/idcf/ilb/errors.rb +10 -0
  31. data/lib/idcf/ilb/request.rb +97 -0
  32. data/lib/idcf/ilb/resources.rb +22 -0
  33. data/lib/idcf/ilb/resources/base.rb +60 -0
  34. data/lib/idcf/ilb/resources/config.rb +21 -0
  35. data/lib/idcf/ilb/resources/fwgroup.rb +16 -0
  36. data/lib/idcf/ilb/resources/job.rb +16 -0
  37. data/lib/idcf/ilb/resources/limit.rb +13 -0
  38. data/lib/idcf/ilb/resources/loadbalancer.rb +16 -0
  39. data/lib/idcf/ilb/resources/log.rb +13 -0
  40. data/lib/idcf/ilb/resources/network.rb +9 -0
  41. data/lib/idcf/ilb/resources/nic.rb +13 -0
  42. data/lib/idcf/ilb/resources/server.rb +9 -0
  43. data/lib/idcf/ilb/resources/sslalgorithm.rb +21 -0
  44. data/lib/idcf/ilb/resources/sslcert.rb +16 -0
  45. data/lib/idcf/ilb/resources/sslpolicy.rb +23 -0
  46. data/lib/idcf/ilb/resources/traffic.rb +9 -0
  47. data/lib/idcf/ilb/resources/virtualmachine.rb +13 -0
  48. data/lib/idcf/ilb/response.rb +84 -0
  49. data/lib/idcf/ilb/validators.rb +22 -0
  50. data/lib/idcf/ilb/validators/base.rb +105 -0
  51. data/lib/idcf/ilb/validators/config.rb +27 -0
  52. data/lib/idcf/ilb/validators/fwgroup.rb +17 -0
  53. data/lib/idcf/ilb/validators/job.rb +18 -0
  54. data/lib/idcf/ilb/validators/limit.rb +17 -0
  55. data/lib/idcf/ilb/validators/loadbalancer.rb +26 -0
  56. data/lib/idcf/ilb/validators/log.rb +22 -0
  57. data/lib/idcf/ilb/validators/network.rb +25 -0
  58. data/lib/idcf/ilb/validators/server.rb +13 -0
  59. data/lib/idcf/ilb/validators/sslalgorithm.rb +14 -0
  60. data/lib/idcf/ilb/validators/sslcert.rb +24 -0
  61. data/lib/idcf/ilb/validators/sslpolicy.rb +17 -0
  62. data/lib/idcf/ilb/validators/traffic.rb +14 -0
  63. data/lib/idcf/ilb/validators/virtualmachine.rb +26 -0
  64. data/lib/idcf/ilb/version.rb +5 -0
  65. metadata +232 -0
@@ -0,0 +1,17 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Fwgroup validator class
5
+ class Fwgroup < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ name: { type: String, create: :required },
9
+ allow: { type: Array, create: :any_cidr },
10
+ drop: { type: Array, create: :any_cidr },
11
+ created_at: { type: String },
12
+ updated_at: { type: String }
13
+ }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Job validator class
5
+ class Job < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ resource: { type: String, list: :optional },
9
+ resource_id: { type: String },
10
+ path: { type: String },
11
+ method: { type: String, list: :required },
12
+ created_at: { type: String },
13
+ updated_at: { type: String }
14
+ }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Limit validator class
5
+ class Limit < Base
6
+ self.valid_attributes = {
7
+ loadbalancer_limit: { type: Integer },
8
+ sslcert_limit: { type: Integer },
9
+ sslpolicy_limit: { type: Integer },
10
+ fwgroup_limit: { type: Integer },
11
+ log_remain_month: { type: Integer },
12
+ traffic_remain_month: { type: Integer }
13
+ }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,26 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Loadbalancer validator class
5
+ class Loadbalancer < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ account_id: { type: String },
9
+ name: { type: String, create: :required },
10
+ network_id: { type: String, create: :required },
11
+ network_name: { type: String },
12
+ network: { type: Hash },
13
+ configs: { type: Array, create: :required, update: :required },
14
+ mackerel: { type: Hash, create: :optional, update: :optional },
15
+ fqdn: { type: String },
16
+ state: { type: String },
17
+ zone_id: { type: String },
18
+ zone_name: { type: String },
19
+ fwgroup_id: { type: String, create: :optional, update: :optional },
20
+ created_at: { type: String },
21
+ updated_at: { type: String }
22
+ }
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Log validator class
5
+ class Log < Base
6
+ self.valid_attributes = {
7
+ # for search
8
+ page: { type: Integer, list: :optional },
9
+ per_page: { type: Integer, list: :optional },
10
+ # resource attributes
11
+ user_id: { type: String },
12
+ account_id: { type: String },
13
+ level: { type: String },
14
+ type: { type: String },
15
+ text: { type: String },
16
+ user_name: { type: String },
17
+ created_at: { type: String }
18
+ }
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,25 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Network validator class
5
+ class Network < Base
6
+ self.valid_attributes = {
7
+ account_id: { type: String },
8
+ id: { type: String },
9
+ name: { type: String },
10
+ networkcidr: { type: String },
11
+ domainid: { type: String },
12
+ domain: { type: String },
13
+ gateway: { type: String },
14
+ networkoffering_id: { type: String },
15
+ networkoffering_name: { type: String },
16
+ state: { type: String },
17
+ traffic_type: { type: String },
18
+ related: { type: String },
19
+ zone_id: { type: String },
20
+ zone_name: { type: String }
21
+ }
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,13 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Server validator class
5
+ class Server < Base
6
+ self.valid_attributes = {
7
+ ipaddress: { type: String, add: :required },
8
+ port: { type: Integer, add: :required }
9
+ }
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Sslalgorithm validator class
5
+ class Sslalgorithm < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ protocol: { type: String },
9
+ cipher: { type: String }
10
+ }
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,24 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Sslcert validator class
5
+ class Sslcert < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ name: { type: String, create: :required, upload: :required, list: :optional },
9
+ type: { type: String, create: :required, upload: :required },
10
+ certificate: { type: String, upload: :required },
11
+ private_key: { type: String, upload: :required },
12
+ certificate_chain: { type: String, upload: :optional },
13
+ fqdn: { type: String },
14
+ state: { type: String },
15
+ fingerprint: { type: String },
16
+ remaining_days: { type: Integer },
17
+ expired_at: { type: String },
18
+ created_at: { type: String },
19
+ updated_at: { type: String }
20
+ }
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Sslpolicy validator class
5
+ class Sslpolicy < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ name: { type: String, create: :required },
9
+ algorithms: { type: Array, create: :required },
10
+ state: { type: String },
11
+ created_at: { type: String },
12
+ updated_at: { type: String }
13
+ }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Traffic validator class
5
+ class Traffic < Base
6
+ self.valid_attributes = {
7
+ from: { type: String, list: :optional },
8
+ to: { type: String, list: :optional },
9
+ unit: { type: String, list: :optional }
10
+ }
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,26 @@
1
+ module Idcf
2
+ module Ilb
3
+ module Validators
4
+ # Virtualmachine validator class
5
+ class Virtualmachine < Base
6
+ self.valid_attributes = {
7
+ id: { type: String },
8
+ name: { type: String, list: :optional },
9
+ account_id: { type: String },
10
+ domain: { type: String },
11
+ state: { type: String },
12
+ zone_id: { type: String },
13
+ zone_name: { type: String },
14
+ display_name: { type: String },
15
+ host_id: { type: String },
16
+ host_name: { type: String },
17
+ nics: { type: Array },
18
+ gateway: { type: String },
19
+ network_id: { type: String },
20
+ ipaddress: { type: String },
21
+ network_name: { type: String }
22
+ }
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ module Idcf
2
+ module Ilb
3
+ VERSION = "0.0.1".freeze
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,232 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: idcf-ilb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Akito Ueno
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: codeclimate-test-reporter
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: dotenv
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activesupport
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 4.2.3
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 4.2.3
111
+ - !ruby/object:Gem::Dependency
112
+ name: faraday
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.9.1
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.9.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: faraday_middleware
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.10.0
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.10.0
139
+ description:
140
+ email:
141
+ - aueno@idcf.jp
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".gitignore"
147
+ - ".rspec"
148
+ - ".rubocop.yml"
149
+ - ".travis.yml"
150
+ - CODE_OF_CONDUCT.md
151
+ - Gemfile
152
+ - LICENSE.txt
153
+ - README.md
154
+ - Rakefile
155
+ - bin/console
156
+ - bin/setup
157
+ - idcf-ilb.gemspec
158
+ - lib/idcf/ilb.rb
159
+ - lib/idcf/ilb/client.rb
160
+ - lib/idcf/ilb/client_extensions.rb
161
+ - lib/idcf/ilb/client_extensions/config.rb
162
+ - lib/idcf/ilb/client_extensions/fwgroup.rb
163
+ - lib/idcf/ilb/client_extensions/job.rb
164
+ - lib/idcf/ilb/client_extensions/limit.rb
165
+ - lib/idcf/ilb/client_extensions/loadbalancer.rb
166
+ - lib/idcf/ilb/client_extensions/log.rb
167
+ - lib/idcf/ilb/client_extensions/network.rb
168
+ - lib/idcf/ilb/client_extensions/server.rb
169
+ - lib/idcf/ilb/client_extensions/sslalgorithm.rb
170
+ - lib/idcf/ilb/client_extensions/sslcert.rb
171
+ - lib/idcf/ilb/client_extensions/sslpolicy.rb
172
+ - lib/idcf/ilb/client_extensions/traffic.rb
173
+ - lib/idcf/ilb/client_extensions/virtualmachine.rb
174
+ - lib/idcf/ilb/errors.rb
175
+ - lib/idcf/ilb/request.rb
176
+ - lib/idcf/ilb/resources.rb
177
+ - lib/idcf/ilb/resources/base.rb
178
+ - lib/idcf/ilb/resources/config.rb
179
+ - lib/idcf/ilb/resources/fwgroup.rb
180
+ - lib/idcf/ilb/resources/job.rb
181
+ - lib/idcf/ilb/resources/limit.rb
182
+ - lib/idcf/ilb/resources/loadbalancer.rb
183
+ - lib/idcf/ilb/resources/log.rb
184
+ - lib/idcf/ilb/resources/network.rb
185
+ - lib/idcf/ilb/resources/nic.rb
186
+ - lib/idcf/ilb/resources/server.rb
187
+ - lib/idcf/ilb/resources/sslalgorithm.rb
188
+ - lib/idcf/ilb/resources/sslcert.rb
189
+ - lib/idcf/ilb/resources/sslpolicy.rb
190
+ - lib/idcf/ilb/resources/traffic.rb
191
+ - lib/idcf/ilb/resources/virtualmachine.rb
192
+ - lib/idcf/ilb/response.rb
193
+ - lib/idcf/ilb/validators.rb
194
+ - lib/idcf/ilb/validators/base.rb
195
+ - lib/idcf/ilb/validators/config.rb
196
+ - lib/idcf/ilb/validators/fwgroup.rb
197
+ - lib/idcf/ilb/validators/job.rb
198
+ - lib/idcf/ilb/validators/limit.rb
199
+ - lib/idcf/ilb/validators/loadbalancer.rb
200
+ - lib/idcf/ilb/validators/log.rb
201
+ - lib/idcf/ilb/validators/network.rb
202
+ - lib/idcf/ilb/validators/server.rb
203
+ - lib/idcf/ilb/validators/sslalgorithm.rb
204
+ - lib/idcf/ilb/validators/sslcert.rb
205
+ - lib/idcf/ilb/validators/sslpolicy.rb
206
+ - lib/idcf/ilb/validators/traffic.rb
207
+ - lib/idcf/ilb/validators/virtualmachine.rb
208
+ - lib/idcf/ilb/version.rb
209
+ homepage: http://www.idcf.jp/cloud/
210
+ licenses: []
211
+ metadata: {}
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ required_rubygems_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
+ requirements: []
227
+ rubyforge_project:
228
+ rubygems_version: 2.4.5
229
+ signing_key:
230
+ specification_version: 4
231
+ summary: A Ruby client for IDCF Cloud ILB Service.
232
+ test_files: []