radfish-supermicro 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: 20b841559e3cc4e455080d08674e9dea05765e03eba7993fd8aa163091d5d8bf
4
+ data.tar.gz: c081dda341c709cac9adc8218f162cf94ef5c8447b89d2cf4a3565cad8aed3bb
5
+ SHA512:
6
+ metadata.gz: bcac0dc35c77d06305ad51bfbfc9b8c2ae2c6e3a9f44efe51f9e6fb8d0718bad82e21ca0f6fab53e297f48df949d1dec88aba03721cca3c50c8c9aa958e9a2f4
7
+ data.tar.gz: ead37a3aa5ed5ee9ffe5daed00e5ebe6efaa45279fa3a631ba3589ee5b44b20e5f476229ff7c17867251e7aab2b3d2b287ce661efdb3ec4dc0dea28e2dfbe3e9
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.
data/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # Radfish::Supermicro
2
+
3
+ Supermicro adapter for the Radfish unified Redfish client library. This gem provides seamless integration between Radfish and Supermicro BMC systems.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'radfish-supermicro'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```bash
16
+ bundle install
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```bash
22
+ gem install radfish-supermicro
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ This gem is automatically loaded by Radfish when working with Supermicro servers. When you use Radfish with a Supermicro BMC, it will automatically use this adapter:
28
+
29
+ ```ruby
30
+ require 'radfish'
31
+ require 'radfish/supermicro_adapter'
32
+
33
+ # Radfish will auto-detect Supermicro BMC
34
+ client = Radfish::Client.new(
35
+ host: '192.168.1.100',
36
+ username: 'admin',
37
+ password: 'password'
38
+ )
39
+
40
+ # Or explicitly specify Supermicro
41
+ client = Radfish::Client.new(
42
+ host: '192.168.1.100',
43
+ username: 'admin',
44
+ password: 'password',
45
+ vendor: 'supermicro'
46
+ )
47
+
48
+ # Use unified Radfish API
49
+ client.power_status
50
+ client.power_on
51
+ client.virtual_media_status
52
+ ```
53
+
54
+ ## Features
55
+
56
+ This adapter provides full Supermicro BMC support including:
57
+
58
+ - Power management (on/off/restart/cycle)
59
+ - Virtual media operations
60
+ - Boot configuration
61
+ - System information and inventory
62
+ - Storage management
63
+ - SEL (System Event Log) operations
64
+ - License management
65
+ - BIOS configuration
66
+ - Task/job monitoring
67
+
68
+ ## Dependencies
69
+
70
+ - `radfish` (~> 0.1) - The main Radfish client library
71
+ - `supermicro` (~> 0.1) - Supermicro BMC client implementation
72
+
73
+ ## Development
74
+
75
+ After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rspec` to run the tests.
76
+
77
+ 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
78
+
79
+ ## Contributing
80
+
81
+ Bug reports and pull requests are welcome on GitHub at https://github.com/buildio/radfish-supermicro.
82
+
83
+ ## License
84
+
85
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Radfish
4
+ module Supermicro
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,316 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'supermicro'
4
+
5
+ module Radfish
6
+ class SupermicroAdapter < Core::BaseClient
7
+ include Core::Power
8
+ include Core::System
9
+ include Core::Storage
10
+ include Core::VirtualMedia
11
+ include Core::Boot
12
+ include Core::Jobs
13
+ include Core::Utility
14
+
15
+ attr_reader :supermicro_client
16
+
17
+ def initialize(host:, username:, password:, **options)
18
+ super
19
+
20
+ # Create the underlying Supermicro client
21
+ @supermicro_client = ::Supermicro::Client.new(
22
+ host: host,
23
+ username: username,
24
+ password: password,
25
+ port: options[:port] || 443,
26
+ use_ssl: options.fetch(:use_ssl, true),
27
+ verify_ssl: options.fetch(:verify_ssl, false),
28
+ direct_mode: options.fetch(:direct_mode, false),
29
+ retry_count: options[:retry_count] || 3,
30
+ retry_delay: options[:retry_delay] || 1,
31
+ host_header: options[:host_header]
32
+ )
33
+ end
34
+
35
+ def vendor
36
+ 'supermicro'
37
+ end
38
+
39
+ def verbosity=(value)
40
+ super
41
+ @supermicro_client.verbosity = value if @supermicro_client
42
+ end
43
+
44
+ # Session management
45
+
46
+ def login
47
+ @supermicro_client.login
48
+ end
49
+
50
+ def logout
51
+ @supermicro_client.logout
52
+ end
53
+
54
+ def authenticated_request(method, path, **options)
55
+ @supermicro_client.authenticated_request(method, path, **options)
56
+ end
57
+
58
+ # Power management
59
+
60
+ def power_status
61
+ @supermicro_client.power_status
62
+ end
63
+
64
+ def power_on
65
+ @supermicro_client.power_on
66
+ end
67
+
68
+ def power_off(force: false)
69
+ @supermicro_client.power_off(force: force)
70
+ end
71
+
72
+ def power_restart(force: false)
73
+ @supermicro_client.power_restart(force: force)
74
+ end
75
+
76
+ def power_cycle
77
+ @supermicro_client.power_cycle
78
+ end
79
+
80
+ def reset_type_allowed
81
+ @supermicro_client.reset_type_allowed
82
+ end
83
+
84
+ # System information
85
+
86
+ def system_info
87
+ @supermicro_client.system_info
88
+ end
89
+
90
+ def cpus
91
+ @supermicro_client.cpus
92
+ end
93
+
94
+ def memory
95
+ @supermicro_client.memory
96
+ end
97
+
98
+ def nics
99
+ @supermicro_client.nics
100
+ end
101
+
102
+ def fans
103
+ @supermicro_client.fans
104
+ end
105
+
106
+ def temperatures
107
+ @supermicro_client.temperatures
108
+ end
109
+
110
+ def psus
111
+ @supermicro_client.psus
112
+ end
113
+
114
+ def power_consumption
115
+ @supermicro_client.power_consumption
116
+ end
117
+
118
+ # Storage
119
+
120
+ def storage_controllers
121
+ @supermicro_client.storage_controllers
122
+ end
123
+
124
+ def drives
125
+ @supermicro_client.drives
126
+ end
127
+
128
+ def volumes
129
+ @supermicro_client.volumes
130
+ end
131
+
132
+ def storage_summary
133
+ @supermicro_client.storage_summary
134
+ end
135
+
136
+ # Virtual Media
137
+
138
+ def virtual_media
139
+ @supermicro_client.virtual_media
140
+ end
141
+
142
+ def insert_virtual_media(iso_url, device: nil)
143
+ @supermicro_client.insert_virtual_media(iso_url, device: device)
144
+ end
145
+
146
+ def eject_virtual_media(device: nil)
147
+ @supermicro_client.eject_virtual_media(device: device)
148
+ end
149
+
150
+ def virtual_media_status
151
+ @supermicro_client.virtual_media_status
152
+ end
153
+
154
+ def mount_iso_and_boot(iso_url, device: nil)
155
+ @supermicro_client.mount_iso_and_boot(iso_url, device: device)
156
+ end
157
+
158
+ def unmount_all_media
159
+ @supermicro_client.unmount_all_media
160
+ end
161
+
162
+ # Boot configuration
163
+
164
+ def boot_options
165
+ @supermicro_client.boot_options
166
+ end
167
+
168
+ def set_boot_override(target, persistence: nil, mode: nil, persistent: false)
169
+ # Pass all parameters through to the supermicro client
170
+ @supermicro_client.set_boot_override(target,
171
+ persistence: persistence,
172
+ mode: mode,
173
+ persistent: persistent)
174
+ end
175
+
176
+ def clear_boot_override
177
+ @supermicro_client.clear_boot_override
178
+ end
179
+
180
+ def set_boot_order(devices)
181
+ @supermicro_client.set_boot_order(devices)
182
+ end
183
+
184
+ def get_boot_devices
185
+ @supermicro_client.get_boot_devices
186
+ end
187
+
188
+ def boot_to_pxe(persistence: nil, mode: nil)
189
+ @supermicro_client.boot_to_pxe(persistence: persistence, mode: mode)
190
+ end
191
+
192
+ def boot_to_disk(persistence: nil, mode: nil)
193
+ @supermicro_client.boot_to_disk(persistence: persistence, mode: mode)
194
+ end
195
+
196
+ def boot_to_cd(persistence: nil, mode: nil)
197
+ @supermicro_client.boot_to_cd(persistence: persistence, mode: mode)
198
+ end
199
+
200
+ def boot_to_usb(persistence: nil, mode: nil)
201
+ @supermicro_client.boot_to_usb(persistence: persistence, mode: mode)
202
+ end
203
+
204
+ def boot_to_bios_setup(persistence: nil, mode: nil)
205
+ @supermicro_client.boot_to_bios_setup(persistence: persistence, mode: mode)
206
+ end
207
+
208
+ def configure_boot_settings(persistence: nil, mode: nil)
209
+ @supermicro_client.configure_boot_settings(persistence: persistence, mode: mode)
210
+ end
211
+
212
+ # Jobs
213
+
214
+ def jobs
215
+ @supermicro_client.jobs
216
+ end
217
+
218
+ def job_status(job_id)
219
+ @supermicro_client.job_status(job_id)
220
+ end
221
+
222
+ def wait_for_job(job_id, timeout: 600)
223
+ @supermicro_client.wait_for_job(job_id, timeout: timeout)
224
+ end
225
+
226
+ def cancel_job(job_id)
227
+ @supermicro_client.cancel_job(job_id)
228
+ end
229
+
230
+ def clear_completed_jobs
231
+ @supermicro_client.clear_completed_jobs
232
+ end
233
+
234
+ def jobs_summary
235
+ @supermicro_client.jobs_summary
236
+ end
237
+
238
+ # Utility
239
+
240
+ def sel_log
241
+ @supermicro_client.sel_log
242
+ end
243
+
244
+ def clear_sel_log
245
+ @supermicro_client.clear_sel_log
246
+ end
247
+
248
+ def sel_summary(limit: 10)
249
+ @supermicro_client.sel_summary(limit: limit)
250
+ end
251
+
252
+ def accounts
253
+ @supermicro_client.accounts
254
+ end
255
+
256
+ def create_account(username:, password:, role: "Administrator")
257
+ @supermicro_client.create_account(username: username, password: password, role: role)
258
+ end
259
+
260
+ def delete_account(username)
261
+ @supermicro_client.delete_account(username)
262
+ end
263
+
264
+ def update_account_password(username:, new_password:)
265
+ @supermicro_client.update_account_password(username: username, new_password: new_password)
266
+ end
267
+
268
+ def sessions
269
+ @supermicro_client.sessions
270
+ end
271
+
272
+ def service_info
273
+ @supermicro_client.service_info
274
+ end
275
+
276
+ def get_firmware_version
277
+ @supermicro_client.get_firmware_version
278
+ end
279
+
280
+ # License management
281
+
282
+ def check_virtual_media_license
283
+ @supermicro_client.check_virtual_media_license if @supermicro_client.respond_to?(:check_virtual_media_license)
284
+ end
285
+
286
+ def licenses
287
+ @supermicro_client.licenses if @supermicro_client.respond_to?(:licenses)
288
+ end
289
+
290
+ def activate_license(license_key)
291
+ @supermicro_client.activate_license(license_key) if @supermicro_client.respond_to?(:activate_license)
292
+ end
293
+
294
+ def clear_license(license_id)
295
+ @supermicro_client.clear_license(license_id) if @supermicro_client.respond_to?(:clear_license)
296
+ end
297
+
298
+ # Additional Supermicro-specific methods
299
+
300
+ def bios_attributes
301
+ @supermicro_client.bios_attributes if @supermicro_client.respond_to?(:bios_attributes)
302
+ end
303
+
304
+ def set_bios_attribute(name, value)
305
+ @supermicro_client.set_bios_attribute(name, value) if @supermicro_client.respond_to?(:set_bios_attribute)
306
+ end
307
+
308
+ def manager_network_protocol
309
+ @supermicro_client.manager_network_protocol if @supermicro_client.respond_to?(:manager_network_protocol)
310
+ end
311
+ end
312
+
313
+ # Register the adapter
314
+ Radfish.register_adapter('supermicro', SupermicroAdapter)
315
+ Radfish.register_adapter('smc', SupermicroAdapter)
316
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/radfish/supermicro/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "radfish-supermicro"
7
+ spec.version = Radfish::Supermicro::VERSION
8
+ spec.authors = ["Jonathan Siegel"]
9
+ spec.email = ["248302+usiegj00@users.noreply.github.com"]
10
+
11
+ spec.summary = "Supermicro adapter for Radfish"
12
+ spec.description = "Provides Supermicro BMC support for the Radfish unified Redfish client library"
13
+ spec.homepage = "https://github.com/buildio/radfish-supermicro"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.7.0"
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/buildio/radfish-supermicro"
21
+
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ Dir["{lib}/**/*", "LICENSE", "README.md", "*.gemspec"]
24
+ end
25
+
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_dependency "radfish", "~> 0.1"
29
+ spec.add_dependency "supermicro", "~> 0.1"
30
+
31
+ spec.add_development_dependency "rspec", "~> 3.0"
32
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: radfish-supermicro
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: supermicro
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.1'
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 Supermicro BMC support for the Radfish unified Redfish client
56
+ library
57
+ email:
58
+ - 248302+usiegj00@users.noreply.github.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - LICENSE
64
+ - README.md
65
+ - lib/radfish/supermicro/version.rb
66
+ - lib/radfish/supermicro_adapter.rb
67
+ - radfish-supermicro.gemspec
68
+ homepage: https://github.com/buildio/radfish-supermicro
69
+ licenses:
70
+ - MIT
71
+ metadata:
72
+ allowed_push_host: https://rubygems.org
73
+ homepage_uri: https://github.com/buildio/radfish-supermicro
74
+ source_code_uri: https://github.com/buildio/radfish-supermicro
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: 2.7.0
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubygems_version: 3.3.26
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: Supermicro adapter for Radfish
94
+ test_files: []