idrac 0.1.31 → 0.1.38
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/README.md +48 -101
- data/bin/idrac +128 -12
- data/idrac.gemspec +9 -8
- data/lib/idrac/version.rb +1 -1
- data/lib/idrac.rb +1 -0
- metadata +3 -36
- data/.rspec +0 -3
- data/Rakefile +0 -17
- data/dell_firmware_downloads/Catalog.etag +0 -1
- data/dell_firmware_downloads/Catalog.xml +0 -0
- data/idrac-0.1.6/.rspec +0 -3
- data/idrac-0.1.6/README.md +0 -103
- data/idrac-0.1.6/Rakefile +0 -17
- data/idrac-0.1.6/bin/console +0 -11
- data/idrac-0.1.6/bin/idrac +0 -179
- data/idrac-0.1.6/bin/setup +0 -8
- data/idrac-0.1.6/idrac.gemspec +0 -51
- data/idrac-0.1.6/lib/idrac/client.rb +0 -109
- data/idrac-0.1.6/lib/idrac/firmware.rb +0 -366
- data/idrac-0.1.6/lib/idrac/version.rb +0 -5
- data/idrac-0.1.6/lib/idrac.rb +0 -30
- data/idrac-0.1.6/sig/idrac.rbs +0 -4
- data/idrac-0.1.7/.rspec +0 -3
- data/idrac-0.1.7/README.md +0 -103
- data/idrac-0.1.7/Rakefile +0 -17
- data/idrac-0.1.7/bin/console +0 -11
- data/idrac-0.1.7/bin/idrac +0 -179
- data/idrac-0.1.7/bin/setup +0 -8
- data/idrac-0.1.7/idrac.gemspec +0 -51
- data/idrac-0.1.7/lib/idrac/client.rb +0 -109
- data/idrac-0.1.7/lib/idrac/firmware.rb +0 -366
- data/idrac-0.1.7/lib/idrac/screenshot.rb +0 -49
- data/idrac-0.1.7/lib/idrac/version.rb +0 -5
- data/idrac-0.1.7/lib/idrac.rb +0 -30
- data/idrac-0.1.7/sig/idrac.rbs +0 -4
- data/idrac.py +0 -500
- data/sig/idrac.rbs +0 -4
- data/test_firmware_update.rb +0 -68
- data/updater.rb +0 -729
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 462eec3a8d4efc8ef0c8b79247cb3b5624f96c97b1cb2b98e10311939fcea521
|
4
|
+
data.tar.gz: 91793e111a24c4d71ef4ab9c38ea6291630b4314e754f108068a6cded9c23b70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e6ecd835d5f68d3e4230944843131d70cc5e239bfc546127af7fed5d9fe83a82c4c5421f68fd88ea76f6f94fc9df8193405c936f20ee1a4905cc66e3d457bd7
|
7
|
+
data.tar.gz: e301acc6c69c352fb3ae4bc2503a7501ab01fe4dd3af9597a2b276aa468c98cb9a9e03c649e55271b26edc8d738b7fcf758e46ab5adef4100cbd6553583f1371
|
data/README.md
CHANGED
@@ -54,6 +54,11 @@ idrac firmware:update /path/to/firmware.exe --host=192.168.1.100 --username=root
|
|
54
54
|
|
55
55
|
# Interactive firmware update
|
56
56
|
idrac firmware:interactive --host=192.168.1.100 --username=root --password=calvin
|
57
|
+
|
58
|
+
# Display a summary of system information
|
59
|
+
idrac summary --host=192.168.1.100 --username=root --password=calvin
|
60
|
+
# With verbose output for debugging
|
61
|
+
idrac summary --host=192.168.1.100 --username=root --password=calvin --verbose
|
57
62
|
```
|
58
63
|
|
59
64
|
All commands automatically handle session expiration by re-authenticating when necessary, ensuring that long-running operations like firmware updates complete successfully even if the iDRAC session times out.
|
@@ -134,24 +139,51 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
134
139
|
|
135
140
|
## Changelog
|
136
141
|
|
142
|
+
### Version 0.1.38
|
143
|
+
- **Enhanced License Display**: Updated the summary command to show both license type and description
|
144
|
+
- Improved readability by displaying license information in the format "Type (Description)"
|
145
|
+
- Better user experience with more detailed license information
|
146
|
+
|
147
|
+
### Version 0.1.37
|
148
|
+
- **Improved License Detection**: Enhanced license detection using both DMTF standard and Dell OEM methods
|
149
|
+
- Added fallback mechanisms to ensure proper license type detection
|
150
|
+
- Improved error handling for license information retrieval
|
151
|
+
|
152
|
+
### Version 0.1.36
|
153
|
+
- **Fixed License Type Display**: Updated the summary command to correctly display Enterprise license
|
154
|
+
- **Added Verbose Mode**: New `--verbose` option for the summary command to show detailed API responses
|
155
|
+
- Improved debugging capabilities with raw JSON output of system, iDRAC, network, and license information
|
156
|
+
|
157
|
+
### Version 0.1.35
|
158
|
+
- **Added System Summary Command**: New `summary` command to display key system information
|
159
|
+
- Shows power state, model, host name, OS details, service tag, firmware versions, and more
|
160
|
+
- Formatted output with color-coding for improved readability
|
161
|
+
|
162
|
+
### Version 0.1.34
|
163
|
+
- **Fixed Gem Build Process**: Corrected version mismatch in the Rakefile
|
164
|
+
- **Improved CLI Structure**: Removed hardcoded command list in favor of explicit host requirements in each command
|
165
|
+
- Enhanced code organization and maintainability
|
166
|
+
|
167
|
+
### Version 0.1.33
|
168
|
+
- **Fixed Command-Line Interface**: Improved handling of commands that don't require a host
|
169
|
+
- Made the `firmware:catalog` command work without requiring host, username, and password
|
170
|
+
- Enhanced command-line interface reliability
|
171
|
+
|
172
|
+
### Version 0.1.32
|
173
|
+
- **Fixed Gem Loading Issues**: Ensured proper loading of the colorize gem in the main module
|
174
|
+
- Resolved issues with running commands when installed as a gem
|
175
|
+
- Improved reliability of command-line interface
|
176
|
+
|
137
177
|
### Version 0.1.31
|
138
|
-
- **Enhanced Job Monitoring**:
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
- Improved error handling for common firmware update issues with clear user guidance
|
143
|
-
- Added better handling of "deployment already in progress" scenarios
|
144
|
-
- Implemented a more robust firmware download process with better error reporting
|
145
|
-
- Enhanced the interactive update process with clearer user prompts and status messages
|
178
|
+
- **Enhanced Job Monitoring**: Improved firmware update job tracking and monitoring
|
179
|
+
- Added more robust error handling during firmware updates
|
180
|
+
- Enhanced progress reporting with color-coded status messages
|
181
|
+
- Improved recovery mechanisms for common firmware update issues
|
146
182
|
|
147
183
|
### Version 0.1.30
|
148
|
-
- **
|
149
|
-
-
|
150
|
-
-
|
151
|
-
- Improved visual distinction between different types of messages (success, error, warning, info)
|
152
|
-
- Enhanced readability of firmware update status, system information, and error messages
|
153
|
-
- Updated all output messages across the codebase for consistent color formatting
|
154
|
-
- Added color to the test script output for better visualization of the firmware update process
|
184
|
+
- **Added Color Output**: Enhanced terminal output with color-coded messages
|
185
|
+
- Improved readability of status, warning, and error messages
|
186
|
+
- Added the colorize gem as a dependency
|
155
187
|
|
156
188
|
### Version 0.1.29
|
157
189
|
- **Enhanced Firmware Update Error Handling**: Improved detection and handling of common firmware update issues
|
@@ -214,89 +246,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
214
246
|
|
215
247
|
### Version 0.1.21
|
216
248
|
- **Improved Authentication Flow**: Completely restructured the login process
|
217
|
-
- Renamed `
|
218
|
-
- Implemented proper Redfish authentication flow: start with direct login to get a session
|
219
|
-
- Enhanced session management: when max sessions are encountered, delete sessions using direct login
|
220
|
-
- Simplified code by removing redundant authentication methods and focusing on Redfish standards
|
221
|
-
- Improved error handling and logging for better troubleshooting
|
222
|
-
|
223
|
-
### Version 0.1.20
|
224
|
-
- **Simplified CLI Interface**: Removed the direct-mode CLI option
|
225
|
-
- Maintained internal direct mode functionality as an automatic fallback mechanism
|
226
|
-
- The client will still automatically switch to direct mode when session management fails
|
227
|
-
- This change simplifies the user interface while preserving the robust session handling
|
228
|
-
|
229
|
-
### Version 0.1.19
|
230
|
-
- **Basic Auth Session Clearing**: Implemented direct session management using Basic Authentication
|
231
|
-
- Added ability to list and delete all active sessions without requiring a session
|
232
|
-
- Improved session clearing by directly accessing the Redfish Sessions API with Basic Auth
|
233
|
-
- Enhanced force_clear_sessions to first try the direct Basic Auth approach before falling back to login/logout cycles
|
234
|
-
- Added detailed logging of session clearing operations
|
235
|
-
|
236
|
-
### Version 0.1.18
|
237
|
-
- **Direct Mode Implementation**: Added a fallback mechanism for environments with persistent session issues
|
238
|
-
- Implemented automatic switching to direct mode (Basic Auth) when session creation repeatedly fails
|
239
|
-
- Added detection of maximum sessions condition to avoid unnecessary session creation attempts
|
240
|
-
- Improved handling of authentication failures with graceful degradation to direct mode
|
241
|
-
- Added Basic Auth support for all request types when in direct mode
|
242
|
-
- Enhanced logging for better visibility into authentication mode changes
|
243
|
-
|
244
|
-
### Version 0.1.17
|
245
|
-
- **Enhanced Session Clearing**: Added aggressive session clearing functionality
|
246
|
-
- Implemented a force_clear_sessions method that attempts multiple login/logout cycles with both authentication methods
|
247
|
-
- Added automatic session clearing when maximum sessions error is encountered
|
248
|
-
- Improved retry logic after session clearing
|
249
|
-
- Added detailed logging during session clearing process for better troubleshooting
|
250
|
-
|
251
|
-
### Version 0.1.16
|
252
|
-
- **Implemented Redfish API Session Management**: Completely redesigned session handling to use the proper Redfish API
|
253
|
-
- Added support for X-Auth-Token authentication (the standard Redfish approach)
|
254
|
-
- Maintained backward compatibility with legacy session management for screenshot functionality
|
255
|
-
- Improved session creation and deletion with proper error handling
|
256
|
-
- Added fallback mechanism to legacy authentication if Redfish session creation fails
|
257
|
-
- Enhanced logging for better troubleshooting of session-related issues
|
258
|
-
|
259
|
-
### Version 0.1.15
|
260
|
-
- **Aggressive Session Management**: Implemented a more robust approach to handle persistent session issues
|
261
|
-
- Added retry counters with limits to prevent infinite loops
|
262
|
-
- Increased delays between logout and login operations (5 seconds)
|
263
|
-
- Added multiple logout attempts to ensure sessions are properly cleared
|
264
|
-
- Added pre-emptive logout before login to help clear existing sessions
|
265
|
-
- Improved error messages with attempt counters for better debugging
|
266
|
-
|
267
|
-
### Version 0.1.14
|
268
|
-
- **Enhanced Session Management**: Improved handling of "maximum number of user sessions" errors
|
269
|
-
- Added detection and handling of session limits during initial login
|
270
|
-
- Added retry mechanism with proper session cleanup
|
271
|
-
- Added delays between logout and login operations to allow server to process session changes
|
272
|
-
- Made logout operation more robust by handling potential errors
|
273
|
-
|
274
|
-
### Version 0.1.13
|
275
|
-
- **Fixed Maximum Sessions Error**: Added handling for "maximum number of user sessions" errors
|
276
|
-
- The client now properly logs out before attempting to create a new session
|
277
|
-
- Improved session management to prevent session buildup on the iDRAC server
|
278
|
-
|
279
|
-
### Version 0.1.12
|
280
|
-
- **Improved Session Handling**: Added automatic re-authentication when sessions expire (401 errors)
|
281
|
-
- The client now automatically re-logs in and retries the request when it encounters a 401 Unauthorized error
|
282
|
-
- This prevents interruptions during long-running operations when the iDRAC session times out
|
283
|
-
|
284
|
-
### Version 0.1.11
|
285
|
-
- Added support for Ruby 3.2.x (previously required Ruby 3.3.0+)
|
286
|
-
- Fixed SSL verification warnings by making SSL verification optional
|
287
|
-
- Improved error handling and reporting
|
288
|
-
|
289
|
-
### Version 0.1.10
|
290
|
-
- Added base64 gem as a dependency to address Ruby 3.4.0 compatibility warnings
|
291
|
-
- Updated dependency versions with bounded requirements
|
292
|
-
- Added proper license specification in gemspec
|
293
|
-
|
294
|
-
### Version 0.1.9
|
295
|
-
- Added screenshot functionality with custom output filename support
|
296
|
-
- Improved firmware update process with better progress reporting
|
297
|
-
- Enhanced error handling for network connectivity issues
|
298
|
-
- Added default credentials (root/calvin) to simplify command usage
|
299
|
-
|
300
|
-
## Contributing
|
301
|
-
|
302
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/usiegj00/idrac.
|
249
|
+
- Renamed `
|
data/bin/idrac
CHANGED
@@ -11,23 +11,24 @@ end
|
|
11
11
|
require "thor"
|
12
12
|
require "idrac"
|
13
13
|
require "colorize"
|
14
|
+
require "json"
|
14
15
|
|
15
16
|
module IDRAC
|
16
17
|
class CLI < Thor
|
17
18
|
# Make host not required for all commands
|
18
19
|
class_option :host, type: :string, required: false, desc: "iDRAC host address"
|
19
|
-
class_option :username, type: :string, required: false, default: "root", desc: "iDRAC username
|
20
|
-
class_option :password, type: :string, required: false, default: "calvin", desc: "iDRAC password
|
20
|
+
class_option :username, type: :string, required: false, default: "root", desc: "iDRAC username"
|
21
|
+
class_option :password, type: :string, required: false, default: "calvin", desc: "iDRAC password"
|
21
22
|
class_option :port, type: :numeric, default: 443, desc: "iDRAC port"
|
22
23
|
class_option :no_ssl, type: :boolean, default: false, desc: "Disable SSL"
|
23
24
|
class_option :verify_ssl, type: :boolean, default: false, desc: "Enable SSL verification (not recommended for iDRAC's self-signed certificates)"
|
24
|
-
class_option :auto_delete_sessions, type: :boolean, default: true, desc: "Automatically delete sessions when maximum sessions are reached
|
25
|
+
class_option :auto_delete_sessions, type: :boolean, default: true, desc: "Automatically delete sessions when maximum sessions are reached"
|
25
26
|
|
26
27
|
desc "firmware:update PATH", "Update firmware using the specified file"
|
27
28
|
method_option :wait, type: :boolean, default: true, desc: "Wait for the update to complete"
|
28
29
|
method_option :timeout, type: :numeric, default: 3600, desc: "Timeout in seconds when waiting"
|
29
30
|
def firmware_update(path)
|
30
|
-
#
|
31
|
+
# This command requires a host
|
31
32
|
ensure_host_provided
|
32
33
|
|
33
34
|
check_ssl_verification
|
@@ -48,11 +49,10 @@ module IDRAC
|
|
48
49
|
desc "firmware:catalog [DIRECTORY]", "Download Dell firmware catalog"
|
49
50
|
def firmware_catalog(directory = nil)
|
50
51
|
# This command doesn't require a host
|
51
|
-
# Create a FirmwareCatalog instance directly
|
52
52
|
catalog = IDRAC::FirmwareCatalog.new
|
53
53
|
|
54
54
|
begin
|
55
|
-
puts "Downloading Dell catalog...".
|
55
|
+
puts "Downloading Dell catalog...".light_cyan
|
56
56
|
catalog_path = catalog.download(directory)
|
57
57
|
puts "Catalog downloaded to: #{catalog_path}".green
|
58
58
|
rescue IDRAC::Error => e
|
@@ -64,7 +64,7 @@ module IDRAC
|
|
64
64
|
desc "firmware:status", "Show current firmware status and available updates"
|
65
65
|
method_option :catalog, type: :string, desc: "Path to existing catalog file"
|
66
66
|
def firmware_status
|
67
|
-
#
|
67
|
+
# This command requires a host
|
68
68
|
ensure_host_provided
|
69
69
|
|
70
70
|
check_ssl_verification
|
@@ -113,7 +113,7 @@ module IDRAC
|
|
113
113
|
desc "firmware:interactive", "Interactive firmware update"
|
114
114
|
method_option :catalog, type: :string, desc: "Path to existing catalog file"
|
115
115
|
def firmware_interactive
|
116
|
-
#
|
116
|
+
# This command requires a host
|
117
117
|
ensure_host_provided
|
118
118
|
|
119
119
|
check_ssl_verification
|
@@ -178,7 +178,7 @@ module IDRAC
|
|
178
178
|
desc "screenshot", "Take a screenshot of the current iDRAC console"
|
179
179
|
method_option :output, type: :string, desc: "Output filename (default: idrac_screenshot_timestamp.png)"
|
180
180
|
def screenshot
|
181
|
-
#
|
181
|
+
# This command requires a host
|
182
182
|
ensure_host_provided
|
183
183
|
|
184
184
|
check_ssl_verification
|
@@ -205,6 +205,123 @@ module IDRAC
|
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
208
|
+
desc "summary", "Display a summary of system information"
|
209
|
+
method_option :verbose, type: :boolean, default: false, desc: "Show verbose output including raw API responses"
|
210
|
+
def summary
|
211
|
+
# This command requires a host
|
212
|
+
ensure_host_provided
|
213
|
+
|
214
|
+
check_ssl_verification
|
215
|
+
client = create_client
|
216
|
+
|
217
|
+
begin
|
218
|
+
# Get system information using authenticated_request
|
219
|
+
puts "Retrieving system information...".light_yellow if options[:verbose]
|
220
|
+
system_response = client.authenticated_request(:get, "/redfish/v1/Systems/System.Embedded.1")
|
221
|
+
system_info = JSON.parse(system_response.body)
|
222
|
+
puts JSON.pretty_generate(system_info).light_yellow if options[:verbose]
|
223
|
+
|
224
|
+
# Get iDRAC information using authenticated_request
|
225
|
+
puts "Retrieving iDRAC information...".light_yellow if options[:verbose]
|
226
|
+
idrac_response = client.authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1")
|
227
|
+
idrac_info = JSON.parse(idrac_response.body)
|
228
|
+
puts JSON.pretty_generate(idrac_info).light_yellow if options[:verbose]
|
229
|
+
|
230
|
+
# Get network information using authenticated_request
|
231
|
+
puts "Retrieving network information...".light_yellow if options[:verbose]
|
232
|
+
network_response = client.authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1/EthernetInterfaces/NIC.1")
|
233
|
+
network_info = JSON.parse(network_response.body)
|
234
|
+
puts JSON.pretty_generate(network_info).light_yellow if options[:verbose]
|
235
|
+
|
236
|
+
# Initialize license_type to Unknown
|
237
|
+
license_type = "Unknown"
|
238
|
+
license_description = nil
|
239
|
+
|
240
|
+
# Try to get license information using DMTF standard method
|
241
|
+
begin
|
242
|
+
puts "Retrieving license information (DMTF method)...".light_yellow if options[:verbose]
|
243
|
+
license_response = client.authenticated_request(:get, "/redfish/v1/LicenseService/Licenses")
|
244
|
+
license_info = JSON.parse(license_response.body)
|
245
|
+
puts JSON.pretty_generate(license_info).light_yellow if options[:verbose]
|
246
|
+
|
247
|
+
# Extract license type if licenses are found
|
248
|
+
if license_info["Members"] && !license_info["Members"].empty?
|
249
|
+
license_entry_response = client.authenticated_request(:get, license_info["Members"][0]["@odata.id"])
|
250
|
+
license_entry = JSON.parse(license_entry_response.body)
|
251
|
+
puts JSON.pretty_generate(license_entry).light_yellow if options[:verbose]
|
252
|
+
|
253
|
+
# Get license type from EntitlementId or LicenseType
|
254
|
+
if license_entry["EntitlementId"] && license_entry["EntitlementId"].include?("Enterprise")
|
255
|
+
license_type = "Enterprise"
|
256
|
+
elsif license_entry["LicenseType"]
|
257
|
+
license_type = license_entry["LicenseType"]
|
258
|
+
end
|
259
|
+
|
260
|
+
# Get license description if available
|
261
|
+
license_description = license_entry["Description"] if license_entry["Description"]
|
262
|
+
end
|
263
|
+
rescue => e
|
264
|
+
puts "Error retrieving license information using DMTF method: #{e.message}".light_red if options[:verbose]
|
265
|
+
|
266
|
+
# If DMTF method fails, try Dell OEM method
|
267
|
+
begin
|
268
|
+
puts "Retrieving license information (Dell OEM method)...".light_yellow if options[:verbose]
|
269
|
+
dell_license_response = client.authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/DellLicenses")
|
270
|
+
dell_license_info = JSON.parse(dell_license_response.body)
|
271
|
+
puts JSON.pretty_generate(dell_license_info).light_yellow if options[:verbose]
|
272
|
+
|
273
|
+
# Extract license type if licenses are found
|
274
|
+
if dell_license_info["Members"] && !dell_license_info["Members"].empty?
|
275
|
+
dell_license_entry_response = client.authenticated_request(:get, dell_license_info["Members"][0]["@odata.id"])
|
276
|
+
dell_license_entry = JSON.parse(dell_license_entry_response.body)
|
277
|
+
puts JSON.pretty_generate(dell_license_entry).light_yellow if options[:verbose]
|
278
|
+
|
279
|
+
# Get license type from LicenseType or Description
|
280
|
+
if dell_license_entry["LicenseType"]
|
281
|
+
license_type = dell_license_entry["LicenseType"]
|
282
|
+
elsif dell_license_entry["Description"] && dell_license_entry["Description"].include?("Enterprise")
|
283
|
+
license_type = "Enterprise"
|
284
|
+
end
|
285
|
+
|
286
|
+
# Get license description if available
|
287
|
+
license_description = dell_license_entry["Description"] if dell_license_entry["Description"]
|
288
|
+
end
|
289
|
+
rescue => e2
|
290
|
+
puts "Error retrieving Dell license information: #{e2.message}".light_red if options[:verbose]
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
# Format the license display string
|
295
|
+
license_display = license_type
|
296
|
+
if license_description
|
297
|
+
license_display = "#{license_type} (#{license_description})"
|
298
|
+
end
|
299
|
+
|
300
|
+
# Format and display the information
|
301
|
+
puts "System Summary:".green.bold
|
302
|
+
puts "=" * 50
|
303
|
+
|
304
|
+
puts "Power State:".ljust(25) + (system_info["PowerState"] || "Unknown").light_cyan
|
305
|
+
puts "Model:".ljust(25) + (system_info["Model"] || "Unknown").light_cyan
|
306
|
+
puts "Host Name:".ljust(25) + (system_info["HostName"] || "Unknown").light_cyan
|
307
|
+
puts "Operating System:".ljust(25) + (system_info.dig("Oem", "Dell", "OperatingSystem") || "Unknown").light_cyan
|
308
|
+
puts "Operating System Version:".ljust(25) + (system_info.dig("Oem", "Dell", "OperatingSystemVersion") || "Unknown").light_cyan
|
309
|
+
puts "Service Tag:".ljust(25) + (system_info["SKU"] || "Unknown").light_cyan
|
310
|
+
puts "BIOS Version:".ljust(25) + (system_info.dig("BiosVersion") || "Unknown").light_cyan
|
311
|
+
puts "iDRAC Firmware Version:".ljust(25) + (idrac_info.dig("FirmwareVersion") || "Unknown").light_cyan
|
312
|
+
puts "IP Address:".ljust(25) + (network_info.dig("IPv4Addresses", 0, "Address") || "Unknown").light_cyan
|
313
|
+
puts "iDRAC MAC Address:".ljust(25) + (network_info.dig("MACAddress") || "Unknown").light_cyan
|
314
|
+
puts "License:".ljust(25) + license_display.light_cyan
|
315
|
+
|
316
|
+
puts "=" * 50
|
317
|
+
rescue IDRAC::Error => e
|
318
|
+
puts "Error: #{e.message}".red.bold
|
319
|
+
exit 1
|
320
|
+
ensure
|
321
|
+
client.logout
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
208
325
|
map "firmware:update" => :firmware_update
|
209
326
|
map "firmware:catalog" => :firmware_catalog
|
210
327
|
map "firmware:status" => :firmware_status
|
@@ -213,7 +330,7 @@ module IDRAC
|
|
213
330
|
private
|
214
331
|
|
215
332
|
def ensure_host_provided
|
216
|
-
|
333
|
+
if !options[:host]
|
217
334
|
puts "Error: No value provided for required option '--host'".red.bold
|
218
335
|
exit 1
|
219
336
|
end
|
@@ -235,8 +352,7 @@ module IDRAC
|
|
235
352
|
password: options[:password],
|
236
353
|
port: options[:port],
|
237
354
|
use_ssl: !options[:no_ssl],
|
238
|
-
verify_ssl: options[:verify_ssl]
|
239
|
-
auto_delete_sessions: options[:auto_delete_sessions]
|
355
|
+
verify_ssl: options[:verify_ssl]
|
240
356
|
)
|
241
357
|
end
|
242
358
|
end
|
data/idrac.gemspec
CHANGED
@@ -21,13 +21,14 @@ Gem::Specification.new do |spec|
|
|
21
21
|
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
22
22
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
24
|
-
#
|
25
|
-
spec.files = Dir
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
# Instead of using git ls-files, use a more explicit approach
|
25
|
+
spec.files = Dir[
|
26
|
+
"lib/**/*",
|
27
|
+
"bin/*",
|
28
|
+
"README.md",
|
29
|
+
"LICENSE.txt",
|
30
|
+
"*.gemspec"
|
31
|
+
]
|
31
32
|
spec.bindir = "bin"
|
32
33
|
spec.executables = ["idrac"]
|
33
34
|
spec.require_paths = ["lib"]
|
@@ -39,7 +40,7 @@ Gem::Specification.new do |spec|
|
|
39
40
|
spec.add_dependency "faraday-multipart", ">= 1.0.0", "< 1.1.0"
|
40
41
|
spec.add_dependency "thor", ">= 1.2.0", "< 1.4.0"
|
41
42
|
spec.add_dependency "base64", "~> 0.1", ">= 0.1.0"
|
42
|
-
spec.add_dependency "colorize", "~>
|
43
|
+
spec.add_dependency "colorize", "~> 1.1"
|
43
44
|
|
44
45
|
# Development dependencies
|
45
46
|
spec.add_development_dependency "bundler", "~> 2.4", ">= 2.4.0"
|
data/lib/idrac/version.rb
CHANGED
data/lib/idrac.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idrac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Siegel
|
@@ -136,14 +136,14 @@ dependencies:
|
|
136
136
|
requirements:
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
139
|
+
version: '1.1'
|
140
140
|
type: :runtime
|
141
141
|
prerelease: false
|
142
142
|
version_requirements: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
146
|
+
version: '1.1'
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: bundler
|
149
149
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,41 +214,11 @@ executables:
|
|
214
214
|
extensions: []
|
215
215
|
extra_rdoc_files: []
|
216
216
|
files:
|
217
|
-
- ".rspec"
|
218
217
|
- README.md
|
219
|
-
- Rakefile
|
220
218
|
- bin/console
|
221
219
|
- bin/idrac
|
222
220
|
- bin/setup
|
223
|
-
- dell_firmware_downloads/Catalog.etag
|
224
|
-
- dell_firmware_downloads/Catalog.xml
|
225
|
-
- idrac-0.1.6/.rspec
|
226
|
-
- idrac-0.1.6/README.md
|
227
|
-
- idrac-0.1.6/Rakefile
|
228
|
-
- idrac-0.1.6/bin/console
|
229
|
-
- idrac-0.1.6/bin/idrac
|
230
|
-
- idrac-0.1.6/bin/setup
|
231
|
-
- idrac-0.1.6/idrac.gemspec
|
232
|
-
- idrac-0.1.6/lib/idrac.rb
|
233
|
-
- idrac-0.1.6/lib/idrac/client.rb
|
234
|
-
- idrac-0.1.6/lib/idrac/firmware.rb
|
235
|
-
- idrac-0.1.6/lib/idrac/version.rb
|
236
|
-
- idrac-0.1.6/sig/idrac.rbs
|
237
|
-
- idrac-0.1.7/.rspec
|
238
|
-
- idrac-0.1.7/README.md
|
239
|
-
- idrac-0.1.7/Rakefile
|
240
|
-
- idrac-0.1.7/bin/console
|
241
|
-
- idrac-0.1.7/bin/idrac
|
242
|
-
- idrac-0.1.7/bin/setup
|
243
|
-
- idrac-0.1.7/idrac.gemspec
|
244
|
-
- idrac-0.1.7/lib/idrac.rb
|
245
|
-
- idrac-0.1.7/lib/idrac/client.rb
|
246
|
-
- idrac-0.1.7/lib/idrac/firmware.rb
|
247
|
-
- idrac-0.1.7/lib/idrac/screenshot.rb
|
248
|
-
- idrac-0.1.7/lib/idrac/version.rb
|
249
|
-
- idrac-0.1.7/sig/idrac.rbs
|
250
221
|
- idrac.gemspec
|
251
|
-
- idrac.py
|
252
222
|
- lib/idrac.rb
|
253
223
|
- lib/idrac/client.rb
|
254
224
|
- lib/idrac/error.rb
|
@@ -256,9 +226,6 @@ files:
|
|
256
226
|
- lib/idrac/firmware_catalog.rb
|
257
227
|
- lib/idrac/screenshot.rb
|
258
228
|
- lib/idrac/version.rb
|
259
|
-
- sig/idrac.rbs
|
260
|
-
- test_firmware_update.rb
|
261
|
-
- updater.rb
|
262
229
|
homepage: http://github.com
|
263
230
|
licenses:
|
264
231
|
- MIT
|
data/.rspec
DELETED
data/Rakefile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
require "rspec/core/rake_task"
|
5
|
-
|
6
|
-
RSpec::Core::RakeTask.new(:spec)
|
7
|
-
|
8
|
-
task default: :spec
|
9
|
-
|
10
|
-
# Add a task that tags and pushes to the repository and builds
|
11
|
-
# the gem and pushes it to rubygems.org.
|
12
|
-
# Depend on the build task to ensure the gem is up to date.
|
13
|
-
task :release => [:build] do
|
14
|
-
system "git tag v#{Idrac::VERSION}"
|
15
|
-
system "git push --tags"
|
16
|
-
system "gem push pkg/idrac-#{Idrac::VERSION}.gem"
|
17
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
"8e46be845f83db1:0"
|
Binary file
|
data/idrac-0.1.6/.rspec
DELETED
data/idrac-0.1.6/README.md
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
# IDRAC
|
2
|
-
|
3
|
-
A Ruby client for the Dell iDRAC API. This gem provides a command-line interface and a Ruby API for interacting with Dell iDRAC servers.
|
4
|
-
|
5
|
-
## Features
|
6
|
-
|
7
|
-
- Take screenshots of the iDRAC console
|
8
|
-
- Update firmware using Dell's catalog
|
9
|
-
- Check for firmware updates
|
10
|
-
- Interactive firmware update process
|
11
|
-
|
12
|
-
## Installation
|
13
|
-
|
14
|
-
Add this line to your application's Gemfile:
|
15
|
-
|
16
|
-
```ruby
|
17
|
-
gem 'idrac'
|
18
|
-
```
|
19
|
-
|
20
|
-
And then execute:
|
21
|
-
|
22
|
-
$ bundle install
|
23
|
-
|
24
|
-
Or install it yourself as:
|
25
|
-
|
26
|
-
$ gem install idrac
|
27
|
-
|
28
|
-
## Usage
|
29
|
-
|
30
|
-
### Command Line Interface
|
31
|
-
|
32
|
-
The gem provides a command-line interface for interacting with iDRAC servers:
|
33
|
-
|
34
|
-
```bash
|
35
|
-
# Take a screenshot of the iDRAC console
|
36
|
-
idrac screenshot --host=192.168.1.100 --username=root --password=calvin
|
37
|
-
# Specify a custom output filename
|
38
|
-
idrac screenshot --host=192.168.1.100 --username=root --password=calvin --output=my_screenshot.png
|
39
|
-
|
40
|
-
# Download the Dell firmware catalog
|
41
|
-
idrac firmware:catalog --host=192.168.1.100 --username=root --password=calvin
|
42
|
-
|
43
|
-
# Check firmware status and available updates
|
44
|
-
idrac firmware:status --host=192.168.1.100 --username=root --password=calvin
|
45
|
-
|
46
|
-
# Update firmware using a specific file
|
47
|
-
idrac firmware:update /path/to/firmware.exe --host=192.168.1.100 --username=root --password=calvin
|
48
|
-
|
49
|
-
# Interactive firmware update
|
50
|
-
idrac firmware:interactive --host=192.168.1.100 --username=root --password=calvin
|
51
|
-
```
|
52
|
-
|
53
|
-
### Ruby API
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
require 'idrac'
|
57
|
-
|
58
|
-
# Create a client
|
59
|
-
client = IDRAC.new(
|
60
|
-
host: '192.168.1.100',
|
61
|
-
username: 'root',
|
62
|
-
password: 'calvin'
|
63
|
-
)
|
64
|
-
|
65
|
-
# Take a screenshot (using the client convenience method)
|
66
|
-
filename = client.screenshot
|
67
|
-
puts "Screenshot saved to: #{filename}"
|
68
|
-
|
69
|
-
# Or use the Screenshot class directly for more control
|
70
|
-
screenshot = IDRAC::Screenshot.new(client)
|
71
|
-
filename = screenshot.capture
|
72
|
-
puts "Screenshot saved to: #{filename}"
|
73
|
-
|
74
|
-
# Firmware operations
|
75
|
-
firmware = IDRAC::Firmware.new(client)
|
76
|
-
|
77
|
-
# Download catalog
|
78
|
-
catalog_path = firmware.download_catalog
|
79
|
-
|
80
|
-
# Get system inventory
|
81
|
-
inventory = firmware.get_system_inventory
|
82
|
-
puts "Service Tag: #{inventory[:system][:service_tag]}"
|
83
|
-
|
84
|
-
# Check for updates
|
85
|
-
updates = firmware.check_updates(catalog_path)
|
86
|
-
updates.each do |update|
|
87
|
-
puts "#{update[:name]}: #{update[:current_version]} -> #{update[:available_version]}"
|
88
|
-
end
|
89
|
-
|
90
|
-
# Update firmware
|
91
|
-
job_id = firmware.update('/path/to/firmware.exe', wait: true)
|
92
|
-
puts "Update completed with job ID: #{job_id}"
|
93
|
-
```
|
94
|
-
|
95
|
-
## Development
|
96
|
-
|
97
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
98
|
-
|
99
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
100
|
-
|
101
|
-
## Contributing
|
102
|
-
|
103
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/usiegj00/idrac.
|