server

package
v2.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package server implements pmm-managed Server API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSInstanceChecker

type AWSInstanceChecker struct {
	// contains filtered or unexported fields
}

AWSInstanceChecker checks AWS EC2 instance ID for AMI.

func NewAWSInstanceChecker

func NewAWSInstanceChecker(db *reform.DB, telemetryService telemetryService) *AWSInstanceChecker

NewAWSInstanceChecker creates a new AWSInstanceChecker.

func (*AWSInstanceChecker) MustCheck

func (c *AWSInstanceChecker) MustCheck() bool

MustCheck returns true if instance ID must be checked: this is AMI, and it wasn't checked already.

type Params

type Params struct {
	DB                 *reform.DB
	Prometheus         prometheusService
	Alertmanager       alertmanagerService
	Supervisord        supervisordService
	TelemetryService   telemetryService
	AwsInstanceChecker *AWSInstanceChecker
	GrafanaClient      grafanaClient
}

Params holds the parameters needed to create a new service.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents service for checking PMM Server status and changing settings.

func NewServer

func NewServer(params *Params) (*Server, error)

NewServer returns new server for Server service.

func (*Server) AWSInstanceCheck

AWSInstanceCheck checks AWS EC2 instance ID.

func (*Server) ChangeSettings

ChangeSettings changes PMM Server settings.

func (*Server) CheckUpdates

CheckUpdates checks PMM Server updates availability.

func (*Server) GetSettings

GetSettings returns current PMM Server settings.

func (*Server) Readiness

Readiness returns an error when some PMM Server component is not ready yet or is being restarted. It can be used as for Docker health check or Kubernetes readiness probe.

func (*Server) StartUpdate

StartUpdate starts PMM Server update.

func (*Server) UpdateSettingsFromEnv

func (s *Server) UpdateSettingsFromEnv(env []string) []error

UpdateSettingsFromEnv updates settings in the database with environment variables values. It returns only validation or database errors; invalid environment variables are logged and skipped.

func (*Server) UpdateStatus

UpdateStatus returns PMM Server update status.

func (*Server) Version

Version returns PMM Server version.

Jump to

Keyboard shortcuts

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