Explore/magellan serve#132
Open
alexlovelltroy wants to merge 3 commits into
Open
Conversation
- Updated imports from redfish to schemas in various files to align with the new package structure. - Modified Client interface methods to return types from schemas instead of redfish. - Adjusted implementations in GenericClient to accommodate the new schemas types. - Updated tests to reflect changes in the types used for power states and reset types. - Refactored functions in collect, crawler, power, service, and update packages to utilize schemas types. - Introduced helper functions to dereference optional numeric fields for better handling of nil values. Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
…BMC layer Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
- Add middleware for request logging and bearer token authentication in the server. - Create response handling functions for JSON responses and error messages. - Develop the main server structure to handle API routes for inventory and power operations. - Implement health check endpoints for liveness and readiness. - Introduce a mock Redfish service for testing power state transitions. - Add power transition logic with confirmation and escalation handling. - Create tests for various power operations, including success, timeout, and escalation scenarios. - Enhance service layer to support power transition operations. Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major new "serve" subcommand to run Magellan as a persistent REST API service for BMC inventory and power operations, as well as significant enhancements to the power command interface and several dependency updates. The most important changes are grouped below.
New REST API Service:
servesubcommand (cmd/serve.go) to run Magellan as a long-lived REST daemon, exposing endpoints for BMC inventory and power operations, with support for TLS and bearer token authentication.internal/server/handlers.go).internal/server/middleware.go).cmd/root.go.Power Command Enhancements:
--operation), confirmation/wait logic (--wait,--wait-timeout), and improves flag validation and error handling incmd/power.go. Also replaces raw Redfish reset type handling to use the updated gofish schema. [1] [2] [3] [4] [5]-l), and adds a test to guard against future flag conflicts (cmd/power.go,cmd/power_test.go). [1] [2]Dependency and Module Updates:
go.mod, includinggofish,cobra,viper,zerolog, and others, ensuring compatibility and security.These changes lay the foundation for Magellan to be used as a shared backend service for other OpenCHAMI tools, enhance the CLI's flexibility and safety, and modernize the codebase's dependencies.
For more info, see Contributing Guidelines.