Documentation ¶
Index ¶
- Constants
- func Transact(db *DB, txFunc func(*DBTrans) error) error
- func Unique(a []string) []string
- type DB
- func (db *DB) AddManagerGcpApi(managerId string, managerAcctId string, credential string) (*string, error)
- func (db *DB) AddManagerNodeToDB(managerId string, managerAcctId string, credential string, acctAlias string, ...) ([]string, error)
- func (db *DB) AddManagerNodesToDB(nodesArr []*manager.ManagerNode, managerId string, managerAcctId string, ...) []string
- func (db *DB) AddManagerSubscriptionsToDB(subs []*manager.ManagerNode, managerId string, tenantID string, ...) []string
- func (db *DB) AddNode(inNode *nodes.Node) (string, error)
- func (db *DB) AddNodeManager(inNodeManager *manager.NodeManager, acctID string) (string, error)
- func (db *DB) AssociateNodeIDsWithManagerID(nodeIDs []string, nodeManagerID string) error
- func (db *DB) BulkAddNodes(inNodes []*nodes.Node) (nodeIDs []string, err error)
- func (db *DB) CancelProjectUpdateTask(ctx context.Context, projectUpdateID string, ...) error
- func (db *DB) ChangeNodeState(nodeState *manager.NodeState) error
- func (db *DB) DeleteNode(id string) (int64, error)
- func (db *DB) DeleteNodeManager(id string) error
- func (db *DB) DeleteNodeManagerWithNodeStateUpdate(id string, state string) error
- func (db *DB) DeleteNodeManagerWithNodes(id string) ([]string, error)
- func (db *DB) DeleteNodesById(ctx context.Context, ids []string) ([]string, error)
- func (db *DB) DeleteNodesWithQuery(filters []*common.Filter) ([]string, error)
- func (db *DB) GetAllManagersByType(mgrType string) ([]string, error)
- func (db *DB) GetCredentialFromNodeManager(ctx context.Context, id string, secretsClient secrets.SecretsServiceClient) (*secrets.Secret, error)
- func (db *DB) GetManualNodesDue(timeAgo time.Time) ([]string, error)
- func (db *DB) GetNode(ctx context.Context, id string) (*nodes.Node, error)
- func (db *DB) GetNodeManager(id string) (*manager.NodeManager, error)
- func (db *DB) GetNodeManagers(sortField string, insortOrder manager.Query_OrderType, pageNr int32, ...) ([]*manager.NodeManager, int64, error)
- func (db *DB) GetNodeSecretIds(ctx context.Context, id string) ([]string, error)
- func (db *DB) GetNodeState(id string) (string, error)
- func (db *DB) GetNodeSuggestions(ctx context.Context, field string, filters []*common.Filter) ([]string, error)
- func (db *DB) GetNodes(sortField string, insortOrder nodes.Query_OrderType, pageNr int32, ...) ([]*nodes.Node, *TotalCount, error)
- func (db *DB) JobCancel(ctx context.Context, jobID string) error
- func (db *DB) JobStatus(ctx context.Context, jobID string) (project_update_lib.JobStatus, error)
- func (db *DB) ListProjectUpdateTasks(ctx context.Context) ([]project_update_lib.SerializedProjectUpdateTask, error)
- func (db *DB) MonitorProjectUpdateTask(ctx context.Context, projectUpdateID string, ...) (project_update_lib.SerializedProjectUpdateTaskStatus, error)
- func (db *DB) ProcessIncomingNode(node *manager.NodeMetadata) error
- func (db *DB) QueryManualNodesFields(ctx context.Context, filters []*common.Filter, field string) ([]string, error)
- func (db *DB) RemoveStaleNodeAssociations(managerId string, nodeIds []string) error
- func (db *DB) RunProjectUpdateTask(ctx context.Context, projectUpdateID string, params map[string]string, ...) (project_update_lib.SerializedProjectUpdateTaskID, ...)
- func (db *DB) UpdateManagerStatus(mgrId string, status string) error
- func (db *DB) UpdateNode(inNode *nodes.Node) error
- func (db *DB) UpdateNodeConnectionErr(ctx context.Context, connErr *nodes.NodeError) (err error)
- func (db *DB) UpdateNodeDetectInfo(ctx context.Context, nodeDetectInfo *nodes.NodeDetectJobInfo) (err error)
- func (db *DB) UpdateNodeManager(inNodeManager *manager.NodeManager) (string, error)
- func (db *DB) UpdateOrInsertInstanceSourceStateInDb(instance InstanceState, mgrID string, sourceAcctID string, mgrType string) (bool, error)
- func (db *DB) UpdateProjectTags(ctx context.Context, projectRules map[string]*authz.ProjectRules) ([]string, error)
- type DBTrans
- type InstanceState
- type NodeProjectData
- type NodeSecret
- type NodeTag
- type TotalCount
Constants ¶
const ( NodesTableAbbrev = "n" TagsTableAbbrev = "t" NodeManagersTableAbbrev = "nm" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
func (*DB) AddManagerGcpApi ¶
func (db *DB) AddManagerGcpApi(managerId string, managerAcctId string, credential string) (*string, error)
Adds gcp-api node that corresponds to a gcp node manager
func (*DB) AddManagerNodeToDB ¶
func (*DB) AddManagerNodesToDB ¶
func (db *DB) AddManagerNodesToDB(nodesArr []*manager.ManagerNode, managerId string, managerAcctId string, instanceCredentials []*manager.CredentialsByTags, mgrType string) []string
func (*DB) AddManagerSubscriptionsToDB ¶
func (*DB) AddNodeManager ¶
func (*DB) AssociateNodeIDsWithManagerID ¶
func (*DB) BulkAddNodes ¶
func (*DB) CancelProjectUpdateTask ¶
func (db *DB) CancelProjectUpdateTask(ctx context.Context, projectUpdateID string, id project_update_lib.SerializedProjectUpdateTaskID) error
func (*DB) DeleteNodeManager ¶
func (*DB) DeleteNodeManagerWithNodeStateUpdate ¶
func (*DB) DeleteNodeManagerWithNodes ¶
func (*DB) DeleteNodesById ¶
func (*DB) DeleteNodesWithQuery ¶
func (*DB) GetAllManagersByType ¶
func (*DB) GetCredentialFromNodeManager ¶
func (*DB) GetNodeManager ¶
func (db *DB) GetNodeManager(id string) (*manager.NodeManager, error)
func (*DB) GetNodeManagers ¶
func (*DB) GetNodeSecretIds ¶
func (*DB) GetNodeSuggestions ¶
func (db *DB) GetNodeSuggestions(ctx context.Context, field string, filters []*common.Filter) ([]string, error)
GetNodeSuggestions returns "suggestions" for filtering the nodes list, given a field and filters this is not used by any API/other function yet, but will be. it only supports suggestions for columns that are in the nodes table. it respects filters, it does not apply sorting to the returned list.
func (*DB) ListProjectUpdateTasks ¶
func (db *DB) ListProjectUpdateTasks(ctx context.Context) ([]project_update_lib.SerializedProjectUpdateTask, error)
func (*DB) MonitorProjectUpdateTask ¶
func (db *DB) MonitorProjectUpdateTask(ctx context.Context, projectUpdateID string, id project_update_lib.SerializedProjectUpdateTaskID) ( project_update_lib.SerializedProjectUpdateTaskStatus, error)
func (*DB) ProcessIncomingNode ¶
func (db *DB) ProcessIncomingNode(node *manager.NodeMetadata) error
func (*DB) QueryManualNodesFields ¶
func (*DB) RemoveStaleNodeAssociations ¶
func (*DB) RunProjectUpdateTask ¶
func (db *DB) 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 (*DB) UpdateManagerStatus ¶
func (*DB) UpdateNode ¶
UpdateNode takes an inNode model struct and uses it to update a Node in the db.
func (*DB) UpdateNodeConnectionErr ¶
update node with the connection error
func (*DB) UpdateNodeDetectInfo ¶
func (db *DB) UpdateNodeDetectInfo(ctx context.Context, nodeDetectInfo *nodes.NodeDetectJobInfo) (err error)
Update node with inspec detect job results. This includes platform name, platform release, last_contact, status and state
func (*DB) UpdateNodeManager ¶
func (db *DB) UpdateNodeManager(inNodeManager *manager.NodeManager) (string, error)
func (*DB) UpdateOrInsertInstanceSourceStateInDb ¶
func (db *DB) UpdateOrInsertInstanceSourceStateInDb(instance InstanceState, mgrID string, sourceAcctID string, mgrType string) (bool, error)
UpdateInstanceSourceStateInDb updates source_state of instance passed in, and updates the status as unreachable if the source_state is anything other than running if any rows are inserted or updated returns true, otherwise false
func (*DB) UpdateProjectTags ¶
func (db *DB) UpdateProjectTags(ctx context.Context, projectRules map[string]*authz.ProjectRules) ([]string, error)
UpdateProjectTags - start a project update
type DBTrans ¶
type DBTrans struct {
*gorp.Transaction
}
type NodeProjectData ¶
type NodeProjectData struct { ID string `db:"id"` Data string `db:"projects_data"` ProjectDataKeyValues []*nodes.ProjectsData }
type NodeSecret ¶
NodeSecret used only to (de)serialize database access
type TotalCount ¶
type TotalCount struct {
Total, Unreachable, Reachable, Unknown int32
}