Documentation ¶
Overview ¶
Package service provides the agent GRPC service server.
Index ¶
- type IPMIClient
- type IPMIClientFactory
- type Server
- func (s *Server) GetPowerManagement(ctx context.Context, req *agentpb.GetPowerManagementRequest) (*agentpb.GetPowerManagementResponse, error)
- func (s *Server) Hello(_ context.Context, _ *agentpb.HelloRequest) (*agentpb.HelloResponse, error)
- func (s *Server) Reboot(ctx context.Context, req *agentpb.RebootRequest) (*agentpb.RebootResponse, error)
- func (s *Server) SetPowerManagement(ctx context.Context, req *agentpb.SetPowerManagementRequest) (*agentpb.SetPowerManagementResponse, error)
- func (s *Server) WipeDisks(ctx context.Context, req *agentpb.WipeDisksRequest) (*agentpb.WipeDisksResponse, error)
- type TalosClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPMIClient ¶
type IPMIClient interface { io.Closer // UserExists checks if the user exists. UserExists(username string) (bool, error) // AttemptUserSetup attempts to set up the BMC user. AttemptUserSetup(username, password string, logger *zap.Logger) error // GetIPPort returns the BMC IP and port. GetIPPort() (string, uint16, error) }
IPMIClient represents an IPMI client.
type IPMIClientFactory ¶
type IPMIClientFactory func() (IPMIClient, error)
IPMIClientFactory is the factory to create IPMI clients.
type Server ¶
type Server struct { agentpb.UnimplementedAgentServiceServer // contains filtered or unexported fields }
Server is the agent service server.
func NewServer ¶
func NewServer(talosClient TalosClient, ipmiClientFactory IPMIClientFactory, testMode bool, logger *zap.Logger) *Server
NewServer creates a new service server.
func (*Server) GetPowerManagement ¶
func (s *Server) GetPowerManagement(ctx context.Context, req *agentpb.GetPowerManagementRequest) (*agentpb.GetPowerManagementResponse, error)
GetPowerManagement returns the power management info.
func (*Server) Hello ¶
func (s *Server) Hello(_ context.Context, _ *agentpb.HelloRequest) (*agentpb.HelloResponse, error)
Hello is an endpoint to check if the service is available.
func (*Server) Reboot ¶
func (s *Server) Reboot(ctx context.Context, req *agentpb.RebootRequest) (*agentpb.RebootResponse, error)
Reboot reboots the machine.
func (*Server) SetPowerManagement ¶
func (s *Server) SetPowerManagement(ctx context.Context, req *agentpb.SetPowerManagementRequest) (*agentpb.SetPowerManagementResponse, error)
SetPowerManagement sets the power management info.
func (*Server) WipeDisks ¶
func (s *Server) WipeDisks(ctx context.Context, req *agentpb.WipeDisksRequest) (*agentpb.WipeDisksResponse, error)
WipeDisks wipes the disks.
type TalosClient ¶
type TalosClient interface { Reboot(ctx context.Context, opts ...talosclient.RebootMode) error State() state.State BlockDeviceWipe(ctx context.Context, req *storage.BlockDeviceWipeRequest, callOptions ...grpc.CallOption) error }
TalosClient represents a Talos API client.
Click to show internal directories.
Click to hide internal directories.