Documentation
¶
Index ¶
- type AlertSender
- type CertificateProvider
- type Controller
- func (controller *Controller) CheckNodeConfig(nodeID, version string, nodeConfig cloudprotocol.NodeConfig) error
- func (controller *Controller) Close() error
- func (controller *Controller) CloudConnected()
- func (controller *Controller) CloudDisconnected()
- func (controller *Controller) GetAverageMonitoring(nodeID string) (aostypes.NodeMonitoring, error)
- func (controller *Controller) GetLog(logRequest cloudprotocol.RequestLog) error
- func (controller *Controller) GetNodeConfigStatus(nodeID string) (unitconfig.NodeConfigStatus, error)
- func (controller *Controller) GetNodeConfigStatuses() ([]unitconfig.NodeConfigStatus, error)
- func (controller *Controller) GetRunInstancesStatusChannel() <-chan launcher.NodeRunInstanceStatus
- func (controller *Controller) GetSystemQuoteAlertChannel() <-chan cloudprotocol.SystemQuotaAlert
- func (controller *Controller) GetUpdateInstancesStatusChannel() <-chan []cloudprotocol.InstanceStatus
- func (controller *Controller) NodeConfigStatusChannel() <-chan unitconfig.NodeConfigStatus
- func (controller *Controller) OverrideEnvVars(nodeID string, envVars cloudprotocol.OverrideEnvVars) error
- func (controller *Controller) RegisterSM(stream pb.SMService_RegisterSMServer) error
- func (controller *Controller) RunInstances(nodeID string, services []aostypes.ServiceInfo, layers []aostypes.LayerInfo, ...) error
- func (controller *Controller) SetNodeConfig(nodeID, version string, nodeConfig cloudprotocol.NodeConfig) error
- func (controller *Controller) UpdateNetwork(nodeID string, networkParameters []aostypes.NetworkParameters) error
- type MessageSender
- type MonitoringSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertSender ¶
type AlertSender interface {
SendAlert(alert interface{})
}
AlertSender sends alert.
type CertificateProvider ¶
type CertificateProvider interface { GetCertificate(certType string, issuer []byte, serial string) (certURL, keyURL string, err error) SubscribeCertChanged(certType string) (<-chan *iamanager.CertInfo, 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) CheckNodeConfig ¶
func (controller *Controller) CheckNodeConfig(nodeID, version string, nodeConfig cloudprotocol.NodeConfig) error
CheckNodeConfig checks node config.
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) GetAverageMonitoring ¶
func (controller *Controller) GetAverageMonitoring(nodeID string) (aostypes.NodeMonitoring, error)
GetAverageMonitoring returns average monitoring data for the node.
func (*Controller) GetLog ¶
func (controller *Controller) GetLog(logRequest cloudprotocol.RequestLog) error
GetLog requests log from SM.
func (*Controller) GetNodeConfigStatus ¶
func (controller *Controller) GetNodeConfigStatus(nodeID string) (unitconfig.NodeConfigStatus, error)
GetNodeConfigStatus gets node configuration status.
func (*Controller) GetNodeConfigStatuses ¶
func (controller *Controller) GetNodeConfigStatuses() ([]unitconfig.NodeConfigStatus, error)
GetNodeConfigStatuses returns node configuration statuses.
func (*Controller) GetRunInstancesStatusChannel ¶
func (controller *Controller) GetRunInstancesStatusChannel() <-chan launcher.NodeRunInstanceStatus
GetRunInstancesStatusChannel returns channel with run instances status.
func (*Controller) GetSystemQuoteAlertChannel ¶
func (controller *Controller) GetSystemQuoteAlertChannel() <-chan cloudprotocol.SystemQuotaAlert
GetSystemQuoteAlertChannel returns channel with alerts about RAM, CPU system limits.
func (*Controller) GetUpdateInstancesStatusChannel ¶
func (controller *Controller) GetUpdateInstancesStatusChannel() <-chan []cloudprotocol.InstanceStatus
GetUpdateInstancesStatusChannel returns channel with update instances status.
func (*Controller) NodeConfigStatusChannel ¶
func (controller *Controller) NodeConfigStatusChannel() <-chan unitconfig.NodeConfigStatus
NodeConfigStatusChannel returns channel used to send new node configuration statuses.
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) SetNodeConfig ¶
func (controller *Controller) SetNodeConfig(nodeID, version string, nodeConfig cloudprotocol.NodeConfig) error
SetNodeConfig sets node config.
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 {
SendNodeMonitoring(monitoring aostypes.NodeMonitoring)
}
MonitoringSender sends monitoring data.