Documentation ¶
Index ¶
- type MachineClient
- func (c *MachineClient) CopyOut(req *machineapi.CopyOutRequest, srv machineapi.Machine_CopyOutServer) error
- func (c *MachineClient) LS(req *machineapi.LSRequest, srv machineapi.Machine_LSServer) error
- func (c *MachineClient) Mounts(ctx context.Context, in *empty.Empty) (reply *machineapi.MountsReply, err error)
- func (c *MachineClient) Reboot(ctx context.Context, in *empty.Empty) (*machineapi.RebootReply, error)
- func (c *MachineClient) Reset(ctx context.Context, in *empty.Empty) (data *machineapi.ResetReply, err error)
- func (c *MachineClient) ServiceList(ctx context.Context, in *empty.Empty) (data *machineapi.ServiceListReply, err error)
- func (c *MachineClient) ServiceRestart(ctx context.Context, in *machineapi.ServiceRestartRequest) (data *machineapi.ServiceRestartReply, err error)
- func (c *MachineClient) ServiceStart(ctx context.Context, in *machineapi.ServiceStartRequest) (data *machineapi.ServiceStartReply, err error)
- func (c *MachineClient) ServiceStop(ctx context.Context, in *machineapi.ServiceStopRequest) (data *machineapi.ServiceStopReply, err error)
- func (c *MachineClient) Shutdown(ctx context.Context, in *empty.Empty) (*machineapi.ShutdownReply, error)
- func (c *MachineClient) Start(ctx context.Context, in *machineapi.StartRequest) (data *machineapi.StartReply, err error)
- func (c *MachineClient) Stop(ctx context.Context, in *machineapi.StopRequest) (data *machineapi.StopReply, err error)
- func (c *MachineClient) Upgrade(ctx context.Context, in *machineapi.UpgradeRequest) (data *machineapi.UpgradeReply, err error)
- type NetworkClient
- type Registrator
- func (r *Registrator) Containers(ctx context.Context, in *osapi.ContainersRequest) (reply *osapi.ContainersReply, err error)
- func (r *Registrator) Dmesg(ctx context.Context, in *empty.Empty) (data *osapi.Data, err error)
- func (r *Registrator) Kubeconfig(ctx context.Context, in *empty.Empty) (data *osapi.Data, err error)
- func (r *Registrator) Logs(req *osapi.LogsRequest, l osapi.OS_LogsServer) (err error)
- func (r *Registrator) Processes(ctx context.Context, in *empty.Empty) (reply *osapi.ProcessesReply, err error)
- func (r *Registrator) Register(s *grpc.Server)
- func (r *Registrator) Restart(ctx context.Context, in *osapi.RestartRequest) (*osapi.RestartReply, error)
- func (r *Registrator) Stats(ctx context.Context, in *osapi.StatsRequest) (reply *osapi.StatsReply, err error)
- func (r *Registrator) Version(ctx context.Context, in *empty.Empty) (reply *machineapi.VersionReply, err error)
- type TimeClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MachineClient ¶
type MachineClient struct {
machineapi.MachineClient
}
MachineClient is a gRPC client for init service API
func NewMachineClient ¶
func NewMachineClient() (*MachineClient, error)
NewMachineClient initializes new client and connects to init
func (*MachineClient) CopyOut ¶
func (c *MachineClient) CopyOut(req *machineapi.CopyOutRequest, srv machineapi.Machine_CopyOutServer) error
CopyOut executes the init CopyOut() API.
func (*MachineClient) LS ¶
func (c *MachineClient) LS(req *machineapi.LSRequest, srv machineapi.Machine_LSServer) error
LS executes the init LS() API.
func (*MachineClient) Mounts ¶
func (c *MachineClient) Mounts(ctx context.Context, in *empty.Empty) (reply *machineapi.MountsReply, err error)
Mounts implements the machineapi.OSDServer interface.
func (*MachineClient) Reboot ¶
func (c *MachineClient) Reboot(ctx context.Context, in *empty.Empty) (*machineapi.RebootReply, error)
Reboot executes init Reboot() API
func (*MachineClient) Reset ¶
func (c *MachineClient) Reset(ctx context.Context, in *empty.Empty) (data *machineapi.ResetReply, err error)
Reset executes the init Reset() API.
func (*MachineClient) ServiceList ¶
func (c *MachineClient) ServiceList(ctx context.Context, in *empty.Empty) (data *machineapi.ServiceListReply, err error)
ServiceList executes the init ServiceList() API.
func (*MachineClient) ServiceRestart ¶
func (c *MachineClient) ServiceRestart(ctx context.Context, in *machineapi.ServiceRestartRequest) (data *machineapi.ServiceRestartReply, err error)
ServiceRestart executes the init ServiceRestart() API.
func (*MachineClient) ServiceStart ¶
func (c *MachineClient) ServiceStart(ctx context.Context, in *machineapi.ServiceStartRequest) (data *machineapi.ServiceStartReply, err error)
ServiceStart executes the init ServiceStart() API.
func (*MachineClient) ServiceStop ¶
func (c *MachineClient) ServiceStop(ctx context.Context, in *machineapi.ServiceStopRequest) (data *machineapi.ServiceStopReply, err error)
ServiceStop executes the init ServiceStop() API.
func (*MachineClient) Shutdown ¶
func (c *MachineClient) Shutdown(ctx context.Context, in *empty.Empty) (*machineapi.ShutdownReply, error)
Shutdown executes init Shutdown() API.
func (*MachineClient) Start ¶
func (c *MachineClient) Start(ctx context.Context, in *machineapi.StartRequest) (data *machineapi.StartReply, err error)
Start executes the init Start() API (deprecated). nolint: staticcheck
func (*MachineClient) Stop ¶
func (c *MachineClient) Stop(ctx context.Context, in *machineapi.StopRequest) (data *machineapi.StopReply, err error)
Stop executes the init Stop() API (deprecated). nolint: staticcheck
func (*MachineClient) Upgrade ¶
func (c *MachineClient) Upgrade(ctx context.Context, in *machineapi.UpgradeRequest) (data *machineapi.UpgradeReply, err error)
Upgrade executes the init Upgrade() API.
type NetworkClient ¶
type NetworkClient struct {
networkapi.NetworkClient
}
NetworkClient is a gRPC client for init service API
func NewNetworkClient ¶
func NewNetworkClient() (*NetworkClient, error)
NewNetworkClient initializes new client and connects to networkd
func (*NetworkClient) Interfaces ¶
func (c *NetworkClient) Interfaces(ctx context.Context, in *empty.Empty) (*networkapi.InterfacesReply, error)
Interfaces returns the hosts network interfaces and addresses.
func (*NetworkClient) Routes ¶
func (c *NetworkClient) Routes(ctx context.Context, in *empty.Empty) (*networkapi.RoutesReply, error)
Routes returns the hosts routing table.
type Registrator ¶
type Registrator struct { // every Init service API is proxied via OSD *MachineClient *TimeClient *NetworkClient Data *userdata.UserData }
Registrator is the concrete type that implements the factory.Registrator and osapi.OSDServer interfaces.
func (*Registrator) Containers ¶ added in v0.3.0
func (r *Registrator) Containers(ctx context.Context, in *osapi.ContainersRequest) (reply *osapi.ContainersReply, err error)
Containers implements the osapi.OSDServer interface.
func (*Registrator) Dmesg ¶
Dmesg implements the osapi.OSDServer interface. The klogctl syscall is used to read from the ring buffer at /proc/kmsg by taking the SYSLOG_ACTION_READ_ALL action. This action reads all messages remaining in the ring buffer non-destructively.
func (*Registrator) Kubeconfig ¶
func (r *Registrator) Kubeconfig(ctx context.Context, in *empty.Empty) (data *osapi.Data, err error)
Kubeconfig implements the osapi.OSDServer interface. The admin kubeconfig is generated by kubeadm and placed at /etc/kubernetes/admin.conf. This method returns the contents of the generated admin.conf in the response.
func (*Registrator) Logs ¶
func (r *Registrator) Logs(req *osapi.LogsRequest, l osapi.OS_LogsServer) (err error)
Logs implements the osapi.OSDServer interface. Service or container logs can be requested and the contents of the log file are streamed in chunks. nolint: gocyclo
func (*Registrator) Processes ¶
func (r *Registrator) Processes(ctx context.Context, in *empty.Empty) (reply *osapi.ProcessesReply, err error)
Processes implements the osapi.OSDServer interface
func (*Registrator) Register ¶
func (r *Registrator) Register(s *grpc.Server)
Register implements the factory.Registrator interface.
func (*Registrator) Restart ¶
func (r *Registrator) Restart(ctx context.Context, in *osapi.RestartRequest) (*osapi.RestartReply, error)
Restart implements the osapi.OSDServer interface.
func (*Registrator) Stats ¶
func (r *Registrator) Stats(ctx context.Context, in *osapi.StatsRequest) (reply *osapi.StatsReply, err error)
Stats implements the osapi.OSDServer interface. nolint: gocyclo
func (*Registrator) Version ¶
func (r *Registrator) Version(ctx context.Context, in *empty.Empty) (reply *machineapi.VersionReply, err error)
Version implements the osapi.OSDServer interface.
type TimeClient ¶
type TimeClient struct {
timeapi.TimeClient
}
TimeClient is a gRPC client for init service API
func NewTimeClient ¶
func NewTimeClient() (*TimeClient, error)
NewTimeClient initializes new client and connects to ntpd
func (*TimeClient) TimeCheck ¶
func (c *TimeClient) TimeCheck(ctx context.Context, in *timeapi.TimeRequest) (*timeapi.TimeReply, error)
TimeCheck issues a query to the specified ntp server and displays the results