Documentation ¶
Overview ¶
Package server implements pmm-managed Server API.
Index ¶
- type AWSInstanceChecker
- type Params
- type Server
- func (s *Server) AWSInstanceCheck(ctx context.Context, req *serverpb.AWSInstanceCheckRequest) (*serverpb.AWSInstanceCheckResponse, error)
- func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSettingsRequest) (*serverpb.ChangeSettingsResponse, error)
- func (s *Server) CheckUpdates(ctx context.Context, req *serverpb.CheckUpdatesRequest) (*serverpb.CheckUpdatesResponse, error)
- func (s *Server) GetSettings(ctx context.Context, req *serverpb.GetSettingsRequest) (*serverpb.GetSettingsResponse, error)
- func (s *Server) PlatformSignIn(ctx context.Context, req *serverpb.PlatformSignInRequest) (*serverpb.PlatformSignInResponse, error)
- func (s *Server) PlatformSignOut(ctx context.Context, _ *serverpb.PlatformSignOutRequest) (*serverpb.PlatformSignOutResponse, error)
- func (s *Server) PlatformSignUp(ctx context.Context, req *serverpb.PlatformSignUpRequest) (*serverpb.PlatformSignUpResponse, error)
- func (s *Server) Readiness(ctx context.Context, req *serverpb.ReadinessRequest) (*serverpb.ReadinessResponse, error)
- func (s *Server) StartUpdate(ctx context.Context, req *serverpb.StartUpdateRequest) (*serverpb.StartUpdateResponse, error)
- func (s *Server) UpdateConfigurations() error
- func (s *Server) UpdateSettingsFromEnv(env []string) []error
- func (s *Server) UpdateStatus(ctx context.Context, req *serverpb.UpdateStatusRequest) (*serverpb.UpdateStatusResponse, error)
- func (s *Server) Version(ctx context.Context, req *serverpb.VersionRequest) (*serverpb.VersionResponse, error)
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 AgentsRegistry agentsRegistry VMDB prometheusService VMAlert prometheusService Alertmanager alertmanagerService ChecksService checksService VMAlertExternalRules vmAlertExternalRules Supervisord supervisordService TelemetryService telemetryService PlatformService platformService AwsInstanceChecker *AWSInstanceChecker GrafanaClient grafanaClient RulesService rulesService }
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 (*Server) AWSInstanceCheck ¶
func (s *Server) AWSInstanceCheck(ctx context.Context, req *serverpb.AWSInstanceCheckRequest) (*serverpb.AWSInstanceCheckResponse, error)
AWSInstanceCheck checks AWS EC2 instance ID.
func (*Server) ChangeSettings ¶
func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSettingsRequest) (*serverpb.ChangeSettingsResponse, error)
ChangeSettings changes PMM Server settings.
func (*Server) CheckUpdates ¶
func (s *Server) CheckUpdates(ctx context.Context, req *serverpb.CheckUpdatesRequest) (*serverpb.CheckUpdatesResponse, error)
CheckUpdates checks PMM Server updates availability.
func (*Server) GetSettings ¶
func (s *Server) GetSettings(ctx context.Context, req *serverpb.GetSettingsRequest) (*serverpb.GetSettingsResponse, error)
GetSettings returns current PMM Server settings.
func (*Server) PlatformSignIn ¶
func (s *Server) PlatformSignIn(ctx context.Context, req *serverpb.PlatformSignInRequest) (*serverpb.PlatformSignInResponse, error)
PlatformSignIn links that PMM instance to Percona Platform user and created new session.
func (*Server) PlatformSignOut ¶
func (s *Server) PlatformSignOut(ctx context.Context, _ *serverpb.PlatformSignOutRequest) (*serverpb.PlatformSignOutResponse, error)
PlatformSignOut logouts that PMM instance from Percona Platform account.
func (*Server) PlatformSignUp ¶
func (s *Server) PlatformSignUp(ctx context.Context, req *serverpb.PlatformSignUpRequest) (*serverpb.PlatformSignUpResponse, error)
PlatformSignUp creates new Percona Platform user with given email and password.
func (*Server) Readiness ¶
func (s *Server) Readiness(ctx context.Context, req *serverpb.ReadinessRequest) (*serverpb.ReadinessResponse, error)
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 ¶
func (s *Server) StartUpdate(ctx context.Context, req *serverpb.StartUpdateRequest) (*serverpb.StartUpdateResponse, error)
StartUpdate starts PMM Server update.
func (*Server) UpdateConfigurations ¶
UpdateConfigurations updates supervisor config and requests configuration update for VictoriaMetrics components.
func (*Server) UpdateSettingsFromEnv ¶
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 ¶
func (s *Server) UpdateStatus(ctx context.Context, req *serverpb.UpdateStatusRequest) (*serverpb.UpdateStatusResponse, error)
UpdateStatus returns PMM Server update status.
func (*Server) Version ¶
func (s *Server) Version(ctx context.Context, req *serverpb.VersionRequest) (*serverpb.VersionResponse, error)
Version returns PMM Server version.