server

package
v0.0.0-...-130476d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PurgeScheduleName         = "periodic_purge_timeseries"
	PurgeConvergeHistoryName  = "converge-history"
	PurgeConvergeHistoryIndex = "converge-history"
	PurgeActionsName          = "actions"
	PurgeActionsIndex         = "actions"
)

Variables

View Source
var (
	MissingNodesWorkflowName = cereal.NewWorkflowName("missing_nodes")
	MissingNodesScheduleName = "periodic_missing_nodes"

	DeleteNodesWorkflowName = cereal.NewWorkflowName("delete_nodes")
	DeleteNodesScheduleName = "periodic_delete_nodes"

	MissingNodesForDeletionWorkflowName = cereal.NewWorkflowName("missing_nodes_for_deletion")
	MissingNodesForDeletionScheduleName = "periodic_missing_nodes_for_deletion"
)
View Source
var DefaultPurgePolicies = &purge.Policies{
	Es: map[string]purge.EsPolicy{
		PurgeConvergeHistoryName: {
			Name:          PurgeConvergeHistoryName,
			IndexName:     PurgeConvergeHistoryIndex,
			OlderThanDays: 30,
		},
		PurgeActionsName: {
			Name:          PurgeActionsName,
			IndexName:     PurgeActionsIndex,
			OlderThanDays: 30,
		},
	},
}
View Source
var (
	PurgeWorkflowName = cereal.NewWorkflowName("purge_timeseries")
)
View Source
var SERVICE_NAME = "ingest-service"

Functions

func ConfigurePurge

func ConfigurePurge(man *cereal.Manager, opts *serveropts.Opts) error

ConfigurePurge migrates purge policies from the server options that are passed at startup and creates a scheduled workflow if it doesn't exist.

func InitializeJobManager

func InitializeJobManager(c *cereal.Manager, client backend.Client, esSidecarClient es.EsSidecarServiceClient,
	nodeMgrClient manager.NodeManagerServiceClient, nodesClient nodes.NodesServiceClient) error

func JobSettingsToUpdateOpts

func JobSettingsToUpdateOpts(settings *ingest.JobSettings, oldSchedule *cereal.Schedule) ([]cereal.WorkflowScheduleUpdateOpt, bool, error)

func MigrateJobsSchedule

func MigrateJobsSchedule(ctx context.Context, c *cereal.Manager, oldConfigFile string,
	opts serveropts.JobsConfig) error

Types

type AutomateEventHandlerServer

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

func NewAutomateEventHandlerServer

func NewAutomateEventHandlerServer(client backend.Client, chefIngestServer ChefIngestServer,
	authzProjectsClient authz.ProjectsServiceClient) *AutomateEventHandlerServer

func (*AutomateEventHandlerServer) HandleEvent

func (*AutomateEventHandlerServer) ProjectUpdateStatus

type ChefIngestServer

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

func NewChefIngestServer

func NewChefIngestServer(client backend.Client, authzClient authz.ProjectsServiceClient,
	nodeMgrClient manager.NodeManagerServiceClient,
	nodesClient nodes.NodesServiceClient,
	actionPipeline pipeline.ChefActionPipeline,
	chefRunPipeline pipeline.ChefRunPipeline) *ChefIngestServer

NewChefIngestServer creates a new server instance and it automatically initializes the ChefRun Pipeline by consuming the provided backend client

func (*ChefIngestServer) GetVersion

func (s *ChefIngestServer) GetVersion(ctx context.Context, empty *ingest.VersionRequest) (*ingest.Version, error)

GetVersion returns the service version

func (*ChefIngestServer) ProcessChefAction

func (s *ChefIngestServer) ProcessChefAction(ctx context.Context, action *chef.Action) (*response.ProcessChefActionResponse, error)

ProcessChefAction

func (*ChefIngestServer) ProcessChefRun

func (s *ChefIngestServer) ProcessChefRun(ctx context.Context, run *chef.Run) (*response.ProcessChefRunResponse, error)

ProcessChefRun

func (*ChefIngestServer) ProcessLivenessPing

func (s *ChefIngestServer) ProcessLivenessPing(ctx context.Context, liveness *chef.Liveness) (*response.ProcessLivenessResponse, error)

func (*ChefIngestServer) ProcessMultipleNodeDeletes

func (s *ChefIngestServer) ProcessMultipleNodeDeletes(ctx context.Context,
	multipleNodeDeleteRequest *chef.MultipleNodeDeleteRequest) (*response.ProcessMultipleNodeDeleteResponse, error)

ProcessMultipleNodeDeletes send multiple deletes actions

func (*ChefIngestServer) ProcessNodeDelete

func (s *ChefIngestServer) ProcessNodeDelete(ctx context.Context,
	delete *chef.Delete) (*response.ProcessNodeDeleteResponse, error)

ProcessNodeDelete send a delete action threw the action pipeline

func (*ChefIngestServer) TotalChefActionMessages

func (s *ChefIngestServer) TotalChefActionMessages() int64

func (*ChefIngestServer) TotalChefRunMessages

func (s *ChefIngestServer) TotalChefRunMessages() int64

