manageiq-api-client 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3537abcdd5d9a79fa4e54c352dc010a541c4ce87
4
- data.tar.gz: f2756d0fe7d77fa904f6862d0299c96dea29bd0e
2
+ SHA256:
3
+ metadata.gz: 3ca83700fb1d4b54c43d3291ab55d6c6219bf5618cd2c79fa9c791801e960968
4
+ data.tar.gz: 96c96017e33930ba4d55de7f7f2cb327d5ba693bd40a1495c9afbf31ebb4826f
5
5
  SHA512:
6
- metadata.gz: 0fc3127e3de0055f0c7b34a729877cf80c74a752939485d9ab0b344cb6c2de22754a0171de7b8db47bdb67ea8e3c3a0841aefe2228c512b1afe5cf673bea305e
7
- data.tar.gz: a5b0d7472fc865e6fe80569a3358ac419302b455ad1278949459a1b301c26069305fd96babebc87c62fa424eac9f87580c8f237b8ba2336067ab67d3bb8849fc
6
+ metadata.gz: fbaa770ff5d0e944d1b9f8cfbb1875a4b02564650bf9382d3431881fffe28b80c2bd9cc2700db09e17eb9093b1a6642091d666cad07a491e74da2abb90609846
7
+ data.tar.gz: '08a8a0892373c931c21704fc8a0492b261c9e24bdc3a84791bb1ff6109518933a49c834d8153fbbf88566af9acd3273055b55a1ad21fe797f6b3126549aa862d'
@@ -1,6 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.5
3
+ - 2.2.7
4
+ - 2.3.1
5
+ - 2.4.2
4
6
  sudo: false
5
7
  cache: bundler
