redfish_client 0.6.0 → 0.7.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 +4 -4
- data/lib/redfish_client/resource.rb +22 -10
- data/lib/redfish_client/version.rb +1 -1
- data/redfish_client.gemspec +1 -1
- metadata +15 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f6ba76d56a2c09531c6e64bf19821d0b5f582dd70b16d1905aba16dc2b68df2e
|
|
4
|
+
data.tar.gz: 530aebc45865ab6b64d2eb188c76f65dd1537f3e10d2b45c8e8dc29941dd86cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7671904be9a15568124d63ebff70d72e3b6f35a0adafc632e278637720aaae2b4e1ee1e29355997c47be9060cf6ce4daae6c8bfc7f2af8682e2c38f8f8e72f2b
|
|
7
|
+
data.tar.gz: 074a32b18fb628befd56cc46977f3efbe431571cda082e4c6498d89a0dbc581debac11e07cbd2e5412437bb1d7cf653aef85b3e98ea071b0957bb43fb4c9eb4b
|
|
@@ -149,10 +149,15 @@ module RedfishClient
|
|
|
149
149
|
# @param method [Symbol] HTTP method (:get, :post, :patch or :delete)
|
|
150
150
|
# @param field [String, Symbol] path lookup field
|
|
151
151
|
# @param path [String] path to post to
|
|
152
|
+
# @param payload Hash<String, >] data to send
|
|
153
|
+
# @param headers [Hash<String, String>] additional headers for this request only
|
|
152
154
|
# @return [RedfishClient::Response] response
|
|
153
155
|
# @raise [NoODataId] resource has no OpenData id
|
|
154
|
-
def request(method, field, path, payload = nil)
|
|
156
|
+
def request(method, field, path, payload = nil, headers = nil)
|
|
157
|
+
@connector.add_headers(headers) if headers&.any?
|
|
155
158
|
@connector.request(method, get_path(field, path), payload)
|
|
159
|
+
ensure
|
|
160
|
+
@connector.remove_headers(headers) if headers&.any?
|
|
156
161
|
end
|
|
157
162
|
|
|
158
163
|
# Issue a GET requests to the selected endpoint.
|
|
@@ -169,10 +174,11 @@ module RedfishClient
|
|
|
169
174
|
#
|
|
170
175
|
# @param field [String, Symbol] path lookup field
|
|
171
176
|
# @param path [String] path to post to
|
|
177
|
+
# @param headers [Hash<String, String>] additional headers for this request only
|
|
172
178
|
# @return [RedfishClient::Response] response
|
|
173
179
|
# @raise [NoODataId] resource has no OpenData id
|
|
174
|
-
def get(field: "@odata.id", path: nil)
|
|
175
|
-
request(:get, field, path)
|
|
180
|
+
def get(field: "@odata.id", path: nil, headers: nil)
|
|
181
|
+
request(:get, field, path, nil, headers)
|
|
176
182
|
end
|
|
177
183
|
|
|
178
184
|
# Issue a POST requests to the selected endpoint.
|
|
@@ -193,10 +199,11 @@ module RedfishClient
|
|
|
193
199
|
# @param field [String, Symbol] path lookup field
|
|
194
200
|
# @param path [String] path to post to
|
|
195
201
|
# @param payload [Hash<String, >] data to send
|
|
202
|
+
# @param headers [Hash<String, String>] additional headers for this request only
|
|
196
203
|
# @return [RedfishClient::Response] response
|
|
197
204
|
# @raise [NoODataId] resource has no OpenData id
|
|
198
|
-
def post(field: "@odata.id", path: nil,
|
|
199
|
-
request(:post, field, path, payload)
|
|
205
|
+
def post(field: "@odata.id", path: nil, payload: nil, headers: nil)
|
|
206
|
+
request(:post, field, path, payload, headers)
|
|
200
207
|
end
|
|
201
208
|
|
|
202
209
|
# Issue a PATCH requests to the selected endpoint.
|
|
@@ -207,10 +214,11 @@ module RedfishClient
|
|
|
207
214
|
# @param field [String, Symbol] path lookup field
|
|
208
215
|
# @param path [String] path to patch
|
|
209
216
|
# @param payload [Hash<String, >] data to send
|
|
217
|
+
# @param headers [Hash<String, String>] additional headers for this request only
|
|
210
218
|
# @return [RedfishClient::Response] response
|
|
211
219
|
# @raise [NoODataId] resource has no OpenData id
|
|
212
|
-
def patch(field: "@odata.id", path: nil,
|
|
213
|
-
request(:patch, field, path, payload)
|
|
220
|
+
def patch(field: "@odata.id", path: nil, payload: nil, headers: nil)
|
|
221
|
+
request(:patch, field, path, payload, headers)
|
|
214
222
|
end
|
|
215
223
|
|
|
216
224
|
# Issue a DELETE requests to the endpoint of the resource.
|
|
@@ -219,16 +227,20 @@ module RedfishClient
|
|
|
219
227
|
# raised, since deleting non-networked resources makes no sense and
|
|
220
228
|
# probably indicates bug in library consumer.
|
|
221
229
|
#
|
|
230
|
+
# @param field [String, Symbol] path lookup field
|
|
231
|
+
# @param path [String] path to patch
|
|
232
|
+
# @param payload [Hash<String, >] data to send
|
|
233
|
+
# @param headers [Hash<String, String>] additional headers for this request only
|
|
222
234
|
# @return [RedfishClient::Response] response
|
|
223
235
|
# @raise [NoODataId] resource has no OpenData id
|
|
224
|
-
def delete(field: "@odata.id", path: nil, payload: nil)
|
|
225
|
-
request(:delete, field, path, payload)
|
|
236
|
+
def delete(field: "@odata.id", path: nil, payload: nil, headers: nil)
|
|
237
|
+
request(:delete, field, path, payload, headers)
|
|
226
238
|
end
|
|
227
239
|
|
|
228
240
|
# Refresh resource content from the API
|
|
229
241
|
#
|
|
230
242
|
# Caling this method will ensure that the resource data is in sync with
|
|
231
|
-
# the
|
|
243
|
+
# the Redfish API, invalidating any caches as necessary.
|
|
232
244
|
def refresh
|
|
233
245
|
return unless self["@odata.id"]
|
|
234
246
|
|
data/redfish_client.gemspec
CHANGED
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
|
|
30
30
|
spec.required_ruby_version = ">= 2.1"
|
|
31
31
|
|
|
32
|
-
spec.add_runtime_dependency "excon", "
|
|
32
|
+
spec.add_runtime_dependency "excon", ">= 0.71", "< 2"
|
|
33
33
|
spec.add_runtime_dependency "server_sent_events", "~> 0.1"
|
|
34
34
|
|
|
35
35
|
spec.add_development_dependency "rake", ">= 11.0"
|
metadata
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redfish_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tadej Borovšak
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-12-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: excon
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '0.71'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '2'
|
|
20
23
|
type: :runtime
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
|
-
- - "
|
|
27
|
+
- - ">="
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
29
|
version: '0.71'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '2'
|
|
27
33
|
- !ruby/object:Gem::Dependency
|
|
28
34
|
name: server_sent_events
|
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -136,7 +142,7 @@ dependencies:
|
|
|
136
142
|
- - ">="
|
|
137
143
|
- !ruby/object:Gem::Version
|
|
138
144
|
version: '0'
|
|
139
|
-
description:
|
|
145
|
+
description:
|
|
140
146
|
email:
|
|
141
147
|
- tadej.borovsak@xlab.si
|
|
142
148
|
executables: []
|
|
@@ -170,7 +176,7 @@ licenses:
|
|
|
170
176
|
- Apache-2.0
|
|
171
177
|
metadata:
|
|
172
178
|
allowed_push_host: https://rubygems.org
|
|
173
|
-
post_install_message:
|
|
179
|
+
post_install_message:
|
|
174
180
|
rdoc_options: []
|
|
175
181
|
require_paths:
|
|
176
182
|
- lib
|
|
@@ -185,8 +191,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
185
191
|
- !ruby/object:Gem::Version
|
|
186
192
|
version: '0'
|
|
187
193
|
requirements: []
|
|
188
|
-
rubygems_version: 3.
|
|
189
|
-
signing_key:
|
|
194
|
+
rubygems_version: 3.4.20
|
|
195
|
+
signing_key:
|
|
190
196
|
specification_version: 4
|
|
191
197
|
summary: Simple Redfish client library
|
|
192
198
|
test_files: []
|