type DeleteExpiredMarkedNodesTask

type DeleteExpiredMarkedNodesTask struct {
	Client backend.Client
}

func (*DeleteExpiredMarkedNodesTask) Run

func (t *DeleteExpiredMarkedNodesTask) Run(ctx context.Context, task cereal.Task) (interface{}, error)

type IngestStatus

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

func NewIngestStatus

func NewIngestStatus(client backend.Client, A1migration *migration.Status) *IngestStatus

NewIngestStatus creates a new status server instance

func (*IngestStatus) GetHealth

func (is *IngestStatus) GetHealth(ctx context.Context, empty *ingest.HealthRequest) (*ingest.Health, error)

GetHealth returns the health of the ingest service

func (*IngestStatus) GetMetrics

func (is *IngestStatus) GetMetrics(ctx context.Context, empty *ingest.MetricsRequest) (*ingest.Metrics, error)

GetMetrics returns the metrics of the ingest service

func (*IngestStatus) GetMigrationStatus

func (is *IngestStatus) GetMigrationStatus(ctx context.Context, empty *ingest.MigrationStatusRequest) (*ingest.MigrationStatus, error)

GetMigrationStatus returns the migration status if there is any migration from A1 to A2

func (*IngestStatus) SetChefIngestServer

func (is *IngestStatus) SetChefIngestServer(s *ChefIngestServer)

type JobSchedulerServer

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

func NewJobSchedulerServer

func NewJobSchedulerServer(client backend.Client, manager *cereal.Manager) *JobSchedulerServer

NewJobSchedulerServer - create a new JobSchedulerServer

func (*JobSchedulerServer) ConfigureDeleteNodesScheduler

func (server *JobSchedulerServer) ConfigureDeleteNodesScheduler(ctx context.Context,
	settings *ingest.JobSettings) (*ingest.ConfigureDeleteNodesSchedulerResponse, error)

ConfigureDeleteNodesScheduler changed the configurations for the delete node scheduler

func (*JobSchedulerServer) ConfigureMissingNodesForDeletionScheduler

func (server *JobSchedulerServer) ConfigureMissingNodesForDeletionScheduler(ctx context.Context,
	settings *ingest.JobSettings) (*ingest.ConfigureMissingNodesForDeletionSchedulerResponse, error)

ConfigureMissingNodesForDeletionScheduler rpc call to configure the MissingNodesForDeletion Job

func (*JobSchedulerServer) ConfigureNodesMissingScheduler

func (server *JobSchedulerServer) ConfigureNodesMissingScheduler(ctx context.Context,
	settings *ingest.JobSettings) (*ingest.ConfigureNodesMissingSchedulerResponse, error)

ConfigureNodesMissingScheduler rpc call to configure the NodesMissing Job

func (*JobSchedulerServer) DeleteMarkedNodes

DeleteMarkedNodes - run the delete node task now

func (*JobSchedulerServer) GetStatusJobScheduler

func (server *JobSchedulerServer) GetStatusJobScheduler(ctx context.Context,
	empty *ingest.JobSchedulerStatusRequest) (*ingest.JobSchedulerStatus, error)

GetStatusJobScheduler - collect and return the status of all the jobs in the Job Scheduler

func (*JobSchedulerServer) MarkMissingNodesForDeletion

MarkMissingNodesForDeletion - run the mark missing nodes for deletion task now

func (*JobSchedulerServer) MarkNodesMissing

MarkNodesMissing - run the mark nodes missing task now

func (*JobSchedulerServer) StartDeleteNodesScheduler

StartDeleteNodesScheduler - start the scheduled task of deleting nodes

func (*JobSchedulerServer) StartMissingNodesForDeletionScheduler

StartMissingNodesForDeletionScheduler - start the scheduled task of marking nodes for deletion

func (*JobSchedulerServer) StartNodesMissingScheduler

StartNodesMissingScheduler - start the scheduled task of deleting nodes

func (*JobSchedulerServer) StopDeleteNodesScheduler

StopDeleteNodesScheduler - stop the scheduled delete node task from running

func (*JobSchedulerServer) StopMissingNodesForDeletionScheduler

StopMissingNodesForDeletionScheduler - stop the scheduled marking nodes for deletion task from running

func (*JobSchedulerServer) StopNodesMissingScheduler

StopNodesMissingScheduler - stop the scheduled delete node task from running

type MarkMissingNodesForDeletionTask

type MarkMissingNodesForDeletionTask struct {
	Client      backend.Client
	NodesClient nodes.NodesServiceClient
}

func (*MarkMissingNodesForDeletionTask) Run

func (t *MarkMissingNodesForDeletionTask) Run(ctx context.Context, task cereal.Task) (interface{}, error)

type MarkNodesMissingTask

type MarkNodesMissingTask struct {
	Client        backend.Client
	NodeMgrClient manager.NodeManagerServiceClient
}

func (*MarkNodesMissingTask) Run

func (t *MarkNodesMissingTask) Run(ctx context.Context, task cereal.Task) (interface{}, error)

Jump to

Keyboard shortcuts

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