6
8
  before_install: gem install bundler -v 1.12.5
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.0] - 2018-03-14
10
+
11
+ ### Changed
12
+ - Adding support for Faraday's open_timeout and timeout options [[#78](https://github.com/ManageIQ/manageiq-api-client/pull/78)]
13
+ - Loosen dependency on activesupport [[#74](https://github.com/ManageIQ/manageiq-api-client/pull/74)]
14
+ - Updated JSON gem to 2.1.0 [[#73](https://github.com/ManageIQ/manageiq-api-client/pull/73)]
15
+ - Loosen dependency on faraday to allow for upgrades [[#71](https://github.com/ManageIQ/manageiq-api-client/pull/71)]
16
+ - Enhanced ServerInfo to support the new \_href entries [[#66](https://github.com/ManageIQ/manageiq-api-client/pull/66)]
17
+
18
+ ### Fixed
19
+ - Improve query used when fetching collection actions [[#77](https://github.com/ManageIQ/manageiq-api-client/pull/77)]
20
+
9
21
  ## [0.2.0] - 2017-02-24
10
22
 
11
23
  ### Changed
@@ -22,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
22
34
  - Add CHANGELOG.md
23
35
  - Update README with simple instructions reflecting the query interface.
24
36
 
25
- [Unreleased]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.1...HEAD
26
- [0.1.1]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.0...v0.1.1
37
+ [Unreleased]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.3.0...HEAD
38
+ [0.3.0]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.2.0...v0.3.0
27
39
  [0.2.0]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.1...v0.2.0
40
+ [0.1.1]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.0...v0.1.1
@@ -58,7 +58,7 @@ module ManageIQ
58
58
  end
59
59
 
60
60
  def reconnect
61
- @connection = ManageIQ::API::Client::Connection.new(self, client_options.slice(:ssl))
61
+ @connection = ManageIQ::API::Client::Connection.new(self, client_options.slice(:ssl, :open_timeout, :timeout))
62
62
  load_definitions
63
63
  end
64
64
 
@@ -95,7 +95,7 @@ module ManageIQ
95
95
  private
96
96
 
97
97
  def method_missing(sym, *args, &block)
98
- get unless actions_present?
98
+ query_actions unless actions_present?
99
99
  if action_defined?(sym)
100
100
  exec_action(sym, *args, &block)
101
101
  else
@@ -104,7 +104,7 @@ module ManageIQ
104
104
  end
105
105
 
106
106
  def respond_to_missing?(sym, *_)
107
- get unless actions_present?
107
+ query_actions unless actions_present?
108
108
  action_defined?(sym) || super
109
109
  end
110
110
 
@@ -194,6 +194,11 @@ module ManageIQ
194
194
  end
195
195
  body
196
196
  end
197
+
198
+ def query_actions
199
+ result_hash = client.get(name, :limit => 1)
200
+ fetch_actions(result_hash)
201
+ end
197
202
  end
198
203
  end
199
204
  end
@@ -67,12 +67,12 @@ module ManageIQ
67
67
  end
68
68
  end
69
69
 
70
- private
71
-
72
70
  def handle
73
71
  ssl_options = @connection_options[:ssl]
74
72
  Faraday.new(:url => url, :ssl => ssl_options) do |faraday|
75
73
  faraday.request(:url_encoded) # form-encode POST params
74
+ faraday.options.open_timeout = @connection_options[:open_timeout] if @connection_options[:open_timeout]
75
+ faraday.options.timeout = @connection_options[:timeout] if @connection_options[:timeout]
76
76
  faraday.response(:logger, client.logger)
77
77
  faraday.use FaradayMiddleware::FollowRedirects, :limit => 3, :standards_compliant => true
78
78
  faraday.adapter(Faraday.default_adapter) # make requests with Net::HTTP
@@ -82,6 +82,8 @@ module ManageIQ
82
82
  end
83
83
  end
84
84
 
85
+ private
86
+
85
87
  def send_request(method, path, params, &block)
86
88
  begin
87
89
  @error = nil
@@ -5,10 +5,13 @@ module ManageIQ
5
5
  attr_reader :version
6
6
  attr_reader :build
7
7
  attr_reader :appliance
8
+ attr_reader :server_href
9
+ attr_reader :zone_href
10
+ attr_reader :region_href
8
11
 
9
12
  def initialize(server_info)
10
- @version, @build, @appliance =
11
- server_info.values_at("version", "build", "appliance")
13
+ @version, @build, @appliance, @server_href, @zone_href, @region_href =
14
+ server_info.values_at("version", "build", "appliance", "server_href", "zone_href", "region_href")
12
15
  end
13
16
  end
14
17
  end
@@ -1,7 +1,7 @@
1
1
  module ManageIQ
2
2
  module API
3
3
  class Client
4
- VERSION = "0.2.0".freeze
4
+ VERSION = "0.3.0".freeze
5
5
  end
6
6
  end
7
7
  end
@@ -27,10 +27,10 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
29
 
30
- spec.add_dependency "activesupport", "~> 5.0"
31
- spec.add_dependency "faraday", "~> 0.9.2"
30
+ spec.add_dependency "activesupport", ">= 5.0", "< 5.2"
31
+ spec.add_dependency "faraday", "~> 0.9"
32
32
  spec.add_dependency "faraday_middleware", "~> 0.10.0"
33
- spec.add_dependency "json", "~> 2.0.1"
33
+ spec.add_dependency "json", "~> 2.1.0"
34
34
  spec.add_dependency "more_core_extensions"
35
35
  spec.add_dependency "query_relation"
36
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Bellotti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-02-24 00:00:00.000000000 Z
12
+ date: 2018-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -57,30 +57,36 @@ dependencies:
57
57
  name: activesupport
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '5.0'
63
+ - - "<"
64
+ - !ruby/object:Gem::Version
65
+ version: '5.2'
63
66
  type: :runtime
64
67
  prerelease: false
65
68
  version_requirements: !ruby/object:Gem::Requirement
66
69
  requirements:
67
- - - "~>"
70
+ - - ">="
68
71
  - !ruby/object:Gem::Version
69
72
  version: '5.0'
73
+ - - "<"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.2'
70
76
  - !ruby/object:Gem::Dependency
71
77
  name: faraday
72
78
  requirement: !ruby/object:Gem::Requirement
73
79
  requirements:
74
80
  - - "~>"
75
81
  - !ruby/object:Gem::Version
76
- version: 0.9.2
82
+ version: '0.9'
77
83
  type: :runtime
78
84
  prerelease: false
79
85
  version_requirements: !ruby/object:Gem::Requirement
80
86
  requirements:
81
87
  - - "~>"
82
88
  - !ruby/object:Gem::Version
83
- version: 0.9.2
89
+ version: '0.9'
84
90
  - !ruby/object:Gem::Dependency
85
91
  name: faraday_middleware
86
92
  requirement: !ruby/object:Gem::Requirement
@@ -101,14 +107,14 @@ dependencies:
101
107
  requirements:
102
108
  - - "~>"
103
109
  - !ruby/object:Gem::Version
104
- version: 2.0.1
110
+ version: 2.1.0
105
111
  type: :runtime
106
112
  prerelease: false
107
113
  version_requirements: !ruby/object:Gem::Requirement
108
114
  requirements:
109
115
  - - "~>"
110
116
  - !ruby/object:Gem::Version
111
- version: 2.0.1
117
+ version: 2.1.0
112
118
  - !ruby/object:Gem::Dependency
113
119
  name: more_core_extensions
114
120
  requirement: !ruby/object:Gem::Requirement
@@ -199,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
205
  version: '0'
200
206
  requirements: []
201
207
  rubyforge_project:
202
- rubygems_version: 2.5.2
208
+ rubygems_version: 2.7.6
203
209
  signing_key:
204
210
  specification_version: 4
205
211
  summary: ManageIQ API Client