Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectToJobsManager(jobCfg *config.Jobs, connFactory *secureconn.Factory) (*cereal.Manager, error)
- func DaysBetween(fromTime, toTime time.Time) int
- type ApplicationsServer
- func (app *ApplicationsServer) DeleteDisconnectedServices(ctx context.Context, request *applications.DisconnectedServicesReq) (*applications.ServicesRes, error)
- func (app *ApplicationsServer) DeleteServicesByID(ctx context.Context, request *applications.DeleteServicesByIDReq) (*applications.ServicesRes, error)
- func (app *ApplicationsServer) FindServices(request *applications.ServicesReq, ...) error
- func (app *ApplicationsServer) GetDeleteDisconnectedServicesConfig(ctx context.Context, req *applications.GetDeleteDisconnectedServicesConfigReq) (*applications.PeriodicJobConfig, error)
- func (app *ApplicationsServer) GetDisconnectedServices(ctx context.Context, request *applications.DisconnectedServicesReq) (*applications.ServicesRes, error)
- func (app *ApplicationsServer) GetDisconnectedServicesConfig(ctx context.Context, req *applications.GetDisconnectedServicesConfigReq) (*applications.PeriodicMandatoryJobConfig, error)
- func (a *ApplicationsServer) GetServiceGroups(ctx context.Context, request *applications.ServiceGroupsReq) (*applications.ServiceGroups, error)
- func (app *ApplicationsServer) GetServiceGroupsHealthCounts(ctx context.Context, request *applications.ServiceGroupsHealthCountsReq) (*applications.HealthCounts, error)
- func (app *ApplicationsServer) GetServices(ctx context.Context, request *applications.ServicesReq) (*applications.ServicesRes, error)
- func (app *ApplicationsServer) GetServicesBySG(ctx context.Context, request *applications.ServicesBySGReq) (*applications.ServicesBySGRes, error)
- func (a *ApplicationsServer) GetServicesDistinctValues(ctx context.Context, request *applications.ServicesDistinctValuesReq) (*applications.ServicesDistinctValuesRes, error)
- func (app *ApplicationsServer) GetServicesStats(ctx context.Context, request *applications.ServicesStatsReq) (*applications.ServicesStatsRes, error)
- func (app *ApplicationsServer) GetServicesUsageCount(ctx context.Context, e *applications.GetServicesUsageCountRequest) (*applications.GetServicesUsageCountResponse, error)
- func (a *ApplicationsServer) GetVersion(context.Context, *ver_api.VersionInfoRequest) (*ver_api.VersionInfo, error)
- func (a *ApplicationsServer) Health() *health.Service
- func (app *ApplicationsServer) MarkDisconnectedServices(thresholdSeconds int32) ([]*applications.Service, error)
- func (app *ApplicationsServer) RunDeleteDisconnectedServicesJob(ctx context.Context, request *applications.RunDeleteDisconnectedServicesJobReq) (*applications.RunDeleteDisconnectedServicesJobResponse, error)
- func (app *ApplicationsServer) RunDisconnectedServicesJob(ctx context.Context, request *applications.RunDisconnectedServicesJobReq) (*applications.RunDisconnectedServicesJobResponse, error)
- func (app *ApplicationsServer) UpdateDeleteDisconnectedServicesConfig(ctx context.Context, req *applications.PeriodicJobConfig) (*applications.UpdateDeleteDisconnectedServicesConfigRes, error)
- func (app *ApplicationsServer) UpdateDisconnectedServicesConfig(ctx context.Context, req *applications.PeriodicMandatoryJobConfig) (*applications.UpdateDisconnectedServicesConfigRes, error)
- func (s *ApplicationsServer) UpdateTelemetryReported(ctx context.Context, req *applications.UpdateTelemetryReportedRequest) (*applications.UpdateTelemetryReportedResponse, error)
- type DeleteDisconnectedServicesExecutor
- type DisconnectedServicesConfigAndInfo
- type DisconnectedServicesConfigV0
- type DisconnectedServicesInfo
- type DisconnectedServicesParamsV0
- type JobRunnerSet
- type JobScheduler
- func (j *JobScheduler) DisableDeleteDisconnectedServicesJob(ctx context.Context) error
- func (j *JobScheduler) DisableDisconnectedServicesJob(ctx context.Context) error
- func (j *JobScheduler) EnableDeleteDisconnectedServicesJob(ctx context.Context) error
- func (j *JobScheduler) EnableDisconnectedServicesJob(ctx context.Context) error
- func (j *JobScheduler) GetDeleteDisconnectedServicesJobConfig(ctx context.Context) (*DisconnectedServicesConfigAndInfo, error)
- func (j *JobScheduler) GetDisconnectedServicesJobConfig(ctx context.Context) (*DisconnectedServicesConfigAndInfo, error)
- func (j *JobScheduler) ResetParams() error
- func (j *JobScheduler) RunAllJobsConstantly(ctx context.Context) error
- func (j *JobScheduler) RunDeleteDisconnectedServicesJob(ctx context.Context) error
- func (j *JobScheduler) RunDisconnectedServicesJob(ctx context.Context) error
- func (j *JobScheduler) Setup() error
- func (j *JobScheduler) UpdateDeleteDisconnectedServicesJobConfig(ctx context.Context, conf *DisconnectedServicesConfigV0) error
- func (j *JobScheduler) UpdateDisconnectedServicesJobConfig(ctx context.Context, conf *DisconnectedServicesConfigV0) error
- type MarkDisconnectedServicesExecutor
Constants ¶
const ( DefaultRecurrence = "FREQ=SECONDLY;DTSTART=20200612T182105Z;INTERVAL=60" DefaultJobIntervalSeconds = 60 )
Variables ¶
var ( DisconnectedServicesWorkflowName = cereal.NewWorkflowName("disconnected_services") DisconnectedServicesScheduleName = "periodic_disconnected_services" DeleteDisconnectedServicesWorkflowName = cereal.NewWorkflowName("delete_disconnected_services") DeleteDisconnectedServicesScheduleName = "periodic_delete_disconnected_services" )
Functions ¶
func ConnectToJobsManager ¶
func DaysBetween ¶
DaysBetween get the calendar days between two timestamp
Types ¶
type ApplicationsServer ¶
type ApplicationsServer struct {
// contains filtered or unexported fields
}
ApplicationsServer is the interface to this component.
func New ¶
func New(sc storage.Client, ic ingester.Client, j *JobScheduler) *ApplicationsServer
New creates a new ApplicationsServer instance.
func (*ApplicationsServer) DeleteDisconnectedServices ¶
func (app *ApplicationsServer) DeleteDisconnectedServices(ctx context.Context, request *applications.DisconnectedServicesReq) (*applications.ServicesRes, error)
DeleteDisconnectedServices deletes disconnected services and returns the list of services deleted
func (*ApplicationsServer) DeleteServicesByID ¶
func (app *ApplicationsServer) DeleteServicesByID(ctx context.Context, request *applications.DeleteServicesByIDReq) (*applications.ServicesRes, error)
func (*ApplicationsServer) FindServices ¶
func (app *ApplicationsServer) FindServices( request *applications.ServicesReq, stream applications.ApplicationsService_FindServicesServer) error
func (*ApplicationsServer) GetDeleteDisconnectedServicesConfig ¶
func (app *ApplicationsServer) GetDeleteDisconnectedServicesConfig(ctx context.Context, req *applications.GetDeleteDisconnectedServicesConfigReq) (*applications.PeriodicJobConfig, error)
func (*ApplicationsServer) GetDisconnectedServices ¶
func (app *ApplicationsServer) GetDisconnectedServices(ctx context.Context, request *applications.DisconnectedServicesReq) (*applications.ServicesRes, error)
GetDisconnectedServices returns a list of disconnected services
func (*ApplicationsServer) GetDisconnectedServicesConfig ¶
func (app *ApplicationsServer) GetDisconnectedServicesConfig(ctx context.Context, req *applications.GetDisconnectedServicesConfigReq) (*applications.PeriodicMandatoryJobConfig, error)
func (*ApplicationsServer) GetServiceGroups ¶
func (a *ApplicationsServer) GetServiceGroups(ctx context.Context, request *applications.ServiceGroupsReq) (*applications.ServiceGroups, error)
func (*ApplicationsServer) GetServiceGroupsHealthCounts ¶
func (app *ApplicationsServer) GetServiceGroupsHealthCounts( ctx context.Context, request *applications.ServiceGroupsHealthCountsReq, ) (*applications.HealthCounts, error)
GetServiceGroupsHealthCounts returns the health counts from all service groups
func (*ApplicationsServer) GetServices ¶
func (app *ApplicationsServer) GetServices( ctx context.Context, request *applications.ServicesReq, ) (*applications.ServicesRes, error)
GetServices returns a list of services
func (*ApplicationsServer) GetServicesBySG ¶
func (app *ApplicationsServer) GetServicesBySG( ctx context.Context, request *applications.ServicesBySGReq, ) (*applications.ServicesBySGRes, error)
GetServicesBySG returns a list of services within a service-group
func (*ApplicationsServer) GetServicesDistinctValues ¶
func (a *ApplicationsServer) GetServicesDistinctValues(ctx context.Context, request *applications.ServicesDistinctValuesReq) (*applications.ServicesDistinctValuesRes, error)
func (*ApplicationsServer) GetServicesStats ¶
func (app *ApplicationsServer) GetServicesStats(ctx context.Context, request *applications.ServicesStatsReq) (*applications.ServicesStatsRes, error)
func (*ApplicationsServer) GetServicesUsageCount ¶
func (app *ApplicationsServer) GetServicesUsageCount(ctx context.Context, e *applications.GetServicesUsageCountRequest) (*applications.GetServicesUsageCountResponse, error)
GetServicesUsageCount returns the count of unique nodes with lastRun in a given time.
func (*ApplicationsServer) GetVersion ¶
func (a *ApplicationsServer) GetVersion( context.Context, *ver_api.VersionInfoRequest) (*ver_api.VersionInfo, error)
GetVersion returns the version of service
func (*ApplicationsServer) Health ¶
func (a *ApplicationsServer) Health() *health.Service
Health returns the servers embedded health check service
func (*ApplicationsServer) MarkDisconnectedServices ¶
func (app *ApplicationsServer) MarkDisconnectedServices(thresholdSeconds int32) ([]*applications.Service, error)
func (*ApplicationsServer) RunDeleteDisconnectedServicesJob ¶
func (app *ApplicationsServer) RunDeleteDisconnectedServicesJob(ctx context.Context, request *applications.RunDeleteDisconnectedServicesJobReq) (*applications.RunDeleteDisconnectedServicesJobResponse, error)
func (*ApplicationsServer) RunDisconnectedServicesJob ¶
func (app *ApplicationsServer) RunDisconnectedServicesJob(ctx context.Context, request *applications.RunDisconnectedServicesJobReq) (*applications.RunDisconnectedServicesJobResponse, error)
func (*ApplicationsServer) UpdateDeleteDisconnectedServicesConfig ¶
func (app *ApplicationsServer) UpdateDeleteDisconnectedServicesConfig(ctx context.Context, req *applications.PeriodicJobConfig) (*applications.UpdateDeleteDisconnectedServicesConfigRes, error)
func (*ApplicationsServer) UpdateDisconnectedServicesConfig ¶
func (app *ApplicationsServer) UpdateDisconnectedServicesConfig(ctx context.Context, req *applications.PeriodicMandatoryJobConfig) (*applications.UpdateDisconnectedServicesConfigRes, error)
func (*ApplicationsServer) UpdateTelemetryReported ¶
func (s *ApplicationsServer) UpdateTelemetryReported(ctx context.Context, req *applications.UpdateTelemetryReportedRequest) (*applications.UpdateTelemetryReportedResponse, error)
type DeleteDisconnectedServicesExecutor ¶
type DeleteDisconnectedServicesExecutor struct { ApplicationsServer *ApplicationsServer // contains filtered or unexported fields }
func (*DeleteDisconnectedServicesExecutor) TotalRuns ¶
func (d *DeleteDisconnectedServicesExecutor) TotalRuns() int64
type DisconnectedServicesConfigAndInfo ¶
type DisconnectedServicesConfigAndInfo struct { *DisconnectedServicesConfigV0 *DisconnectedServicesInfo }
type DisconnectedServicesConfigV0 ¶
type DisconnectedServicesConfigV0 struct { Enabled bool Params *DisconnectedServicesParamsV0 Recurrence string // string representation of rrule // contains filtered or unexported fields }
+ enabled/disabled for both jobs, not just the deleter + recurrence for both
func (*DisconnectedServicesConfigV0) Validate ¶
func (c *DisconnectedServicesConfigV0) Validate() (bool, string)
func (*DisconnectedServicesConfigV0) Verror ¶
func (c *DisconnectedServicesConfigV0) Verror() error
type DisconnectedServicesParamsV0 ¶
type DisconnectedServicesParamsV0 struct {
ThresholdDuration string `mapstructure:"threshold_duration"`
}
type JobRunnerSet ¶
type JobRunnerSet struct { MarkDisconnectedServicesExecutor *MarkDisconnectedServicesExecutor DeleteDisconnectedServicesExecutor *DeleteDisconnectedServicesExecutor }
func NewJobRunnerSet ¶
func NewJobRunnerSet(applicationsServer *ApplicationsServer) *JobRunnerSet
type JobScheduler ¶
func NewJobScheduler ¶
func NewJobScheduler(cerealSvc *cereal.Manager) *JobScheduler
func (*JobScheduler) DisableDeleteDisconnectedServicesJob ¶
func (j *JobScheduler) DisableDeleteDisconnectedServicesJob(ctx context.Context) error
func (*JobScheduler) DisableDisconnectedServicesJob ¶
func (j *JobScheduler) DisableDisconnectedServicesJob(ctx context.Context) error
func (*JobScheduler) EnableDeleteDisconnectedServicesJob ¶
func (j *JobScheduler) EnableDeleteDisconnectedServicesJob(ctx context.Context) error
func (*JobScheduler) EnableDisconnectedServicesJob ¶
func (j *JobScheduler) EnableDisconnectedServicesJob(ctx context.Context) error
func (*JobScheduler) GetDeleteDisconnectedServicesJobConfig ¶
func (j *JobScheduler) GetDeleteDisconnectedServicesJobConfig(ctx context.Context) (*DisconnectedServicesConfigAndInfo, error)
func (*JobScheduler) GetDisconnectedServicesJobConfig ¶
func (j *JobScheduler) GetDisconnectedServicesJobConfig(ctx context.Context) (*DisconnectedServicesConfigAndInfo, error)
func (*JobScheduler) ResetParams ¶
func (j *JobScheduler) ResetParams() error
FIXME: should this be changed to do a full reset?
func (*JobScheduler) RunAllJobsConstantly ¶
func (j *JobScheduler) RunAllJobsConstantly(ctx context.Context) error
RunAllJobsConstantly sets all the jobs to run every 1 second. Intended for use in testing scenarios.
func (*JobScheduler) RunDeleteDisconnectedServicesJob ¶
func (j *JobScheduler) RunDeleteDisconnectedServicesJob(ctx context.Context) error
func (*JobScheduler) RunDisconnectedServicesJob ¶
func (j *JobScheduler) RunDisconnectedServicesJob(ctx context.Context) error
func (*JobScheduler) Setup ¶
func (j *JobScheduler) Setup() error
SetupScheduler ensures all our jobs exist in the cereal service backend.
func (*JobScheduler) UpdateDeleteDisconnectedServicesJobConfig ¶
func (j *JobScheduler) UpdateDeleteDisconnectedServicesJobConfig(ctx context.Context, conf *DisconnectedServicesConfigV0) error
func (*JobScheduler) UpdateDisconnectedServicesJobConfig ¶
func (j *JobScheduler) UpdateDisconnectedServicesJobConfig(ctx context.Context, conf *DisconnectedServicesConfigV0) error
type MarkDisconnectedServicesExecutor ¶
type MarkDisconnectedServicesExecutor struct { ApplicationsServer *ApplicationsServer // contains filtered or unexported fields }
func (*MarkDisconnectedServicesExecutor) TotalRuns ¶
func (m *MarkDisconnectedServicesExecutor) TotalRuns() int64