radfish-idrac 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c6008309c192c47666c88a24e72879af4e82b9e778df20991af68b056d5adeb8
4
+ data.tar.gz: 0d8a89c1b148b18f1646b27e37a94a5b371b06cd599ad2bc79847d97efeaea29
5
+ SHA512:
6
+ metadata.gz: 4d38ab479b1ff05097e29448bc3af881b25413528f20e2dafd902c76bdfa810377d02fa8ccd9a9fbd40e6c5a13425feb79ed73fadb653aa396bc48db4ce65e93
7
+ data.tar.gz: 2a4b023f76f69b14f4fad92f4bb628c135dbbda88c1f92aeda904772b1fd50a02a2e70abe483b6c88f7c13b04057e2aed5d8d7aab87d88acd74f176cce506df8
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jonathan Siegel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Radfish
4
+ module Idrac
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,312 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'radfish'
4
+ require 'idrac'
5
+
6
+ module Radfish
7
+ class IdracAdapter < Core::BaseClient
8
+ include Core::Power
9
+ include Core::System
10
+ include Core::Storage
11
+ include Core::VirtualMedia
12
+ include Core::Boot
13
+ include Core::Jobs
14
+ include Core::Utility
15
+
16
+ attr_reader :idrac_client
17
+
18
+ def initialize(host:, username:, password:, **options)
19
+ super
20
+
21
+ # Create the underlying iDRAC client
22
+ @idrac_client = IDRAC::Client.new(
23
+ host: host,
24
+ username: username,
25
+ password: password,
26
+ port: options[:port] || 443,
27
+ use_ssl: options.fetch(:use_ssl, true),
28
+ verify_ssl: options.fetch(:verify_ssl, false),
29
+ direct_mode: options.fetch(:direct_mode, false),
30
+ retry_count: options[:retry_count] || 3,
31
+ retry_delay: options[:retry_delay] || 1,
32
+ host_header: options[:host_header]
33
+ )
34
+ end
35
+
36
+ def vendor
37
+ 'dell'
38
+ end
39
+
40
+ def verbosity=(value)
41
+ super
42
+ @idrac_client.verbosity = value if @idrac_client
43
+ end
44
+
45
+ # Session management
46
+
47
+ def login
48
+ @idrac_client.login
49
+ end
50
+
51
+ def logout
52
+ @idrac_client.logout
53
+ end
54
+
55
+ def authenticated_request(method, path, **options)
56
+ @idrac_client.authenticated_request(method, path, **options)
57
+ end
58
+
59
+ # Power management - delegate to iDRAC client
60
+
61
+ def power_status
62
+ @idrac_client.get_power_state
63
+ end
64
+
65
+ def power_on
66
+ @idrac_client.power_on
67
+ end
68
+
69
+ def power_off(force: false)
70
+ kind = force ? "ForceOff" : "GracefulShutdown"
71
+ @idrac_client.power_off(kind: kind)
72
+ end
73
+
74
+ def power_restart(force: false)
75
+ # iDRAC uses reboot method, which is ForceRestart by default
76
+ if force
77
+ @idrac_client.reboot
78
+ else
79
+ # Try graceful restart first
80
+ @idrac_client.power_off(kind: "GracefulRestart") rescue @idrac_client.reboot
81
+ end
82
+ end
83
+
84
+ def power_cycle
85
+ # iDRAC doesn't have power_cycle, simulate with off then on
86
+ power_off
87
+ sleep 5
88
+ power_on
89
+ end
90
+
91
+ def reset_type_allowed
92
+ # iDRAC doesn't expose this directly, return common types
93
+ ["On", "ForceOff", "GracefulShutdown", "GracefulRestart", "ForceRestart", "Nmi", "PushPowerButton"]
94
+ end
95
+
96
+ # System information
97
+
98
+ def system_info
99
+ @idrac_client.system_info
100
+ end
101
+
102
+ def cpus
103
+ @idrac_client.cpus
104
+ end
105
+
106
+ def memory
107
+ @idrac_client.memory
108
+ end
109
+
110
+ def nics
111
+ @idrac_client.nics
112
+ end
113
+
114
+ def fans
115
+ @idrac_client.fans
116
+ end
117
+
118
+ def temperatures
119
+ @idrac_client.temperatures
120
+ end
121
+
122
+ def psus
123
+ @idrac_client.psus
124
+ end
125
+
126
+ def power_consumption
127
+ @idrac_client.power_consumption
128
+ end
129
+
130
+ # Storage
131
+
132
+ def storage_controllers
133
+ @idrac_client.storage_controllers
134
+ end
135
+
136
+ def drives
137
+ @idrac_client.drives
138
+ end
139
+
140
+ def volumes
141
+ @idrac_client.volumes
142
+ end
143
+
144
+ def storage_summary
145
+ @idrac_client.storage_summary
146
+ end
147
+
148
+ # Virtual Media
149
+
150
+ def virtual_media
151
+ @idrac_client.virtual_media
152
+ end
153
+
154
+ def insert_virtual_media(iso_url, device: "CD")
155
+ @idrac_client.insert_virtual_media(iso_url, device: device)
156
+ end
157
+
158
+ def eject_virtual_media(device: "CD")
159
+ @idrac_client.eject_virtual_media(device: device)
160
+ end
161
+
162
+ def virtual_media_status
163
+ @idrac_client.virtual_media
164
+ end
165
+
166
+ def mount_iso_and_boot(iso_url, device: "CD")
167
+ insert_virtual_media(iso_url, device: device)
168
+ boot_to_cd
169
+ end
170
+
171
+ def unmount_all_media
172
+ media_list = virtual_media
173
+ success = true
174
+
175
+ media_list.each do |media|
176
+ if media[:inserted]
177
+ success &&= eject_virtual_media(device: media[:device])
178
+ end
179
+ end
180
+
181
+ success
182
+ end
183
+
184
+ # Boot configuration
185
+
186
+ def boot_options
187
+ @idrac_client.boot_options
188
+ end
189
+
190
+ def set_boot_override(target, persistent: false)
191
+ @idrac_client.set_boot_override(target, persistent: persistent)
192
+ end
193
+
194
+ def clear_boot_override
195
+ @idrac_client.clear_boot_override
196
+ end
197
+
198
+ def set_boot_order(devices)
199
+ @idrac_client.set_boot_order(devices)
200
+ end
201
+
202
+ def get_boot_devices
203
+ @idrac_client.get_boot_devices
204
+ end
205
+
206
+ def boot_to_pxe
207
+ @idrac_client.boot_to_pxe
208
+ end
209
+
210
+ def boot_to_disk
211
+ @idrac_client.boot_to_disk
212
+ end
213
+
214
+ def boot_to_cd
215
+ @idrac_client.boot_to_cd
216
+ end
217
+
218
+ def boot_to_usb
219
+ @idrac_client.boot_to_usb
220
+ end
221
+
222
+ def boot_to_bios_setup
223
+ @idrac_client.boot_to_bios_setup
224
+ end
225
+
226
+ # Jobs
227
+
228
+ def jobs
229
+ @idrac_client.jobs
230
+ end
231
+
232
+ def job_status(job_id)
233
+ @idrac_client.job_status(job_id)
234
+ end
235
+
236
+ def wait_for_job(job_id, timeout: 600)
237
+ @idrac_client.wait_for_job(job_id, timeout: timeout)
238
+ end
239
+
240
+ def cancel_job(job_id)
241
+ @idrac_client.cancel_job(job_id)
242
+ end
243
+
244
+ def clear_completed_jobs
245
+ @idrac_client.clear_jobs
246
+ end
247
+
248
+ def jobs_summary
249
+ jobs
250
+ end
251
+
252
+ # Utility
253
+
254
+ def sel_log
255
+ @idrac_client.sel_log
256
+ end
257
+
258
+ def clear_sel_log
259
+ @idrac_client.clear_sel_log
260
+ end
261
+
262
+ def sel_summary(limit: 10)
263
+ @idrac_client.sel_summary(limit: limit)
264
+ end
265
+
266
+ def accounts
267
+ @idrac_client.accounts
268
+ end
269
+
270
+ def create_account(username:, password:, role: "Administrator")
271
+ @idrac_client.create_account(username: username, password: password, role: role)
272
+ end
273
+
274
+ def delete_account(username)
275
+ @idrac_client.delete_account(username)
276
+ end
277
+
278
+ def update_account_password(username:, new_password:)
279
+ @idrac_client.update_account_password(username: username, new_password: new_password)
280
+ end
281
+
282
+ def sessions
283
+ @idrac_client.sessions
284
+ end
285
+
286
+ def service_info
287
+ @idrac_client.service_info
288
+ end
289
+
290
+ def get_firmware_version
291
+ @idrac_client.get_firmware_version
292
+ end
293
+
294
+ # Additional iDRAC-specific methods
295
+
296
+ def screenshot
297
+ @idrac_client.screenshot if @idrac_client.respond_to?(:screenshot)
298
+ end
299
+
300
+ def licenses
301
+ @idrac_client.licenses if @idrac_client.respond_to?(:licenses)
302
+ end
303
+
304
+ def license_info
305
+ @idrac_client.license_info if @idrac_client.respond_to?(:license_info)
306
+ end
307
+ end
308
+
309
+ # Register the adapter
310
+ Radfish.register_adapter('dell', IdracAdapter)
311
+ Radfish.register_adapter('idrac', IdracAdapter)
312
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: radfish-idrac
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jonathan Siegel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-08-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: radfish
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: idrac
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: Provides Dell iDRAC support for the Radfish unified Redfish client
56
+ email:
57
+ - jonathan@buildio.co
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - LICENSE
63
+ - lib/radfish/idrac/version.rb
64
+ - lib/radfish/idrac_adapter.rb
65
+ homepage: https://github.com/buildio/radfish-idrac
66
+ licenses:
67
+ - MIT
68
+ metadata:
69
+ allowed_push_host: https://rubygems.org
70
+ homepage_uri: https://github.com/buildio/radfish-idrac
71
+ source_code_uri: https://github.com/buildio/radfish-idrac
72
+ changelog_uri: https://github.com/buildio/radfish-idrac/blob/main/CHANGELOG.md
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 3.1.0
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubygems_version: 3.3.26
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Dell iDRAC adapter for Radfish
92
+ test_files: []