Documentation ¶
Index ¶
- Constants
- type MachineService
- func (s *MachineService) AddPackageVersion(ctx context.Context, ...) (*connect.Response[machinev1alpha1.AddPackageVersionResponse], error)
- func (s *MachineService) GetJob(ctx context.Context, c *connect.Request[machinev1alpha1.GetJobRequest]) (*connect.Response[machinev1alpha1.GetJobResponse], error)
- func (s *MachineService) Install(ctx context.Context, c *connect.Request[machinev1alpha1.InstallRequest]) (*connect.Response[machinev1alpha1.InstallResponse], error)
- func (s *MachineService) ListMachines(ctx context.Context, c *connect.Request[machinev1alpha1.ListMachinesRequest]) (*connect.Response[machinev1alpha1.ListMachinesResponse], error)
- func (s *MachineService) RemovePackageVersion(ctx context.Context, ...) (*connect.Response[machinev1alpha1.RemovePackageVersionResponse], error)
- func (s *MachineService) ScanMachine(ctx context.Context, c *connect.Request[machinev1alpha1.ScanMachineRequest]) (*connect.Response[machinev1alpha1.ScanMachineResponse], error)
- func (s *MachineService) SetPackageVersion(ctx context.Context, ...) (*connect.Response[machinev1alpha1.SetPackageVersionResponse], error)
- func (s *MachineService) StartScheduler(ctx context.Context)
- func (s *MachineService) UpdateMachineStatus(ctx context.Context, ...) (*connect.Response[machinev1alpha1.UpdateMachineStatusResponse], error)
- type Option
Constants ¶
View Source
const ( AddPackageFailureReason = "package already in the list" SetPackageFailureReason = "package is not in the list" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MachineService ¶
type MachineService struct { machinev1alpha1connect.UnimplementedMachineServiceHandler // contains filtered or unexported fields }
func NewService ¶
func NewService(cfg *rest.Config, opts ...Option) *MachineService
func (*MachineService) AddPackageVersion ¶
func (s *MachineService) AddPackageVersion( ctx context.Context, c *connect.Request[machinev1alpha1.AddPackageVersionRequest], ) (*connect.Response[machinev1alpha1.AddPackageVersionResponse], error)
func (*MachineService) GetJob ¶
func (s *MachineService) GetJob( ctx context.Context, c *connect.Request[machinev1alpha1.GetJobRequest], ) (*connect.Response[machinev1alpha1.GetJobResponse], error)
func (*MachineService) Install ¶
func (s *MachineService) Install( ctx context.Context, c *connect.Request[machinev1alpha1.InstallRequest], ) (*connect.Response[machinev1alpha1.InstallResponse], error)
Install schedules package installation for target Machine.
func (*MachineService) ListMachines ¶
func (s *MachineService) ListMachines( ctx context.Context, c *connect.Request[machinev1alpha1.ListMachinesRequest], ) (*connect.Response[machinev1alpha1.ListMachinesResponse], error)
ListMachines returns the list of Machine objects.
func (*MachineService) RemovePackageVersion ¶
func (s *MachineService) RemovePackageVersion( ctx context.Context, c *connect.Request[machinev1alpha1.RemovePackageVersionRequest], ) (*connect.Response[machinev1alpha1.RemovePackageVersionResponse], error)
func (*MachineService) ScanMachine ¶
func (s *MachineService) ScanMachine( ctx context.Context, c *connect.Request[machinev1alpha1.ScanMachineRequest], ) (*connect.Response[machinev1alpha1.ScanMachineResponse], error)
ScanMachine runs scan job for target Machine. First it checks whether Machine state is in service's cache. If cache entry is found, it checks whether last scan timestamp is within defined horizon. If not, scan job will be spawned. Otherwise, cached state will be returned in response.
func (*MachineService) SetPackageVersion ¶
func (s *MachineService) SetPackageVersion( ctx context.Context, c *connect.Request[machinev1alpha1.SetPackageVersionRequest], ) (*connect.Response[machinev1alpha1.SetPackageVersionResponse], error)
func (*MachineService) StartScheduler ¶
func (s *MachineService) StartScheduler(ctx context.Context)
func (*MachineService) UpdateMachineStatus ¶
func (s *MachineService) UpdateMachineStatus( ctx context.Context, c *connect.Request[machinev1alpha1.UpdateMachineStatusRequest], ) (*connect.Response[machinev1alpha1.UpdateMachineStatusResponse], error)
UpdateMachineStatus request initialized by the spawned Job and should update the status of processed Machine. If request succeed, Job exits with exit code 0, otherwise, Job will stop with non-zero exit code.
type Option ¶
type Option func(service *MachineService)
func WithHorizon ¶
func WithNamespace ¶
func WithScheduler ¶
func WithScheduler(scheduler *scheduler.Scheduler[*lifecyclev1alpha1.Machine]) Option
Click to show internal directories.
Click to hide internal directories.