xclarity_client 0.6.3 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/docs/apib/discover_request.apib +3 -1
  3. data/docs/apib/event.apib +0 -1
  4. data/docs/apib/manage_request.apib +359 -0
  5. data/docs/apib/storages.apib +3 -3
  6. data/docs/apib/update_comp.apib +426 -0
  7. data/docs/apib/update_repo.apib +0 -57
  8. data/lib/xclarity_client.rb +0 -1
  9. data/lib/xclarity_client/client.rb +3 -0
  10. data/lib/xclarity_client/connection/connection.rb +73 -35
  11. data/lib/xclarity_client/endpoints/endpoints.rb +3 -0
  12. data/lib/xclarity_client/endpoints/manage_request.rb +11 -0
  13. data/lib/xclarity_client/endpoints/management_server.rb +5 -0
  14. data/lib/xclarity_client/endpoints/storage.rb +7 -6
  15. data/lib/xclarity_client/endpoints/update_comp.rb +18 -0
  16. data/lib/xclarity_client/mixins/job_mixin.rb +0 -4
  17. data/lib/xclarity_client/mixins/manage_request_mixin.rb +54 -0
  18. data/lib/xclarity_client/mixins/management_server_mixin.rb +40 -0
  19. data/lib/xclarity_client/mixins/mixins.rb +3 -0
  20. data/lib/xclarity_client/mixins/node_mixin.rb +42 -0
  21. data/lib/xclarity_client/mixins/update_comp_mixin.rb +37 -0
  22. data/lib/xclarity_client/mixins/update_repo_mixin.rb +107 -7
  23. data/lib/xclarity_client/services/job_management.rb +2 -4
  24. data/lib/xclarity_client/services/manage_request_management.rb +62 -0
  25. data/lib/xclarity_client/services/management_server_management.rb +86 -0
  26. data/lib/xclarity_client/services/node_management.rb +46 -0
  27. data/lib/xclarity_client/services/osimage_management.rb +3 -2
  28. data/lib/xclarity_client/services/remote_access_management.rb +6 -4
  29. data/lib/xclarity_client/services/services.rb +3 -0
  30. data/lib/xclarity_client/services/update_comp_management.rb +111 -0
  31. data/lib/xclarity_client/services/update_repo_management.rb +100 -47
  32. data/lib/xclarity_client/services/virtual_appliance_management.rb +13 -16
  33. data/lib/xclarity_client/services/xclarity_service.rb +2 -3
  34. data/lib/xclarity_client/version.rb +1 -1
  35. data/lib/xclarity_client/xclarity_credentials_validator.rb +8 -11
  36. data/xclarity_client.gemspec +2 -2
  37. metadata +26 -11
  38. data/lib/xclarity_client/xclarity_base.rb +0 -88
@@ -17,12 +17,12 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", "~> 1.12"
20
+ spec.add_development_dependency('bundler', '>= 1.11.2')
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
22
  spec.add_development_dependency "rspec", "~> 3.0"
23
23
  spec.add_development_dependency "apib-mock_server", "~> 1.0.3"
24
24
  spec.add_development_dependency "webmock", "~> 2.1.0"
25
- spec.add_dependency "faraday", "~> 0.9"
25
+ spec.add_dependency "faraday", '>= 0.9', '< 2.0.0'
26
26
  spec.add_dependency "faraday-cookie_jar", "~> 0.0.6"
27
27
  spec.add_dependency "httpclient", "~>2.8.3"
28
28
  spec.add_dependency "uuid", "~> 2.3.8"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xclarity_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manasa Rao
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-09-04 00:00:00.000000000 Z
12
+ date: 2020-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '1.12'
20
+ version: 1.11.2
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '1.12'
27
+ version: 1.11.2
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -85,16 +85,22 @@ dependencies:
85
85
  name: faraday
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - "~>"
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0.9'
91
+ - - "<"
92
+ - !ruby/object:Gem::Version
93
+ version: 2.0.0
91
94
  type: :runtime
92
95
  prerelease: false
93
96
  version_requirements: !ruby/object:Gem::Requirement
94
97
  requirements:
95
- - - "~>"
98
+ - - ">="
96
99
  - !ruby/object:Gem::Version
97
100
  version: '0.9'
101
+ - - "<"
102
+ - !ruby/object:Gem::Version
103
+ version: 2.0.0
98
104
  - !ruby/object:Gem::Dependency
99
105
  name: faraday-cookie_jar
100
106
  requirement: !ruby/object:Gem::Requirement
@@ -204,6 +210,7 @@ files:
204
210
  - docs/apib/fan_muxes.apib
205
211
  - docs/apib/ffdc.apib
206
212
  - docs/apib/jobs.apib
213
+ - docs/apib/manage_request.apib
207
214
  - docs/apib/node.apib
208
215
  - docs/apib/node_bmc.apib
209
216
  - docs/apib/persisted_result.apib
@@ -213,6 +220,7 @@ files:
213
220
  - docs/apib/storages.apib
214
221
  - docs/apib/switches.apib
215
222
  - docs/apib/unmanage_request.apib
223
+ - docs/apib/update_comp.apib
216
224
  - docs/apib/update_repo.apib
217
225
  - docs/apib/users.apib
218
226
  - example/simple.rb
@@ -242,6 +250,8 @@ files:
242
250
  - lib/xclarity_client/endpoints/globalsettings.rb
243
251
  - lib/xclarity_client/endpoints/hostplatform.rb
244
252
  - lib/xclarity_client/endpoints/job.rb
253
+ - lib/xclarity_client/endpoints/manage_request.rb
254
+ - lib/xclarity_client/endpoints/management_server.rb
245
255
  - lib/xclarity_client/endpoints/node.rb
246
256
  - lib/xclarity_client/endpoints/osimage.rb
247
257
  - lib/xclarity_client/endpoints/persisted_result.rb
@@ -252,6 +262,7 @@ files:
252
262
  - lib/xclarity_client/endpoints/storage.rb
253
263
  - lib/xclarity_client/endpoints/switch.rb
254
264
  - lib/xclarity_client/endpoints/unmanage_request.rb
265
+ - lib/xclarity_client/endpoints/update_comp.rb
255
266
  - lib/xclarity_client/endpoints/update_repo.rb
256
267
  - lib/xclarity_client/endpoints/user.rb
257
268
  - lib/xclarity_client/endpoints/xclarity_endpoint.rb
@@ -279,6 +290,8 @@ files:
279
290
  - lib/xclarity_client/mixins/global_setting_mixin.rb
280
291
  - lib/xclarity_client/mixins/host_platform_mixin.rb
281
292
  - lib/xclarity_client/mixins/job_mixin.rb
293
+ - lib/xclarity_client/mixins/manage_request_mixin.rb
294
+ - lib/xclarity_client/mixins/management_server_mixin.rb
282
295
  - lib/xclarity_client/mixins/mixins.rb
283
296
  - lib/xclarity_client/mixins/node_mixin.rb
284
297
  - lib/xclarity_client/mixins/os_image_mixin.rb
@@ -290,6 +303,7 @@ files:
290
303
  - lib/xclarity_client/mixins/storage_mixin.rb
291
304
  - lib/xclarity_client/mixins/switch_mixin.rb
292
305
  - lib/xclarity_client/mixins/unmanage_request_mixin.rb
306
+ - lib/xclarity_client/mixins/update_comp_mixin.rb
293
307
  - lib/xclarity_client/mixins/update_repo_mixin.rb
294
308
  - lib/xclarity_client/mixins/user_mixin.rb
295
309
  - lib/xclarity_client/schemas.rb
@@ -311,6 +325,8 @@ files:
311
325
  - lib/xclarity_client/services/globalsettings_management.rb
312
326
  - lib/xclarity_client/services/hostplatform_management.rb
313
327
  - lib/xclarity_client/services/job_management.rb
328
+ - lib/xclarity_client/services/manage_request_management.rb
329
+ - lib/xclarity_client/services/management_server_management.rb
314
330
  - lib/xclarity_client/services/mixins/endpoint_manager_mixin.rb
315
331
  - lib/xclarity_client/services/mixins/list_name_interpreter_mixin.rb
316
332
  - lib/xclarity_client/services/mixins/power_action_sender_mixin.rb
@@ -326,13 +342,13 @@ files:
326
342
  - lib/xclarity_client/services/storage_management.rb
327
343
  - lib/xclarity_client/services/switch_management.rb
328
344
  - lib/xclarity_client/services/unmanage_request_management.rb
345
+ - lib/xclarity_client/services/update_comp_management.rb
329
346
  - lib/xclarity_client/services/update_repo_management.rb
330
347
  - lib/xclarity_client/services/user_management.rb
331
348
  - lib/xclarity_client/services/virtual_appliance_management.rb
332
349
  - lib/xclarity_client/services/xclarity_management_mixin.rb
