Documentation ¶
Overview ¶
Package server implements pmm-managed Server API.
Index ¶
- type Server
- 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) 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) 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 Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents service for checking PMM Server status and changing settings.
func NewServer ¶
func NewServer(db *reform.DB, prometheus prometheusService, supervisord supervisordService) (*Server, error)
NewServer returns new server for Server service.
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) 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) 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.