Documentation ¶
Index ¶
- func FindKeyValue(tags []*common.Kv, key string) *common.Kv
- func KeyValueToRawMap(arr []*common.Kv) (json.RawMessage, error)
- func RawMapToKeyValue(rawJSON json.RawMessage) ([]*common.Kv, error)
- func RemoveKeyValue(tags []*common.Kv, key string) []*common.Kv
- func Transact(db *DB, txFunc func(*DBTrans) error) error
- type DB
- func (db *DB) AddManagerGcpApi(managerId string, managerAcctId string, credential string) (*string, error)
- func (db *DB) AddManagerNodesToDB(nodesArr []*manager.ManagerNode, managerId string, managerAcctId string, ...) []string
- func (db *DB) AddManagerRegionsToDB(regions []string, managerId string, managerAcctId string, credential 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) 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) GetNodes(sortField string, insortOrder nodes.Query_OrderType, pageNr int32, ...) ([]*nodes.Node, *TotalCount, 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) 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)
- type DBTrans
- type InstanceState
- type NodeSecret
- type NodeTag
- type TotalCount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindKeyValue ¶
FindKeyValue finds a Tag object in the array based on key match
func KeyValueToRawMap ¶
func KeyValueToRawMap(arr []*common.Kv) (json.RawMessage, error)
KeyValueToRawMap helps convert an array of KeyValues in a Map and convert it to json
func RawMapToKeyValue ¶
func RawMapToKeyValue(rawJSON json.RawMessage) ([]*common.Kv, error)
RawMapToKeyValue helps convert an array of KeyValues in a Map and convert it to json
func RemoveKeyValue ¶
RemoveKeyValue removes an item from the array base on key match
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) AddManagerNodesToDB ¶
func (db *DB) AddManagerNodesToDB(nodesArr []*manager.ManagerNode, managerId string, managerAcctId string, instanceCredentials []*manager.CredentialsByTags, mgrType string) []string
func (*DB) AddManagerRegionsToDB ¶
func (*DB) AddManagerSubscriptionsToDB ¶
func (*DB) AddNodeManager ¶
func (*DB) AssociateNodeIDsWithManagerID ¶
func (*DB) BulkAddNodes ¶
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) ProcessIncomingNode ¶
func (db *DB) ProcessIncomingNode(node *manager.NodeMetadata) error
func (*DB) QueryManualNodesFields ¶
func (*DB) RemoveStaleNodeAssociations ¶
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
type DBTrans ¶
type DBTrans struct {
*gorp.Transaction
}
type NodeSecret ¶
NodeSecret used only to (de)serialize database access
type TotalCount ¶
type TotalCount struct {
Total, Unreachable, Reachable, Unknown int32
}