reg

package
v0.3.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

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

CopyOut executes the init CopyOut() API.

func (*MachineClient) LS

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

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

ServiceRestart executes the init ServiceRestart() API.

func (*MachineClient) ServiceStart

ServiceStart executes the init ServiceStart() API.

func (*MachineClient) ServiceStop

ServiceStop executes the init ServiceStop() API.

func (*MachineClient) Shutdown

Shutdown executes init Shutdown() API.

func (*MachineClient) Start

Start executes the init Start() API (deprecated). nolint: staticcheck

func (*MachineClient) Stop

Stop executes the init Stop() API (deprecated). nolint: staticcheck

func (*MachineClient) Upgrade

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

Interfaces returns the hosts network interfaces and addresses.

func (*NetworkClient) Routes

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

func (r *Registrator) Dmesg(ctx context.Context, in *empty.Empty) (data *osapi.Data, err error)

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

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) Time

func (c *TimeClient) Time(ctx context.Context, in *empty.Empty) (*timeapi.TimeReply, error)

Time issues a query to the configured ntp server and displays the results

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

Jump to

Keyboard shortcuts

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