333
350
  - lib/xclarity_client/services/xclarity_service.rb
334
351
  - lib/xclarity_client/version.rb
335
- - lib/xclarity_client/xclarity_base.rb
336
352
  - lib/xclarity_client/xclarity_credentials_validator.rb
337
353
  - xclarity_client.gemspec
338
354
  homepage: https://github.com/lenovo/xclarity_client
@@ -353,8 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
369
  - !ruby/object:Gem::Version
354
370
  version: '0'
355
371
  requirements: []
356
- rubyforge_project:
357
- rubygems_version: 2.6.14
372
+ rubygems_version: 3.1.3
358
373
  signing_key:
359
374
  specification_version: 4
360
375
  summary: Lenovo XClarity API Client
@@ -1,88 +0,0 @@
1
- require 'faraday'
2
- require 'faraday-cookie_jar'
3
- require 'uri'
4
- require 'uri/https'
5
-
6
- module XClarityClient
7
- class XClarityBase
8
-
9
- attr_reader :conn
10
-
11
- def initialize(conf, uri)
12
- connection_builder(conf, uri)
13
- end
14
-
15
- def connection_builder(conf, uri)
16
- $lxca_log.info "XClarityClient::XClarityBase connection_builder", "Building the url"
17
- #Building configuration
18
- hostname = URI.parse(conf.host)
19
- url = URI::HTTPS.build({ :host => hostname.scheme ? hostname.host : hostname.path,
20
- :port => conf.port.to_i,
21
- :path => uri,
22
- :query => hostname.query,
23
- :fragment => hostname.fragment }).to_s
24
-
25
- $lxca_log.info "XClarityClient::XClarityBase connection_builder", "Creating connection to #{url}"
26
-
27
- @conn = Faraday.new(url: url) do |faraday|
28
- faraday.request :url_encoded # form-encode POST params
29
- faraday.response :logger, $lxca_log.log # log requests to STDOUT -- This line, should be uncommented if you wanna inspect the URL Request
30
- faraday.use :cookie_jar if conf.auth_type == 'token'
31
- faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
32
- faraday.ssl[:verify] = conf.verify_ssl == 'PEER'
33
- end
34
-
35
- @conn.headers[:user_agent] = "LXCA via Ruby Client/#{XClarityClient::VERSION}" + (conf.user_agent_label.nil? ? "" : " (#{conf.user_agent_label})")
36
- @conn.basic_auth(conf.username, conf.password) if conf.auth_type == 'basic_auth'
37
- $lxca_log.info "XClarityClient::XclarityBase connection_builder", "Connection created Successfuly"
38
- @conn
39
- end
40
-
41
- private
42
-
43
- def connection(uri = "", opts = {})
44
- query = opts.size > 0 ? "?" + opts.map {|k, v| "#{k}=#{v}"}.join(",") : ""
45
- begin
46
- @conn.get(uri + query)
47
- rescue Faraday::Error::ConnectionFailed => e
48
- $lxca_log.error "XClarityClient::XclarityBase connection", "Error trying to send a GET to #{uri + query}"
49
- Faraday::Response.new
50
- end
51
- end
52
-
53
- def do_post(uri="", request = {})
54
- begin
55
- @conn.post do |req|
56
- req.url uri
57
- req.headers['Content-Type'] = 'application/json'
58
- req.body = request
59
- end
60
- rescue Faraday::Error::ConnectionFailed => e
61
- $lxca_log.error "XClarityClient::XclarityBase do_post", "Error trying to send a POST to #{uri}"
62
- $lxca_log.error "XClarityClient::XclarityBase do_post", "Request sent: #{request}"
63
- Faraday::Response.new
64
- end
65
- end
66
-
67
- def do_put (uri="", request = {})
68
- begin
69
- @conn.put do |req|
70
- req.url uri
71
- req.headers['Content-Type'] = 'application/json'
72
- req.body = request
73
- end
74
- rescue Faraday::Error::ConnectionFailed => e
75
- $lxca_log.error "XClarityClient::XclarityBase do_put", "Error trying to send a PUT to #{uri}"
76
- $lxca_log.error "XClarityClient::XclarityBase do_put", "Request sent: #{request}"
77
- Faraday::Response.new
78
- end
79
- end
80
-
81
- def do_delete (uri="")
82
- @conn.delete do |req|
83
- req.url uri
84
- req.headers['Content-Type'] = 'application/json'
85
- end
86
- end
87
- end
88
- end