smcontroller

package
v0.0.0-...-2b5bdcb Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertSender

type AlertSender interface {
	SendAlert(alert cloudprotocol.AlertItem)
}

AlertSender sends alert.

type CertificateProvider

type CertificateProvider interface {
	GetCertificate(certType string, issuer []byte, serial string) (certURL, keyURL string, err error)
}

CertificateProvider certificate and key provider interface.

type Controller

type Controller struct {
	sync.Mutex

	pb.UnimplementedSMServiceServer
	// contains filtered or unexported fields
}

Controller SM controller instance.

func New

func New(
	cfg *config.Config, messageSender MessageSender, alertSender AlertSender, monitoringSender MonitoringSender,
	certProvider CertificateProvider, cryptcoxontext *cryptutils.CryptoContext,
	insecureConn bool,
) (controller *Controller, err error)

New creates new SM controller.

func (*Controller) CheckUnitConfig

func (controller *Controller) CheckUnitConfig(unitConfig aostypes.UnitConfig) error

CheckUnitConfig checks unit config for the node.

func (*Controller) Close

func (controller *Controller) Close() error

Close closes SM controller.

func (*Controller) CloudConnected

func (controller *Controller) CloudConnected()

CloudConnected indicates unit connected to cloud.

func (*Controller) CloudDisconnected

func (controller *Controller) CloudDisconnected()

CloudDisconnected indicates unit disconnected from cloud.

func (*Controller) GetLog

func (controller *Controller) GetLog(logRequest cloudprotocol.RequestLog) error

GetLog requests log from SM.

func (*Controller) GetNodeConfiguration

func (controller *Controller) GetNodeConfiguration(nodeID string) (cfg launcher.NodeInfo, err error)

GetNodeConfiguration gets node static configuration.

func (*Controller) GetNodeMonitoringData

func (controller *Controller) GetNodeMonitoringData(nodeID string) (data cloudprotocol.NodeMonitoringData, err error)

GetNodeMonitoringData requests node monitoring data from SM.

func (*Controller) GetRunInstancesStatusChannel

func (controller *Controller) GetRunInstancesStatusChannel() <-chan launcher.NodeRunInstanceStatus

GetRunInstancesStatusChannel returns channel with run instances status.

func (*Controller) GetSystemLimitAlertChannel

func (controller *Controller) GetSystemLimitAlertChannel() <-chan cloudprotocol.SystemQuotaAlert

GetSystemLimitAlertChannel returns channel with alerts about RAM CLU system limits.

func (*Controller) GetUnitConfigStatus

func (controller *Controller) GetUnitConfigStatus(nodeID string) (string, error)

GetUnitConfigStatus gets unit configuration status fot he node.

func (*Controller) GetUpdateInstancesStatusChannel

func (controller *Controller) GetUpdateInstancesStatusChannel() <-chan []cloudprotocol.InstanceStatus

GetUpdateInstancesStatusChannel returns channel with update instances status.

func (*Controller) OverrideEnvVars

func (controller *Controller) OverrideEnvVars(nodeID string, envVars cloudprotocol.OverrideEnvVars) error

OverrideEnvVars overrides instance env vars.

func (*Controller) RegisterSM

func (controller *Controller) RegisterSM(stream pb.SMService_RegisterSMServer) error

RegisterSM registers new SM client connection.

func (*Controller) RunInstances

func (controller *Controller) RunInstances(nodeID string,
	services []aostypes.ServiceInfo, layers []aostypes.LayerInfo, instances []aostypes.InstanceInfo, forceRestart bool,
) error

RunInstances runs desired services instances.

func (*Controller) SetUnitConfig

func (controller *Controller) SetUnitConfig(unitConfig aostypes.UnitConfig) error

SetUnitConfig sets unit config for the node.

func (*Controller) UpdateNetwork

func (controller *Controller) UpdateNetwork(nodeID string, networkParameters []aostypes.NetworkParameters) error

UpdateNetwork updates node networks configuration.

type MessageSender

type MessageSender interface {
	SubscribeForConnectionEvents(consumer amqphandler.ConnectionEventsConsumer) error
	UnsubscribeFromConnectionEvents(consumer amqphandler.ConnectionEventsConsumer) error
	SendOverrideEnvVarsStatus(envs cloudprotocol.OverrideEnvVarsStatus) error
	SendLog(serviceLog cloudprotocol.PushLog) error
}

MessageSender sends messages to the cloud.

type MonitoringSender

type MonitoringSender interface {
	SendMonitoringData(monitoringData cloudprotocol.NodeMonitoringData)
}

MonitoringSender sends monitoring data.

Jump to

Keyboard shortcuts

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