service

package
v0.1.0-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package service provides the agent GRPC service server.

Index

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

GetPowerManagement returns the power management info.

func (*Server) Hello

Hello is an endpoint to check if the service is available.

func (*Server) Reboot

Reboot reboots the machine.

func (*Server) SetPowerManagement

SetPowerManagement sets the power management info.

func (*Server) WipeDisks

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL