Documentation ¶
Index ¶
- type Backend
- func (backend *Backend) CancelProjectUpdateTask(ctx context.Context, projectUpdateID string, ...) error
- func (es *Backend) CreateAlias(ctx context.Context, aliasName string, indexName string) error
- func (es *Backend) CreateBulkNodeAttributeUpdateRequest(nodeAttr backend.NodeAttribute) elastic.BulkableRequest
- func (es *Backend) CreateBulkNodeRunInfoUpdateRequest(node backend.Run) elastic.BulkableRequest
- func (es *Backend) CreateBulkNodeUpdateRequest(node backend.Node) elastic.BulkableRequest
- func (es *Backend) CreateBulkRunUpdateRequest(run backend.Run) elastic.BulkableRequest
- func (es *Backend) DeleteAllIndexesWithPrefix(prefix string, ctx context.Context) error
- func (es *Backend) DeleteIndex(ctx context.Context, index string) error
- func (es *Backend) DeleteMarkedNodes(ctx context.Context, threshold string) (updateCount int, err error)
- func (es *Backend) DeleteNodeByFields(ctx context.Context, orgName string, remoteHostname string, nodeName string) (int, error)
- func (es *Backend) DeleteNodeByID(ctx context.Context, nodeID string) (int, error)
- func (es *Backend) DeleteTemplate(ctx context.Context, templateName string) error
- func (es *Backend) DoesAliasExists(ctx context.Context, aliasName string) bool
- func (es *Backend) DoesIndexExists(ctx context.Context, indexName string) (bool, error)
- func (es *Backend) EmptyNodeLatestRunID(ctx context.Context, nodeEntityUUID string) error
- func (es *Backend) FindNodeIDByInstanceId(ctx context.Context, instanceId string) ([]string, error)
- func (es *Backend) FindNodeIDsByFields(ctx context.Context, filters map[string]string) ([]string, error)
- func (es *Backend) GetActions(index string, pageSize int, cursorDate time.Time, cursorID string, next bool) ([]backend.InternalChefAction, int64, error)
- func (es *Backend) GetAllTimeseriesIndiceNames(ctx context.Context, indexName string) ([]string, error)
- func (es *Backend) GetInsightsRunData(ctx context.Context, insightsIndex string, cursorID string) ([]backend.InsightsRunNodePayLoadData, error)
- func (es *Backend) GetLatestA1NodeRun(ctx context.Context, nodeEntityUUID string, a1IndexInsights string) (backend.InsightsRun, bool, error)
- func (es *Backend) GetNodeBasics(ctx context.Context, cursorID string) ([]backend.NodeBasics, error)
- func (es *Backend) GetNodeCount(ctx context.Context, indexName string) (int64, error)
- func (es *Backend) InitializeStore(ctx context.Context) error
- func (es *Backend) Initializing() bool
- func (es *Backend) InsertNode(ctx context.Context, node backend.Node) error
- func (es *Backend) InsertNodeAttribute(ctx context.Context, nodeAttr backend.NodeAttribute) error
- func (es *Backend) InsertNodeRunDateInfo(ctx context.Context, nodeInfo backend.Run) error
- func (es *Backend) InsertRun(ctx context.Context, run backend.Run) error
- func (es *Backend) InsertUpsertNode(ctx context.Context, node backend.UpsertNode) error
- func (es *Backend) JobCancel(ctx context.Context, jobID string) error
- func (es *Backend) JobStatus(ctx context.Context, jobID string) (project_update_lib.JobStatus, error)
- func (backend *Backend) ListProjectUpdateTasks(ctx context.Context) ([]project_update_lib.SerializedProjectUpdateTask, error)
- func (es *Backend) MarkForDeleteMultipleNodesByID(ctx context.Context, nodeIDs []string) (int, error)
- func (es *Backend) MarkMissingNodesForDeletion(ctx context.Context, threshold string) ([]string, error)
- func (es *Backend) MarkNodesMissing(ctx context.Context, threshold string) ([]string, error)
- func (backend *Backend) MonitorProjectUpdateTask(ctx context.Context, projectUpdateID string, ...) (project_update_lib.SerializedProjectUpdateTaskStatus, error)
- func (es *Backend) RecordLivenessPing(ctx context.Context, liveness backend.Liveness) error
- func (es *Backend) RefreshIndex(ctx context.Context, indexName string) error
- func (es *Backend) ReindexInsightstoActions(ctx context.Context, insightsIndexName string, actionsIndexName string) error
- func (es *Backend) ReindexInsightstoConvergeHistory(ctx context.Context, insightsIndexName string, convergeHistoryIndexName string) error
- func (es *Backend) ReindexNodeStateA1(ctx context.Context, a1NodeStateIndexName string) error
- func (es *Backend) ReindexNodeStateToLatest(ctx context.Context, previousIndex string) (string, error)
- func (es *Backend) RemoveAlias(ctx context.Context, aliasName string, indexName string) error
- func (backend *Backend) RunProjectUpdateTask(ctx context.Context, projectUpdateID string, params map[string]string, ...) (project_update_lib.SerializedProjectUpdateTaskID, ...)
- func (es *Backend) SendBulkRequest(ctx context.Context, bulkUpdateRequests []elastic.BulkableRequest) error
- func (es *Backend) UpdateNode(ctx context.Context, nodeEntityUUID string, insightsRun backend.InsightsRun, ...) error
- func (es *Backend) UpdateNodeProjectTags(ctx context.Context, projectTaggingRules map[string]*authz.ProjectRules) (string, error)
- func (es *Backend) UpdateProjectTags(ctx context.Context, projectTaggingRules map[string]*authz.ProjectRules) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (*Backend) CancelProjectUpdateTask ¶
func (backend *Backend) CancelProjectUpdateTask(ctx context.Context, projectUpdateID string, id project_update_lib.SerializedProjectUpdateTaskID) error
func (*Backend) CreateAlias ¶
func (*Backend) CreateBulkNodeAttributeUpdateRequest ¶
func (es *Backend) CreateBulkNodeAttributeUpdateRequest(nodeAttr backend.NodeAttribute) elastic.BulkableRequest
func (*Backend) CreateBulkNodeRunInfoUpdateRequest ¶
func (es *Backend) CreateBulkNodeRunInfoUpdateRequest(node backend.Run) elastic.BulkableRequest
func (*Backend) CreateBulkNodeUpdateRequest ¶
func (es *Backend) CreateBulkNodeUpdateRequest(node backend.Node) elastic.BulkableRequest
func (*Backend) CreateBulkRunUpdateRequest ¶
func (es *Backend) CreateBulkRunUpdateRequest(run backend.Run) elastic.BulkableRequest
func (*Backend) DeleteAllIndexesWithPrefix ¶
func (*Backend) DeleteIndex ¶
DeleteIndex - delete index with name 'index'
func (*Backend) DeleteMarkedNodes ¶
func (es *Backend) DeleteMarkedNodes(ctx context.Context, threshold string) (updateCount int, err error)
DeleteMarkedNodes will delete all the nodes from elasticsearch that no longer exists for the eyes of the config-mgmt-service. (that is, the nodes that has exists=false) The time constraint is the provided threshold
func (*Backend) DeleteNodeByFields ¶
func (es *Backend) DeleteNodeByFields(ctx context.Context, orgName string, remoteHostname string, nodeName string) (int, error)
DeleteNodeByFields deletes a node from node state but it's org name, node name and source_fqdn
func (*Backend) DeleteNodeByID ¶
DeleteNodeByID deletes a node from node-state by it's ID
func (*Backend) DeleteTemplate ¶
DeleteTemplate - delete the template with name 'templateName' DELETE /_template/node-state
func (*Backend) DoesAliasExists ¶
DoesAliasExists - does the alias 'aliasName' exists in elasticsearch
func (*Backend) DoesIndexExists ¶
DoesIndexExists - does the index 'indexName' exists in elasticsearch
func (*Backend) EmptyNodeLatestRunID ¶
EmptyNodeLatestRunID - Set the nodes latest Run ID to a empty string
func (*Backend) FindNodeIDByInstanceId ¶
func (*Backend) FindNodeIDsByFields ¶
func (*Backend) GetActions ¶
func (*Backend) GetAllTimeseriesIndiceNames ¶
func (es *Backend) GetAllTimeseriesIndiceNames(ctx context.Context, indexName string) ([]string, error)
GetAllTimeseriesIndiceNames - get all the indice names for the givin indexName tag. Example of indexName = converge-history, insights
func (*Backend) GetInsightsRunData ¶
func (es *Backend) GetInsightsRunData(ctx context.Context, insightsIndex string, cursorID string) ([]backend.InsightsRunNodePayLoadData, error)
GetInsightsRunData -
func (*Backend) GetLatestA1NodeRun ¶
func (es *Backend) GetLatestA1NodeRun(ctx context.Context, nodeEntityUUID string, a1IndexInsights string) (backend.InsightsRun, bool, error)
GetLatestA1NodeRun - get the newest A1 Node run from the insights index for the givin 'nodeEntityUUID'. Return InsightsRun - run data if found in elasticsearch bool if runs were found. Error trying to find runs
func (*Backend) GetNodeBasics ¶
func (es *Backend) GetNodeBasics(ctx context.Context, cursorID string) ([]backend.NodeBasics, error)
GetNodeIds - Get the 100 node IDs & Checkin times after the cursorID. 'SearchAfter' is used because we can not pull all the nodes at once. If there where 10,000 nodes elasticsearch would not allow us to pull them all at once.
func (*Backend) GetNodeCount ¶
GetNodeCount - count how many node-state documents are in an index
func (*Backend) InitializeStore ¶
InitializeStore runs the necessary initialization processes to make elasticsearch usable in particular it creates the indexes and aliases for documents to be added
func (*Backend) Initializing ¶
func (*Backend) InsertNode ¶
InsertNode inserts the state of the node as a result of a Chef Client Run into node-state index
func (*Backend) InsertNodeAttribute ¶
InsertNodeAttribute inserts the ohai attributes from a CCR into the node-attribute index
func (*Backend) InsertNodeRunDateInfo ¶
func (*Backend) InsertRun ¶
InsertRun inserts a Chef Client Run into converge-history-YYYY.MM.DD index
func (*Backend) InsertUpsertNode ¶
InsertUpsertNode inserts the UpsertNode with the created date
func (*Backend) ListProjectUpdateTasks ¶
func (backend *Backend) ListProjectUpdateTasks(ctx context.Context) ([]project_update_lib.SerializedProjectUpdateTask, error)
func (*Backend) MarkForDeleteMultipleNodesByID ¶
func (es *Backend) MarkForDeleteMultipleNodesByID(ctx context.Context, nodeIDs []string) (int, error)
MarkForDeleteMultipleNodesByID marks for delete multiple nodes by their IDs
func (*Backend) MarkMissingNodesForDeletion ¶
func (es *Backend) MarkMissingNodesForDeletion(ctx context.Context, threshold string) ([]string, error)
MarkMissingNodesForDeletion will mark all the nodes that have been missing for over the specified threshold time as 'ready for deletion'. (that is, mark the node as exists=false)
func (*Backend) MarkNodesMissing ¶
MarkNodesMissing marks all nodes that have passed the specified threshold as 'missing'
func (*Backend) MonitorProjectUpdateTask ¶
func (backend *Backend) MonitorProjectUpdateTask(ctx context.Context, projectUpdateID string, id project_update_lib.SerializedProjectUpdateTaskID) ( project_update_lib.SerializedProjectUpdateTaskStatus, error)
func (*Backend) RecordLivenessPing ¶
func (*Backend) RefreshIndex ¶
func (*Backend) ReindexInsightstoActions ¶
func (es *Backend) ReindexInsightstoActions(ctx context.Context, insightsIndexName string, actionsIndexName string) error
ReindexInsightstoActions -reindex the A1 insights indexes to the actions indexes Below is a link to how the actions were created in A1 https://github.com/chef/automate/blob/master/logstash/config/10-action-filter.conf
func (*Backend) ReindexInsightstoConvergeHistory ¶
func (es *Backend) ReindexInsightstoConvergeHistory(ctx context.Context, insightsIndexName string, convergeHistoryIndexName string) error
ReindexInsightstoConvergeHistory - reindex the A1 insights indexes to the converge-history indexes
TODO: Still need to add the VersionedCookbooks to each run.
func (*Backend) ReindexNodeStateA1 ¶
ReindexNodeStateA1 - reindex the A1 node-state index to the current node-state index
func (*Backend) ReindexNodeStateToLatest ¶
func (*Backend) RemoveAlias ¶
RemoveAlias - remove an alias from the index named 'indexName'
func (*Backend) RunProjectUpdateTask ¶
func (backend *Backend) RunProjectUpdateTask(ctx context.Context, projectUpdateID string, params map[string]string, projectTaggingRules map[string]*authz.ProjectRules) ( project_update_lib.SerializedProjectUpdateTaskID, project_update_lib.SerializedProjectUpdateTaskStatus, error)
func (*Backend) SendBulkRequest ¶
func (*Backend) UpdateNode ¶
func (es *Backend) UpdateNode(ctx context.Context, nodeEntityUUID string, insightsRun backend.InsightsRun, versionedCookbooks []backend.VersionedCookbook) error
UpdateNode - Update a node-state doc with the givin data.
func (*Backend) UpdateNodeProjectTags ¶
func (es *Backend) UpdateNodeProjectTags(ctx context.Context, projectTaggingRules map[string]*authz.ProjectRules) (string, error)
UpdateNodeProjectTags - update project tagging with all the rules
All the conditions must be true for a rule to be true (ANDed together). Only one rule has to be true for the project to match (ORed together). If there are no rules the project does not match If the rule does not have any conditions it does not match any resources.